* Fix objtool 'unannotated intra-function call'
Fixes objtool errors in stricter kernel configs
objtool likely wants the function to be annotated with
SYM_CODE_START/SYM_CODE_END (linux/linkage.h). It might be
better to rewrite the linux kernel module assembly files to use gas,
and properly annotate everything, but this should be a quick fix for
now.
* Use module_init/module_exit in linux driver
Fixes objtool errors in stricter kernel configs
* Make init functions static
* Re-add __init & __exit macros in linux driver
* Add semicolons after module_init/module_exit calls
---------
Signed-off-by: J. Stephan Bentze <j.s.bentze@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
The current implementation of __swsmi__ for x86-64 is rather complicated
as it uses more registers than needed. Simplyfy it.
We can use the passed SMI_CTX buffer as scratch space without the need
to use intermediate registers (beside for RDI, for which we use R10 -- a
callee clobbered register).
Bring the implementation more in line with its OS X counterpart and
adapt the comments and code to reflect reality, namely:
- change the C type members to mirror the used (and intended) registers,
- mark the registers as in/out parameters in the comments,
- drop the bogus comment about clobbering DX, as we don't do that and
- fix and tweak the comment about split i/o because of picky firmwares.
Signed-off-by: Mathias Krause <minipli@grsecurity.net>