]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2009-11-13 Robert Millan <rmh.grub@aybabtu.com>
authorRobert Millan <rmh@aybabtu.com>
Fri, 13 Nov 2009 13:30:55 +0000 (13:30 +0000)
committerRobert Millan <rmh@aybabtu.com>
Fri, 13 Nov 2009 13:30:55 +0000 (13:30 +0000)
        * include/multiboot2.h (multiboot_word): Rename from this ...
        (multiboot2_word): ... to this.  Update all users.
        (multiboot_header): Rename from this ...
        (multiboot2_header): ... to this.  Update all users.
        (multiboot_tag_header): Rename from this ...
        (multiboot2_tag_header): ... to this.  Update all users.
        (multiboot_tag_start): Rename from this ...
        (multiboot2_tag_start): ... to this.  Update all users.
        (multiboot_tag_name): Rename from this ...
        (multiboot2_tag_name): ... to this.  Update all users.
        (multiboot_tag_module): Rename from this ...
        (multiboot2_tag_module): ... to this.  Update all users.
        (multiboot_tag_memory): Rename from this ...
        (multiboot2_tag_memory): ... to this.  Update all users.
        (multiboot_tag_unused): Rename from this ...
        (multiboot2_tag_unused): ... to this.  Update all users.
        (multiboot_tag_end): Rename from this ...
        (multiboot2_tag_end): ... to this.  Update all users.

include/grub/multiboot2.h
include/multiboot2.h
loader/i386/pc/multiboot2.c
loader/ieee1275/multiboot2.c
loader/multiboot2.c

index 2c9780996a74bb8ea8c6a9e60190ee269fed17ca..af10cdc2190c785ca814a217e983d36e4a09447b 100644 (file)
@@ -30,7 +30,7 @@ typedef grub_uint64_t uint64_t;
 #define __WORDSIZE GRUB_TARGET_WORDSIZE
 #endif
 
-struct multiboot_tag_header;
+struct multiboot2_tag_header;
 
 grub_err_t
 grub_mb2_tag_alloc (grub_addr_t *addr, int key, grub_size_t len);
@@ -42,7 +42,7 @@ void
 grub_mb2_arch_boot (grub_addr_t entry, void *tags);
 
 void
-grub_mb2_arch_unload (struct multiboot_tag_header *tags);
+grub_mb2_arch_unload (struct multiboot2_tag_header *tags);
 
 grub_err_t
 grub_mb2_arch_elf32_hook (Elf32_Phdr *phdr, grub_addr_t *addr, int *do_load);
@@ -65,6 +65,6 @@ grub_module2 (int argc, char *argv[]);
 #define for_each_tag(tag, tags) \
   for (tag = tags; \
        tag && tag->key != MULTIBOOT2_TAG_END; \
-       tag = (struct multiboot_tag_header *)((char *)tag + tag->len))
+       tag = (struct multiboot2_tag_header *)((char *)tag + tag->len))
 
 #endif /* ! GRUB_MULTIBOOT2_HEADER */
index c87c3d175f986cbe85e374958101273df0930191..e55af8392b42577becda4d834441308b5e0370fa 100644 (file)
 
 /* XXX not portable? */
 #if __WORDSIZE == 64
-typedef uint64_t multiboot_word;
+typedef uint64_t multiboot2_word;
 #else
-typedef uint32_t multiboot_word;
+typedef uint32_t multiboot2_word;
 #endif
 
-struct multiboot_header
+struct multiboot2_header
 {
   uint32_t magic;
   uint32_t flags;
 };
 
