From 78ddd6d384264d62ab67bcc5ba7b0ff17c90ce2f Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Mon, 1 Jun 2009 22:19:12 -0700 Subject: [PATCH] core: call16(): simple wrapper to call 16-bit functions in the core 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 --- core/call16.c | 25 +++++++++++++++++++++++++ core/include/core.h | 2 ++ 2 files changed, 27 insertions(+) create mode 100644 core/call16.c diff --git a/core/call16.c b/core/call16.c new file mode 100644 index 0000000..1e369e2 --- /dev/null +++ b/core/call16.c @@ -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 +#include "core.h" + +void call16(void (*func)(void), const com32sys_t *ireg, com32sys_t *oreg) +{ + core_farcall((size_t)func, ireg, oreg); +} diff --git a/core/include/core.h b/core/include/core.h index 714196e..91bd2d8 100644 --- a/core/include/core.h +++ b/core/include/core.h @@ -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 */ -- 2.7.4