[2257] 2009-06-04 Vladimir Serbinenko <[email protected]>

Vladimir Serbinenko <[email protected]>
Newsgroups gmane.comp.boot-loaders.grub.cvs
Message-ID <[email protected]>
Revision: 2257
          http://svn.sv.gnu.org/viewvc/?view=rev&root=grub&revision=2257
Author:   phcoder
Date:     2009-06-04 20:40:51 +0000 (Thu, 04 Jun 2009)
Log Message:
-----------
2009-06-04  Vladimir Serbinenko  <[email protected]>

	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
	

Modified Paths:
--------------
    trunk/grub2/ChangeLog
    trunk/grub2/efiemu/runtime/efiemu.c
    trunk/grub2/include/grub/dl.h

Modified: trunk/grub2/ChangeLog
===================================================================
--- trunk/grub2/ChangeLog	2009-06-04 20:25:11 UTC (rev 2256)
+++ trunk/grub2/ChangeLog	2009-06-04 20:40:51 UTC (rev 2257)
@@ -1,5 +1,21 @@
 2009-06-04  Vladimir Serbinenko  <[email protected]>
 
+	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  <[email protected]>
+
 	Allow a compilation without -mcmodel=large
 
 	* kern/efi/mm.c (grub_efi_allocate_pages): don't allocate >4GiB

Modified: trunk/grub2/efiemu/runtime/efiemu.c
===================================================================
--- trunk/grub2/efiemu/runtime/efiemu.c	2009-06-04 20:25:11 UTC (rev 2256)
+++ trunk/grub2/efiemu/runtime/efiemu.c	2009-06-04 20:40:51 UTC (rev 2257)
@@ -40,18 +40,23 @@
 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 @@
 					      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

Modified: trunk/grub2/include/grub/dl.h
===================================================================
--- trunk/grub2/include/grub/dl.h	2009-06-04 20:25:11 UTC (rev 2256)
+++ trunk/grub2/include/grub/dl.h	2009-06-04 20:40:51 UTC (rev 2257)
@@ -40,11 +40,19 @@
 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
 {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.