-struct multiboot_tag_header
+struct multiboot2_tag_header
 {
   uint32_t key;
   uint32_t len;
@@ -61,48 +61,48 @@ struct multiboot_tag_header
 #define MULTIBOOT2_TAG_RESERVED2 (~0)
 
 #define MULTIBOOT2_TAG_START     1
-struct multiboot_tag_start
+struct multiboot2_tag_start
 {
-  struct multiboot_tag_header header;
-  multiboot_word size; /* Total size of all multiboot tags. */
+  struct multiboot2_tag_header header;
+  multiboot2_word size; /* Total size of all multiboot tags. */
 };
 
 #define MULTIBOOT2_TAG_NAME      2
-struct multiboot_tag_name
+struct multiboot2_tag_name
 {
-  struct multiboot_tag_header header;
+  struct multiboot2_tag_header header;
   char name[1];
 };
 
 #define MULTIBOOT2_TAG_MODULE    3
-struct multiboot_tag_module
+struct multiboot2_tag_module
 {
-  struct multiboot_tag_header header;
-  multiboot_word addr;
-  multiboot_word size;
+  struct multiboot2_tag_header header;
+  multiboot2_word addr;
+  multiboot2_word size;
   char type[36];
   char cmdline[1];
 };
 
 #define MULTIBOOT2_TAG_MEMORY    4
-struct multiboot_tag_memory
+struct multiboot2_tag_memory
 {
-  struct multiboot_tag_header header;
-  multiboot_word addr;
-  multiboot_word size;
-  multiboot_word type;
+  struct multiboot2_tag_header header;
+  multiboot2_word addr;
+  multiboot2_word size;
+  multiboot2_word type;
 };
 
 #define MULTIBOOT2_TAG_UNUSED    5
-struct multiboot_tag_unused
+struct multiboot2_tag_unused
 {
-  struct multiboot_tag_header header;
+  struct multiboot2_tag_header header;
 };
 
 #define MULTIBOOT2_TAG_END       0xffff
-struct multiboot_tag_end
+struct multiboot2_tag_end
 {
-  struct multiboot_tag_header header;
+  struct multiboot2_tag_header header;
 };
 
 #endif /* ! ASM_FILE */
index 3baf4883bb8ea8651f820b90cc49eff874e11c8c..e2d649613926d60cf1fadf893996c82ecb5ff09d 100644 (file)
@@ -95,17 +95,17 @@ grub_mb2_arch_boot (grub_addr_t entry, void *tags)
 }
 
 void
