summaryrefslogtreecommitdiffstats
path: root/src/arch/x86/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/x86/include')
-rw-r--r--src/arch/x86/include/librm.h23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/arch/x86/include/librm.h b/src/arch/x86/include/librm.h
index 379e085a2..2786027a0 100644
--- a/src/arch/x86/include/librm.h
+++ b/src/arch/x86/include/librm.h
@@ -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;