core: call16(): simple wrapper to call 16-bit functions in the core
authorH. Peter Anvin <hpa@zytor.com>
Tue, 2 Jun 2009 05:19:12 +0000 (22:19 -0700)
committerH. Peter Anvin <hpa@zytor.com>
Tue, 2 Jun 2009 05:20:23 +0000 (22:20 -0700)
Simple wrapper to call 16-bit functions in the core (CS == 0, and
having a symbol, which is easiest modelled with a function prototype.)

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
core/call16.c [new file with mode: 0644]
core/include/core.h

diff --git a/core/call16.c b/core/call16.c
new file mode 100644 (file)
index 0000000..1e369e2
--- /dev/null
@@ -0,0 +1,25 @@
+/* ----------------------------------------------------------------------- *
+ *
+ *   Copyright 2009 Intel Corporation; author: H. Peter Anvin
+ *
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ *   Boston MA 02110-1301, USA; either version 2 of the License, or
+ *   (at your option) any later version; incorporated herein by reference.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * call16.c
+ *
+ * Simple wrapper to call 16-bit core functions from 32-bit code
+ */
+
+#include <stddef.h>
+#include "core.h"
+
+void call16(void (*func)(void), const com32sys_t *ireg, com32sys_t *oreg)
+{
+    core_farcall((size_t)func, ireg, oreg);
+}
index 714196e..91bd2d8 100644 (file)
@@ -8,4 +8,6 @@ void __cdecl core_intcall(uint8_t, const com32sys_t *, com32sys_t *);
 void __cdecl core_farcall(uint32_t, const com32sys_t *, com32sys_t *);
 int __cdecl core_cfarcall(uint32_t, const void *, uint32_t);
 
+void call16(void (*)(void), const com32sys_t *, com32sys_t *);
+
 #endif /* CORE_H */