]> xenbits.xensource.com Git - seabios.git/commitdiff
Eliminate FUNCFSEG - only force portions of inline asm to f-segment
authorKevin O'Connor <kevin@koconnor.net>
Wed, 3 Dec 2014 17:53:01 +0000 (12:53 -0500)
committerKevin O'Connor <kevin@koconnor.net>
Wed, 3 Dec 2014 18:06:24 +0000 (13:06 -0500)
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>
src/stacks.c
src/types.h

index c6b7e8b543add004b9cd704e0a8920931080368f..1dbdfe9bbc525942e84c9b3aa66d016c1ce0e6ee 100644 (file)
@@ -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();
index 6dd8c43db607256aef43364620afec0fe19f1e9e..097372cdb1a90ec1e336e632d35dedbc3215788a 100644 (file)
@@ -70,8 +70,6 @@ extern void __force_link_error__only_in_16bit(void) __noreturn;
 # define VARFSEG __section(".discard.varfseg." UNIQSEC) __VISIBLE __weak
 // Designate a variable at a specific address in the f-segment.
 # define VARFSEGFIXED(addr) __section(".discard.varfixed." UNIQSEC) __VISIBLE __weak
-// Notes a 32bit flat function that must reside in the f-segment.
-# define FUNCFSEG __section(".discard.32fseg." UNIQSEC) __VISIBLE __weak
 // Verify a variable is only accessable via 32bit "init" functions
 # define VARVERIFY32INIT __section(".discard.varinit." UNIQSEC)
 // Designate top-level assembler as 16bit only.
@@ -92,7 +90,6 @@ extern void __force_link_error__only_in_16bit(void) __noreturn;
 # define VARLOW __section(".discard.varlow." UNIQSEC) __VISIBLE __weak
 # define VARFSEG __section(".discard.varfseg." UNIQSEC) __VISIBLE __weak
 # define VARFSEGFIXED(addr) __section(".discard.varfixed." UNIQSEC) __VISIBLE __weak
-# define FUNCFSEG __section(".discard.32fseg." UNIQSEC) __VISIBLE __weak
 # define VARVERIFY32INIT __section(".discard.varinit." UNIQSEC)
 # define ASM16(code)
 # define ASM32FLAT(code)
@@ -109,7 +106,6 @@ extern void __force_link_error__only_in_16bit(void) __noreturn;
 # define VARLOW __section(".data.varlow." UNIQSEC) __VISIBLE __weak
 # define VARFSEG __section(".data.varfseg." UNIQSEC) __VISIBLE
 # define VARFSEGFIXED(addr) __section(".fixedaddr." __stringify(addr)) __VISIBLE __aligned(1)
-# define FUNCFSEG __section(".text.32fseg." UNIQSEC) __VISIBLE
 # define VARVERIFY32INIT __section(".data.varinit." UNIQSEC)
 # define ASM16(code)
 # define ASM32FLAT(code) __ASM(code)