Merge mainline into keylayouts

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2010-08-31 14:03:29 +02:00
commit 5aaf2c18bd
616 changed files with 13408 additions and 7359 deletions

View file

@ -20,6 +20,8 @@
#define GRUB_BSD_CPU_HEADER 1
#include <grub/types.h>
#include <grub/relocator.h>
#include <grub/i386/freebsd_reboot.h>
#include <grub/i386/netbsd_reboot.h>
#include <grub/i386/openbsd_reboot.h>
@ -27,7 +29,6 @@
#include <grub/i386/netbsd_bootinfo.h>
#include <grub/i386/openbsd_bootarg.h>
enum bsd_kernel_types
{
KERNEL_TYPE_NONE,
@ -65,35 +66,55 @@ struct grub_freebsd_bootinfo
grub_uint32_t tags;
} __attribute__ ((packed));
struct grub_openbsd_bios_mmap
struct freebsd_tag_header
{
grub_uint64_t addr;
grub_uint64_t len;
#define OPENBSD_MMAP_AVAILABLE 1
#define OPENBSD_MMAP_RESERVED 2
#define OPENBSD_MMAP_ACPI 3
#define OPENBSD_MMAP_NVS 4
grub_uint32_t type;
grub_uint32_t len;
};
void grub_unix_real_boot (grub_addr_t entry, ...)
__attribute__ ((cdecl,noreturn));
grub_err_t grub_freebsd_load_elfmodule32 (grub_file_t file, int argc,
grub_err_t grub_freebsd_load_elfmodule32 (struct grub_relocator *relocator,
grub_file_t file, int argc,
char *argv[], grub_addr_t *kern_end);
grub_err_t grub_freebsd_load_elfmodule_obj64 (grub_file_t file, int argc,
grub_err_t grub_freebsd_load_elfmodule_obj64 (struct grub_relocator *relocator,
grub_file_t file, int argc,
char *argv[],
grub_addr_t *kern_end);
grub_err_t grub_freebsd_load_elf_meta32 (grub_file_t file,
grub_err_t grub_freebsd_load_elf_meta32 (struct grub_relocator *relocator,
grub_file_t file,
grub_addr_t *kern_end);
grub_err_t grub_freebsd_load_elf_meta64 (grub_file_t file,
grub_err_t grub_freebsd_load_elf_meta64 (struct grub_relocator *relocator,
grub_file_t file,
grub_addr_t *kern_end);
grub_err_t grub_freebsd_add_meta (grub_uint32_t type, void *data,
grub_uint32_t len);
grub_err_t grub_netbsd_load_elf_meta32 (struct grub_relocator *relocator,
grub_file_t file,
grub_addr_t *kern_end);
grub_err_t grub_netbsd_load_elf_meta64 (struct grub_relocator *relocator,
grub_file_t file,
grub_addr_t *kern_end);
grub_err_t grub_bsd_add_meta (grub_uint32_t type,
void *data, grub_uint32_t len);
grub_err_t grub_freebsd_add_meta_module (char *filename, char *type,
int argc, char **argv,
grub_addr_t addr, grub_uint32_t size);
struct grub_openbsd_ramdisk_descriptor
{
grub_size_t max_size;
grub_uint8_t *target;
grub_uint32_t *size;
};
grub_err_t grub_openbsd_find_ramdisk32 (grub_file_t file,
grub_addr_t kern_start,
void *kern_chunk_src,
struct grub_openbsd_ramdisk_descriptor *desc);
grub_err_t grub_openbsd_find_ramdisk64 (grub_file_t file,
grub_addr_t kern_start,
void *kern_chunk_src,
struct grub_openbsd_ramdisk_descriptor *desc);
extern grub_uint8_t grub_bsd64_trampoline_start, grub_bsd64_trampoline_end;
extern grub_uint32_t grub_bsd64_trampoline_selfjump;
extern grub_uint32_t grub_bsd64_trampoline_gdt;

View file

@ -1 +0,0 @@
#include <grub/cpu/loader.h>

View file

@ -1,22 +0,0 @@
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2002,2003,2004,2006,2007 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_LOADER_MACHINE_HEADER
#define GRUB_LOADER_MACHINE_HEADER 1
#endif /* ! GRUB_LOADER_MACHINE_HEADER */

View file

@ -1,29 +0,0 @@
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2002,2003,2004,2007,2008 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_LOADER_MACHINE_HEADER
#define GRUB_LOADER_MACHINE_HEADER 1
#include <grub/types.h>
#include <grub/symbol.h>
#include <grub/multiboot.h>
void grub_rescue_cmd_linux (int argc, char *argv[]);
void grub_rescue_cmd_initrd (int argc, char *argv[]);
#endif /* ! GRUB_LOADER_MACHINE_HEADER */

View file

@ -124,7 +124,7 @@ struct linux_kernel_header
grub_uint32_t bootsect_kludge; /* obsolete */
grub_uint16_t heap_end_ptr; /* Free memory after setup end */
grub_uint16_t pad1; /* Unused */
char *cmd_line_ptr; /* Points to the kernel command line */
grub_uint32_t cmd_line_ptr; /* Points to the kernel command line */
grub_uint32_t initrd_addr_max; /* Highest address for initrd */
} __attribute__ ((packed));

View file

@ -1,37 +0,0 @@
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2002,2003,2004,2007,2008,2009,2010 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_LOADER_CPU_HEADER
#define GRUB_LOADER_CPU_HEADER 1
#include <grub/types.h>
#include <grub/err.h>
#include <grub/symbol.h>
extern grub_addr_t EXPORT_VAR(grub_os_area_addr);
extern grub_size_t EXPORT_VAR(grub_os_area_size);
#ifdef GRUB_MACHINE_PCBIOS
extern grub_uint32_t EXPORT_VAR(grub_linux_prot_size);
extern char *EXPORT_VAR(grub_linux_tmp_addr);
extern char *EXPORT_VAR(grub_linux_real_addr);
extern grub_int32_t EXPORT_VAR(grub_linux_is_bzimage);
grub_err_t EXPORT_FUNC(grub_linux16_real_boot) (void);
#endif
#endif /* ! GRUB_LOADER_CPU_HEADER */

View file

@ -22,9 +22,34 @@
/* The flag for protected mode. */
#define GRUB_MEMORY_CPU_CR0_PE_ON 0x1
#define GRUB_MEMORY_CPU_CR4_PAE_ON 0x00000040
#define GRUB_MEMORY_CPU_CR4_PAE_ON 0x00000020
#define GRUB_MEMORY_CPU_CR4_PSE_ON 0x00000010
#define GRUB_MEMORY_CPU_CR0_PAGING_ON 0x80000000
#define GRUB_MEMORY_CPU_AMD64_MSR 0xc0000080
#define GRUB_MEMORY_CPU_AMD64_MSR_ON 0x00000100
#ifndef ASM_FILE
typedef grub_addr_t grub_phys_addr_t;
static inline grub_phys_addr_t
grub_vtop (void *a)
{
return (grub_phys_addr_t) a;
}
static inline void *
grub_map_memory (grub_phys_addr_t a, grub_size_t size __attribute__ ((unused)))
{
return (void *) a;
}
static inline void
grub_unmap_memory (void *a __attribute__ ((unused)),
grub_size_t size __attribute__ ((unused)))
{
}
#endif
#endif /* ! GRUB_MEMORY_CPU_HEADER */

View file

@ -19,11 +19,6 @@
#ifndef GRUB_MULTIBOOT_CPU_HEADER
#define GRUB_MULTIBOOT_CPU_HEADER 1
extern grub_uint32_t grub_multiboot_payload_eip;
extern char *grub_multiboot_payload_orig;
extern grub_addr_t grub_multiboot_payload_dest;
extern grub_size_t grub_multiboot_payload_size;
#define MULTIBOOT_INITIAL_STATE { .eax = MULTIBOOT_BOOTLOADER_MAGIC, \
.ecx = 0, \
.edx = 0, \

View file

@ -1 +0,0 @@
#include <grub/i386/coreboot/loader.h>

View file

@ -49,64 +49,90 @@
#include <grub/types.h>
#define NETBSD_BTINFO_BOOTPATH 0
#define NETBSD_BTINFO_ROOTDEVICE 1
#define NETBSD_BTINFO_BOOTDISK 3
#define NETBSD_BTINFO_CONSOLE 6
#define NETBSD_BTINFO_SYMTAB 8
#define NETBSD_BTINFO_MEMMAP 9
#define NETBSD_BTINFO_MODULES 11
#define NETBSD_BTINFO_FRAMEBUF 12
struct grub_netbsd_bootinfo
{
grub_uint32_t bi_count;
grub_uint32_t bi_data[0];
};
struct grub_netbsd_btinfo_common
{
int len;
int type;
};
struct grub_netbsd_btinfo_mmap_header
{
struct grub_netbsd_btinfo_common common;
grub_uint32_t count;
};
struct grub_netbsd_btinfo_mmap_entry
{
grub_uint64_t addr;
grub_uint64_t len;
#define NETBSD_MMAP_AVAILABLE 1
#define NETBSD_MMAP_RESERVED 2
#define NETBSD_MMAP_ACPI 3
#define NETBSD_MMAP_NVS 4
grub_uint32_t len;
grub_uint32_t type;
};
struct grub_netbsd_btinfo_bootpath
{
struct grub_netbsd_btinfo_common common;
char bootpath[80];
};
struct grub_netbsd_btinfo_rootdevice
{
struct grub_netbsd_btinfo_common common;
char devname[16];
};
#define GRUB_NETBSD_MAX_BOOTPATH_LEN 80
struct grub_netbsd_btinfo_bootdisk
{
struct grub_netbsd_btinfo_common common;
int labelsector; /* label valid if != -1 */
grub_uint32_t labelsector; /* label valid if != 0xffffffff */
struct
{
grub_uint16_t type, checksum;
char packname[16];
} label;
int biosdev;
int partition;
grub_uint32_t biosdev;
grub_uint32_t partition;
};
struct grub_netbsd_bootinfo
struct grub_netbsd_btinfo_symtab
{
grub_uint32_t bi_count;
void *bi_data[1];
grub_uint32_t nsyms;
grub_uint32_t ssyms;
grub_uint32_t esyms;
};
struct grub_netbsd_btinfo_serial
{
char devname[16];
grub_uint32_t addr;
grub_uint32_t speed;
};
struct grub_netbsd_btinfo_modules
{
grub_uint32_t num;
grub_uint32_t last_addr;
struct grub_netbsd_btinfo_module
{
char name[80];
#define GRUB_NETBSD_MODULE_RAW 0
#define GRUB_NETBSD_MODULE_ELF 1
grub_uint32_t type;
grub_uint32_t size;
grub_uint32_t addr;
} mods[0];
};
struct grub_netbsd_btinfo_framebuf
{
grub_uint64_t fbaddr;
grub_uint32_t flags;
grub_uint32_t width;
grub_uint32_t height;
grub_uint16_t pitch;
grub_uint8_t bpp;
grub_uint8_t red_mask_size;
grub_uint8_t green_mask_size;
grub_uint8_t blue_mask_size;
grub_uint8_t red_field_pos;
grub_uint8_t green_field_pos;
grub_uint8_t blue_field_pos;
grub_uint8_t reserved[16];
};
#define GRUB_NETBSD_MAX_ROOTDEVICE_LEN 16
#endif

View file

@ -61,12 +61,22 @@
#define OPENBSD_BOOTARG_END -1
#define OPENBSD_BOOTARG_MMAP 0
#define OPENBSD_BOOTARG_CONSOLE 5
struct grub_openbsd_bootargs
{
int ba_type;
int ba_size;
struct grub_openbsd_bootargs *ba_next;
grub_uint32_t ba_type;
grub_uint32_t ba_size;
grub_uint32_t ba_next;
} __attribute__ ((packed));
struct grub_openbsd_bootarg_console
{
grub_uint32_t device;
grub_uint32_t speed;
};
#define GRUB_OPENBSD_COM_MAJOR 8
#define GRUB_OPENBSD_VGA_MAJOR 12
#endif

View file

@ -1,24 +0,0 @@
/*
* 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_MACHINE_EFI_EMU_HEADER
#define GRUB_MACHINE_EFI_EMU_HEADER 1
grub_err_t grub_machine_efiemu_init_tables (void);
#endif

View file

@ -20,7 +20,6 @@
#define GRUB_LOADER_MACHINE_HEADER 1
#include <grub/symbol.h>
#include <grub/cpu/loader.h>
/* This is an asm part of the chainloader. */
void EXPORT_FUNC(grub_chainloader_real_boot) (int drive, void *part_addr) __attribute__ ((noreturn));

View file

@ -1 +0,0 @@
#include <grub/cpu/loader.h>

View file

@ -21,6 +21,7 @@
#include <grub/types.h>
#include <grub/err.h>
#include <grub/relocator.h>
struct grub_relocator32_state
{
@ -30,12 +31,42 @@ struct grub_relocator32_state
grub_uint32_t ecx;
grub_uint32_t edx;
grub_uint32_t eip;
grub_uint32_t esi;
};
void *grub_relocator32_alloc (grub_size_t size);
grub_err_t grub_relocator32_boot (void *relocator, grub_uint32_t dest,
struct grub_relocator16_state
{
grub_uint16_t cs;
grub_uint16_t ds;
grub_uint16_t es;
grub_uint16_t fs;
grub_uint16_t gs;
grub_uint16_t ss;
grub_uint16_t sp;
grub_uint16_t ip;
grub_uint32_t edx;
};
struct grub_relocator64_state
{
grub_uint64_t rsp;
grub_uint64_t rax;
grub_uint64_t rbx;
grub_uint64_t rcx;
grub_uint64_t rdx;
grub_uint64_t rip;
grub_uint64_t rsi;
grub_addr_t cr3;
};
grub_err_t grub_relocator16_boot (struct grub_relocator *rel,
struct grub_relocator16_state state);
grub_err_t grub_relocator32_boot (struct grub_relocator *rel,
struct grub_relocator32_state state);
void *grub_relocator32_realloc (void *relocator, grub_size_t size);
void grub_relocator32_free (void *relocator);
grub_err_t grub_relocator64_boot (struct grub_relocator *rel,
struct grub_relocator64_state state,
grub_addr_t min_addr, grub_addr_t max_addr);
#endif /* ! GRUB_RELOCATOR_CPU_HEADER */

View file

@ -115,5 +115,4 @@ extern grub_uint32_t grub_xnu_arg1;
extern char grub_xnu_cmdline[1024];
grub_err_t grub_xnu_boot (void);
grub_err_t grub_cpu_xnu_fill_devicetree (void);
extern grub_uint32_t grub_xnu_heap_will_be_at;
#endif