-grub_mb2_arch_unload (struct multiboot_tag_header *tags)
+grub_mb2_arch_unload (struct multiboot2_tag_header *tags)
 {
-   struct multiboot_tag_header *tag;
+   struct multiboot2_tag_header *tag;
 
    /* Free all module memory in the tag list.  */
    for_each_tag (tag, tags)
      {
        if (tag->key == MULTIBOOT2_TAG_MODULE)
          {
-           struct multiboot_tag_module *module =
-              (struct multiboot_tag_module *) tag;
+           struct multiboot2_tag_module *module =
+              (struct multiboot2_tag_module *) tag;
            grub_free((void *) module->addr);
          }
      }
index fda62fc4b2cf9567ea65fa2868688b505a57e02f..3646e8091bd85e6fd03d19ec35cb7e7db6a1bd8e 100644 (file)
@@ -115,17 +115,17 @@ grub_mb2_tags_arch_create (void)
 
 /* Release the memory we claimed from Open Firmware above.  */
 void
-grub_mb2_arch_unload (struct multiboot_tag_header *tags)
+grub_mb2_arch_unload (struct multiboot2_tag_header *tags)
 {
-  struct multiboot_tag_header *tag;
+  struct multiboot2_tag_header *tag;
 
   /* Free all module memory in the tag list.  */
   for_each_tag (tag, tags)
     {
       if (tag->key == MULTIBOOT2_TAG_MODULE)
        {
-         struct multiboot_tag_module *module =
-             (struct multiboot_tag_module *) tag;
+         struct multiboot2_tag_module *module =
+             (struct multiboot2_tag_module *) tag;
          grub_ieee1275_release (module->addr, module->size);
        }
     }
index 62f923a9b15fa2571401094167dc3f3c97af0097..976285b856ae8bae35b41485b27b567423ffa8b0 100644 (file)
@@ -51,7 +51,7 @@ grub_mb2_tags_free (void)
 grub_err_t
 grub_mb2_tag_alloc (grub_addr_t *addr, int key, grub_size_t len)
 {
-  struct multiboot_tag_header *tag;
+  struct multiboot2_tag_header *tag;
   grub_size_t used;
   grub_size_t needed;
 
@@ -59,7 +59,7 @@ grub_mb2_tag_alloc (grub_addr_t *addr, int key, grub_size_t len)
                key, (unsigned long) len);
 
   used = grub_mb2_tags_pos - grub_mb2_tags;
-  len = ALIGN_UP (len, sizeof (multiboot_word));
+  len = ALIGN_UP (len, sizeof (multiboot2_word));
 
   needed = used + len;
 
@@ -83,7 +83,7 @@ grub_mb2_tag_alloc (grub_addr_t *addr, int key, grub_size_t len)
       grub_mb2_tags_pos = newarea + used;
     }
 
-  tag = (struct multiboot_tag_header *) grub_mb2_tags_pos;
+  tag = (struct multiboot2_tag_header *) grub_mb2_tags_pos;
   grub_mb2_tags_pos += len;
 
   tag->key = key;
@@ -103,24 +103,24 @@ static grub_err_t
 grub_mb2_tag_start_create (void)
 {
   return grub_mb2_tag_alloc (0, MULTIBOOT2_TAG_START,
-                           sizeof (struct multiboot_tag_start));
+                           sizeof (struct multiboot2_tag_start));
 }
 
 static grub_err_t
 grub_mb2_tag_name_create (void)
 {
-  struct multiboot_tag_name *name;
+  struct multiboot2_tag_name *name;
   grub_addr_t name_addr;
   grub_err_t err;
   const char *grub_version = PACKAGE_STRING;
 
   err = grub_mb2_tag_alloc (&name_addr, MULTIBOOT2_TAG_NAME,
-                          sizeof (struct multiboot_tag_name) +
+                          sizeof (struct multiboot2_tag_name) +
                           sizeof (grub_version) + 1);
   if (err)
     return err;
 
-  name = (struct multiboot_tag_name *) name_addr;
+  name = (struct multiboot2_tag_name *) name_addr;
   grub_strcpy (name->name, grub_version);
 
   return GRUB_ERR_NONE;
@@ -159,17 +159,17 @@ error:
 static grub_err_t
 grub_mb2_tags_finish (void)
 {
-  struct multiboot_tag_start *start;
+  struct multiboot2_tag_start *start;
   grub_err_t err;
 
   /* Create the `end' tag.  */
   err = grub_mb2_tag_alloc (0, MULTIBOOT2_TAG_END,
-                          sizeof (struct multiboot_tag_end));
+                          sizeof (struct multiboot2_tag_end));
   if (err)
     goto error;
 
   /* We created the `start' tag first.  Update it now.  */
-  start = (struct multiboot_tag_start *) grub_mb2_tags;
+  start = (struct multiboot2_tag_start *) grub_mb2_tags;
   start->size = grub_mb2_tags_pos - grub_mb2_tags;
   return GRUB_ERR_NONE;
 
@@ -195,17 +195,17 @@ grub_mb2_boot (void)
 static grub_err_t
 grub_mb2_unload (void)
 {
-  struct multiboot_tag_header *tag;
-  struct multiboot_tag_header *tags =
-    (struct multiboot_tag_header *) grub_mb2_tags;
+  struct multiboot2_tag_header *tag;
+  struct multiboot2_tag_header *tags =
+    (struct multiboot2_tag_header *) grub_mb2_tags;
 
   /* Free all module memory in the tag list.  */
   for_each_tag (tag, tags)
     {
       if (tag->key == MULTIBOOT2_TAG_MODULE)
        {
-         struct multiboot_tag_module *module =
-             (struct multiboot_tag_module *) tag;
+         struct multiboot2_tag_module *module =
+             (struct multiboot2_tag_module *) tag;
          grub_free ((void *) module->addr);
        }
     }
@@ -233,7 +233,7 @@ static grub_err_t
 grub_mb2_tag_module_create (grub_addr_t modaddr, grub_size_t modsize,
                            char *type, int key, int argc, char *argv[])
 {
-  struct multiboot_tag_module *module;
+  struct multiboot2_tag_module *module;
   grub_ssize_t argslen = 0;
   grub_err_t err;
   char *p;
@@ -246,11 +246,11 @@ grub_mb2_tag_module_create (grub_addr_t modaddr, grub_size_t modsize,
 
   /* Note: includes implicit 1-byte cmdline.  */
   err = grub_mb2_tag_alloc (&module_addr, key,
-                          sizeof (struct multiboot_tag_module) + argslen);
+                          sizeof (struct multiboot2_tag_module) + argslen);
   if (err)
     return grub_errno;
 
-  module = (struct multiboot_tag_module *) module_addr;
+  module = (struct multiboot2_tag_module *) module_addr;
   module->addr = modaddr;
   module->size = modsize;
   grub_strcpy(module->type, type);
@@ -308,7 +308,7 @@ grub_multiboot2 (int argc, char *argv[])
   char *buffer;
   grub_file_t file = 0;
   grub_elf_t elf = 0;
-  struct multiboot_header *header = 0;
+  struct multiboot2_header *header = 0;
   char *p;
   grub_ssize_t len;
   grub_err_t err;
@@ -344,7 +344,7 @@ grub_multiboot2 (int argc, char *argv[])
      be at least 8 bytes and aligned on a 8-byte boundary.  */
   for (p = buffer; p <= buffer + len - 8; p += 8)
     {
-      header = (struct multiboot_header *) p;
+      header = (struct multiboot2_header *) p;
       if (header->magic == MULTIBOOT2_HEADER_MAGIC)
        {
          header_found = 1;