merge with mainline
This commit is contained in:
commit
e5a73c4247
182 changed files with 9977 additions and 5276 deletions
|
@ -120,8 +120,8 @@ union grub_aout_header
|
|||
int EXPORT_FUNC(grub_aout_get_type) (union grub_aout_header *header);
|
||||
|
||||
grub_err_t EXPORT_FUNC(grub_aout_load) (grub_file_t file, int offset,
|
||||
grub_addr_t load_addr, int load_size,
|
||||
grub_addr_t bss_end_addr);
|
||||
void *load_addr, int load_size,
|
||||
grub_size_t bss_size);
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -50,6 +50,7 @@ static inline grub_err_t grub_autoefi_prepare (void)
|
|||
# define SYSTEM_TABLE_PTR(x) ((void *)(grub_efi_system_table->x))
|
||||
# define SIZEOF_OF_UINTN sizeof (grub_efi_uintn_t)
|
||||
# define SYSTEM_TABLE(x) (grub_efi_system_table->x)
|
||||
# define grub_autoefi_finish_boot_services grub_efi_finish_boot_services
|
||||
# define EFI_PRESENT 1
|
||||
#else
|
||||
# include <grub/efiemu/efiemu.h>
|
||||
|
@ -72,6 +73,7 @@ static inline grub_err_t grub_autoefi_prepare (void)
|
|||
# define SYSTEM_TABLE GRUB_EFIEMU_SYSTEM_TABLE
|
||||
# define grub_efi_allocate_pages(x,y) (x)
|
||||
# define grub_efi_free_pages(x,y) GRUB_EFI_SUCCESS
|
||||
# define grub_autoefi_finish_boot_services grub_efiemu_finish_boot_services
|
||||
# define EFI_PRESENT 1
|
||||
#endif
|
||||
|
||||
|
|
|
@ -101,7 +101,6 @@ grub_dl_t EXPORT_FUNC(grub_dl_load) (const char *name);
|
|||
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
|
||||
int EXPORT_FUNC(grub_dl_unload) (grub_dl_t mod);
|
||||
void grub_dl_unload_unneeded (void);
|
||||
void grub_dl_unload_all (void);
|
||||
int EXPORT_FUNC(grub_dl_ref) (grub_dl_t mod);
|
||||
int EXPORT_FUNC(grub_dl_unref) (grub_dl_t mod);
|
||||
extern grub_dl_t EXPORT_VAR(grub_dl_head);
|
||||
|
|
|
@ -53,8 +53,10 @@ void EXPORT_FUNC(grub_efi_print_device_path) (grub_efi_device_path_t *dp);
|
|||
char *EXPORT_FUNC(grub_efi_get_filename) (grub_efi_device_path_t *dp);
|
||||
grub_efi_device_path_t *
|
||||
EXPORT_FUNC(grub_efi_get_device_path) (grub_efi_handle_t handle);
|
||||
int EXPORT_FUNC(grub_efi_exit_boot_services) (grub_efi_uintn_t map_key);
|
||||
int EXPORT_FUNC (grub_efi_finish_boot_services) (void);
|
||||
grub_err_t EXPORT_FUNC (grub_efi_finish_boot_services) (grub_efi_uintn_t *outbuf_size, void *outbuf,
|
||||
grub_efi_uintn_t *map_key,
|
||||
grub_efi_uintn_t *efi_desc_size,
|
||||
grub_efi_uint32_t *efi_desc_version);
|
||||
grub_err_t EXPORT_FUNC (grub_efi_set_virtual_address_map) (grub_efi_uintn_t memory_map_size,
|
||||
grub_efi_uintn_t descriptor_size,
|
||||
grub_efi_uint32_t descriptor_version,
|
||||
|
@ -70,4 +72,6 @@ void grub_efi_set_prefix (void);
|
|||
extern grub_efi_system_table_t *EXPORT_VAR(grub_efi_system_table);
|
||||
extern grub_efi_handle_t EXPORT_VAR(grub_efi_image_handle);
|
||||
|
||||
extern int EXPORT_VAR(grub_efi_is_finished);
|
||||
|
||||
#endif /* ! GRUB_EFI_EFI_HEADER */
|
||||
|
|
|
@ -217,13 +217,20 @@ int grub_efiemu_get_memory_map (grub_efi_uintn_t *memory_map_size,
|
|||
grub_efi_uintn_t *map_key,
|
||||
grub_efi_uintn_t *descriptor_size,
|
||||
grub_efi_uint32_t *descriptor_version);
|
||||
|
||||
|
||||
grub_err_t
|
||||
grub_efiemu_finish_boot_services (grub_efi_uintn_t *memory_map_size,
|
||||
grub_efi_memory_descriptor_t *memory_map,
|
||||
grub_efi_uintn_t *map_key,
|
||||
grub_efi_uintn_t *descriptor_size,
|
||||
grub_efi_uint32_t *descriptor_version);
|
||||
|
||||
grub_err_t
|
||||
grub_efiemu_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t,
|
||||
grub_uint64_t,
|
||||
grub_uint32_t));
|
||||
int grub_efiemu_sizeof_uintn_t (void);
|
||||
int grub_efiemu_exit_boot_services (grub_efi_uintn_t map_key);
|
||||
int grub_efiemu_finish_boot_services (void);
|
||||
grub_err_t
|
||||
grub_efiemu_get_lower_upper_memory (grub_uint64_t *lower, grub_uint64_t *upper);
|
||||
#define GRUB_EFIEMU_MEMORY_AVAILABLE 1
|
||||
|
@ -283,4 +290,6 @@ grub_efiemu_set_virtual_address_map (grub_efi_uintn_t memory_map_size,
|
|||
__attribute__ ((unused)),
|
||||
grub_efi_memory_descriptor_t *virtual_map);
|
||||
|
||||
grub_err_t grub_machine_efiemu_init_tables (void);
|
||||
|
||||
#endif /* ! GRUB_EFI_EMU_HEADER */
|
||||
|
|
|
@ -54,5 +54,13 @@ int grub_elf_is_elf64 (grub_elf_t);
|
|||
grub_size_t grub_elf64_size (grub_elf_t, Elf64_Addr *);
|
||||
grub_err_t grub_elf64_load (grub_elf_t, grub_elf64_load_hook_t, grub_addr_t *,
|
||||
grub_size_t *);
|
||||
grub_err_t
|
||||
grub_elf32_phdr_iterate (grub_elf_t elf,
|
||||
int NESTED_FUNC_ATTR (*hook) (grub_elf_t, Elf32_Phdr *, void *),
|
||||
void *hook_arg);
|
||||
grub_err_t
|
||||
grub_elf64_phdr_iterate (grub_elf_t elf,
|
||||
int NESTED_FUNC_ATTR (*hook) (grub_elf_t, Elf64_Phdr *, void *),
|
||||
void *hook_arg);
|
||||
|
||||
#endif /* ! GRUB_ELFLOAD_HEADER */
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
#include <grub/cpu/loader.h>
|
|
@ -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 */
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2007 Free Software Foundation, Inc.
|
||||
* Copyright (C) 2002,2003,2004,2005,2006,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
|
||||
|
@ -16,13 +16,21 @@
|
|||
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef GRUB_INIT_I386_LINUXBIOS_HEADER
|
||||
#define GRUB_INIT_I386_LINUXBIOS_HEADER 1
|
||||
#ifndef GRUB_FLOPPY_CPU_HEADER
|
||||
#define GRUB_FLOPPY_CPU_HEADER 1
|
||||
|
||||
#include <grub/symbol.h>
|
||||
#include <grub/i386/pc/memory.h>
|
||||
#define GRUB_FLOPPY_REG_DIGITAL_OUTPUT 0x3f2
|
||||
|
||||
void EXPORT_FUNC(grub_stop) (void) __attribute__ ((noreturn));
|
||||
void EXPORT_FUNC(grub_stop_floppy) (void);
|
||||
#ifndef ASM_FILE
|
||||
#include <grub/cpu/io.h>
|
||||
|
||||
/* Stop the floppy drive from spinning, so that other software is
|
||||
jumped to with a known state. */
|
||||
static inline void
|
||||
grub_stop_floppy (void)
|
||||
{
|
||||
grub_outb (0, GRUB_FLOPPY_REG_DIGITAL_OUTPUT);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -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));
|
||||
|
||||
|
|
|
@ -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 */
|
|
@ -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 */
|
||||
|
|
|
@ -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, \
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
#include <grub/i386/coreboot/init.h>
|
|
@ -1 +0,0 @@
|
|||
#include <grub/i386/coreboot/loader.h>
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -106,21 +106,4 @@ struct grub_biosdisk_dap
|
|||
grub_uint64_t block;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
int EXPORT_FUNC(grub_biosdisk_rw_int13_extensions) (int ah, int drive, void *dap);
|
||||
int EXPORT_FUNC(grub_biosdisk_rw_standard) (int ah, int drive, int coff, int hoff,
|
||||
int soff, int nsec, int segment);
|
||||
int EXPORT_FUNC(grub_biosdisk_check_int13_extensions) (int drive);
|
||||
int EXPORT_FUNC(grub_biosdisk_get_diskinfo_int13_extensions) (int drive,
|
||||
void *drp);
|
||||
int EXPORT_FUNC(grub_biosdisk_get_cdinfo_int13_extensions) (int drive,
|
||||
void *cdrp);
|
||||
int EXPORT_FUNC(grub_biosdisk_get_diskinfo_standard) (int drive,
|
||||
unsigned long *cylinders,
|
||||
unsigned long *heads,
|
||||
unsigned long *sectors);
|
||||
int EXPORT_FUNC(grub_biosdisk_get_num_floppies) (void);
|
||||
|
||||
void grub_biosdisk_init (void);
|
||||
void grub_biosdisk_fini (void);
|
||||
|
||||
#endif /* ! GRUB_BIOSDISK_MACHINE_HEADER */
|
||||
|
|
|
@ -22,23 +22,9 @@
|
|||
#include <grub/types.h>
|
||||
#include <grub/symbol.h>
|
||||
#include <grub/machine/memory.h>
|
||||
|
||||
/* Get the memory size in KB. If EXTENDED is zero, return conventional
|
||||
memory, otherwise return extended memory. */
|
||||
grub_uint16_t grub_get_memsize (int extended);
|
||||
|
||||
/* Get a packed EISA memory map. Lower 16 bits are between 1MB and 16MB
|
||||
in 1KB parts, and upper 16 bits are above 16MB in 64KB parts. */
|
||||
grub_uint32_t grub_get_eisa_mmap (void);
|
||||
|
||||
/* Get a memory map entry. Return next continuation value. Zero means
|
||||
the end. */
|
||||
grub_uint32_t grub_get_mmap_entry (struct grub_machine_mmap_entry *entry,
|
||||
grub_uint32_t cont);
|
||||
#include <grub/cpu/floppy.h>
|
||||
|
||||
/* Turn on/off Gate A20. */
|
||||
void grub_gate_a20 (int on);
|
||||
|
||||
void EXPORT_FUNC(grub_stop_floppy) (void);
|
||||
|
||||
#endif /* ! GRUB_INIT_MACHINE_HEADER */
|
||||
|
|
52
include/grub/i386/pc/int.h
Normal file
52
include/grub/i386/pc/int.h
Normal file
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
* 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_INTERRUPT_MACHINE_HEADER
|
||||
#define GRUB_INTERRUPT_MACHINE_HEADER 1
|
||||
|
||||
#include <grub/symbol.h>
|
||||
|
||||
struct grub_bios_int_registers
|
||||
{
|
||||
grub_uint32_t eax;
|
||||
grub_uint16_t es;
|
||||
grub_uint16_t ds;
|
||||
grub_uint16_t flags;
|
||||
grub_uint16_t dummy;
|
||||
grub_uint32_t ebx;
|
||||
grub_uint32_t ecx;
|
||||
grub_uint32_t edi;
|
||||
grub_uint32_t esi;
|
||||
grub_uint32_t edx;
|
||||
};
|
||||
|
||||
#define GRUB_CPU_INT_FLAGS_CARRY 0x1
|
||||
#define GRUB_CPU_INT_FLAGS_PARITY 0x4
|
||||
#define GRUB_CPU_INT_FLAGS_ADJUST 0x10
|
||||
#define GRUB_CPU_INT_FLAGS_ZERO 0x40
|
||||
#define GRUB_CPU_INT_FLAGS_SIGN 0x80
|
||||
#define GRUB_CPU_INT_FLAGS_TRAP 0x100
|
||||
#define GRUB_CPU_INT_FLAGS_INTERRUPT 0x200
|
||||
#define GRUB_CPU_INT_FLAGS_DIRECTION 0x400
|
||||
#define GRUB_CPU_INT_FLAGS_OVERFLOW 0x800
|
||||
#define GRUB_CPU_INT_FLAGS_DEFAULT GRUB_CPU_INT_FLAGS_INTERRUPT
|
||||
|
||||
void EXPORT_FUNC (grub_bios_interrupt) (grub_uint8_t intno,
|
||||
struct grub_bios_int_registers *regs);
|
||||
|
||||
#endif
|
|
@ -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));
|
||||
|
|
|
@ -168,6 +168,8 @@
|
|||
|
||||
#ifndef ASM_FILE
|
||||
|
||||
#define GRUB_PXE_SIGNATURE "PXENV+"
|
||||
|
||||
struct grub_pxenv
|
||||
{
|
||||
grub_uint8_t signature[6]; /* 'PXENV+'. */
|
||||
|
@ -190,6 +192,19 @@ struct grub_pxenv
|
|||
grub_uint32_t pxe_ptr; /* SEG:OFF to !PXE struct. */
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct grub_pxe_bangpxe
|
||||
{
|
||||
grub_uint8_t signature[4];
|
||||
#define GRUB_PXE_BANGPXE_SIGNATURE "!PXE"
|
||||
grub_uint8_t length;
|
||||
grub_uint8_t chksum;
|
||||
grub_uint8_t rev;
|
||||
grub_uint8_t reserved;
|
||||
grub_uint32_t undiromid;
|
||||
grub_uint32_t baseromid;
|
||||
grub_uint32_t rm_entry;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct grub_pxenv_get_cached_info
|
||||
{
|
||||
grub_uint16_t status;
|
||||
|
@ -302,10 +317,9 @@ struct grub_pxenv_unload_stack
|
|||
grub_uint8_t reserved[10];
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct grub_pxenv * EXPORT_FUNC(grub_pxe_scan) (void);
|
||||
int EXPORT_FUNC(grub_pxe_call) (int func, void * data);
|
||||
int EXPORT_FUNC(grub_pxe_call) (int func, void * data, grub_uint32_t pxe_rm_entry);
|
||||
|
||||
extern struct grub_pxenv *grub_pxe_pxenv;
|
||||
extern struct grub_pxe_bangpxe *grub_pxe_pxenv;
|
||||
|
||||
void grub_pxe_unload (void);
|
||||
|
||||
|
|
|
@ -169,56 +169,40 @@ struct grub_vbe_palette_data
|
|||
grub_uint8_t alignment;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* Prototypes for kernel real mode thunks. */
|
||||
|
||||
/* Prototypes for helper functions. */
|
||||
/* Call VESA BIOS 0x4f00 to get VBE Controller Information, return status. */
|
||||
grub_vbe_status_t EXPORT_FUNC(grub_vbe_bios_get_controller_info) (struct grub_vbe_info_block *controller_info);
|
||||
|
||||
grub_vbe_status_t
|
||||
grub_vbe_bios_get_controller_info (struct grub_vbe_info_block *controller_info);
|
||||
/* Call VESA BIOS 0x4f01 to get VBE Mode Information, return status. */
|
||||
grub_vbe_status_t EXPORT_FUNC(grub_vbe_bios_get_mode_info) (grub_uint32_t mode,
|
||||
struct grub_vbe_mode_info_block *mode_info);
|
||||
grub_vbe_status_t
|
||||
grub_vbe_bios_get_mode_info (grub_uint32_t mode,
|
||||
struct grub_vbe_mode_info_block *mode_info);
|
||||
/* Call VESA BIOS 0x4f03 to return current VBE Mode, return status. */
|
||||
grub_vbe_status_t
|
||||
grub_vbe_bios_get_mode (grub_uint32_t *mode);
|
||||
/* Call VESA BIOS 0x4f05 to set memory window, return status. */
|
||||
grub_vbe_status_t
|
||||
grub_vbe_bios_set_memory_window (grub_uint32_t window, grub_uint32_t position);
|
||||
/* Call VESA BIOS 0x4f05 to return memory window, return status. */
|
||||
grub_vbe_status_t
|
||||
grub_vbe_bios_get_memory_window (grub_uint32_t window,
|
||||
grub_uint32_t *position);
|
||||
/* Call VESA BIOS 0x4f06 to set scanline length (in bytes), return status. */
|
||||
grub_vbe_status_t
|
||||
grub_vbe_bios_set_scanline_length (grub_uint32_t length);
|
||||
/* Call VESA BIOS 0x4f06 to return scanline length (in bytes), return status. */
|
||||
grub_vbe_status_t
|
||||
grub_vbe_bios_get_scanline_length (grub_uint32_t *length);
|
||||
/* Call VESA BIOS 0x4f07 to get display start, return status. */
|
||||
grub_vbe_status_t
|
||||
grub_vbe_bios_get_display_start (grub_uint32_t *x,
|
||||
grub_uint32_t *y);
|
||||
|
||||
grub_vbe_status_t EXPORT_FUNC(grub_vbe_bios_getset_dac_palette_width) (int set, int *width);
|
||||
grub_vbe_status_t grub_vbe_bios_getset_dac_palette_width (int set, int *width);
|
||||
|
||||
#define grub_vbe_bios_get_dac_palette_width(width) grub_vbe_bios_getset_dac_palette_width(0, (width))
|
||||
#define grub_vbe_bios_set_dac_palette_width(width) grub_vbe_bios_getset_dac_palette_width(1, (width))
|
||||
|
||||
/* Call VESA BIOS 0x4f02 to set video mode, return status. */
|
||||
grub_vbe_status_t EXPORT_FUNC(grub_vbe_bios_set_mode) (grub_uint32_t mode,
|
||||
struct grub_vbe_crtc_info_block *crtc_info);
|
||||
|
||||
/* Call VESA BIOS 0x4f03 to return current VBE Mode, return status. */
|
||||
grub_vbe_status_t EXPORT_FUNC(grub_vbe_bios_get_mode) (grub_uint32_t *mode);
|
||||
|
||||
/* Call VESA BIOS 0x4f05 to set memory window, return status. */
|
||||
grub_vbe_status_t EXPORT_FUNC(grub_vbe_bios_set_memory_window) (grub_uint32_t window,
|
||||
grub_uint32_t position);
|
||||
|
||||
/* Call VESA BIOS 0x4f05 to return memory window, return status. */
|
||||
grub_vbe_status_t EXPORT_FUNC(grub_vbe_bios_get_memory_window) (grub_uint32_t window,
|
||||
grub_uint32_t *position);
|
||||
|
||||
/* Call VESA BIOS 0x4f06 to set scanline length (in bytes), return status. */
|
||||
grub_vbe_status_t EXPORT_FUNC(grub_vbe_bios_set_scanline_length) (grub_uint32_t length);
|
||||
|
||||
/* Call VESA BIOS 0x4f06 to return scanline length (in bytes), return status. */
|
||||
grub_vbe_status_t EXPORT_FUNC(grub_vbe_bios_get_scanline_length) (grub_uint32_t *length);
|
||||
|
||||
/* Call VESA BIOS 0x4f07 to set display start, return status. */
|
||||
grub_vbe_status_t EXPORT_FUNC(grub_vbe_bios_set_display_start) (grub_uint32_t x,
|
||||
grub_uint32_t y);
|
||||
|
||||
/* Call VESA BIOS 0x4f07 to get display start, return status. */
|
||||
grub_vbe_status_t EXPORT_FUNC(grub_vbe_bios_get_display_start) (grub_uint32_t *x,
|
||||
grub_uint32_t *y);
|
||||
|
||||
/* Call VESA BIOS 0x4f09 to set palette data, return status. */
|
||||
grub_vbe_status_t EXPORT_FUNC(grub_vbe_bios_set_palette_data) (grub_uint32_t color_count,
|
||||
grub_uint32_t start_index,
|
||||
struct grub_vbe_palette_data *palette_data);
|
||||
|
||||
/* Prototypes for helper functions. */
|
||||
|
||||
grub_err_t grub_vbe_probe (struct grub_vbe_info_block *info_block);
|
||||
grub_err_t grub_vbe_set_video_mode (grub_uint32_t mode,
|
||||
struct grub_vbe_mode_info_block *mode_info);
|
||||
|
|
|
@ -25,7 +25,4 @@
|
|||
/* The VGA (at the beginning of upper memory). */
|
||||
#define GRUB_MEMORY_MACHINE_VGA_ADDR GRUB_MEMORY_MACHINE_UPPER
|
||||
|
||||
/* Set the video mode to MODE and return the previous mode. */
|
||||
unsigned char EXPORT_FUNC(grub_vga_set_mode) (unsigned char mode);
|
||||
|
||||
#endif /* ! GRUB_VGA_MACHINE_HEADER */
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
#include <grub/i386/coreboot/init.h>
|
|
@ -1 +0,0 @@
|
|||
#include <grub/cpu/loader.h>
|
|
@ -21,21 +21,54 @@
|
|||
|
||||
#include <grub/types.h>
|
||||
#include <grub/err.h>
|
||||
#include <grub/relocator.h>
|
||||
|
||||
struct grub_relocator32_state
|
||||
{
|
||||
grub_uint32_t esp;
|
||||
grub_uint32_t ebp;
|
||||
grub_uint32_t eax;
|
||||
grub_uint32_t ebx;
|
||||
grub_uint32_t ecx;
|
||||
grub_uint32_t edx;
|
||||
grub_uint32_t eip;
|
||||
grub_uint32_t esi;
|
||||
grub_uint32_t edi;
|
||||
};
|
||||
|
||||
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 */
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -26,8 +26,7 @@ enum
|
|||
{
|
||||
OBJ_TYPE_ELF,
|
||||
OBJ_TYPE_MEMDISK,
|
||||
OBJ_TYPE_CONFIG,
|
||||
OBJ_TYPE_FONT
|
||||
OBJ_TYPE_CONFIG
|
||||
};
|
||||
|
||||
/* The module header. */
|
||||
|
|
1
include/grub/mips/memory.h
Normal file
1
include/grub/mips/memory.h
Normal file
|
@ -0,0 +1 @@
|
|||
#include <grub/machine/memory.h>
|
|
@ -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 { .gpr[4] = MULTIBOOT_BOOTLOADER_MAGIC, \
|
||||
.jumpreg = 1 }
|
||||
#define MULTIBOOT_ENTRY_REGISTER gpr[1]
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
#include <grub/types.h>
|
||||
#include <grub/err.h>
|
||||
#include <grub/relocator.h>
|
||||
|
||||
struct grub_relocator32_state
|
||||
{
|
||||
|
@ -30,10 +31,8 @@ struct grub_relocator32_state
|
|||
int jumpreg;
|
||||
};
|
||||
|
||||
void *grub_relocator32_alloc (grub_size_t size);
|
||||
grub_err_t grub_relocator32_boot (void *relocator, grub_uint32_t dest,
|
||||
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_relocator32_boot (struct grub_relocator *rel,
|
||||
struct grub_relocator32_state state);
|
||||
|
||||
#endif /* ! GRUB_RELOCATOR_CPU_HEADER */
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
|
||||
#ifndef ASM_FILE
|
||||
|
||||
void EXPORT_FUNC (grub_reboot) (void);
|
||||
void EXPORT_FUNC (grub_halt) (void);
|
||||
void EXPORT_FUNC (grub_reboot) (void) __attribute__ ((noreturn));
|
||||
void EXPORT_FUNC (grub_halt) (void) __attribute__ ((noreturn));
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
#define GRUB_ARCH_LOWMEMMAXSIZE 0x10000000
|
||||
#define GRUB_ARCH_HIGHMEMPSTART 0x10000000
|
||||
|
||||
|
||||
#define GRUB_MACHINE_MEMORY_AVAILABLE 1
|
||||
#define GRUB_MACHINE_MEMORY_MAX_TYPE 1
|
||||
/* This one is special: it's used internally but is never reported
|
||||
|
@ -40,6 +39,27 @@
|
|||
#define GRUB_MACHINE_MEMORY_RESERVED GRUB_MACHINE_MEMORY_HOLE
|
||||
|
||||
#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) & 0x1fffffff;
|
||||
}
|
||||
|
||||
static inline void *
|
||||
grub_map_memory (grub_phys_addr_t a, grub_size_t size __attribute__ ((unused)))
|
||||
{
|
||||
return (void *) (a | 0x80000000);
|
||||
}
|
||||
|
||||
static inline void
|
||||
grub_unmap_memory (void *a __attribute__ ((unused)),
|
||||
grub_size_t size __attribute__ ((unused)))
|
||||
{
|
||||
}
|
||||
|
||||
grub_err_t EXPORT_FUNC (grub_machine_mmap_iterate)
|
||||
(int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, grub_uint64_t, grub_uint32_t));
|
||||
|
||||
|
|
|
@ -43,6 +43,8 @@
|
|||
|
||||
#define ALIGN_UP(addr, align) \
|
||||
((addr + (typeof (addr)) align - 1) & ~((typeof (addr)) align - 1))
|
||||
#define ALIGN_DOWN(addr, align) \
|
||||
((addr) & ~((typeof (addr)) align - 1))
|
||||
#define ARRAY_SIZE(array) (sizeof (array) / sizeof (array[0]))
|
||||
#define COMPILE_TIME_ASSERT(cond) switch (0) { case 1: case !(cond): ; }
|
||||
|
||||
|
@ -319,9 +321,9 @@ void EXPORT_FUNC (grub_reboot) (void) __attribute__ ((noreturn));
|
|||
#ifdef GRUB_MACHINE_PCBIOS
|
||||
/* Halt the system, using APM if possible. If NO_APM is true, don't
|
||||
* use APM even if it is available. */
|
||||
void EXPORT_FUNC (grub_halt) (int no_apm) __attribute__ ((noreturn));
|
||||
void grub_halt (int no_apm) __attribute__ ((noreturn));
|
||||
#else
|
||||
void EXPORT_FUNC (grub_halt) (void) __attribute__ ((noreturn));
|
||||
void grub_halt (void) __attribute__ ((noreturn));
|
||||
#endif
|
||||
|
||||
#ifdef GRUB_MACHINE_EMU
|
||||
|
|
|
@ -35,6 +35,9 @@ void EXPORT_FUNC(grub_free) (void *ptr);
|
|||
void *EXPORT_FUNC(grub_realloc) (void *ptr, grub_size_t size);
|
||||
void *EXPORT_FUNC(grub_memalign) (grub_size_t align, grub_size_t size);
|
||||
|
||||
void grub_mm_check_real (char *file, int line);
|
||||
#define GRUB_MM_CHECK grub_mm_check_real (__FILE__, __LINE__);
|
||||
|
||||
/* For debugging. */
|
||||
#if defined(MM_DEBUG) && !defined(GRUB_UTIL) && !defined (GRUB_MACHINE_EMU)
|
||||
/* Set this variable to 1 when you want to trace all memory function calls. */
|
||||
|
|
64
include/grub/mm_private.h
Normal file
64
include/grub/mm_private.h
Normal file
|
@ -0,0 +1,64 @@
|
|||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 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_MM_PRIVATE_H
|
||||
#define GRUB_MM_PRIVATE_H 1
|
||||
|
||||
#include <grub/mm.h>
|
||||
|
||||
/* Magic words. */
|
||||
#define GRUB_MM_FREE_MAGIC 0x2d3c2808
|
||||
#define GRUB_MM_ALLOC_MAGIC 0x6db08fa4
|
||||
|
||||
typedef struct grub_mm_header
|
||||
{
|
||||
struct grub_mm_header *next;
|
||||
grub_size_t size;
|
||||
grub_size_t magic;
|
||||
#if GRUB_CPU_SIZEOF_VOID_P == 4
|
||||
char padding[4];
|
||||
#elif GRUB_CPU_SIZEOF_VOID_P == 8
|
||||
char padding[8];
|
||||
#else
|
||||
# error "unknown word size"
|
||||
#endif
|
||||
}
|
||||
*grub_mm_header_t;
|
||||
|
||||
#if GRUB_CPU_SIZEOF_VOID_P == 4
|
||||
# define GRUB_MM_ALIGN_LOG2 4
|
||||
#elif GRUB_CPU_SIZEOF_VOID_P == 8
|
||||
# define GRUB_MM_ALIGN_LOG2 5
|
||||
#endif
|
||||
|
||||
#define GRUB_MM_ALIGN (1 << GRUB_MM_ALIGN_LOG2)
|
||||
|
||||
typedef struct grub_mm_region
|
||||
{
|
||||
struct grub_mm_header *first;
|
||||
struct grub_mm_region *next;
|
||||
grub_size_t pre_size;
|
||||
grub_size_t size;
|
||||
}
|
||||
*grub_mm_region_t;
|
||||
|
||||
#ifndef GRUB_MACHINE_EMU
|
||||
extern grub_mm_region_t EXPORT_VAR (grub_mm_base);
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -34,17 +34,21 @@
|
|||
#include <grub/types.h>
|
||||
#include <grub/err.h>
|
||||
|
||||
extern struct grub_relocator *grub_multiboot_relocator;
|
||||
|
||||
void grub_multiboot (int argc, char *argv[]);
|
||||
void grub_module (int argc, char *argv[]);
|
||||
|
||||
grub_size_t grub_multiboot_get_mbi_size (void);
|
||||
grub_err_t grub_multiboot_make_mbi (void *orig, grub_uint32_t dest,
|
||||
grub_off_t buf_off, grub_size_t bufsize);
|
||||
void grub_multiboot_set_accepts_video (int val);
|
||||
grub_err_t grub_multiboot_make_mbi (grub_uint32_t *target);
|
||||
void grub_multiboot_free_mbi (void);
|
||||
grub_err_t grub_multiboot_init_mbi (int argc, char *argv[]);
|
||||
grub_err_t grub_multiboot_add_module (grub_addr_t start, grub_size_t size,
|
||||
int argc, char *argv[]);
|
||||
void grub_multiboot_set_bootdev (void);
|
||||
void
|
||||
grub_multiboot_add_elfsyms (grub_size_t num, grub_size_t entsize,
|
||||
unsigned shndx, void *data);
|
||||
|
||||
grub_uint32_t grub_get_multiboot_mmap_count (void);
|
||||
grub_err_t grub_multiboot_set_video_mode (void);
|
||||
|
@ -70,5 +74,7 @@ grub_err_t
|
|||
grub_multiboot_load_elf (grub_file_t file, void *buffer);
|
||||
extern grub_size_t grub_multiboot_pure_size;
|
||||
extern grub_size_t grub_multiboot_alloc_mbi;
|
||||
extern grub_uint32_t grub_multiboot_payload_eip;
|
||||
|
||||
|
||||
#endif /* ! GRUB_MULTIBOOT_HEADER */
|
||||
|
|
|
@ -70,4 +70,11 @@
|
|||
/* Turn on DTR, RTS, and OUT2. */
|
||||
#define UART_ENABLE_OUT2 0x08
|
||||
|
||||
#ifndef ASM_FILE
|
||||
#include <grub/cpu/io.h>
|
||||
|
||||
grub_port_t
|
||||
grub_ns8250_hw_get_port (const unsigned int unit);
|
||||
#endif
|
||||
|
||||
#endif /* ! GRUB_SERIAL_MACHINE_HEADER */
|
||||
|
|
|
@ -34,14 +34,17 @@
|
|||
/* The offset of GRUB_INSTALL_BSD_PART. */
|
||||
#define GRUB_KERNEL_I386_PC_INSTALL_BSD_PART 0x18
|
||||
|
||||
/* The offset of GRUB_PREFIX. */
|
||||
#define GRUB_KERNEL_I386_PC_PREFIX 0x1c
|
||||
|
||||
/* End of the data section. */
|
||||
#define GRUB_KERNEL_I386_PC_DATA_END 0x5c
|
||||
/* The offset of multiboot signature. */
|
||||
#define GRUB_KERNEL_I386_PC_MULTIBOOT_SIGNATURE 0x1c
|
||||
|
||||
/* The size of the first region which won't be compressed. */
|
||||
#define GRUB_KERNEL_I386_PC_RAW_SIZE (GRUB_KERNEL_I386_PC_DATA_END + 0x5F0)
|
||||
#define GRUB_KERNEL_I386_PC_RAW_SIZE 0x5D8
|
||||
|
||||
/* The offset of GRUB_PREFIX. */
|
||||
#define GRUB_KERNEL_I386_PC_PREFIX GRUB_KERNEL_I386_PC_RAW_SIZE
|
||||
|
||||
/* End of the data section. */
|
||||
#define GRUB_KERNEL_I386_PC_PREFIX_END (GRUB_KERNEL_I386_PC_PREFIX + 0x40)
|
||||
|
||||
/* The segment where the kernel is loaded. */
|
||||
#define GRUB_BOOT_I386_PC_KERNEL_SEG 0x800
|
||||
|
@ -65,7 +68,7 @@
|
|||
#define GRUB_KERNEL_I386_QEMU_PREFIX 0x10
|
||||
|
||||
/* End of the data section. */
|
||||
#define GRUB_KERNEL_I386_QEMU_DATA_END 0x50
|
||||
#define GRUB_KERNEL_I386_QEMU_PREFIX_END 0x50
|
||||
|
||||
#define GRUB_KERNEL_I386_QEMU_LINK_ADDR 0x8200
|
||||
|
||||
|
@ -82,7 +85,7 @@
|
|||
#define GRUB_KERNEL_SPARC64_IEEE1275_PREFIX 0x14
|
||||
|
||||
/* End of the data section. */
|
||||
#define GRUB_KERNEL_SPARC64_IEEE1275_DATA_END 0x114
|
||||
#define GRUB_KERNEL_SPARC64_IEEE1275_PREFIX_END 0x114
|
||||
|
||||
#define GRUB_BOOT_SPARC64_IEEE1275_LIST_SIZE 12
|
||||
|
||||
|
@ -91,7 +94,7 @@
|
|||
#define GRUB_KERNEL_SPARC64_IEEE1275_LINK_ADDR 0x4400
|
||||
|
||||
#define GRUB_KERNEL_POWERPC_IEEE1275_PREFIX 0x4
|
||||
#define GRUB_KERNEL_POWERPC_IEEE1275_DATA_END 0x44
|
||||
#define GRUB_KERNEL_POWERPC_IEEE1275_PREFIX_END 0x44
|
||||
#define GRUB_KERNEL_POWERPC_IEEE1275_LINK_ALIGN 4
|
||||
#define GRUB_KERNEL_POWERPC_IEEE1275_LINK_ADDR 0x200000
|
||||
|
||||
|
@ -105,30 +108,34 @@
|
|||
#define GRUB_KERNEL_MIPS_YEELOONG_KERNEL_IMAGE_SIZE 0x10
|
||||
|
||||
#define GRUB_KERNEL_MIPS_YEELOONG_PREFIX GRUB_KERNEL_MIPS_YEELOONG_RAW_SIZE
|
||||
#define GRUB_KERNEL_MIPS_YEELOONG_DATA_END GRUB_KERNEL_MIPS_YEELOONG_RAW_SIZE + 0x48
|
||||
#define GRUB_KERNEL_MIPS_YEELOONG_PREFIX_END GRUB_KERNEL_MIPS_YEELOONG_RAW_SIZE + 0x48
|
||||
|
||||
/* The offset of GRUB_PREFIX. */
|
||||
#define GRUB_KERNEL_I386_EFI_PREFIX 0x8
|
||||
|
||||
/* End of the data section. */
|
||||
#define GRUB_KERNEL_I386_EFI_DATA_END 0x50
|
||||
#define GRUB_KERNEL_I386_EFI_PREFIX_END 0x50
|
||||
|
||||
/* The offset of GRUB_PREFIX. */
|
||||
#define GRUB_KERNEL_X86_64_EFI_PREFIX 0x8
|
||||
|
||||
/* End of the data section. */
|
||||
#define GRUB_KERNEL_X86_64_EFI_DATA_END 0x50
|
||||
#define GRUB_KERNEL_X86_64_EFI_PREFIX_END 0x50
|
||||
|
||||
#define GRUB_KERNEL_I386_COREBOOT_PREFIX 0x2
|
||||
#define GRUB_KERNEL_I386_COREBOOT_DATA_END 0x42
|
||||
#define GRUB_KERNEL_I386_COREBOOT_PREFIX_END 0x42
|
||||
#define GRUB_KERNEL_I386_COREBOOT_LINK_ADDR 0x8200
|
||||
|
||||
#define GRUB_KERNEL_I386_MULTIBOOT_PREFIX GRUB_KERNEL_I386_COREBOOT_PREFIX
|
||||
#define GRUB_KERNEL_I386_MULTIBOOT_PREFIX_END GRUB_KERNEL_I386_COREBOOT_PREFIX_END
|
||||
|
||||
#define GRUB_KERNEL_I386_IEEE1275_PREFIX 0x2
|
||||
#define GRUB_KERNEL_I386_IEEE1275_DATA_END 0x42
|
||||
#define GRUB_KERNEL_I386_IEEE1275_PREFIX_END 0x42
|
||||
#define GRUB_KERNEL_I386_IEEE1275_LINK_ADDR 0x10000
|
||||
|
||||
#define GRUB_KERNEL_I386_IEEE1275_MOD_ALIGN 0x1000
|
||||
#define GRUB_KERNEL_I386_COREBOOT_MOD_ALIGN 0x1
|
||||
#define GRUB_KERNEL_I386_MULTIBOOT_MOD_ALIGN GRUB_KERNEL_I386_COREBOOT_MOD_ALIGN
|
||||
|
||||
/* Non-zero value is only needed for PowerMacs. */
|
||||
#define GRUB_KERNEL_I386_IEEE1275_MOD_GAP 0x0
|
||||
|
@ -153,7 +160,7 @@
|
|||
#define GRUB_KERNEL_MACHINE_COMPRESSED_SIZE GRUB_OFFSETS_CONCAT (GRUB_KERNEL_, MACHINE, _COMPRESSED_SIZE)
|
||||
|
||||
#define GRUB_KERNEL_MACHINE_PREFIX GRUB_OFFSETS_CONCAT (GRUB_KERNEL_, MACHINE, _PREFIX)
|
||||
#define GRUB_KERNEL_MACHINE_DATA_END GRUB_OFFSETS_CONCAT (GRUB_KERNEL_, MACHINE, _DATA_END)
|
||||
#define GRUB_KERNEL_MACHINE_PREFIX_END GRUB_OFFSETS_CONCAT (GRUB_KERNEL_, MACHINE, _PREFIX_END)
|
||||
#define GRUB_BOOT_MACHINE_KERNEL_SEG GRUB_OFFSETS_CONCAT (GRUB_BOOT_, MACHINE, _KERNEL_SEG)
|
||||
#define GRUB_MEMORY_MACHINE_UPPER GRUB_OFFSETS_CONCAT (GRUB_MEMORY_, MACHINE, _UPPER)
|
||||
#define GRUB_KERNEL_MACHINE_RAW_SIZE GRUB_OFFSETS_CONCAT (GRUB_KERNEL_, MACHINE, _RAW_SIZE)
|
||||
|
|
|
@ -1,32 +0,0 @@
|
|||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2004,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
|
||||
|
||||
/* The symbol shared between the normal mode and rescue mode
|
||||
loader. */
|
||||
void grub_rescue_cmd_linux (int argc, char *argv[]);
|
||||
void grub_rescue_cmd_initrd (int argc, char *argv[]);
|
||||
|
||||
void grub_linux_init (void);
|
||||
void grub_linux_fini (void);
|
||||
void grub_linux_normal_init (void);
|
||||
void grub_linux_normal_fini (void);
|
||||
|
||||
#endif /* ! GRUB_LOADER_MACHINE_HEADER */
|
|
@ -1,6 +1,7 @@
|
|||
/* memory.h - describe the memory map */
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2009 Free Software Foundation, Inc.
|
||||
* Copyright (C) 2002,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
|
||||
|
@ -16,9 +17,31 @@
|
|||
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef GRUB_MACHINE_EFI_EMU_HEADER
|
||||
#define GRUB_MACHINE_EFI_EMU_HEADER 1
|
||||
#ifndef GRUB_MEMORY_CPU_HEADER
|
||||
#define GRUB_MEMORY_CPU_HEADER 1
|
||||
|
||||
grub_err_t grub_machine_efiemu_init_tables (void);
|
||||
#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 */
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2002,2003,2004,2007,2008 Free Software Foundation, Inc.
|
||||
* Copyright (C) 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
|
||||
|
@ -16,14 +16,22 @@
|
|||
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef GRUB_LOADER_MACHINE_HEADER
|
||||
#define GRUB_LOADER_MACHINE_HEADER 1
|
||||
#ifndef GRUB_RELOCATOR_CPU_HEADER
|
||||
#define GRUB_RELOCATOR_CPU_HEADER 1
|
||||
|
||||
#include <grub/types.h>
|
||||
#include <grub/symbol.h>
|
||||
#include <grub/multiboot.h>
|
||||
#include <grub/err.h>
|
||||
#include <grub/relocator.h>
|
||||
|
||||
void grub_rescue_cmd_linux (int argc, char *argv[]);
|
||||
void grub_rescue_cmd_initrd (int argc, char *argv[]);
|
||||
#define GRUB_PPC_JUMP_REGISTER 31
|
||||
|
||||
#endif /* ! GRUB_LOADER_MACHINE_HEADER */
|
||||
struct grub_relocator32_state
|
||||
{
|
||||
grub_uint32_t gpr[32];
|
||||
};
|
||||
|
||||
grub_err_t
|
||||
grub_relocator32_boot (struct grub_relocator *rel,
|
||||
struct grub_relocator32_state state);
|
||||
|
||||
#endif /* ! GRUB_RELOCATOR_CPU_HEADER */
|
58
include/grub/relocator.h
Normal file
58
include/grub/relocator.h
Normal file
|
@ -0,0 +1,58 @@
|
|||
/*
|
||||
* 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_RELOCATOR_HEADER
|
||||
#define GRUB_RELOCATOR_HEADER 1
|
||||
|
||||
#include <grub/types.h>
|
||||
#include <grub/err.h>
|
||||
#include <grub/memory.h>
|
||||
#include <grub/cpu/memory.h>
|
||||
|
||||
struct grub_relocator;
|
||||
struct grub_relocator_chunk;
|
||||
typedef const struct grub_relocator_chunk *grub_relocator_chunk_t;
|
||||
|
||||
struct grub_relocator *grub_relocator_new (void);
|
||||
|
||||
grub_err_t
|
||||
grub_relocator_alloc_chunk_addr (struct grub_relocator *rel,
|
||||
grub_relocator_chunk_t *out,
|
||||
grub_phys_addr_t target, grub_size_t size);
|
||||
|
||||
void *
|
||||
get_virtual_current_address (grub_relocator_chunk_t in);
|
||||
grub_phys_addr_t
|
||||
get_physical_target_address (grub_relocator_chunk_t in);
|
||||
|
||||
grub_err_t
|
||||
grub_relocator_alloc_chunk_align (struct grub_relocator *rel,
|
||||
grub_relocator_chunk_t *out,
|
||||
grub_phys_addr_t min_addr,
|
||||
grub_phys_addr_t max_addr,
|
||||
grub_size_t size, grub_size_t align,
|
||||
int preference);
|
||||
|
||||
#define GRUB_RELOCATOR_PREFERENCE_NONE 0
|
||||
#define GRUB_RELOCATOR_PREFERENCE_LOW 1
|
||||
#define GRUB_RELOCATOR_PREFERENCE_HIGH 2
|
||||
|
||||
void
|
||||
grub_relocator_unload (struct grub_relocator *rel);
|
||||
|
||||
#endif
|
113
include/grub/relocator_private.h
Normal file
113
include/grub/relocator_private.h
Normal file
|
@ -0,0 +1,113 @@
|
|||
/*
|
||||
* 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_RELOCATOR_PRIVATE_HEADER
|
||||
#define GRUB_RELOCATOR_PRIVATE_HEADER 1
|
||||
|
||||
#include <grub/types.h>
|
||||
#include <grub/err.h>
|
||||
#include <grub/mm_private.h>
|
||||
|
||||
extern grub_size_t grub_relocator_align;
|
||||
extern grub_size_t grub_relocator_forward_size;
|
||||
extern grub_size_t grub_relocator_backward_size;
|
||||
extern grub_size_t grub_relocator_jumper_size;
|
||||
|
||||
void
|
||||
grub_cpu_relocator_init (void);
|
||||
grub_err_t
|
||||
grub_relocator_prepare_relocs (struct grub_relocator *rel,
|
||||
grub_addr_t addr,
|
||||
void **relstart, grub_size_t *relsize);
|
||||
void grub_cpu_relocator_forward (void *rels, void *src, void *tgt,
|
||||
grub_size_t size);
|
||||
void grub_cpu_relocator_backward (void *rels, void *src, void *tgt,
|
||||
grub_size_t size);
|
||||
void grub_cpu_relocator_jumper (void *rels, grub_addr_t addr);
|
||||
|
||||
/* Remark: GRUB_RELOCATOR_FIRMWARE_REQUESTS_QUANT_LOG = 1 or 2
|
||||
aren't supported. */
|
||||
#ifdef GRUB_MACHINE_IEEE1275
|
||||
#define GRUB_RELOCATOR_HAVE_FIRMWARE_REQUESTS 1
|
||||
#define GRUB_RELOCATOR_FIRMWARE_REQUESTS_QUANT_LOG 0
|
||||
#elif defined (GRUB_MACHINE_EFI)
|
||||
#define GRUB_RELOCATOR_HAVE_FIRMWARE_REQUESTS 1
|
||||
#define GRUB_RELOCATOR_FIRMWARE_REQUESTS_QUANT_LOG 12
|
||||
#else
|
||||
#define GRUB_RELOCATOR_HAVE_FIRMWARE_REQUESTS 0
|
||||
#endif
|
||||
|
||||
#if GRUB_RELOCATOR_HAVE_FIRMWARE_REQUESTS && GRUB_RELOCATOR_FIRMWARE_REQUESTS_QUANT_LOG != 0
|
||||
#define GRUB_RELOCATOR_HAVE_LEFTOVERS 1
|
||||
#else
|
||||
#define GRUB_RELOCATOR_HAVE_LEFTOVERS 0
|
||||
#endif
|
||||
|
||||
#if GRUB_RELOCATOR_HAVE_FIRMWARE_REQUESTS
|
||||
#define GRUB_RELOCATOR_FIRMWARE_REQUESTS_QUANT (1 << GRUB_RELOCATOR_FIRMWARE_REQUESTS_QUANT_LOG)
|
||||
#endif
|
||||
|
||||
struct grub_relocator_mmap_event
|
||||
{
|
||||
enum {
|
||||
IN_REG_START = 0,
|
||||
IN_REG_END = 1,
|
||||
REG_BEG_START = 2,
|
||||
REG_BEG_END = REG_BEG_START | 1,
|
||||
#if GRUB_RELOCATOR_HAVE_FIRMWARE_REQUESTS
|
||||
REG_FIRMWARE_START = 4,
|
||||
REG_FIRMWARE_END = REG_FIRMWARE_START | 1,
|
||||
/* To track the regions already in heap. */
|
||||
FIRMWARE_BLOCK_START = 6,
|
||||
FIRMWARE_BLOCK_END = FIRMWARE_BLOCK_START | 1,
|
||||
#endif
|
||||
#if GRUB_RELOCATOR_HAVE_LEFTOVERS
|
||||
REG_LEFTOVER_START = 8,
|
||||
REG_LEFTOVER_END = REG_LEFTOVER_START | 1,
|
||||
#endif
|
||||
COLLISION_START = 10,
|
||||
COLLISION_END = COLLISION_START | 1
|
||||
} type;
|
||||
grub_phys_addr_t pos;
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
grub_mm_region_t reg;
|
||||
grub_mm_header_t hancestor;
|
||||
grub_mm_region_t *regancestor;
|
||||
grub_mm_header_t head;
|
||||
};
|
||||
#if GRUB_RELOCATOR_HAVE_FIRMWARE_REQUESTS
|
||||
struct grub_relocator_fw_leftover *leftover;
|
||||
#endif
|
||||
};
|
||||
};
|
||||
|
||||
/* Return 0 on failure, 1 on success. The failure here
|
||||
can be very time-expensive, so please make sure fill events is accurate. */
|
||||
#if GRUB_RELOCATOR_HAVE_FIRMWARE_REQUESTS
|
||||
int grub_relocator_firmware_alloc_region (grub_phys_addr_t start,
|
||||
grub_size_t size);
|
||||
unsigned grub_relocator_firmware_fill_events (struct grub_relocator_mmap_event *events);
|
||||
unsigned grub_relocator_firmware_get_max_events (void);
|
||||
void grub_relocator_firmware_free_region (grub_phys_addr_t start,
|
||||
grub_size_t size);
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -204,6 +204,12 @@ struct grub_lexer_param
|
|||
/* Type of text. */
|
||||
grub_script_arg_type_t type;
|
||||
|
||||
/* Flag to indicate resplit in progres. */
|
||||
unsigned resplit;
|
||||
|
||||
/* Text that is unput. */
|
||||
char *prefix;
|
||||
|
||||
/* Flex scanner. */
|
||||
void *yyscanner;
|
||||
|
||||
|
@ -304,7 +310,7 @@ void grub_script_lexer_ref (struct grub_lexer_param *);
|
|||
void grub_script_lexer_deref (struct grub_lexer_param *);
|
||||
unsigned grub_script_lexer_record_start (struct grub_parser_param *);
|
||||
char *grub_script_lexer_record_stop (struct grub_parser_param *, unsigned);
|
||||
int grub_script_lexer_yywrap (struct grub_parser_param *);
|
||||
int grub_script_lexer_yywrap (struct grub_parser_param *, const char *input);
|
||||
void grub_script_lexer_record (struct grub_parser_param *, char *);
|
||||
|
||||
/* Functions to track allocated memory. */
|
||||
|
|
|
@ -1,27 +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_LOADER_MACHINE_HEADER
|
||||
#define GRUB_LOADER_MACHINE_HEADER 1
|
||||
|
||||
/* The symbol shared between the normal mode and rescue mode
|
||||
loader. */
|
||||
void grub_rescue_cmd_linux (int argc, char *argv[]);
|
||||
void grub_rescue_cmd_initrd (int argc, char *argv[]);
|
||||
|
||||
#endif /* ! GRUB_LOADER_MACHINE_HEADER */
|
1
include/grub/x86_64/memory.h
Normal file
1
include/grub/x86_64/memory.h
Normal file
|
@ -0,0 +1 @@
|
|||
#include <grub/i386/memory.h>
|
|
@ -87,7 +87,7 @@ extern struct grub_xnu_devtree_key *grub_xnu_devtree_root;
|
|||
|
||||
void grub_xnu_free_devtree (struct grub_xnu_devtree_key *cur);
|
||||
|
||||
grub_err_t grub_xnu_writetree_toheap (void **start, grub_size_t *size);
|
||||
grub_err_t grub_xnu_writetree_toheap (grub_addr_t *target, grub_size_t *size);
|
||||
struct grub_xnu_devtree_key *grub_xnu_create_value (struct grub_xnu_devtree_key **parent,
|
||||
char *name);
|
||||
|
||||
|
@ -102,14 +102,15 @@ grub_err_t grub_xnu_scan_dir_for_kexts (char *dirname, char *osbundlerequired,
|
|||
int maxrecursion);
|
||||
grub_err_t grub_xnu_load_kext_from_dir (char *dirname, char *osbundlerequired,
|
||||
int maxrecursion);
|
||||
void *grub_xnu_heap_malloc (int size);
|
||||
grub_err_t grub_xnu_heap_malloc (int size, void **src, grub_addr_t *target);
|
||||
grub_err_t grub_xnu_fill_devicetree (void);
|
||||
extern grub_uint32_t grub_xnu_heap_real_start;
|
||||
extern struct grub_relocator *grub_xnu_relocator;
|
||||
|
||||
extern grub_size_t grub_xnu_heap_size;
|
||||
extern void *grub_xnu_heap_start;
|
||||
extern struct grub_video_bitmap *grub_xnu_bitmap;
|
||||
typedef enum {GRUB_XNU_BITMAP_CENTER, GRUB_XNU_BITMAP_STRETCH}
|
||||
grub_xnu_bitmap_mode_t;
|
||||
extern grub_xnu_bitmap_mode_t grub_xnu_bitmap_mode;
|
||||
extern int grub_xnu_is_64bit;
|
||||
extern grub_addr_t grub_xnu_heap_target_start;
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue