aboutsummaryrefslogtreecommitdiff
path: root/src/types.h
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2010-09-15 21:38:16 -0400
committerKevin O'Connor <kevin@koconnor.net>2010-09-15 21:38:16 -0400
commitd1b4f967ea1abee81d468088793235744442017c (patch)
tree75bde04d7810c8299b6102d9346c748fb612b709 /src/types.h
parent1a4885e72a80bba3dd245381aa62ad728ba63774 (diff)
downloadseabios-hppa-d1b4f967ea1abee81d468088793235744442017c.zip
seabios-hppa-d1b4f967ea1abee81d468088793235744442017c.tar.gz
seabios-hppa-d1b4f967ea1abee81d468088793235744442017c.tar.bz2
Separate out init code from the rest of the 32bit flat code.
Enhance tools/layoutrom.py code so that it can detect which sections are used from the "32bit flat" runtime code. All other "32bit flat" sections can then be assured to be initialization code only. This is in preparation for relocating the 32bit initialization code.
Diffstat (limited to 'src/types.h')
-rw-r--r--src/types.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/types.h b/src/types.h
index 5083941..7d610ec 100644
--- a/src/types.h
+++ b/src/types.h
@@ -1,6 +1,6 @@
// Basic type definitions for X86 cpus.
//
-// Copyright (C) 2008,2009 Kevin O'Connor <kevin@koconnor.net>
+// Copyright (C) 2008-2010 Kevin O'Connor <kevin@koconnor.net>
//
// This file may be distributed under the terms of the GNU LGPLv3 license.
#ifndef __TYPES_H
@@ -45,6 +45,8 @@ extern void __force_link_error__only_in_16bit(void) __noreturn;
# define VISIBLE16 __VISIBLE
// Notes a function as externally visible in the 32bit flat code chunk.
# define VISIBLE32FLAT __section(".discard.func32flat." UNIQSEC) noinline __weak
+// Notes a 32bit flat function that will only be called during init.
+# define VISIBLE32INIT VISIBLE32FLAT
// Notes a function as externally visible in the 32bit segmented code chunk.
# define VISIBLE32SEG __section(".discard.func32seg." UNIQSEC) noinline __weak
// Designate a variable as (only) visible to 16bit code.
@@ -70,6 +72,7 @@ extern void __force_link_error__only_in_16bit(void) __noreturn;
#elif MODESEGMENT == 1
# define VISIBLE16 __section(".discard.func16." UNIQSEC) noinline __weak
# define VISIBLE32FLAT __section(".discard.func32flat." UNIQSEC) noinline __weak
+# define VISIBLE32INIT VISIBLE32FLAT
# define VISIBLE32SEG __VISIBLE
# define VAR16 __section(".discard.var16." UNIQSEC)
# define VAR16VISIBLE VAR16 __VISIBLE __weak
@@ -84,14 +87,15 @@ extern void __force_link_error__only_in_16bit(void) __noreturn;
# define ASSERT32FLAT() __force_link_error__only_in_32bit_flat()
#else
# define VISIBLE16 __section(".discard.func16." UNIQSEC) noinline __weak
-# define VISIBLE32FLAT __VISIBLE
+# define VISIBLE32FLAT __section(".text.runtime." UNIQSEC) __VISIBLE
+# define VISIBLE32INIT __section(".text.init." UNIQSEC) __VISIBLE
# define VISIBLE32SEG __section(".discard.func32seg." UNIQSEC) noinline __weak
# define VAR16 __section(".discard.var16." UNIQSEC)
# define VAR16VISIBLE VAR16 __VISIBLE __weak
# define VAR16EXPORT VAR16VISIBLE
# define VAR16FIXED(addr) VAR16VISIBLE
# define VAR32SEG __section(".discard.var32seg." UNIQSEC)
-# define VAR32FLATVISIBLE __VISIBLE
+# define VAR32FLATVISIBLE __section(".data.runtime." UNIQSEC) __VISIBLE
# define ASM16(code)
# define ASM32FLAT(code) __ASM(code)
# define ASSERT16() __force_link_error__only_in_16bit()