From eb88bf7db541aa2dd70cae869238cfb3003efb56 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Wed, 24 Sep 2014 15:58:12 -0400 Subject: build: Support declaring 32bit C functions that must reside in the f-segment Add support for a FUNCFSEG macro that will force a "32bit flat" C function to be located in the f-segment. This is useful for 32bit code with inline assembler that thunks to 16bit mode. Signed-off-by: Kevin O'Connor --- src/types.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/types.h') diff --git a/src/types.h b/src/types.h index 097372c..6dd8c43 100644 --- a/src/types.h +++ b/src/types.h @@ -70,6 +70,8 @@ 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. @@ -90,6 +92,7 @@ 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) @@ -106,6 +109,7 @@ 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) -- cgit v1.1