mirror of
https://github.com/ipxe/ipxe
synced 2026-01-13 00:48:39 +03:00
[librm] Provide an abstraction wrapper for prot_call
Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user