aboutsummaryrefslogtreecommitdiffstats
path: root/src/stacks.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2014-12-03 12:53:01 -0500
committerKevin O'Connor <kevin@koconnor.net>2014-12-03 13:06:24 -0500
commited675ad4193bc7f929e5b39074d50672970aefa3 (patch)
tree4801b5aa4e32f128613a7551f93aec17895af572 /src/stacks.c
parentff6d5519f2767b160d6f8e12f79d920dbf9872c6 (diff)
downloadseabios-ed675ad4193bc7f929e5b39074d50672970aefa3.tar.gz
Eliminate FUNCFSEG - only force portions of inline asm to f-segment
The FUNCFSEG macro was introduced to force a C function into the f-segment. This was needed for some C functions that used inline assembler that contained some 16bit code. Instead of forcing the entire C function into the f-segment, just force the small subset of inline assembler into the f-segment. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/stacks.c')
-rw-r--r--src/stacks.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/stacks.c b/src/stacks.c
index c6b7e8b5..1dbdfe9b 100644
--- a/src/stacks.c
+++ b/src/stacks.c
@@ -63,8 +63,8 @@ call32_smm_post(void)
inb(PORT_CMOS_DATA);
}
-#define ASM32_SWITCH16 " .code16\n"
-#define ASM32_BACK32 " .code32\n"
+#define ASM32_SWITCH16 " .pushsection .text.32fseg." UNIQSEC "\n .code16\n"
+#define ASM32_BACK32 " .popsection\n .code32\n"
#define ASM16_SWITCH32 " .code32\n"
#define ASM16_BACK16 " .code16gcc\n"
@@ -127,7 +127,7 @@ call16_smm_helper(u32 eax, u32 edx, u32 (*func)(u32 eax, u32 edx))
return ret;
}
-u32 FUNCFSEG
+static u32
call16_smm(u32 eax, u32 edx, void *func)
{
ASSERT32FLAT();
@@ -265,7 +265,7 @@ call16_sloppy_helper(u32 eax, u32 edx, u32 (*func)(u32 eax, u32 edx))
}
// Jump back to 16bit mode while in 32bit mode from call32_sloppy()
-u32 FUNCFSEG
+static u32
call16_sloppy(u32 eax, u32 edx, void *func)
{
ASSERT32FLAT();
@@ -313,7 +313,7 @@ call32(void *func, u32 eax, u32 errret)
}
// Call a 16bit SeaBIOS function from a 32bit SeaBIOS function.
-u32 FUNCFSEG
+static u32
call16(u32 eax, u32 edx, void *func)
{
ASSERT32FLAT();
@@ -340,7 +340,7 @@ call16(u32 eax, u32 edx, void *func)
}
// Call a 16bit SeaBIOS function in "big real" mode.
-u32 FUNCFSEG
+static u32
call16big(u32 eax, u32 edx, void *func)
{
ASSERT32FLAT();