merge mainstream into mips
This commit is contained in:
commit
5afcd00788
104 changed files with 40003 additions and 2373 deletions
30
include/grub/i18n.h
Normal file
30
include/grub/i18n.h
Normal file
|
@ -0,0 +1,30 @@
|
|||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2009 Free Software Foundation, Inc.
|
||||
*
|
||||
* GRUB is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GRUB is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef GRUB_I18N_H
|
||||
#define GRUB_I18N_H 1
|
||||
|
||||
#ifdef GRUB_UTIL
|
||||
# include <locale.h>
|
||||
# include <libintl.h>
|
||||
# define _(str) gettext(str)
|
||||
#else
|
||||
# define _(str) str
|
||||
#endif
|
||||
|
||||
#endif /* GRUB_I18N_H */
|
|
@ -21,10 +21,10 @@
|
|||
|
||||
/* The asm part of the multiboot loader. */
|
||||
void grub_multiboot_real_boot (grub_addr_t entry,
|
||||
struct grub_multiboot_info *mbi)
|
||||
struct multiboot_info *mbi)
|
||||
__attribute__ ((noreturn));
|
||||
void grub_multiboot2_real_boot (grub_addr_t entry,
|
||||
struct grub_multiboot_info *mbi)
|
||||
struct multiboot_info *mbi)
|
||||
__attribute__ ((noreturn));
|
||||
|
||||
extern grub_uint32_t grub_multiboot_payload_eip;
|
||||
|
|
|
@ -25,105 +25,4 @@
|
|||
void grub_multiboot (int argc, char *argv[]);
|
||||
void grub_module (int argc, char *argv[]);
|
||||
|
||||
#ifndef ASM_FILE
|
||||
|
||||
#include <grub/types.h>
|
||||
|
||||
struct grub_multiboot_header
|
||||
{
|
||||
/* Must be MULTIBOOT_MAGIC - see above. */
|
||||
grub_uint32_t magic;
|
||||
|
||||
/* Feature flags. */
|
||||
grub_uint32_t flags;
|
||||
|
||||
/* The above fields plus this one must equal 0 mod 2^32. */
|
||||
grub_uint32_t checksum;
|
||||
|
||||
/* These are only valid if MULTIBOOT_AOUT_KLUDGE is set. */
|
||||
grub_uint32_t header_addr;
|
||||
grub_uint32_t load_addr;
|
||||
grub_uint32_t load_end_addr;
|
||||
grub_uint32_t bss_end_addr;
|
||||
grub_uint32_t entry_addr;
|
||||
|
||||
/* These are only valid if MULTIBOOT_VIDEO_MODE is set. */
|
||||
grub_uint32_t mode_type;
|
||||
grub_uint32_t width;
|
||||
grub_uint32_t height;
|
||||
grub_uint32_t depth;
|
||||
};
|
||||
|
||||
struct grub_multiboot_info
|
||||
{
|
||||
/* Multiboot info version number */
|
||||
grub_uint32_t flags;
|
||||
|
||||
/* Available memory from BIOS */
|
||||
grub_uint32_t mem_lower;
|
||||
grub_uint32_t mem_upper;
|
||||
|
||||
/* "root" partition */
|
||||
grub_uint32_t boot_device;
|
||||
|
||||
/* Kernel command line */
|
||||
grub_uint32_t cmdline;
|
||||
|
||||
/* Boot-Module list */
|
||||
grub_uint32_t mods_count;
|
||||
grub_uint32_t mods_addr;
|
||||
|
||||
grub_uint32_t syms[4];
|
||||
|
||||
/* Memory Mapping buffer */
|
||||
grub_uint32_t mmap_length;
|
||||
grub_uint32_t mmap_addr;
|
||||
|
||||
/* Drive Info buffer */
|
||||
grub_uint32_t drives_length;
|
||||
grub_uint32_t drives_addr;
|
||||
|
||||
/* ROM configuration table */
|
||||
grub_uint32_t config_table;
|
||||
|
||||
/* Boot Loader Name */
|
||||
grub_uint32_t boot_loader_name;
|
||||
|
||||
/* APM table */
|
||||
grub_uint32_t apm_table;
|
||||
|
||||
/* Video */
|
||||
grub_uint32_t vbe_control_info;
|
||||
grub_uint32_t vbe_mode_info;
|
||||
grub_uint16_t vbe_mode;
|
||||
grub_uint16_t vbe_interface_seg;
|
||||
grub_uint16_t vbe_interface_off;
|
||||
grub_uint16_t vbe_interface_len;
|
||||
};
|
||||
|
||||
struct grub_multiboot_mmap_entry
|
||||
{
|
||||
grub_uint32_t size;
|
||||
grub_uint64_t addr;
|
||||
grub_uint64_t len;
|
||||
#define GRUB_MULTIBOOT_MEMORY_AVAILABLE 1
|
||||
#define GRUB_MULTIBOOT_MEMORY_RESERVED 2
|
||||
grub_uint32_t type;
|
||||
} __attribute__((packed));
|
||||
|
||||
struct grub_mod_list
|
||||
{
|
||||
/* the memory used goes from bytes 'mod_start' to 'mod_end-1' inclusive */
|
||||
grub_uint32_t mod_start;
|
||||
grub_uint32_t mod_end;
|
||||
|
||||
/* Module command line */
|
||||
grub_uint32_t cmdline;
|
||||
|
||||
/* padding to take it to 16 bytes (must be zero) */
|
||||
grub_uint32_t pad;
|
||||
};
|
||||
|
||||
#endif /* ! ASM_FILE */
|
||||
|
||||
#endif /* ! GRUB_MULTIBOOT_HEADER */
|
||||
|
|
|
@ -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 */
|
||||
|
|
19
include/grub/x86_64/io.h
Normal file
19
include/grub/x86_64/io.h
Normal file
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2009 Free Software Foundation, Inc.
|
||||
*
|
||||
* GRUB is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GRUB is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <grub/i386/io.h>
|
|
@ -1,20 +1,23 @@
|
|||
/* multiboot.h - multiboot header file. */
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2003,2007,2009 Free Software Foundation, Inc.
|
||||
* multiboot.h - Multiboot header file.
|
||||
* Copyright (C) 2003,2007,2008,2009 Free Software Foundation, Inc.
|
||||
*
|
||||
* GRUB is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to
|
||||
* deal in the Software without restriction, including without limitation the
|
||||
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
* sell copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* GRUB is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ANY
|
||||
* DEVELOPER OR DISTRIBUTOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
|
||||
* IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef MULTIBOOT_HEADER
|
||||
|
@ -92,4 +95,105 @@
|
|||
/* Is there video information? */
|
||||
#define MULTIBOOT_INFO_VIDEO_INFO 0x00000800
|
||||
|
||||
#ifndef ASM_FILE
|
||||
|
||||
#include <grub/types.h>
|
||||
|
||||
struct multiboot_header
|
||||
{
|
||||
/* Must be MULTIBOOT_MAGIC - see above. */
|
||||
grub_uint32_t magic;
|
||||
|
||||
/* Feature flags. */
|
||||
grub_uint32_t flags;
|
||||
|
||||
/* The above fields plus this one must equal 0 mod 2^32. */
|
||||
grub_uint32_t checksum;
|
||||
|
||||
/* These are only valid if MULTIBOOT_AOUT_KLUDGE is set. */
|
||||
grub_uint32_t header_addr;
|
||||
grub_uint32_t load_addr;
|
||||
grub_uint32_t load_end_addr;
|
||||
grub_uint32_t bss_end_addr;
|
||||
grub_uint32_t entry_addr;
|
||||
|
||||
/* These are only valid if MULTIBOOT_VIDEO_MODE is set. */
|
||||
grub_uint32_t mode_type;
|
||||
grub_uint32_t width;
|
||||
grub_uint32_t height;
|
||||
grub_uint32_t depth;
|
||||
};
|
||||
|
||||
struct multiboot_info
|
||||
{
|
||||
/* Multiboot info version number */
|
||||
grub_uint32_t flags;
|
||||
|
||||
/* Available memory from BIOS */
|
||||
grub_uint32_t mem_lower;
|
||||
grub_uint32_t mem_upper;
|
||||
|
||||
/* "root" partition */
|
||||
grub_uint32_t boot_device;
|
||||
|
||||
/* Kernel command line */
|
||||
grub_uint32_t cmdline;
|
||||
|
||||
/* Boot-Module list */
|
||||
grub_uint32_t mods_count;
|
||||
grub_uint32_t mods_addr;
|
||||
|
||||
grub_uint32_t syms[4];
|
||||
|
||||
/* Memory Mapping buffer */
|
||||
grub_uint32_t mmap_length;
|
||||
grub_uint32_t mmap_addr;
|
||||
|
||||
/* Drive Info buffer */
|
||||
grub_uint32_t drives_length;
|
||||
grub_uint32_t drives_addr;
|
||||
|
||||
/* ROM configuration table */
|
||||
grub_uint32_t config_table;
|
||||
|
||||
/* Boot Loader Name */
|
||||
grub_uint32_t boot_loader_name;
|
||||
|
||||
/* APM table */
|
||||
grub_uint32_t apm_table;
|
||||
|
||||
/* Video */
|
||||
grub_uint32_t vbe_control_info;
|
||||
grub_uint32_t vbe_mode_info;
|
||||
grub_uint16_t vbe_mode;
|
||||
grub_uint16_t vbe_interface_seg;
|
||||
grub_uint16_t vbe_interface_off;
|
||||
grub_uint16_t vbe_interface_len;
|
||||
};
|
||||
|
||||
struct multiboot_mmap_entry
|
||||
{
|
||||
grub_uint32_t size;
|
||||
grub_uint64_t addr;
|
||||
grub_uint64_t len;
|
||||
#define MULTIBOOT_MEMORY_AVAILABLE 1
|
||||
#define MULTIBOOT_MEMORY_RESERVED 2
|
||||
grub_uint32_t type;
|
||||
} __attribute__((packed));
|
||||
|
||||
struct multiboot_mod_list
|
||||
{
|
||||
/* the memory used goes from bytes 'mod_start' to 'mod_end-1' inclusive */
|
||||
grub_uint32_t mod_start;
|
||||
grub_uint32_t mod_end;
|
||||
|
||||
/* Module command line */
|
||||
grub_uint32_t cmdline;
|
||||
|
||||
/* padding to take it to 16 bytes (must be zero) */
|
||||
grub_uint32_t pad;
|
||||
};
|
||||
|
||||
#endif /* ! ASM_FILE */
|
||||
|
||||
#endif /* ! MULTIBOOT_HEADER */
|
||||
|
|
|
@ -40,18 +40,18 @@
|
|||
|
||||
/* 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 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue