2009-05-02 Vladimir Serbinenko <phcoder@gmail.com>
Efiemu * conf/i386-pc.rmk: new modules efiemu, efiemu_acpi, efiemu_pnvram, _linux_efi, linux_efi. new files in grub-emu new targets efiemu32.o and efiemu64.o * loader/linux_normal_efiemu.c: likewise * loader/i386/efi/linux.c: added preliminary efiemu support * util/i386/pc/grub-install.in: add efiemu??.o to the list of files to copy * include/grub/autoefi.h: new file * nclude/grub/i386/efiemu.h: likewise * include/grub/i386/pc/efiemu.h: likewise * include/grub/efi/api.h: add LL suffix when necessary new definitions relating to tables * include/grub/efiemu/efiemu.h: new file * include/grub/efiemu/runtime.h: likewise * efiemu/prepare.c: likewise * efiemu/loadcore_common.c: likewise * efiemu/loadcore64.c: likewise * efiemu/runtime/efiemu.sh: likewise * efiemu/runtime/efiemu.S: likewise * efiemu/runtime/efiemu.c: likewise * efiemu/runtime/config.h: likewise * efiemu/prepare32.c: likewise * efiemu/main.c: likewise * efiemu/modules/pnvram.c: likewise * efiemu/modules/i386: likewise * efiemu/modules/i386/pc: likewise * efiemu/modules/acpi.c: likewise * efiemu/i386/pc/cfgtables.c: likewise * efiemu/i386/loadcore64.c: likewise * efiemu/i386/loadcore32.c: likewise * efiemu/prepare64.c: likewise * efiemu/loadcore.c: likewise * efiemu/symbols.c: likewise * efiemu/mm.c: likewise * efiemu/loadcore32.c: likewise
This commit is contained in:
parent
f8efe3ad2d
commit
5caf964d75
29 changed files with 4068 additions and 14 deletions
75
include/grub/autoefi.h
Normal file
75
include/grub/autoefi.h
Normal file
|
@ -0,0 +1,75 @@
|
|||
/*
|
||||
* 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/>.
|
||||
*/
|
||||
/* This file provides some abstractions so that the same code compiles with
|
||||
both efi and efiemu
|
||||
*/
|
||||
#ifndef GRUB_AUTOEFI_HEADER
|
||||
#define GRUB_AUTOEFI_HEADER 1
|
||||
|
||||
#include <grub/machine/machine.h>
|
||||
|
||||
#ifdef GRUB_MACHINE_EFI
|
||||
# include <grub/efi/efi.h>
|
||||
# define grub_autoefi_get_memory_map grub_efi_get_memory_map
|
||||
# define grub_autoefi_finish_boot_services grub_efi_finish_boot_services
|
||||
# define grub_autoefi_system_table grub_efi_system_table
|
||||
# define grub_autoefi_mmap_iterate grub_machine_mmap_iterate
|
||||
static inline grub_err_t grub_autoefi_prepare (void)
|
||||
{
|
||||
return GRUB_ERR_NONE;
|
||||
};
|
||||
# define GRUB_AUTOEFI_MEMORY_AVAILABLE GRUB_MACHINE_MEMORY_AVAILABLE
|
||||
# define GRUB_AUTOEFI_MEMORY_RESERVED GRUB_MACHINE_MEMORY_RESERVED
|
||||
# ifdef GRUB_MACHINE_MEMORY_ACPI
|
||||
# define GRUB_AUTOEFI_MEMORY_ACPI GRUB_MACHINE_MEMORY_ACPI
|
||||
# endif
|
||||
# ifdef GRUB_MACHINE_MEMORY_NVS
|
||||
# define GRUB_AUTOEFI_MEMORY_NVS GRUB_MACHINE_MEMORY_NVS
|
||||
# endif
|
||||
# ifdef GRUB_MACHINE_MEMORY_CODE
|
||||
# define GRUB_AUTOEFI_MEMORY_CODE GRUB_MACHINE_MEMORY_CODE
|
||||
# endif
|
||||
# define SYSTEM_TABLE_SIZEOF(x) (sizeof(grub_efi_system_table->x))
|
||||
# define SYSTEM_TABLE_VAR(x) ((void *)&(grub_efi_system_table->x))
|
||||
# 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 EFI_PRESENT 1
|
||||
#else
|
||||
# include <grub/efiemu/efiemu.h>
|
||||
# define grub_autoefi_get_memory_map grub_efiemu_get_memory_map
|
||||
# define grub_autoefi_finish_boot_services grub_efiemu_finish_boot_services
|
||||
# define grub_autoefi_system_table grub_efiemu_system_table
|
||||
# define grub_autoefi_mmap_iterate grub_efiemu_mmap_iterate
|
||||
# define grub_autoefi_prepare grub_efiemu_prepare
|
||||
# define GRUB_AUTOEFI_MEMORY_AVAILABLE GRUB_EFIEMU_MEMORY_AVAILABLE
|
||||
# define GRUB_AUTOEFI_MEMORY_RESERVED GRUB_EFIEMU_MEMORY_RESERVED
|
||||
# define GRUB_AUTOEFI_MEMORY_ACPI GRUB_EFIEMU_MEMORY_ACPI
|
||||
# define GRUB_AUTOEFI_MEMORY_NVS GRUB_EFIEMU_MEMORY_NVS
|
||||
# define GRUB_AUTOEFI_MEMORY_CODE GRUB_EFIEMU_MEMORY_CODE
|
||||
# define SYSTEM_TABLE_SIZEOF GRUB_EFIEMU_SYSTEM_TABLE_SIZEOF
|
||||
# define SYSTEM_TABLE_VAR GRUB_EFIEMU_SYSTEM_TABLE_VAR
|
||||
# define SYSTEM_TABLE_PTR GRUB_EFIEMU_SYSTEM_TABLE_PTR
|
||||
# define SIZEOF_OF_UINTN GRUB_EFIEMU_SIZEOF_OF_UINTN
|
||||
# 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 EFI_PRESENT 1
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -40,15 +40,15 @@
|
|||
#define GRUB_EFI_TPL_NOTIFY 16
|
||||
#define GRUB_EFI_TPL_HIGH_LEVEL 31
|
||||
|
||||
#define GRUB_EFI_MEMORY_UC 0x0000000000000001
|
||||
#define GRUB_EFI_MEMORY_WC 0x0000000000000002
|
||||
#define GRUB_EFI_MEMORY_WT 0x0000000000000004
|
||||
#define GRUB_EFI_MEMORY_WB 0x0000000000000008
|
||||
#define GRUB_EFI_MEMORY_UCE 0x0000000000000010
|
||||
#define GRUB_EFI_MEMORY_WP 0x0000000000001000
|
||||
#define GRUB_EFI_MEMORY_RP 0x0000000000002000
|
||||
#define GRUB_EFI_MEMORY_XP 0x0000000000004000
|
||||
#define GRUB_EFI_MEMORY_RUNTIME 0x8000000000000000
|
||||
#define GRUB_EFI_MEMORY_UC 0x0000000000000001LL
|
||||
#define GRUB_EFI_MEMORY_WC 0x0000000000000002LL
|
||||
#define GRUB_EFI_MEMORY_WT 0x0000000000000004LL
|
||||
#define GRUB_EFI_MEMORY_WB 0x0000000000000008LL
|
||||
#define GRUB_EFI_MEMORY_UCE 0x0000000000000010LL
|
||||
#define GRUB_EFI_MEMORY_WP 0x0000000000001000LL
|
||||
#define GRUB_EFI_MEMORY_RP 0x0000000000002000LL
|
||||
#define GRUB_EFI_MEMORY_XP 0x0000000000004000LL
|
||||
#define GRUB_EFI_MEMORY_RUNTIME 0x8000000000000000LL
|
||||
|
||||
#define GRUB_EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL 0x00000001
|
||||
#define GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL 0x00000002
|
||||
|
@ -619,7 +619,7 @@ struct grub_efi_time
|
|||
grub_efi_int16_t time_zone;
|
||||
grub_efi_uint8_t daylight;
|
||||
grub_efi_uint8_t pad2;
|
||||
};
|
||||
} __attribute__ ((packed));
|
||||
typedef struct grub_efi_time grub_efi_time_t;
|
||||
|
||||
struct grub_efi_time_capabilities
|
||||
|
@ -936,6 +936,9 @@ struct grub_efi_configuration_table
|
|||
} __attribute__ ((packed));
|
||||
typedef struct grub_efi_configuration_table grub_efi_configuration_table_t;
|
||||
|
||||
#define GRUB_EFIEMU_SYSTEM_TABLE_SIGNATURE 0x5453595320494249LL
|
||||
#define GRUB_EFIEMU_RUNTIME_SERVICES_SIGNATURE 0x56524553544e5552LL
|
||||
|
||||
struct grub_efi_simple_input_interface
|
||||
{
|
||||
grub_efi_status_t
|
||||
|
|
276
include/grub/efiemu/efiemu.h
Normal file
276
include/grub/efiemu/efiemu.h
Normal file
|
@ -0,0 +1,276 @@
|
|||
/*
|
||||
* 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_EFI_EMU_HEADER
|
||||
#define GRUB_EFI_EMU_HEADER 1
|
||||
|
||||
#include <grub/efi/api.h>
|
||||
#include <grub/file.h>
|
||||
|
||||
#define GRUB_EFIEMU_PAGESIZE 4096
|
||||
|
||||
/* EFI api defined in 32-bit and 64-bit version*/
|
||||
struct grub_efi_system_table32
|
||||
{
|
||||
grub_efi_table_header_t hdr;
|
||||
grub_efi_uint32_t firmware_vendor;
|
||||
grub_efi_uint32_t firmware_revision;
|
||||
grub_efi_uint32_t console_in_handler;
|
||||
grub_efi_uint32_t con_in;
|
||||
grub_efi_uint32_t console_out_handler;
|
||||
grub_efi_uint32_t con_out;
|
||||
grub_efi_uint32_t standard_error_handle;
|
||||
grub_efi_uint32_t std_err;
|
||||
grub_efi_uint32_t runtime_services;
|
||||
grub_efi_uint32_t boot_services;
|
||||
grub_efi_uint32_t num_table_entries;
|
||||
grub_efi_uint32_t configuration_table;
|
||||
} __attribute__ ((packed));
|
||||
typedef struct grub_efi_system_table32 grub_efi_system_table32_t;
|
||||
|
||||
struct grub_efi_system_table64
|
||||
{
|
||||
grub_efi_table_header_t hdr;
|
||||
grub_efi_uint64_t firmware_vendor;
|
||||
grub_efi_uint32_t firmware_revision;
|
||||
grub_efi_uint32_t pad;
|
||||
grub_efi_uint64_t console_in_handler;
|
||||
grub_efi_uint64_t con_in;
|
||||
grub_efi_uint64_t console_out_handler;
|
||||
grub_efi_uint64_t con_out;
|
||||
grub_efi_uint64_t standard_error_handle;
|
||||
grub_efi_uint64_t std_err;
|
||||
grub_efi_uint64_t runtime_services;
|
||||
grub_efi_uint64_t boot_services;
|
||||
grub_efi_uint64_t num_table_entries;
|
||||
grub_efi_uint64_t configuration_table;
|
||||
} __attribute__ ((packed));
|
||||
typedef struct grub_efi_system_table64 grub_efi_system_table64_t;
|
||||
|
||||
struct grub_efiemu_runtime_services32
|
||||
{
|
||||
grub_efi_table_header_t hdr;
|
||||
grub_efi_uint32_t get_time;
|
||||
grub_efi_uint32_t set_time;
|
||||
grub_efi_uint32_t get_wakeup_time;
|
||||
grub_efi_uint32_t set_wakeup_time;
|
||||
grub_efi_uint32_t set_virtual_address_map;
|
||||
grub_efi_uint32_t convert_pointer;
|
||||
grub_efi_uint32_t get_variable;
|
||||
grub_efi_uint32_t get_next_variable_name;
|
||||
grub_efi_uint32_t set_variable;
|
||||
grub_efi_uint32_t get_next_high_monotonic_count;
|
||||
grub_efi_uint32_t reset_system;
|
||||
} __attribute__ ((packed));
|
||||
typedef struct grub_efiemu_runtime_services32 grub_efiemu_runtime_services32_t;
|
||||
|
||||
struct grub_efiemu_runtime_services64
|
||||
{
|
||||
grub_efi_table_header_t hdr;
|
||||
grub_efi_uint64_t get_time;
|
||||
grub_efi_uint64_t set_time;
|
||||
grub_efi_uint64_t get_wakeup_time;
|
||||
grub_efi_uint64_t set_wakeup_time;
|
||||
grub_efi_uint64_t set_virtual_address_map;
|
||||
grub_efi_uint64_t convert_pointer;
|
||||
grub_efi_uint64_t get_variable;
|
||||
grub_efi_uint64_t get_next_variable_name;
|
||||
grub_efi_uint64_t set_variable;
|
||||
grub_efi_uint64_t get_next_high_monotonic_count;
|
||||
grub_efi_uint64_t reset_system;
|
||||
} __attribute__ ((packed));
|
||||
typedef struct grub_efiemu_runtime_services64 grub_efiemu_runtime_services64_t;
|
||||
|
||||
extern grub_efi_system_table32_t *grub_efiemu_system_table32;
|
||||
extern grub_efi_system_table64_t *grub_efiemu_system_table64;
|
||||
|
||||
/* Convenience macroses to access currently loaded efiemu */
|
||||
#define grub_efiemu_system_table ((grub_efiemu_sizeof_uintn_t () == 8) \
|
||||
? (void *) grub_efiemu_system_table64 \
|
||||
: (void *) grub_efiemu_system_table32)
|
||||
#define GRUB_EFIEMU_SIZEOF_OF_UINTN (grub_efiemu_sizeof_uintn_t ())
|
||||
#define GRUB_EFIEMU_SYSTEM_TABLE(x) ((grub_efiemu_sizeof_uintn_t () == 8) \
|
||||
? grub_efiemu_system_table64->x \
|
||||
: grub_efiemu_system_table32->x)
|
||||
#define GRUB_EFIEMU_SYSTEM_TABLE_SET(x,y) ((grub_efiemu_sizeof_uintn_t () == 8)\
|
||||
? (grub_efiemu_system_table64->x \
|
||||
= (y)) \
|
||||
: (grub_efiemu_system_table32->x \
|
||||
= (y)))
|
||||
#define GRUB_EFIEMU_SYSTEM_TABLE_PTR(x) ((grub_efiemu_sizeof_uintn_t () == 8)\
|
||||
? UINT_TO_PTR \
|
||||
(grub_efiemu_system_table64->x) \
|
||||
: UINT_TO_PTR \
|
||||
(grub_efiemu_system_table32->x))
|
||||
#define GRUB_EFIEMU_SYSTEM_TABLE_VAR(x) ((grub_efiemu_sizeof_uintn_t () == 8) \
|
||||
? (void *) \
|
||||
&(grub_efiemu_system_table64->x) \
|
||||
: (void *) \
|
||||
&(grub_efiemu_system_table32->x))
|
||||
#define GRUB_EFIEMU_SYSTEM_TABLE_SIZEOF(x) \
|
||||
((grub_efiemu_sizeof_uintn_t () == 8) \
|
||||
? sizeof(grub_efiemu_system_table64->x)\
|
||||
: sizeof(grub_efiemu_system_table32->x))
|
||||
#define GRUB_EFIEMU_SYSTEM_TABLE_SIZEOF_TOTAL ((grub_efiemu_sizeof_uintn_t () == 8) ? sizeof(*grub_efiemu_system_table64):sizeof(*grub_efiemu_system_table32))
|
||||
|
||||
/* ELF management definitions and functions */
|
||||
|
||||
struct grub_efiemu_segment
|
||||
{
|
||||
struct grub_efiemu_segment *next;
|
||||
grub_size_t size;
|
||||
unsigned section;
|
||||
int handle;
|
||||
int ptv_rel_needed;
|
||||
grub_off_t off;
|
||||
void *srcptr;
|
||||
};
|
||||
typedef struct grub_efiemu_segment *grub_efiemu_segment_t;
|
||||
|
||||
struct grub_efiemu_elf_sym
|
||||
{
|
||||
int handle;
|
||||
grub_off_t off;
|
||||
unsigned section;
|
||||
};
|
||||
|
||||
int grub_efiemu_check_header32 (void *ehdr, grub_size_t size);
|
||||
int grub_efiemu_check_header64 (void *ehdr, grub_size_t size);
|
||||
grub_err_t grub_efiemu_loadcore_init32 (void *core, grub_size_t core_size,
|
||||
grub_efiemu_segment_t *segments);
|
||||
grub_err_t grub_efiemu_loadcore_init64 (void *core, grub_size_t core_size,
|
||||
grub_efiemu_segment_t *segments);
|
||||
grub_err_t grub_efiemu_loadcore_load32 (void *core,
|
||||
grub_size_t core_size,
|
||||
grub_efiemu_segment_t segments);
|
||||
grub_err_t grub_efiemu_loadcore_load64 (void *core,
|
||||
grub_size_t core_size,
|
||||
grub_efiemu_segment_t segments);
|
||||
grub_err_t grub_efiemu_loadcore_unload32 (void);
|
||||
grub_err_t grub_efiemu_loadcore_unload64 (void);
|
||||
grub_err_t grub_efiemu_loadcore_unload(void);
|
||||
grub_err_t grub_efiemu_loadcore_init (grub_file_t file);
|
||||
grub_err_t grub_efiemu_loadcore_load (void);
|
||||
|
||||
/* Configuration tables manipulation. Definitions and functions */
|
||||
struct grub_efiemu_configuration_table
|
||||
{
|
||||
struct grub_efiemu_configuration_table *next;
|
||||
grub_efi_guid_t guid;
|
||||
void * (*get_table) (void *data);
|
||||
void (*unload) (void *data);
|
||||
void *data;
|
||||
};
|
||||
struct grub_efiemu_configuration_table32
|
||||
{
|
||||
grub_efi_guid_t vendor_guid;
|
||||
grub_efi_uint32_t vendor_table;
|
||||
} __attribute__ ((packed));
|
||||
typedef struct grub_efiemu_configuration_table32 grub_efiemu_configuration_table32_t;
|
||||
struct grub_efiemu_configuration_table64
|
||||
{
|
||||
grub_efi_guid_t vendor_guid;
|
||||
grub_efi_uint64_t vendor_table;
|
||||
} __attribute__ ((packed));
|
||||
typedef struct grub_efiemu_configuration_table32 grub_efiemu_configuration_table64_t;
|
||||
grub_err_t grub_efiemu_unregister_configuration_table (grub_efi_guid_t guid);
|
||||
grub_err_t
|
||||
grub_efiemu_register_configuration_table (grub_efi_guid_t guid,
|
||||
void * (*get_table) (void *data),
|
||||
void (*unload) (void *data),
|
||||
void *data);
|
||||
|
||||
/* Memory management functions */
|
||||
int grub_efiemu_request_memalign (grub_size_t align, grub_size_t size,
|
||||
grub_efi_memory_type_t type);
|
||||
void *grub_efiemu_mm_obtain_request (int handle);
|
||||
int grub_efiemu_get_memory_map (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_mm_unload (void);
|
||||
grub_err_t grub_efiemu_mm_do_alloc (void);
|
||||
grub_err_t grub_efiemu_mm_init (void);
|
||||
void *grub_efiemu_mm_obtain_request (int handle);
|
||||
void grub_efiemu_mm_return_request (int handle);
|
||||
grub_efi_memory_type_t grub_efiemu_mm_get_type (int handle);
|
||||
|
||||
/* Drop-in replacements for grub_efi_* and grub_machine_* */
|
||||
int grub_efiemu_get_memory_map (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
|
||||
#define GRUB_EFIEMU_MEMORY_RESERVED 2
|
||||
#define GRUB_EFIEMU_MEMORY_ACPI 3
|
||||
#define GRUB_EFIEMU_MEMORY_NVS 4
|
||||
#define GRUB_EFIEMU_MEMORY_CODE 5
|
||||
|
||||
/* efiemu main control definitions and functions*/
|
||||
typedef enum {GRUB_EFIEMU_NOTLOADED,
|
||||
GRUB_EFIEMU32, GRUB_EFIEMU64} grub_efiemu_mode_t;
|
||||
struct grub_efiemu_prepare_hook
|
||||
{
|
||||
struct grub_efiemu_prepare_hook *next;
|
||||
grub_err_t (*hook) (void *data);
|
||||
void (*unload) (void *data);
|
||||
void *data;
|
||||
};
|
||||
grub_err_t grub_efiemu_prepare32 (struct grub_efiemu_prepare_hook
|
||||
*prepare_hooks,
|
||||
struct grub_efiemu_configuration_table
|
||||
*config_tables);
|
||||
grub_err_t grub_efiemu_prepare64 (struct grub_efiemu_prepare_hook
|
||||
*prepare_hooks,
|
||||
struct grub_efiemu_configuration_table
|
||||
*config_tables);
|
||||
grub_err_t grub_efiemu_unload (void);
|
||||
grub_err_t grub_efiemu_prepare (void);
|
||||
grub_err_t
|
||||
grub_efiemu_register_prepare_hook (grub_err_t (*hook) (void *data),
|
||||
void (*unload) (void *data),
|
||||
void *data);
|
||||
|
||||
/* symbols and pointers */
|
||||
grub_err_t grub_efiemu_alloc_syms (void);
|
||||
grub_err_t grub_efiemu_request_symbols (int num);
|
||||
grub_err_t grub_efiemu_resolve_symbol (const char *name,
|
||||
int *handle, grub_off_t *off);
|
||||
grub_err_t grub_efiemu_register_symbol (const char *name,
|
||||
int handle, grub_off_t off);
|
||||
void grub_efiemu_free_syms (void);
|
||||
grub_err_t grub_efiemu_write_value (void * addr, grub_uint32_t value,
|
||||
int plus_handle,
|
||||
int minus_handle, int ptv_needed, int size);
|
||||
grub_err_t grub_efiemu_pnvram (void);
|
||||
grub_err_t grub_efiemu_prepare (void);
|
||||
char *grub_efiemu_get_default_core_name (void);
|
||||
void grub_efiemu_pnvram_cmd_unregister (void);
|
||||
grub_err_t grub_efiemu_autocore (void);
|
||||
#endif /* ! GRUB_EFI_EMU_HEADER */
|
37
include/grub/efiemu/runtime.h
Normal file
37
include/grub/efiemu/runtime.h
Normal file
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
* 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_EFI_EMU_RUNTIME_HEADER
|
||||
#define GRUB_EFI_EMU_RUNTIME_HEADER 1
|
||||
|
||||
struct grub_efiemu_ptv_rel
|
||||
{
|
||||
grub_uint64_t addr;
|
||||
grub_efi_memory_type_t plustype;
|
||||
grub_efi_memory_type_t minustype;
|
||||
grub_uint32_t size;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct efi_variable
|
||||
{
|
||||
grub_efi_guid_t guid;
|
||||
grub_uint32_t namelen;
|
||||
grub_uint32_t size;
|
||||
grub_efi_uint32_t attributes;
|
||||
} __attribute__ ((packed));
|
||||
#endif /* ! GRUB_EFI_EMU_RUNTIME_HEADER */
|
33
include/grub/i386/efiemu.h
Normal file
33
include/grub/i386/efiemu.h
Normal file
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
* 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_ARCH_EFI_EMU_HEADER
|
||||
#define GRUB_ARCH_EFI_EMU_HEADER 1
|
||||
|
||||
grub_err_t
|
||||
grub_arch_efiemu_relocate_symbols32 (grub_efiemu_segment_t segs,
|
||||
struct grub_efiemu_elf_sym *elfsyms,
|
||||
void *ehdr);
|
||||
grub_err_t
|
||||
grub_arch_efiemu_relocate_symbols64 (grub_efiemu_segment_t segs,
|
||||
struct grub_efiemu_elf_sym *elfsyms,
|
||||
void *ehdr);
|
||||
|
||||
int grub_arch_efiemu_check_header32 (void *ehdr);
|
||||
int grub_arch_efiemu_check_header64 (void *ehdr);
|
||||
#endif
|
24
include/grub/i386/pc/efiemu.h
Normal file
24
include/grub/i386/pc/efiemu.h
Normal file
|
@ -0,0 +1,24 @@
|
|||
/*
|
||||
* 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
|
Loading…
Add table
Add a link
Reference in a new issue