[librm] Provide an abstraction wrapper for prot_call

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2016-02-18 23:23:38 +00:00
parent 196f0f2551
commit 31b5c2e753
20 changed files with 77 additions and 60 deletions

View File

@@ -19,7 +19,19 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#define LONG_DS 0x40
#endif
#ifndef ASSEMBLY
#ifdef ASSEMBLY
/**
* Call C function from real-mode code
*
* @v function C function
*/
.macro virtcall function
pushl $\function
call prot_call
.endm
#else /* ASSEMBLY */
#ifdef UACCESS_LIBRM
#define UACCESS_PREFIX_librm
@@ -27,6 +39,15 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#define UACCESS_PREFIX_librm __librm_
#endif
/**
* Call C function from real-mode code
*
* @v function C function
*/
#define VIRT_CALL( function ) \
"pushl $( " #function " )\n\t" \
"call prot_call\n\t"
/* Variables in librm.S */
extern unsigned long virt_offset;