2009-06-04 Vladimir Serbinenko <phcoder@gmail.com>

Define segment as well as section when compiling with
	Apple's CC

	* efiemu/runtime/efiemu.c (PHYSICAL_ATTRIBUTE): new definition
	(efiemu_set_virtual_address_map): declare with PHYSICAL_ATTRIBUTE
	(efiemu_convert_pointer): likewise
	(efiemu_set_virtual_address_map): likewise
	(efiemu_convert_pointer): likewise
	(efiemu_getcrc32): likewise
	(init_crc32_table): likewise
	(reflect): likewise
	* include/grub/dl.h (GRUB_MOD_NAME): define segment with Apple's CC
	(GRUB_MOD_DEP): likewise
This commit is contained in:
phcoder 2009-06-04 20:40:51 +00:00
parent c8600122db
commit d119a20ce5
3 changed files with 38 additions and 6 deletions

View file

@ -1,3 +1,19 @@
2009-06-04 Vladimir Serbinenko <phcoder@gmail.com>
Define segment as well as section when compiling with
Apple's CC
* efiemu/runtime/efiemu.c (PHYSICAL_ATTRIBUTE): new definition
(efiemu_set_virtual_address_map): declare with PHYSICAL_ATTRIBUTE
(efiemu_convert_pointer): likewise
(efiemu_set_virtual_address_map): likewise
(efiemu_convert_pointer): likewise
(efiemu_getcrc32): likewise
(init_crc32_table): likewise
(reflect): likewise
* include/grub/dl.h (GRUB_MOD_NAME): define segment with Apple's CC
(GRUB_MOD_DEP): likewise
2009-06-04 Vladimir Serbinenko <phcoder@gmail.com>
Allow a compilation without -mcmodel=large

View file

@ -40,18 +40,23 @@ grub_efi_status_t
efiemu_set_wakeup_time (grub_efi_boolean_t enabled,
grub_efi_time_t *time);
#ifdef APPLE_CC
#define PHYSICAL_ATTRIBUTE __attribute__ ((section("_text-physical, _text-physical")));
#else
#define PHYSICAL_ATTRIBUTE __attribute__ ((section(".text-physical")));
#endif
grub_efi_status_t
efiemu_set_virtual_address_map (grub_efi_uintn_t memory_map_size,
grub_efi_uintn_t descriptor_size,
grub_efi_uint32_t descriptor_version,
grub_efi_memory_descriptor_t *virtual_map)
__attribute__ ((section(".text-physical")));
PHYSICAL_ATTRIBUTE;
grub_efi_status_t
efiemu_convert_pointer (grub_efi_uintn_t debug_disposition,
void **address)
__attribute__ ((section(".text-physical")));
PHYSICAL_ATTRIBUTE;
grub_efi_status_t
efiemu_get_variable (grub_efi_char16_t *variable_name,
@ -84,17 +89,20 @@ EFI_FUNC (efiemu_set_virtual_address_map) (grub_efi_uintn_t,
grub_efi_uintn_t,
grub_efi_uint32_t,
grub_efi_memory_descriptor_t *)
__attribute__ ((section(".text-physical")));
PHYSICAL_ATTRIBUTE;
grub_efi_status_t
EFI_FUNC (efiemu_convert_pointer) (grub_efi_uintn_t debug_disposition,
void **address)
__attribute__ ((section(".text-physical")));
PHYSICAL_ATTRIBUTE;
static grub_uint32_t
efiemu_getcrc32 (grub_uint32_t crc, void *buf, int size)
__attribute__ ((section(".text-physical")));
PHYSICAL_ATTRIBUTE;
static void
init_crc32_table (void)
__attribute__ ((section(".text-physical")));
PHYSICAL_ATTRIBUTE;
static grub_uint32_t
reflect (grub_uint32_t ref, int len)
PHYSICAL_ATTRIBUTE;
/*
The log. It's used when examining memory dump

View file

@ -40,11 +40,19 @@ grub_##name##_fini (void) { grub_mod_fini (); } \
static void \
grub_mod_fini (void)
#ifdef APPLE_CC
#define GRUB_MOD_NAME(name) \
static char grub_modname[] __attribute__ ((section ("_modname, _modname"), used)) = #name;
#define GRUB_MOD_DEP(name) \
__asm__ (".section _moddeps, _moddeps\n.asciz \"" #name "\"\n")
#else
#define GRUB_MOD_NAME(name) \
__asm__ (".section .modname\n.asciz \"" #name "\"\n")
#define GRUB_MOD_DEP(name) \
__asm__ (".section .moddeps\n.asciz \"" #name "\"\n")
#endif
struct grub_dl_segment
{