Add CODEPATCH_CODE() macro to simplify defining a symbol for a chunk
authorguenther <guenther@openbsd.org>
Fri, 28 Jul 2023 06:18:35 +0000 (06:18 +0000)
committerguenther <guenther@openbsd.org>
Fri, 28 Jul 2023 06:18:35 +0000 (06:18 +0000)
commit40ce500b7f41916ab432eedd939dc54c61e7e49d
treef23e650cfde22d24386845adda8c11c866219567
parent0ec886f54e2ee5e3e2c7472a6b3698eb2ab15dd9
Add CODEPATCH_CODE() macro to simplify defining a symbol for a chunk
of code to use in codepatching.  Use that for all the existing
codepatching snippets.

Similarly, add CODEPATCH_CODE_LEN() which is CODEPATCH_CODE() but also
provides a short variable holding the length of the codepatch snippet.
Use that for some snippets that will be used for retpoline replacement.

ok kettenis@ deraadt@
sys/arch/amd64/amd64/copy.S
sys/arch/amd64/amd64/locore.S
sys/arch/amd64/include/codepatch.h