merge mainline into gingold3
This commit is contained in:
commit
774b7ca021
320 changed files with 18661 additions and 6490 deletions
|
@ -60,10 +60,12 @@ struct grub_acpi_fadt
|
|||
struct grub_acpi_table_header hdr;
|
||||
grub_uint32_t facs_addr;
|
||||
grub_uint32_t dsdt_addr;
|
||||
grub_uint8_t somefields1[88];
|
||||
grub_uint8_t somefields1[20];
|
||||
grub_uint32_t pm1a;
|
||||
grub_uint8_t somefields2[64];
|
||||
grub_uint64_t facs_xaddr;
|
||||
grub_uint64_t dsdt_xaddr;
|
||||
grub_uint8_t somefields2[96];
|
||||
grub_uint8_t somefields3[96];
|
||||
} __attribute__ ((packed));
|
||||
|
||||
#define GRUB_ACPI_MADT_SIGNATURE "APIC"
|
||||
|
@ -145,4 +147,25 @@ grub_uint8_t grub_byte_checksum (void *base, grub_size_t size);
|
|||
|
||||
grub_err_t grub_acpi_create_ebda (void);
|
||||
|
||||
void grub_acpi_halt (void);
|
||||
|
||||
#define GRUB_ACPI_SLP_EN (1 << 13)
|
||||
#define GRUB_ACPI_SLP_TYP_OFFSET 10
|
||||
|
||||
enum
|
||||
{
|
||||
GRUB_ACPI_OPCODE_ZERO = 0, GRUB_ACPI_OPCODE_ONE = 1,
|
||||
GRUB_ACPI_OPCODE_NAME = 8, GRUB_ACPI_OPCODE_BYTE_CONST = 0x0a,
|
||||
GRUB_ACPI_OPCODE_WORD_CONST = 0x0b, GRUB_ACPI_OPCODE_DWORD_CONST = 0x0c,
|
||||
GRUB_ACPI_OPCODE_SCOPE = 0x10, GRUB_ACPI_OPCODE_PACKAGE = 0x12,
|
||||
GRUB_ACPI_OPCODE_METHOD = 0x14, GRUB_ACPI_OPCODE_EXTOP = 0x5b,
|
||||
GRUB_ACPI_OPCODE_IF = 0xa0, GRUB_ACPI_OPCODE_ONES = 0xff
|
||||
};
|
||||
enum
|
||||
{
|
||||
GRUB_ACPI_EXTOPCODE_MUTEX = 0x01,
|
||||
GRUB_ACPI_EXTOPCODE_OPERATION_REGION = 0x80,
|
||||
GRUB_ACPI_EXTOPCODE_FIELD_OP = 0x81
|
||||
};
|
||||
|
||||
#endif /* ! GRUB_ACPI_HEADER */
|
||||
|
|
|
@ -19,36 +19,20 @@
|
|||
#ifndef GRUB_AT_KEYBOARD_HEADER
|
||||
#define GRUB_AT_KEYBOARD_HEADER 1
|
||||
|
||||
#define SHIFT_L 0x2a
|
||||
#define SHIFT_R 0x36
|
||||
#define CTRL 0x1d
|
||||
#define ALT 0x38
|
||||
#define CAPS_LOCK 0x3a
|
||||
#define NUM_LOCK 0x45
|
||||
#define SCROLL_LOCK 0x46
|
||||
|
||||
/* Used for sending commands to the controller. */
|
||||
#define KEYBOARD_COMMAND_ISREADY(x) !((x) & 0x02)
|
||||
#define KEYBOARD_COMMAND_READ 0x20
|
||||
#define KEYBOARD_COMMAND_WRITE 0x60
|
||||
#define KEYBOARD_COMMAND_REBOOT 0xfe
|
||||
|
||||
#define KEYBOARD_SCANCODE_SET1 0x40
|
||||
#define KEYBOARD_AT_TRANSLATE 0x40
|
||||
|
||||
#define GRUB_AT_ACK 0xfa
|
||||
#define GRUB_AT_NACK 0xfe
|
||||
#define GRUB_AT_TRIES 5
|
||||
|
||||
#define KEYBOARD_ISMAKE(x) !((x) & 0x80)
|
||||
#define KEYBOARD_ISREADY(x) ((x) & 0x01)
|
||||
#define KEYBOARD_SCANCODE(x) ((x) & 0x7f)
|
||||
|
||||
#ifdef GRUB_MACHINE_IEEE1275
|
||||
#define OLPC_UP GRUB_TERM_UP
|
||||
#define OLPC_DOWN GRUB_TERM_DOWN
|
||||
#define OLPC_LEFT GRUB_TERM_LEFT
|
||||
#define OLPC_RIGHT GRUB_TERM_RIGHT
|
||||
#else
|
||||
#define OLPC_UP '\0'
|
||||
#define OLPC_DOWN '\0'
|
||||
#define OLPC_LEFT '\0'
|
||||
#define OLPC_RIGHT '\0'
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -34,17 +34,6 @@ 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))
|
||||
|
@ -61,11 +50,6 @@ static inline grub_err_t grub_autoefi_prepare (void)
|
|||
# define grub_autoefi_mmap_iterate grub_efiemu_mmap_iterate
|
||||
# define grub_autoefi_prepare grub_efiemu_prepare
|
||||
# define grub_autoefi_set_virtual_address_map grub_efiemu_set_virtual_address_map
|
||||
# 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
|
||||
|
|
|
@ -23,6 +23,10 @@
|
|||
#include <grub/symbol.h>
|
||||
#include <grub/types.h>
|
||||
|
||||
#ifdef _mips
|
||||
#include <grub/mips/cache.h>
|
||||
#endif
|
||||
|
||||
#if defined (__i386__) || defined (__x86_64__)
|
||||
static inline void
|
||||
grub_arch_sync_caches (void *address __attribute__ ((unused)),
|
||||
|
|
|
@ -23,20 +23,19 @@
|
|||
#include <grub/err.h>
|
||||
#include <grub/list.h>
|
||||
|
||||
/* Can be run in the command-line. */
|
||||
#define GRUB_COMMAND_FLAG_CMDLINE 0x1
|
||||
/* Can be run in the menu. */
|
||||
#define GRUB_COMMAND_FLAG_MENU 0x2
|
||||
/* Can be run in both interfaces. */
|
||||
#define GRUB_COMMAND_FLAG_BOTH 0x3
|
||||
/* Only for the command title. */
|
||||
#define GRUB_COMMAND_FLAG_TITLE 0x4
|
||||
/* Don't print the command on booting. */
|
||||
#define GRUB_COMMAND_FLAG_NO_ECHO 0x8
|
||||
/* This is an extended command. */
|
||||
#define GRUB_COMMAND_FLAG_EXTCMD 0x10
|
||||
/* This is an dynamic command. */
|
||||
#define GRUB_COMMAND_FLAG_DYNCMD 0x20
|
||||
typedef enum grub_command_flags
|
||||
{
|
||||
/* This is an extended command. */
|
||||
GRUB_COMMAND_FLAG_EXTCMD = 0x10,
|
||||
/* This is an dynamic command. */
|
||||
GRUB_COMMAND_FLAG_DYNCMD = 0x20,
|
||||
/* This command accepts block arguments. */
|
||||
GRUB_COMMAND_FLAG_BLOCKS = 0x40,
|
||||
/* This command accepts unknown arguments as direct parameters. */
|
||||
GRUB_COMMAND_ACCEPT_DASH = 0x80,
|
||||
/* This command accepts only options preceding direct arguments. */
|
||||
GRUB_COMMAND_OPTIONS_AT_START = 0x100,
|
||||
} grub_command_flags_t;
|
||||
|
||||
struct grub_command;
|
||||
|
||||
|
@ -59,7 +58,7 @@ struct grub_command
|
|||
grub_command_func_t func;
|
||||
|
||||
/* The flags. */
|
||||
unsigned flags;
|
||||
grub_command_flags_t flags;
|
||||
|
||||
/* The summary of the command usage. */
|
||||
const char *summary;
|
||||
|
|
|
@ -243,10 +243,12 @@ extern gcry_md_spec_t _gcry_digest_spec_md5;
|
|||
extern gcry_md_spec_t _gcry_digest_spec_sha1;
|
||||
extern gcry_md_spec_t _gcry_digest_spec_sha256;
|
||||
extern gcry_md_spec_t _gcry_digest_spec_sha512;
|
||||
extern gcry_md_spec_t _gcry_digest_spec_crc32;
|
||||
#define GRUB_MD_MD5 ((const gcry_md_spec_t *) &_gcry_digest_spec_md5)
|
||||
#define GRUB_MD_SHA1 ((const gcry_md_spec_t *) &_gcry_digest_spec_sha1)
|
||||
#define GRUB_MD_SHA256 ((const gcry_md_spec_t *) &_gcry_digest_spec_sha256)
|
||||
#define GRUB_MD_SHA512 ((const gcry_md_spec_t *) &_gcry_digest_spec_sha512)
|
||||
#define GRUB_MD_CRC32 ((const gcry_md_spec_t *) &_gcry_digest_spec_crc32)
|
||||
|
||||
/* Implement PKCS#5 PBKDF2 as per RFC 2898. The PRF to use is HMAC variant
|
||||
of digest supplied by MD. Inputs are the password P of length PLEN,
|
||||
|
|
|
@ -99,9 +99,6 @@ struct grub_disk
|
|||
/* The total number of sectors. */
|
||||
grub_uint64_t total_sectors;
|
||||
|
||||
/* If partitions can be stored. */
|
||||
int has_partitions;
|
||||
|
||||
/* The id used by the disk cache manager. */
|
||||
unsigned long id;
|
||||
|
||||
|
@ -177,4 +174,13 @@ struct grub_disk_ata_pass_through_parms
|
|||
extern grub_err_t (* EXPORT_VAR(grub_disk_ata_pass_through)) (grub_disk_t,
|
||||
struct grub_disk_ata_pass_through_parms *);
|
||||
|
||||
#if defined (GRUB_UTIL) || defined (GRUB_MACHINE_EMU)
|
||||
void grub_lvm_init (void);
|
||||
void grub_mdraid_init (void);
|
||||
void grub_raid_init (void);
|
||||
void grub_lvm_fini (void);
|
||||
void grub_mdraid_fini (void);
|
||||
void grub_raid_fini (void);
|
||||
#endif
|
||||
|
||||
#endif /* ! GRUB_DISK_HEADER */
|
||||
|
|
|
@ -24,16 +24,6 @@
|
|||
|
||||
#define GRUB_MMAP_REGISTER_BY_FIRMWARE 1
|
||||
|
||||
#define GRUB_MACHINE_MEMORY_AVAILABLE 1
|
||||
#define GRUB_MACHINE_MEMORY_RESERVED 2
|
||||
#define GRUB_MACHINE_MEMORY_ACPI 3
|
||||
#define GRUB_MACHINE_MEMORY_NVS 4
|
||||
#define GRUB_MACHINE_MEMORY_CODE 5
|
||||
#define GRUB_MACHINE_MEMORY_MAX_TYPE 5
|
||||
/* This one is special: it's used internally but is never reported
|
||||
by firmware. */
|
||||
#define GRUB_MACHINE_MEMORY_HOLE 6
|
||||
|
||||
grub_err_t grub_machine_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t,
|
||||
grub_uint64_t,
|
||||
grub_uint32_t));
|
||||
|
|
|
@ -233,11 +233,6 @@ grub_efiemu_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t,
|
|||
int grub_efiemu_sizeof_uintn_t (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,
|
||||
|
|
|
@ -19,12 +19,15 @@
|
|||
#ifndef GRUB_UTIL_GETROOT_HEADER
|
||||
#define GRUB_UTIL_GETROOT_HEADER 1
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
enum grub_dev_abstraction_types {
|
||||
GRUB_DEV_ABSTRACTION_NONE,
|
||||
GRUB_DEV_ABSTRACTION_LVM,
|
||||
GRUB_DEV_ABSTRACTION_RAID,
|
||||
};
|
||||
|
||||
char *grub_find_device (const char *dir, dev_t dev);
|
||||
char *grub_guess_root_device (const char *dir);
|
||||
int grub_util_get_dev_abstraction (const char *os_dev);
|
||||
char *grub_util_get_grub_dev (const char *os_dev);
|
||||
|
|
|
@ -26,5 +26,7 @@ void grub_util_biosdisk_init (const char *dev_map);
|
|||
void grub_util_biosdisk_fini (void);
|
||||
char *grub_util_biosdisk_get_grub_dev (const char *os_dev);
|
||||
const char *grub_util_biosdisk_get_osdev (grub_disk_t disk);
|
||||
int grub_util_biosdisk_is_present (const char *name);
|
||||
int grub_util_biosdisk_is_floppy (grub_disk_t disk);
|
||||
|
||||
#endif /* ! GRUB_BIOSDISK_MACHINE_UTIL_HEADER */
|
||||
|
|
|
@ -19,6 +19,9 @@
|
|||
#ifndef GRUB_EMU_MISC_H
|
||||
#define GRUB_EMU_MISC_H 1
|
||||
|
||||
#include <config-util.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#include <grub/symbol.h>
|
||||
#include <grub/types.h>
|
||||
#include <grub/util/libzfs.h>
|
||||
|
@ -45,6 +48,7 @@ extern const char *program_name;
|
|||
void grub_emu_init (void);
|
||||
void grub_init_all (void);
|
||||
void grub_fini_all (void);
|
||||
void grub_emu_post_init (void);
|
||||
|
||||
void grub_find_zpool_from_dir (const char *dir,
|
||||
char **poolname, char **poolfs);
|
||||
|
|
|
@ -50,7 +50,7 @@ typedef enum
|
|||
GRUB_ERR_BAD_FONT,
|
||||
GRUB_ERR_NOT_IMPLEMENTED_YET,
|
||||
GRUB_ERR_SYMLINK_LOOP,
|
||||
GRUB_ERR_BAD_GZIP_DATA,
|
||||
GRUB_ERR_BAD_COMPRESSED_DATA,
|
||||
GRUB_ERR_MENU,
|
||||
GRUB_ERR_TIMEOUT,
|
||||
GRUB_ERR_IO,
|
||||
|
|
|
@ -21,10 +21,12 @@
|
|||
|
||||
#include <grub/lib/arg.h>
|
||||
#include <grub/command.h>
|
||||
#include <grub/script_sh.h>
|
||||
|
||||
struct grub_extcmd;
|
||||
struct grub_extcmd_context;
|
||||
|
||||
typedef grub_err_t (*grub_extcmd_func_t) (struct grub_extcmd *cmd,
|
||||
typedef grub_err_t (*grub_extcmd_func_t) (struct grub_extcmd_context *ctxt,
|
||||
int argc, char **args);
|
||||
|
||||
/* The argcmd description. */
|
||||
|
@ -38,18 +40,40 @@ struct grub_extcmd
|
|||
const struct grub_arg_option *options;
|
||||
|
||||
void *data;
|
||||
|
||||
struct grub_arg_list *state;
|
||||
};
|
||||
typedef struct grub_extcmd *grub_extcmd_t;
|
||||
|
||||
/* Command context for each instance of execution. */
|
||||
struct grub_extcmd_context
|
||||
{
|
||||
struct grub_extcmd *extcmd;
|
||||
|
||||
struct grub_arg_list *state;
|
||||
|
||||
/* Script parameter, if any. */
|
||||
struct grub_script *script;
|
||||
};
|
||||
typedef struct grub_extcmd_context *grub_extcmd_context_t;
|
||||
|
||||
grub_extcmd_t grub_register_extcmd (const char *name,
|
||||
grub_extcmd_func_t func,
|
||||
unsigned flags,
|
||||
grub_command_flags_t flags,
|
||||
const char *summary,
|
||||
const char *description,
|
||||
const struct grub_arg_option *parser);
|
||||
|
||||
grub_extcmd_t grub_register_extcmd_prio (const char *name,
|
||||
grub_extcmd_func_t func,
|
||||
grub_command_flags_t flags,
|
||||
const char *summary,
|
||||
const char *description,
|
||||
const struct grub_arg_option *parser,
|
||||
int prio);
|
||||
|
||||
void grub_unregister_extcmd (grub_extcmd_t cmd);
|
||||
|
||||
grub_err_t
|
||||
grub_extcmd_dispatcher (struct grub_command *cmd, int argc, char **args,
|
||||
struct grub_script *script);
|
||||
|
||||
#endif /* ! GRUB_EXTCMD_HEADER */
|
||||
|
|
|
@ -39,6 +39,9 @@ struct grub_file
|
|||
/* The file size. */
|
||||
grub_off_t size;
|
||||
|
||||
/* If file is not easly seekable. Should be set by underlying layer. */
|
||||
int not_easly_seekable;
|
||||
|
||||
/* Filesystem-specific data. */
|
||||
void *data;
|
||||
|
||||
|
@ -48,6 +51,51 @@ struct grub_file
|
|||
};
|
||||
typedef struct grub_file *grub_file_t;
|
||||
|
||||
/* Filters with lower ID are executed first. */
|
||||
typedef enum grub_file_filter_id
|
||||
{
|
||||
GRUB_FILE_FILTER_GZIO,
|
||||
GRUB_FILE_FILTER_XZIO,
|
||||
GRUB_FILE_FILTER_MAX,
|
||||
GRUB_FILE_FILTER_COMPRESSION_FIRST = GRUB_FILE_FILTER_GZIO,
|
||||
GRUB_FILE_FILTER_COMPRESSION_LAST = GRUB_FILE_FILTER_XZIO,
|
||||
} grub_file_filter_id_t;
|
||||
|
||||
typedef grub_file_t (*grub_file_filter_t) (grub_file_t in);
|
||||
|
||||
extern grub_file_filter_t EXPORT_VAR(grub_file_filters_all)[GRUB_FILE_FILTER_MAX];
|
||||
extern grub_file_filter_t EXPORT_VAR(grub_file_filters_enabled)[GRUB_FILE_FILTER_MAX];
|
||||
|
||||
static inline void
|
||||
grub_file_filter_register (grub_file_filter_id_t id, grub_file_filter_t filter)
|
||||
{
|
||||
grub_file_filters_all[id] = filter;
|
||||
grub_file_filters_enabled[id] = filter;
|
||||
};
|
||||
|
||||
static inline void
|
||||
grub_file_filter_unregister (grub_file_filter_id_t id)
|
||||
{
|
||||
grub_file_filters_all[id] = 0;
|
||||
grub_file_filters_enabled[id] = 0;
|
||||
};
|
||||
|
||||
static inline void
|
||||
grub_file_filter_disable (grub_file_filter_id_t id)
|
||||
{
|
||||
grub_file_filters_enabled[id] = 0;
|
||||
};
|
||||
|
||||
static inline void
|
||||
grub_file_filter_disable_compression (void)
|
||||
{
|
||||
grub_file_filter_id_t id;
|
||||
|
||||
for (id = GRUB_FILE_FILTER_COMPRESSION_FIRST;
|
||||
id <= GRUB_FILE_FILTER_COMPRESSION_LAST; id++)
|
||||
grub_file_filters_enabled[id] = 0;
|
||||
};
|
||||
|
||||
/* Get a device name from NAME. */
|
||||
char *EXPORT_FUNC(grub_file_get_device_name) (const char *name);
|
||||
|
||||
|
@ -57,6 +105,9 @@ grub_ssize_t EXPORT_FUNC(grub_file_read) (grub_file_t file, void *buf,
|
|||
grub_off_t EXPORT_FUNC(grub_file_seek) (grub_file_t file, grub_off_t offset);
|
||||
grub_err_t EXPORT_FUNC(grub_file_close) (grub_file_t file);
|
||||
|
||||
/* Return value of grub_file_size() in case file size is unknown. */
|
||||
#define GRUB_FILE_SIZE_UNKNOWN 0xffffffffffffffffULL
|
||||
|
||||
static inline grub_off_t
|
||||
grub_file_size (const grub_file_t file)
|
||||
{
|
||||
|
@ -69,4 +120,10 @@ grub_file_tell (const grub_file_t file)
|
|||
return file->offset;
|
||||
}
|
||||
|
||||
static inline int
|
||||
grub_file_seekable (const grub_file_t file)
|
||||
{
|
||||
return !file->not_easly_seekable;
|
||||
}
|
||||
|
||||
#endif /* ! GRUB_FILE_HEADER */
|
||||
|
|
|
@ -1,28 +0,0 @@
|
|||
/* gzio.h - prototypes for gzio */
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2005,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_GZIO_H
|
||||
#define GRUB_GZIO_H 1
|
||||
|
||||
#include <grub/file.h>
|
||||
|
||||
grub_file_t grub_gzio_open (grub_file_t io, int transparent);
|
||||
grub_file_t grub_gzfile_open (const char *name, int transparent);
|
||||
|
||||
#endif /* ! GRUB_GZIO_H */
|
49
include/grub/i386/coreboot/lbio.h
Normal file
49
include/grub/i386/coreboot/lbio.h
Normal file
|
@ -0,0 +1,49 @@
|
|||
/* memory.h - describe the memory map */
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2002,2007,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_MACHINE_LBIO_HEADER
|
||||
#define _GRUB_MACHINE_LBIO_HEADER 1
|
||||
|
||||
struct grub_linuxbios_table_header
|
||||
{
|
||||
char signature[4];
|
||||
grub_uint32_t size;
|
||||
};
|
||||
typedef struct grub_linuxbios_table_header *grub_linuxbios_table_header_t;
|
||||
|
||||
struct grub_linuxbios_table_item
|
||||
{
|
||||
#define GRUB_LINUXBIOS_MEMBER_UNUSED 0x00
|
||||
#define GRUB_LINUXBIOS_MEMBER_MEMORY 0x01
|
||||
#define GRUB_LINUXBIOS_MEMBER_LINK 0x11
|
||||
grub_uint32_t tag;
|
||||
grub_uint32_t size;
|
||||
};
|
||||
typedef struct grub_linuxbios_table_item *grub_linuxbios_table_item_t;
|
||||
|
||||
struct grub_linuxbios_mem_region
|
||||
{
|
||||
grub_uint64_t addr;
|
||||
grub_uint64_t size;
|
||||
#define GRUB_MACHINE_MEMORY_AVAILABLE 1
|
||||
grub_uint32_t type;
|
||||
};
|
||||
typedef struct grub_linuxbios_mem_region *mem_region_t;
|
||||
|
||||
#endif
|
|
@ -21,11 +21,11 @@
|
|||
#define _GRUB_MEMORY_MACHINE_LB_HEADER 1
|
||||
|
||||
#include <grub/symbol.h>
|
||||
#include <grub/i386/pc/memory.h>
|
||||
|
||||
#ifndef ASM_FILE
|
||||
#include <grub/err.h>
|
||||
#include <grub/types.h>
|
||||
#include <grub/memory.h>
|
||||
#endif
|
||||
|
||||
#define GRUB_MEMORY_MACHINE_LOWER_USABLE 0x9fc00 /* 640 kiB - 1 kiB */
|
||||
|
@ -35,36 +35,21 @@
|
|||
|
||||
#ifndef ASM_FILE
|
||||
|
||||
struct grub_linuxbios_table_header
|
||||
{
|
||||
char signature[4];
|
||||
grub_uint32_t size;
|
||||
};
|
||||
typedef struct grub_linuxbios_table_header *grub_linuxbios_table_header_t;
|
||||
|
||||
struct grub_linuxbios_table_item
|
||||
{
|
||||
#define GRUB_LINUXBIOS_MEMBER_UNUSED 0x00
|
||||
#define GRUB_LINUXBIOS_MEMBER_MEMORY 0x01
|
||||
#define GRUB_LINUXBIOS_MEMBER_LINK 0x11
|
||||
grub_uint32_t tag;
|
||||
grub_uint32_t size;
|
||||
};
|
||||
typedef struct grub_linuxbios_table_item *grub_linuxbios_table_item_t;
|
||||
|
||||
struct grub_linuxbios_mem_region
|
||||
{
|
||||
grub_uint64_t addr;
|
||||
grub_uint64_t size;
|
||||
#define GRUB_MACHINE_MEMORY_AVAILABLE 1
|
||||
grub_uint32_t type;
|
||||
};
|
||||
typedef struct grub_linuxbios_mem_region *mem_region_t;
|
||||
|
||||
void grub_machine_mmap_init (void);
|
||||
|
||||
grub_err_t EXPORT_FUNC(grub_machine_mmap_iterate)
|
||||
(int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, grub_uint64_t, grub_uint32_t));
|
||||
static inline grub_err_t
|
||||
grub_machine_mmap_register (grub_uint64_t start __attribute__ ((unused)),
|
||||
grub_uint64_t size __attribute__ ((unused)),
|
||||
int type __attribute__ ((unused)),
|
||||
int handle __attribute__ ((unused)))
|
||||
{
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
static inline grub_err_t
|
||||
grub_machine_mmap_unregister (int handle __attribute__ ((unused)))
|
||||
{
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
#include <grub/i386/pc/memory.h>
|
||||
#include <grub/i386/coreboot/memory.h>
|
||||
|
|
|
@ -30,6 +30,14 @@
|
|||
|
||||
#ifndef ASM_FILE
|
||||
|
||||
#define GRUB_MMAP_MALLOC_LOW 1
|
||||
|
||||
#include <grub/types.h>
|
||||
|
||||
grub_uint64_t grub_mmap_get_upper (void);
|
||||
grub_uint64_t grub_mmap_get_lower (void);
|
||||
grub_uint64_t grub_mmap_get_post64 (void);
|
||||
|
||||
typedef grub_addr_t grub_phys_addr_t;
|
||||
|
||||
static inline grub_phys_addr_t
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2002,2004,2005,2007,2008 Free Software Foundation, Inc.
|
||||
* 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
|
||||
|
@ -16,15 +16,33 @@
|
|||
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef GRUB_INIT_MACHINE_HEADER
|
||||
#define GRUB_INIT_MACHINE_HEADER 1
|
||||
#ifndef GRUB_APM_MACHINE_HEADER
|
||||
#define GRUB_APM_MACHINE_HEADER 1
|
||||
|
||||
#include <grub/types.h>
|
||||
#include <grub/symbol.h>
|
||||
#include <grub/machine/memory.h>
|
||||
#include <grub/cpu/floppy.h>
|
||||
|
||||
/* Turn on/off Gate A20. */
|
||||
void grub_gate_a20 (int on);
|
||||
struct grub_apm_info
|
||||
{
|
||||
grub_uint16_t cseg;
|
||||
grub_uint32_t offset;
|
||||
grub_uint16_t cseg_16;
|
||||
grub_uint16_t dseg;
|
||||
grub_uint16_t flags;
|
||||
grub_uint16_t cseg_len;
|
||||
grub_uint16_t cseg_16_len;
|
||||
grub_uint16_t dseg_len;
|
||||
grub_uint16_t version;
|
||||
};
|
||||
|
||||
#endif /* ! GRUB_INIT_MACHINE_HEADER */
|
||||
enum
|
||||
{
|
||||
GRUB_APM_FLAGS_16BITPROTECTED_SUPPORTED = 1,
|
||||
GRUB_APM_FLAGS_32BITPROTECTED_SUPPORTED = 2,
|
||||
GRUB_APM_FLAGS_CPUIDLE_SLOWS_DOWN = 4,
|
||||
GRUB_APM_FLAGS_DISABLED = 8,
|
||||
GRUB_APM_FLAGS_DISENGAGED = 16,
|
||||
};
|
||||
|
||||
int grub_apm_get_info (struct grub_apm_info *info);
|
||||
|
||||
#endif
|
|
@ -19,19 +19,6 @@
|
|||
#ifndef GRUB_CONSOLE_MACHINE_HEADER
|
||||
#define GRUB_CONSOLE_MACHINE_HEADER 1
|
||||
|
||||
/* Define scan codes. */
|
||||
#define GRUB_CONSOLE_KEY_LEFT 0x4B00
|
||||
#define GRUB_CONSOLE_KEY_RIGHT 0x4D00
|
||||
#define GRUB_CONSOLE_KEY_UP 0x4800
|
||||
#define GRUB_CONSOLE_KEY_DOWN 0x5000
|
||||
#define GRUB_CONSOLE_KEY_IC 0x5200
|
||||
#define GRUB_CONSOLE_KEY_DC 0x5300
|
||||
#define GRUB_CONSOLE_KEY_BACKSPACE 0x0008
|
||||
#define GRUB_CONSOLE_KEY_HOME 0x4700
|
||||
#define GRUB_CONSOLE_KEY_END 0x4F00
|
||||
#define GRUB_CONSOLE_KEY_NPAGE 0x5100
|
||||
#define GRUB_CONSOLE_KEY_PPAGE 0x4900
|
||||
|
||||
#ifndef ASM_FILE
|
||||
|
||||
#include <grub/types.h>
|
||||
|
@ -40,7 +27,6 @@
|
|||
#include <grub/i386/vga_common.h>
|
||||
|
||||
/* These are global to share code between C and asm. */
|
||||
int grub_console_checkkey (struct grub_term_input *term);
|
||||
int grub_console_getkey (struct grub_term_input *term);
|
||||
grub_uint16_t grub_console_getxy (struct grub_term_output *term);
|
||||
void grub_console_gotoxy (struct grub_term_output *term,
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#define GRUB_INTERRUPT_MACHINE_HEADER 1
|
||||
|
||||
#include <grub/symbol.h>
|
||||
#include <grub/types.h>
|
||||
|
||||
struct grub_bios_int_registers
|
||||
{
|
||||
|
|
|
@ -88,51 +88,9 @@ struct grub_machine_bios_data_area
|
|||
grub_uint8_t unused2[0xf0 - 0x18];
|
||||
};
|
||||
|
||||
struct grub_machine_mmap_entry
|
||||
{
|
||||
grub_uint32_t size;
|
||||
grub_uint64_t addr;
|
||||
grub_uint64_t len;
|
||||
#define GRUB_MACHINE_MEMORY_AVAILABLE 1
|
||||
#define GRUB_MACHINE_MEMORY_RESERVED 2
|
||||
#define GRUB_MACHINE_MEMORY_ACPI 3
|
||||
#define GRUB_MACHINE_MEMORY_NVS 4
|
||||
#define GRUB_MACHINE_MEMORY_MAX_TYPE 4
|
||||
/* This one is special: it's used internally but is never reported
|
||||
by firmware. */
|
||||
#define GRUB_MACHINE_MEMORY_HOLE 5
|
||||
|
||||
grub_uint32_t type;
|
||||
} __attribute__((packed));
|
||||
|
||||
grub_err_t EXPORT_FUNC(grub_machine_mmap_iterate)
|
||||
(int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, grub_uint64_t, grub_uint32_t));
|
||||
|
||||
grub_uint64_t grub_mmap_get_post64 (void);
|
||||
grub_uint64_t grub_mmap_get_upper (void);
|
||||
grub_uint64_t grub_mmap_get_lower (void);
|
||||
|
||||
#define GRUB_MMAP_MALLOC_LOW 1
|
||||
|
||||
#ifdef GRUB_MACHINE_PCBIOS
|
||||
grub_err_t grub_machine_mmap_register (grub_uint64_t start, grub_uint64_t size,
|
||||
int type, int handle);
|
||||
grub_err_t grub_machine_mmap_unregister (int handle);
|
||||
#else
|
||||
static inline grub_err_t
|
||||
grub_machine_mmap_register (grub_uint64_t start __attribute__ ((unused)),
|
||||
grub_uint64_t size __attribute__ ((unused)),
|
||||
int type __attribute__ ((unused)),
|
||||
int handle __attribute__ ((unused)))
|
||||
{
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
static inline grub_err_t
|
||||
grub_machine_mmap_unregister (int handle __attribute__ ((unused)))
|
||||
{
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -192,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;
|
||||
|
@ -306,7 +319,7 @@ struct grub_pxenv_unload_stack
|
|||
|
||||
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);
|
||||
|
||||
|
|
19
include/grub/i386/pc/vesa_modes_table.h
Normal file
19
include/grub/i386/pc/vesa_modes_table.h
Normal file
|
@ -0,0 +1,19 @@
|
|||
#ifndef GRUB_VESA_MODE_TABLE_HEADER
|
||||
#define GRUB_VESA_MODE_TABLE_HEADER 1
|
||||
|
||||
#include <grub/types.h>
|
||||
|
||||
#define GRUB_VESA_MODE_TABLE_START 0x300
|
||||
#define GRUB_VESA_MODE_TABLE_END 0x373
|
||||
|
||||
struct grub_vesa_mode_table_entry {
|
||||
grub_uint16_t width;
|
||||
grub_uint16_t height;
|
||||
grub_uint8_t depth;
|
||||
};
|
||||
|
||||
extern struct grub_vesa_mode_table_entry
|
||||
grub_vesa_mode_table[GRUB_VESA_MODE_TABLE_END
|
||||
- GRUB_VESA_MODE_TABLE_START + 1];
|
||||
|
||||
#endif
|
|
@ -21,7 +21,7 @@
|
|||
#define _GRUB_MEMORY_MACHINE_HEADER 1
|
||||
|
||||
#include <grub/symbol.h>
|
||||
#include <grub/i386/pc/memory.h>
|
||||
#include <grub/i386/coreboot/memory.h>
|
||||
|
||||
#ifndef ASM_FILE
|
||||
#include <grub/err.h>
|
||||
|
@ -37,9 +37,6 @@
|
|||
|
||||
void grub_machine_mmap_init (void);
|
||||
|
||||
grub_err_t EXPORT_FUNC(grub_machine_mmap_iterate)
|
||||
(int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, grub_uint64_t, grub_uint32_t));
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* ! _GRUB_MEMORY_MACHINE_HEADER */
|
||||
|
|
|
@ -26,12 +26,14 @@
|
|||
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;
|
||||
};
|
||||
|
||||
struct grub_relocator16_state
|
||||
|
|
|
@ -103,6 +103,9 @@ enum grub_ieee1275_flag
|
|||
|
||||
/* OpenFirmware hangs on qemu if one requests any memory below 1.5 MiB. */
|
||||
GRUB_IEEE1275_FLAG_NO_PRE1_5M_CLAIM,
|
||||
|
||||
/* OLPC / XO firmware has the cursor ON/OFF routines. */
|
||||
GRUB_IEEE1275_FLAG_HAS_CURSORONOFF,
|
||||
};
|
||||
|
||||
extern int EXPORT_FUNC(grub_ieee1275_test_flag) (enum grub_ieee1275_flag flag);
|
||||
|
@ -187,4 +190,6 @@ int EXPORT_FUNC(grub_ieee1275_devices_iterate) (int (*hook)
|
|||
(struct grub_ieee1275_devalias *
|
||||
alias));
|
||||
|
||||
char *EXPORT_FUNC(grub_ieee1275_canonicalise_devname) (const char *path);
|
||||
|
||||
#endif /* ! GRUB_IEEE1275_HEADER */
|
||||
|
|
142
include/grub/keyboard_layouts.h
Normal file
142
include/grub/keyboard_layouts.h
Normal file
|
@ -0,0 +1,142 @@
|
|||
/*
|
||||
* 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_KEYBOARD_LAYOUTS_H
|
||||
#define GRUB_KEYBOARD_LAYOUTS_H 1
|
||||
|
||||
#define GRUB_KEYBOARD_LAYOUTS_FILEMAGIC "GRUBLAYO"
|
||||
#define GRUB_KEYBOARD_LAYOUTS_FILEMAGIC_SIZE (sizeof(GRUB_KEYBOARD_LAYOUTS_FILEMAGIC) - 1)
|
||||
#define GRUB_KEYBOARD_LAYOUTS_VERSION 8
|
||||
|
||||
#define GRUB_KEYBOARD_LAYOUTS_ARRAY_SIZE 128
|
||||
|
||||
struct grub_keyboard_layout
|
||||
{
|
||||
grub_uint32_t keyboard_map[GRUB_KEYBOARD_LAYOUTS_ARRAY_SIZE];
|
||||
grub_uint32_t keyboard_map_shift[GRUB_KEYBOARD_LAYOUTS_ARRAY_SIZE];
|
||||
grub_uint32_t keyboard_map_l3[GRUB_KEYBOARD_LAYOUTS_ARRAY_SIZE];
|
||||
grub_uint32_t keyboard_map_shift_l3[GRUB_KEYBOARD_LAYOUTS_ARRAY_SIZE];
|
||||
};
|
||||
|
||||
typedef enum grub_keyboard_key
|
||||
{
|
||||
GRUB_KEYBOARD_KEY_A = 0x04,
|
||||
GRUB_KEYBOARD_KEY_B = 0x05,
|
||||
GRUB_KEYBOARD_KEY_C = 0x06,
|
||||
GRUB_KEYBOARD_KEY_D = 0x07,
|
||||
GRUB_KEYBOARD_KEY_E = 0x08,
|
||||
GRUB_KEYBOARD_KEY_F = 0x09,
|
||||
GRUB_KEYBOARD_KEY_G = 0x0a,
|
||||
GRUB_KEYBOARD_KEY_H = 0x0b,
|
||||
GRUB_KEYBOARD_KEY_I = 0x0c,
|
||||
GRUB_KEYBOARD_KEY_J = 0x0d,
|
||||
GRUB_KEYBOARD_KEY_K = 0x0e,
|
||||
GRUB_KEYBOARD_KEY_L = 0x0f,
|
||||
GRUB_KEYBOARD_KEY_M = 0x10,
|
||||
GRUB_KEYBOARD_KEY_N = 0x11,
|
||||
GRUB_KEYBOARD_KEY_O = 0x12,
|
||||
GRUB_KEYBOARD_KEY_P = 0x13,
|
||||
GRUB_KEYBOARD_KEY_Q = 0x14,
|
||||
GRUB_KEYBOARD_KEY_R = 0x15,
|
||||
GRUB_KEYBOARD_KEY_S = 0x16,
|
||||
GRUB_KEYBOARD_KEY_T = 0x17,
|
||||
GRUB_KEYBOARD_KEY_U = 0x18,
|
||||
GRUB_KEYBOARD_KEY_V = 0x19,
|
||||
GRUB_KEYBOARD_KEY_W = 0x1a,
|
||||
GRUB_KEYBOARD_KEY_X = 0x1b,
|
||||
GRUB_KEYBOARD_KEY_Y = 0x1c,
|
||||
GRUB_KEYBOARD_KEY_Z = 0x1d,
|
||||
GRUB_KEYBOARD_KEY_1 = 0x1e,
|
||||
GRUB_KEYBOARD_KEY_2 = 0x1f,
|
||||
GRUB_KEYBOARD_KEY_3 = 0x20,
|
||||
GRUB_KEYBOARD_KEY_4 = 0x21,
|
||||
GRUB_KEYBOARD_KEY_5 = 0x22,
|
||||
GRUB_KEYBOARD_KEY_6 = 0x23,
|
||||
GRUB_KEYBOARD_KEY_7 = 0x24,
|
||||
GRUB_KEYBOARD_KEY_8 = 0x25,
|
||||
GRUB_KEYBOARD_KEY_9 = 0x26,
|
||||
GRUB_KEYBOARD_KEY_0 = 0x27,
|
||||
GRUB_KEYBOARD_KEY_ENTER = 0x28,
|
||||
GRUB_KEYBOARD_KEY_ESCAPE = 0x29,
|
||||
GRUB_KEYBOARD_KEY_BACKSPACE = 0x2a,
|
||||
GRUB_KEYBOARD_KEY_TAB = 0x2b,
|
||||
GRUB_KEYBOARD_KEY_SPACE = 0x2c,
|
||||
GRUB_KEYBOARD_KEY_DASH = 0x2d,
|
||||
GRUB_KEYBOARD_KEY_EQUAL = 0x2e,
|
||||
GRUB_KEYBOARD_KEY_LBRACKET = 0x2f,
|
||||
GRUB_KEYBOARD_KEY_RBRACKET = 0x30,
|
||||
GRUB_KEYBOARD_KEY_BACKSLASH = 0x32,
|
||||
GRUB_KEYBOARD_KEY_SEMICOLON = 0x33,
|
||||
GRUB_KEYBOARD_KEY_DQUOTE = 0x34,
|
||||
GRUB_KEYBOARD_KEY_RQUOTE = 0x35,
|
||||
GRUB_KEYBOARD_KEY_COMMA = 0x36,
|
||||
GRUB_KEYBOARD_KEY_DOT = 0x37,
|
||||
GRUB_KEYBOARD_KEY_SLASH = 0x38,
|
||||
GRUB_KEYBOARD_KEY_CAPS_LOCK = 0x39,
|
||||
GRUB_KEYBOARD_KEY_F1 = 0x3a,
|
||||
GRUB_KEYBOARD_KEY_F2 = 0x3b,
|
||||
GRUB_KEYBOARD_KEY_F3 = 0x3c,
|
||||
GRUB_KEYBOARD_KEY_F4 = 0x3d,
|
||||
GRUB_KEYBOARD_KEY_F5 = 0x3e,
|
||||
GRUB_KEYBOARD_KEY_F6 = 0x3f,
|
||||
GRUB_KEYBOARD_KEY_F7 = 0x40,
|
||||
GRUB_KEYBOARD_KEY_F8 = 0x41,
|
||||
GRUB_KEYBOARD_KEY_F9 = 0x42,
|
||||
GRUB_KEYBOARD_KEY_F10 = 0x43,
|
||||
GRUB_KEYBOARD_KEY_F11 = 0x44,
|
||||
GRUB_KEYBOARD_KEY_F12 = 0x45,
|
||||
GRUB_KEYBOARD_KEY_SCROLL_LOCK = 0x47,
|
||||
GRUB_KEYBOARD_KEY_INSERT = 0x49,
|
||||
GRUB_KEYBOARD_KEY_HOME = 0x4a,
|
||||
GRUB_KEYBOARD_KEY_PPAGE = 0x4b,
|
||||
GRUB_KEYBOARD_KEY_DELETE = 0x4c,
|
||||
GRUB_KEYBOARD_KEY_END = 0x4d,
|
||||
GRUB_KEYBOARD_KEY_NPAGE = 0x4e,
|
||||
GRUB_KEYBOARD_KEY_RIGHT = 0x4f,
|
||||
GRUB_KEYBOARD_KEY_LEFT = 0x50,
|
||||
GRUB_KEYBOARD_KEY_DOWN = 0x51,
|
||||
GRUB_KEYBOARD_KEY_UP = 0x52,
|
||||
GRUB_KEYBOARD_KEY_NUM_LOCK = 0x53,
|
||||
GRUB_KEYBOARD_KEY_NUMSLASH = 0x54,
|
||||
GRUB_KEYBOARD_KEY_NUMMUL = 0x55,
|
||||
GRUB_KEYBOARD_KEY_NUMMINUS = 0x56,
|
||||
GRUB_KEYBOARD_KEY_NUMPLUS = 0x57,
|
||||
GRUB_KEYBOARD_KEY_NUMENTER = 0x58,
|
||||
GRUB_KEYBOARD_KEY_NUM1 = 0x59,
|
||||
GRUB_KEYBOARD_KEY_NUM2 = 0x5a,
|
||||
GRUB_KEYBOARD_KEY_NUM3 = 0x5b,
|
||||
GRUB_KEYBOARD_KEY_NUM4 = 0x5c,
|
||||
GRUB_KEYBOARD_KEY_NUM5 = 0x5d,
|
||||
GRUB_KEYBOARD_KEY_NUM6 = 0x5e,
|
||||
GRUB_KEYBOARD_KEY_NUM7 = 0x5f,
|
||||
GRUB_KEYBOARD_KEY_NUM8 = 0x60,
|
||||
GRUB_KEYBOARD_KEY_NUM9 = 0x61,
|
||||
GRUB_KEYBOARD_KEY_NUM0 = 0x62,
|
||||
GRUB_KEYBOARD_KEY_NUMDOT = 0x63,
|
||||
GRUB_KEYBOARD_KEY_102ND = 0x64,
|
||||
GRUB_KEYBOARD_KEY_LEFT_CTRL = 0xe0,
|
||||
GRUB_KEYBOARD_KEY_LEFT_SHIFT = 0xe1,
|
||||
GRUB_KEYBOARD_KEY_LEFT_ALT = 0xe2,
|
||||
GRUB_KEYBOARD_KEY_RIGHT_CTRL = 0xe4,
|
||||
GRUB_KEYBOARD_KEY_RIGHT_SHIFT = 0xe5,
|
||||
GRUB_KEYBOARD_KEY_RIGHT_ALT = 0xe6,
|
||||
} grub_keyboard_key_t;
|
||||
|
||||
unsigned EXPORT_FUNC(grub_term_map_key) (grub_keyboard_key_t code, int status);
|
||||
|
||||
#endif /* GRUB_KEYBOARD_LAYOUTS */
|
|
@ -1,4 +1,3 @@
|
|||
/* crc.h - prototypes for crc */
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2008 Free Software Foundation, Inc.
|
||||
|
@ -17,9 +16,12 @@
|
|||
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef GRUB_CRC_H
|
||||
#define GRUB_CRC_H 1
|
||||
#ifndef GRUB_LEGACY_PARSE_HEADER
|
||||
#define GRUB_LEGACY_PARSE_HEADER 1
|
||||
|
||||
grub_uint32_t grub_getcrc32 (grub_uint32_t crc, void *buf, int size);
|
||||
#include <grub/types.h>
|
||||
|
||||
#endif /* ! GRUB_CRC_H */
|
||||
char *grub_legacy_parse (const char *buf, char **entryname, char **suffix);
|
||||
char *grub_legacy_escape (const char *in, grub_size_t len);
|
||||
|
||||
#endif
|
|
@ -38,6 +38,8 @@ typedef enum grub_arg_type grub_arg_type_t;
|
|||
|
||||
/* Flags for the option field op grub_arg_option. */
|
||||
#define GRUB_ARG_OPTION_OPTIONAL (1 << 1)
|
||||
/* Flags for an option that can appear multiple times. */
|
||||
#define GRUB_ARG_OPTION_REPEATABLE (1 << 2)
|
||||
|
||||
enum grub_key_type
|
||||
{
|
||||
|
@ -59,7 +61,10 @@ struct grub_arg_option
|
|||
struct grub_arg_list
|
||||
{
|
||||
int set;
|
||||
char *arg;
|
||||
union {
|
||||
char *arg;
|
||||
char **args;
|
||||
};
|
||||
};
|
||||
|
||||
struct grub_extcmd;
|
||||
|
@ -68,5 +73,7 @@ int grub_arg_parse (struct grub_extcmd *cmd, int argc, char **argv,
|
|||
struct grub_arg_list *usr, char ***args, int *argnum);
|
||||
|
||||
void grub_arg_show_help (struct grub_extcmd *cmd);
|
||||
struct grub_arg_list* grub_arg_list_alloc (struct grub_extcmd *cmd,
|
||||
int argc, char *argv[]);
|
||||
|
||||
#endif /* ! GRUB_ARG_HEADER */
|
||||
|
|
|
@ -16,7 +16,8 @@
|
|||
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
/* We need to include config-util.h.in for HAVE_*. */
|
||||
#include <config-util.h>
|
||||
|
||||
/* On x86 these functions aren't really needed. Save some space. */
|
||||
#if !defined (__i386__) && !defined (__x86_64__)
|
||||
|
|
|
@ -26,16 +26,16 @@
|
|||
#include <grub/types.h>
|
||||
|
||||
/* Check if a loader is loaded. */
|
||||
int grub_loader_is_loaded (void);
|
||||
int EXPORT_FUNC (grub_loader_is_loaded) (void);
|
||||
|
||||
/* Set loader functions. NORETURN must be set to true, if BOOT won't return
|
||||
to the original state. */
|
||||
void grub_loader_set (grub_err_t (*boot) (void),
|
||||
grub_err_t (*unload) (void),
|
||||
int noreturn);
|
||||
void EXPORT_FUNC (grub_loader_set) (grub_err_t (*boot) (void),
|
||||
grub_err_t (*unload) (void),
|
||||
int noreturn);
|
||||
|
||||
/* Unset current loader, if any. */
|
||||
void grub_loader_unset (void);
|
||||
void EXPORT_FUNC (grub_loader_unset) (void);
|
||||
|
||||
/* Call the boot hook in current loader. This may or may not return,
|
||||
depending on the setting by grub_loader_set. */
|
||||
|
@ -56,7 +56,7 @@ typedef enum {
|
|||
} grub_loader_preboot_hook_prio_t;
|
||||
|
||||
/* Register a preboot hook. */
|
||||
void *grub_loader_register_preboot_hook (grub_err_t (*preboot_func) (int noret),
|
||||
void *EXPORT_FUNC(grub_loader_register_preboot_hook) (grub_err_t (*preboot_func) (int noret),
|
||||
grub_err_t (*preboot_rest_func) (void),
|
||||
grub_loader_preboot_hook_prio_t prio);
|
||||
|
||||
|
|
|
@ -22,11 +22,32 @@
|
|||
|
||||
#include <grub/types.h>
|
||||
#include <grub/err.h>
|
||||
#include <grub/machine/memory.h>
|
||||
|
||||
grub_err_t grub_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t,
|
||||
grub_uint64_t,
|
||||
grub_uint32_t));
|
||||
typedef enum grub_memory_type
|
||||
{
|
||||
GRUB_MEMORY_AVAILABLE = 1,
|
||||
GRUB_MEMORY_RESERVED = 2,
|
||||
GRUB_MEMORY_ACPI = 3,
|
||||
GRUB_MEMORY_NVS = 4,
|
||||
GRUB_MEMORY_BADRAM = 5,
|
||||
GRUB_MEMORY_CODE = 20,
|
||||
/* This one is special: it's used internally but is never reported
|
||||
by firmware. */
|
||||
GRUB_MEMORY_HOLE = 21
|
||||
} grub_memory_type_t;
|
||||
|
||||
typedef int NESTED_FUNC_ATTR (*grub_memory_hook_t) (grub_uint64_t,
|
||||
grub_uint64_t,
|
||||
grub_memory_type_t);
|
||||
|
||||
grub_err_t grub_mmap_iterate (grub_memory_hook_t hook);
|
||||
|
||||
#if !defined (GRUB_MACHINE_EMU) && !defined (GRUB_MACHINE_EFI)
|
||||
grub_err_t EXPORT_FUNC(grub_machine_mmap_iterate) (grub_memory_hook_t hook);
|
||||
#else
|
||||
grub_err_t grub_machine_mmap_iterate (grub_memory_hook_t hook);
|
||||
#endif
|
||||
|
||||
int grub_mmap_register (grub_uint64_t start, grub_uint64_t size, int type);
|
||||
grub_err_t grub_mmap_unregister (int handle);
|
||||
|
||||
|
@ -42,7 +63,7 @@ struct grub_mmap_region
|
|||
struct grub_mmap_region *next;
|
||||
grub_uint64_t start;
|
||||
grub_uint64_t end;
|
||||
int type;
|
||||
grub_memory_type_t type;
|
||||
int handle;
|
||||
};
|
||||
|
||||
|
|
|
@ -47,6 +47,10 @@ struct grub_menu_entry
|
|||
/* The sourcecode of the menu entry, used by the editor. */
|
||||
const char *sourcecode;
|
||||
|
||||
/* Parameters to be passed to menu definition. */
|
||||
int argc;
|
||||
char **args;
|
||||
|
||||
int hotkey;
|
||||
|
||||
/* The next element. */
|
||||
|
@ -96,4 +100,7 @@ void grub_menu_execute_with_fallback (grub_menu_t menu,
|
|||
void grub_menu_entry_run (grub_menu_entry_t entry);
|
||||
int grub_menu_get_default_entry_index (grub_menu_t menu);
|
||||
|
||||
void grub_menu_init (void);
|
||||
void grub_menu_fini (void);
|
||||
|
||||
#endif /* GRUB_MENU_HEADER */
|
||||
|
|
|
@ -28,8 +28,6 @@
|
|||
#define GRUB_MACHINE_MEMORY_STACK_HIGH 0x80f00000
|
||||
#define GRUB_MACHINE_MEMORY_USABLE 0x81000000
|
||||
|
||||
#define GRUB_MACHINE_MEMORY_AVAILABLE 1
|
||||
|
||||
#ifndef ASM_FILE
|
||||
grub_err_t EXPORT_FUNC (grub_machine_mmap_iterate)
|
||||
(int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, grub_uint64_t, grub_uint32_t));
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
#ifdef GRUB_MACHINE_EMU
|
||||
static inline void
|
||||
grub_cpu_idle(void)
|
||||
{
|
||||
}
|
||||
#endif
|
|
@ -31,13 +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
|
||||
by firmware. */
|
||||
#define GRUB_MACHINE_MEMORY_HOLE 2
|
||||
#define GRUB_MACHINE_MEMORY_RESERVED GRUB_MACHINE_MEMORY_HOLE
|
||||
|
||||
#ifndef ASM_FILE
|
||||
|
||||
typedef grub_addr_t grub_phys_addr_t;
|
||||
|
|
|
@ -270,11 +270,11 @@ void EXPORT_FUNC(grub_abort) (void) __attribute__ ((noreturn));
|
|||
grub_uint64_t EXPORT_FUNC(grub_divmod64) (grub_uint64_t n,
|
||||
grub_uint32_t d, grub_uint32_t *r);
|
||||
|
||||
#if defined(NEED_ENABLE_EXECUTE_STACK) && !defined(GRUB_UTIL)
|
||||
#if NEED_ENABLE_EXECUTE_STACK && !defined(GRUB_UTIL)
|
||||
void EXPORT_FUNC(__enable_execute_stack) (void *addr);
|
||||
#endif
|
||||
|
||||
#if defined (NEED_REGISTER_FRAME_INFO) && !defined(GRUB_UTIL)
|
||||
#if NEED_REGISTER_FRAME_INFO && !defined(GRUB_UTIL)
|
||||
void EXPORT_FUNC (__register_frame_info) (void);
|
||||
void EXPORT_FUNC (__deregister_frame_info) (void);
|
||||
#endif
|
||||
|
|
|
@ -54,8 +54,6 @@ void grub_normal_execute (const char *config, int nested, int batch);
|
|||
void grub_menu_init_page (int nested, int edit,
|
||||
struct grub_term_output *term);
|
||||
void grub_normal_init_page (struct grub_term_output *term);
|
||||
grub_err_t grub_normal_add_menu_entry (int argc, const char **args,
|
||||
const char *sourcecode);
|
||||
char *grub_file_getline (grub_file_t file);
|
||||
void grub_cmdline_run (int nested);
|
||||
|
||||
|
@ -117,4 +115,15 @@ void grub_normal_reset_more (void);
|
|||
|
||||
void grub_xputs_normal (const char *str);
|
||||
|
||||
grub_err_t
|
||||
grub_normal_add_menu_entry (int argc, const char **args, char **classes,
|
||||
const char *users, const char *hotkey,
|
||||
const char *prefix, const char *sourcecode);
|
||||
|
||||
grub_err_t
|
||||
grub_normal_set_password (const char *user, const char *password);
|
||||
|
||||
void grub_normal_auth_init (void);
|
||||
void grub_normal_auth_fini (void);
|
||||
|
||||
#endif /* ! GRUB_NORMAL_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,29 +108,29 @@
|
|||
#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_DATA_END GRUB_KERNEL_I386_COREBOOT_DATA_END
|
||||
#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
|
||||
|
@ -147,22 +150,22 @@
|
|||
rewrite grub-mkimage to generate valid ELF files. */
|
||||
#define GRUB_KERNEL_POWERPC_IEEE1275_MOD_GAP 0x8000
|
||||
|
||||
#ifdef MACHINE
|
||||
#ifdef GRUB_MACHINE
|
||||
#define GRUB_OFFSETS_CONCAT_(a,b,c) a ## b ## c
|
||||
#define GRUB_OFFSETS_CONCAT(a,b,c) GRUB_OFFSETS_CONCAT_(a,b,c)
|
||||
#define GRUB_KERNEL_MACHINE_MOD_ALIGN GRUB_OFFSETS_CONCAT (GRUB_KERNEL_, MACHINE, _MOD_ALIGN)
|
||||
#define GRUB_KERNEL_MACHINE_MOD_GAP GRUB_OFFSETS_CONCAT (GRUB_KERNEL_, MACHINE, _MOD_GAP)
|
||||
#define GRUB_KERNEL_MACHINE_TOTAL_MODULE_SIZE GRUB_OFFSETS_CONCAT (GRUB_KERNEL_, MACHINE, _TOTAL_MODULE_SIZE)
|
||||
#define GRUB_KERNEL_MACHINE_KERNEL_IMAGE_SIZE GRUB_OFFSETS_CONCAT (GRUB_KERNEL_, MACHINE, _KERNEL_IMAGE_SIZE)
|
||||
#define GRUB_KERNEL_MACHINE_COMPRESSED_SIZE GRUB_OFFSETS_CONCAT (GRUB_KERNEL_, MACHINE, _COMPRESSED_SIZE)
|
||||
#define GRUB_KERNEL_MACHINE_MOD_ALIGN GRUB_OFFSETS_CONCAT (GRUB_KERNEL_, GRUB_MACHINE, _MOD_ALIGN)
|
||||
#define GRUB_KERNEL_MACHINE_MOD_GAP GRUB_OFFSETS_CONCAT (GRUB_KERNEL_, GRUB_MACHINE, _MOD_GAP)
|
||||
#define GRUB_KERNEL_MACHINE_TOTAL_MODULE_SIZE GRUB_OFFSETS_CONCAT (GRUB_KERNEL_, GRUB_MACHINE, _TOTAL_MODULE_SIZE)
|
||||
#define GRUB_KERNEL_MACHINE_KERNEL_IMAGE_SIZE GRUB_OFFSETS_CONCAT (GRUB_KERNEL_, GRUB_MACHINE, _KERNEL_IMAGE_SIZE)
|
||||
#define GRUB_KERNEL_MACHINE_COMPRESSED_SIZE GRUB_OFFSETS_CONCAT (GRUB_KERNEL_, GRUB_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_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)
|
||||
#define GRUB_KERNEL_MACHINE_INSTALL_BSD_PART GRUB_OFFSETS_CONCAT (GRUB_KERNEL_, MACHINE, _INSTALL_BSD_PART)
|
||||
#define GRUB_KERNEL_MACHINE_INSTALL_DOS_PART GRUB_OFFSETS_CONCAT (GRUB_KERNEL_, MACHINE, _INSTALL_DOS_PART)
|
||||
#define GRUB_KERNEL_MACHINE_PREFIX GRUB_OFFSETS_CONCAT (GRUB_KERNEL_, GRUB_MACHINE, _PREFIX)
|
||||
#define GRUB_KERNEL_MACHINE_PREFIX_END GRUB_OFFSETS_CONCAT (GRUB_KERNEL_, GRUB_MACHINE, _PREFIX_END)
|
||||
#define GRUB_BOOT_MACHINE_KERNEL_SEG GRUB_OFFSETS_CONCAT (GRUB_BOOT_, GRUB_MACHINE, _KERNEL_SEG)
|
||||
#define GRUB_MEMORY_MACHINE_UPPER GRUB_OFFSETS_CONCAT (GRUB_MEMORY_, GRUB_MACHINE, _UPPER)
|
||||
#define GRUB_KERNEL_MACHINE_RAW_SIZE GRUB_OFFSETS_CONCAT (GRUB_KERNEL_, GRUB_MACHINE, _RAW_SIZE)
|
||||
#define GRUB_KERNEL_MACHINE_INSTALL_BSD_PART GRUB_OFFSETS_CONCAT (GRUB_KERNEL_, GRUB_MACHINE, _INSTALL_BSD_PART)
|
||||
#define GRUB_KERNEL_MACHINE_INSTALL_DOS_PART GRUB_OFFSETS_CONCAT (GRUB_KERNEL_, GRUB_MACHINE, _INSTALL_DOS_PART)
|
||||
#endif
|
||||
|
||||
#ifndef ASM_FILE
|
||||
|
|
|
@ -26,6 +26,13 @@ struct grub_disk;
|
|||
|
||||
typedef struct grub_partition *grub_partition_t;
|
||||
|
||||
#ifdef GRUB_UTIL
|
||||
typedef enum
|
||||
{
|
||||
GRUB_EMBED_PCBIOS
|
||||
} grub_embed_type_t;
|
||||
#endif
|
||||
|
||||
/* Partition map type. */
|
||||
struct grub_partition_map
|
||||
{
|
||||
|
@ -39,6 +46,11 @@ struct grub_partition_map
|
|||
grub_err_t (*iterate) (struct grub_disk *disk,
|
||||
int (*hook) (struct grub_disk *disk,
|
||||
const grub_partition_t partition));
|
||||
#ifdef GRUB_UTIL
|
||||
/* Determine sectors available for embedding. */
|
||||
grub_err_t (*embed) (struct grub_disk *disk, unsigned int nsectors,
|
||||
grub_embed_type_t embed_type, grub_disk_addr_t *sectors);
|
||||
#endif
|
||||
};
|
||||
typedef struct grub_partition_map *grub_partition_map_t;
|
||||
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 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_MEMORY_MACHINE_HEADER
|
||||
#define GRUB_MEMORY_MACHINE_HEADER 1
|
||||
|
||||
#include <grub/ieee1275/ieee1275.h>
|
||||
|
||||
#define GRUB_MACHINE_MEMORY_AVAILABLE 1
|
||||
|
||||
#endif
|
|
@ -40,8 +40,13 @@ struct grub_script_cmd
|
|||
|
||||
struct grub_script
|
||||
{
|
||||
unsigned refcnt;
|
||||
struct grub_script_mem *mem;
|
||||
struct grub_script_cmd *cmd;
|
||||
|
||||
/* grub_scripts from block arguments. */
|
||||
struct grub_script *next_siblings;
|
||||
struct grub_script *children;
|
||||
};
|
||||
|
||||
typedef enum
|
||||
|
@ -50,7 +55,8 @@ typedef enum
|
|||
GRUB_SCRIPT_ARG_TYPE_TEXT,
|
||||
GRUB_SCRIPT_ARG_TYPE_DQVAR,
|
||||
GRUB_SCRIPT_ARG_TYPE_DQSTR,
|
||||
GRUB_SCRIPT_ARG_TYPE_SQSTR
|
||||
GRUB_SCRIPT_ARG_TYPE_SQSTR,
|
||||
GRUB_SCRIPT_ARG_TYPE_BLOCK
|
||||
} grub_script_arg_type_t;
|
||||
|
||||
/* A part of an argument. */
|
||||
|
@ -60,6 +66,9 @@ struct grub_script_arg
|
|||
|
||||
char *str;
|
||||
|
||||
/* Parsed block argument. */
|
||||
struct grub_script *script;
|
||||
|
||||
/* Next argument part. */
|
||||
struct grub_script_arg *next;
|
||||
};
|
||||
|
@ -69,8 +78,19 @@ struct grub_script_argv
|
|||
{
|
||||
unsigned argc;
|
||||
char **args;
|
||||
struct grub_script *script;
|
||||
};
|
||||
|
||||
/* Pluggable wildcard translator. */
|
||||
struct grub_script_wildcard_translator
|
||||
{
|
||||
char *(*escape) (const char *str);
|
||||
char *(*unescape) (const char *str);
|
||||
grub_err_t (*expand) (const char *str, char ***expansions);
|
||||
};
|
||||
extern struct grub_script_wildcard_translator *grub_wildcard_translator;
|
||||
extern struct grub_script_wildcard_translator grub_filename_translator;
|
||||
|
||||
/* A complete argument. It consists of a list of one or more `struct
|
||||
grub_script_arg's. */
|
||||
struct grub_script_arglist
|
||||
|
@ -135,21 +155,6 @@ struct grub_script_cmdwhile
|
|||
int until;
|
||||
};
|
||||
|
||||
/* A menu entry generate statement. */
|
||||
struct grub_script_cmd_menuentry
|
||||
{
|
||||
struct grub_script_cmd cmd;
|
||||
|
||||
/* The arguments for this menu entry. */
|
||||
struct grub_script_arglist *arglist;
|
||||
|
||||
/* The sourcecode the entry will be generated from. */
|
||||
const char *sourcecode;
|
||||
|
||||
/* Options. XXX: Not used yet. */
|
||||
int options;
|
||||
};
|
||||
|
||||
/* State of the lexer as passed to the lexer. */
|
||||
struct grub_lexer_param
|
||||
{
|
||||
|
@ -194,6 +199,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;
|
||||
|
||||
|
@ -217,6 +228,9 @@ struct grub_parser_param
|
|||
/* The memory that was used while parsing and scanning. */
|
||||
struct grub_script_mem *memused;
|
||||
|
||||
/* The block argument scripts. */
|
||||
struct grub_script *scripts;
|
||||
|
||||
/* The result of the parser. */
|
||||
struct grub_script_cmd *parsed;
|
||||
|
||||
|
@ -226,7 +240,10 @@ struct grub_parser_param
|
|||
void grub_script_init (void);
|
||||
void grub_script_fini (void);
|
||||
|
||||
void grub_script_mem_free (struct grub_script_mem *mem);
|
||||
|
||||
void grub_script_argv_free (struct grub_script_argv *argv);
|
||||
int grub_script_argv_make (struct grub_script_argv *argv, int argc, char **args);
|
||||
int grub_script_argv_next (struct grub_script_argv *argv);
|
||||
int grub_script_argv_append (struct grub_script_argv *argv, const char *s);
|
||||
int grub_script_argv_split_append (struct grub_script_argv *argv, char *s);
|
||||
|
@ -260,12 +277,6 @@ grub_script_create_cmdwhile (struct grub_parser_param *state,
|
|||
struct grub_script_cmd *list,
|
||||
int is_an_until_loop);
|
||||
|
||||
struct grub_script_cmd *
|
||||
grub_script_create_cmdmenu (struct grub_parser_param *state,
|
||||
struct grub_script_arglist *arglist,
|
||||
char *sourcecode,
|
||||
int options);
|
||||
|
||||
struct grub_script_cmd *
|
||||
grub_script_append_cmd (struct grub_parser_param *state,
|
||||
struct grub_script_cmd *list,
|
||||
|
@ -287,9 +298,9 @@ struct grub_lexer_param *grub_script_lexer_init (struct grub_parser_param *parse
|
|||
void grub_script_lexer_fini (struct grub_lexer_param *);
|
||||
void grub_script_lexer_ref (struct grub_lexer_param *);
|
||||
void grub_script_lexer_deref (struct grub_lexer_param *);
|
||||
void grub_script_lexer_record_start (struct grub_parser_param *);
|
||||
char *grub_script_lexer_record_stop (struct grub_parser_param *);
|
||||
int grub_script_lexer_yywrap (struct grub_parser_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 *, const char *input);
|
||||
void grub_script_lexer_record (struct grub_parser_param *, char *);
|
||||
|
||||
/* Functions to track allocated memory. */
|
||||
|
@ -310,10 +321,10 @@ grub_err_t grub_script_execute_cmdlist (struct grub_script_cmd *cmd);
|
|||
grub_err_t grub_script_execute_cmdif (struct grub_script_cmd *cmd);
|
||||
grub_err_t grub_script_execute_cmdfor (struct grub_script_cmd *cmd);
|
||||
grub_err_t grub_script_execute_cmdwhile (struct grub_script_cmd *cmd);
|
||||
grub_err_t grub_script_execute_menuentry (struct grub_script_cmd *cmd);
|
||||
|
||||
/* Execute any GRUB pre-parsed command or script. */
|
||||
grub_err_t grub_script_execute (struct grub_script *script);
|
||||
grub_err_t grub_script_execute_sourcecode (const char *source, int argc, char **args);
|
||||
|
||||
/* Break command for loops. */
|
||||
grub_err_t grub_script_break (grub_command_t cmd, int argc, char *argv[]);
|
||||
|
@ -321,6 +332,12 @@ grub_err_t grub_script_break (grub_command_t cmd, int argc, char *argv[]);
|
|||
/* SHIFT command for GRUB script. */
|
||||
grub_err_t grub_script_shift (grub_command_t cmd, int argc, char *argv[]);
|
||||
|
||||
/* SETPARAMS command for GRUB script functions. */
|
||||
grub_err_t grub_script_setparams (grub_command_t cmd, int argc, char *argv[]);
|
||||
|
||||
/* RETURN command for functions. */
|
||||
grub_err_t grub_script_return (grub_command_t cmd, int argc, char *argv[]);
|
||||
|
||||
/* This variable points to the parsed command. This is used to
|
||||
communicate with the bison code. */
|
||||
extern struct grub_script_cmd *grub_script_parsed;
|
||||
|
@ -365,4 +382,24 @@ grub_script_execute_arglist_to_argv (struct grub_script_arglist *arglist, int *c
|
|||
grub_err_t
|
||||
grub_normal_parse_line (char *line, grub_reader_getline_t getline);
|
||||
|
||||
static inline struct grub_script *
|
||||
grub_script_ref (struct grub_script *script)
|
||||
{
|
||||
if (script)
|
||||
script->refcnt++;
|
||||
return script;
|
||||
}
|
||||
|
||||
static inline void
|
||||
grub_script_unref (struct grub_script *script)
|
||||
{
|
||||
if (! script)
|
||||
return;
|
||||
|
||||
if (script->refcnt == 0)
|
||||
grub_script_free (script);
|
||||
else
|
||||
script->refcnt--;
|
||||
}
|
||||
|
||||
#endif /* ! GRUB_NORMAL_PARSER_HEADER */
|
||||
|
|
|
@ -19,8 +19,11 @@
|
|||
#ifndef GRUB_SEARCH_HEADER
|
||||
#define GRUB_SEARCH_HEADER 1
|
||||
|
||||
void grub_search_fs_file (const char *key, const char *var, int no_floppy);
|
||||
void grub_search_fs_uuid (const char *key, const char *var, int no_floppy);
|
||||
void grub_search_label (const char *key, const char *var, int no_floppy);
|
||||
void grub_search_fs_file (const char *key, const char *var, int no_floppy,
|
||||
char **hints, unsigned nhints);
|
||||
void grub_search_fs_uuid (const char *key, const char *var, int no_floppy,
|
||||
char **hints, unsigned nhints);
|
||||
void grub_search_label (const char *key, const char *var, int no_floppy,
|
||||
char **hints, unsigned nhints);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -52,4 +52,13 @@
|
|||
|
||||
#define GRUB_BOOT_MACHINE_KERNEL_ADDR 0x4200
|
||||
|
||||
#ifndef ASM_FILE
|
||||
/* This is the blocklist used in the diskboot image. */
|
||||
struct grub_boot_blocklist
|
||||
{
|
||||
grub_uint64_t start;
|
||||
grub_uint32_t len;
|
||||
} __attribute__ ((packed));
|
||||
#endif
|
||||
|
||||
#endif /* ! BOOT_MACHINE_HEADER */
|
||||
|
|
|
@ -1,26 +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_MEMORY_MACHINE_HEADER
|
||||
#define GRUB_MEMORY_MACHINE_HEADER 1
|
||||
|
||||
#include <grub/ieee1275/ieee1275.h>
|
||||
|
||||
#define GRUB_MACHINE_MEMORY_AVAILABLE 1
|
||||
|
||||
#endif
|
|
@ -25,7 +25,7 @@
|
|||
#define LOCAL(sym) L_ ## sym
|
||||
|
||||
/* Add an underscore to a C symbol in assembler code if needed. */
|
||||
#ifdef HAVE_ASM_USCORE
|
||||
#if HAVE_ASM_USCORE
|
||||
# define EXT_C(sym) _ ## sym
|
||||
#else
|
||||
# define EXT_C(sym) sym
|
||||
|
|
|
@ -19,19 +19,45 @@
|
|||
#ifndef GRUB_TERM_HEADER
|
||||
#define GRUB_TERM_HEADER 1
|
||||
|
||||
#define GRUB_TERM_NO_KEY 0
|
||||
|
||||
/* Internal codes used by GRUB to represent terminal input. */
|
||||
#define GRUB_TERM_LEFT 2
|
||||
#define GRUB_TERM_RIGHT 6
|
||||
#define GRUB_TERM_UP 16
|
||||
#define GRUB_TERM_DOWN 14
|
||||
#define GRUB_TERM_HOME 1
|
||||
#define GRUB_TERM_END 5
|
||||
#define GRUB_TERM_DC 4
|
||||
#define GRUB_TERM_PPAGE 7
|
||||
#define GRUB_TERM_NPAGE 3
|
||||
/* Only for keys otherwise not having shifted modification. */
|
||||
#define GRUB_TERM_SHIFT 0x01000000
|
||||
#define GRUB_TERM_CTRL 0x02000000
|
||||
#define GRUB_TERM_ALT 0x04000000
|
||||
|
||||
/* Keys without associated character. */
|
||||
#define GRUB_TERM_EXTENDED 0x00800000
|
||||
#define GRUB_TERM_KEY_MASK 0x00ffffff
|
||||
|
||||
#define GRUB_TERM_KEY_LEFT (GRUB_TERM_EXTENDED | 0x4b)
|
||||
#define GRUB_TERM_KEY_RIGHT (GRUB_TERM_EXTENDED | 0x4d)
|
||||
#define GRUB_TERM_KEY_UP (GRUB_TERM_EXTENDED | 0x48)
|
||||
#define GRUB_TERM_KEY_DOWN (GRUB_TERM_EXTENDED | 0x50)
|
||||
#define GRUB_TERM_KEY_HOME (GRUB_TERM_EXTENDED | 0x47)
|
||||
#define GRUB_TERM_KEY_END (GRUB_TERM_EXTENDED | 0x4f)
|
||||
#define GRUB_TERM_KEY_DC (GRUB_TERM_EXTENDED | 0x53)
|
||||
#define GRUB_TERM_KEY_PPAGE (GRUB_TERM_EXTENDED | 0x49)
|
||||
#define GRUB_TERM_KEY_NPAGE (GRUB_TERM_EXTENDED | 0x51)
|
||||
#define GRUB_TERM_KEY_F1 (GRUB_TERM_EXTENDED | 0x3b)
|
||||
#define GRUB_TERM_KEY_F2 (GRUB_TERM_EXTENDED | 0x3c)
|
||||
#define GRUB_TERM_KEY_F3 (GRUB_TERM_EXTENDED | 0x3d)
|
||||
#define GRUB_TERM_KEY_F4 (GRUB_TERM_EXTENDED | 0x3e)
|
||||
#define GRUB_TERM_KEY_F5 (GRUB_TERM_EXTENDED | 0x3f)
|
||||
#define GRUB_TERM_KEY_F6 (GRUB_TERM_EXTENDED | 0x40)
|
||||
#define GRUB_TERM_KEY_F7 (GRUB_TERM_EXTENDED | 0x41)
|
||||
#define GRUB_TERM_KEY_F8 (GRUB_TERM_EXTENDED | 0x42)
|
||||
#define GRUB_TERM_KEY_F9 (GRUB_TERM_EXTENDED | 0x43)
|
||||
#define GRUB_TERM_KEY_F10 (GRUB_TERM_EXTENDED | 0x44)
|
||||
#define GRUB_TERM_KEY_F11 (GRUB_TERM_EXTENDED | 0x57)
|
||||
#define GRUB_TERM_KEY_F12 (GRUB_TERM_EXTENDED | 0x58)
|
||||
#define GRUB_TERM_KEY_INSERT (GRUB_TERM_EXTENDED | 0x52)
|
||||
#define GRUB_TERM_KEY_CENTER (GRUB_TERM_EXTENDED | 0x4c)
|
||||
|
||||
#define GRUB_TERM_ESC '\e'
|
||||
#define GRUB_TERM_TAB '\t'
|
||||
#define GRUB_TERM_BACKSPACE 8
|
||||
#define GRUB_TERM_BACKSPACE '\b'
|
||||
|
||||
#ifndef ASM_FILE
|
||||
|
||||
|
@ -86,9 +112,15 @@ grub_term_color_state;
|
|||
|
||||
|
||||
/* Bitmasks for modifier keys returned by grub_getkeystatus. */
|
||||
#define GRUB_TERM_STATUS_SHIFT (1 << 0)
|
||||
#define GRUB_TERM_STATUS_CTRL (1 << 1)
|
||||
#define GRUB_TERM_STATUS_ALT (1 << 2)
|
||||
#define GRUB_TERM_STATUS_RSHIFT (1 << 0)
|
||||
#define GRUB_TERM_STATUS_LSHIFT (1 << 1)
|
||||
#define GRUB_TERM_STATUS_RCTRL (1 << 2)
|
||||
#define GRUB_TERM_STATUS_RALT (1 << 3)
|
||||
#define GRUB_TERM_STATUS_SCROLL (1 << 4)
|
||||
#define GRUB_TERM_STATUS_NUM (1 << 5)
|
||||
#define GRUB_TERM_STATUS_CAPS (1 << 6)
|
||||
#define GRUB_TERM_STATUS_LCTRL (1 << 8)
|
||||
#define GRUB_TERM_STATUS_LALT (1 << 9)
|
||||
|
||||
/* Menu-related geometrical constants. */
|
||||
|
||||
|
@ -128,10 +160,7 @@ struct grub_term_input
|
|||
/* Clean up the terminal. */
|
||||
grub_err_t (*fini) (struct grub_term_input *term);
|
||||
|
||||
/* Check if any input character is available. */
|
||||
int (*checkkey) (struct grub_term_input *term);
|
||||
|
||||
/* Get a character. */
|
||||
/* Get a character if any input character is available. Otherwise return -1 */
|
||||
int (*getkey) (struct grub_term_input *term);
|
||||
|
||||
/* Get keyboard modifier status. */
|
||||
|
@ -279,7 +308,6 @@ grub_term_unregister_output (grub_term_output_t term)
|
|||
void grub_putcode (grub_uint32_t code, struct grub_term_output *term);
|
||||
int EXPORT_FUNC(grub_getkey) (void);
|
||||
int EXPORT_FUNC(grub_checkkey) (void);
|
||||
int EXPORT_FUNC(grub_getkeystatus) (void);
|
||||
void grub_cls (void);
|
||||
void EXPORT_FUNC(grub_refresh) (void);
|
||||
void grub_puts_terminal (const char *str, struct grub_term_output *term);
|
||||
|
@ -461,8 +489,8 @@ grub_print_spaces (struct grub_term_output *term, int number_spaces)
|
|||
|
||||
extern void (*EXPORT_VAR (grub_term_poll_usb)) (void);
|
||||
|
||||
/* For convenience. */
|
||||
#define GRUB_TERM_ASCII_CHAR(c) ((c) & 0xff)
|
||||
#define GRUB_TERM_REPEAT_PRE_INTERVAL 400
|
||||
#define GRUB_TERM_REPEAT_INTERVAL 50
|
||||
|
||||
#endif /* ! ASM_FILE */
|
||||
|
||||
|
|
|
@ -64,7 +64,6 @@ void EXPORT_FUNC (grub_terminfo_setcolorstate) (struct grub_term_output *term,
|
|||
const grub_term_color_state state);
|
||||
|
||||
|
||||
int EXPORT_FUNC (grub_terminfo_checkkey) (struct grub_term_input *term);
|
||||
grub_err_t EXPORT_FUNC (grub_terminfo_input_init) (struct grub_term_input *term);
|
||||
int EXPORT_FUNC (grub_terminfo_getkey) (struct grub_term_input *term);
|
||||
void EXPORT_FUNC (grub_terminfo_putchar) (struct grub_term_output *term,
|
||||
|
|
|
@ -101,8 +101,10 @@ typedef grub_int64_t grub_ssize_t;
|
|||
|
||||
# if GRUB_CPU_SIZEOF_LONG == 8
|
||||
# define PRIxGRUB_SIZE "lx"
|
||||
# define PRIuGRUB_SIZE "lu"
|
||||
# else
|
||||
# define PRIxGRUB_SIZE "llx"
|
||||
# define PRIuGRUB_SIZE "llu"
|
||||
# endif
|
||||
#else
|
||||
typedef grub_uint32_t grub_addr_t;
|
||||
|
@ -110,6 +112,7 @@ typedef grub_uint32_t grub_size_t;
|
|||
typedef grub_int32_t grub_ssize_t;
|
||||
|
||||
# define PRIxGRUB_SIZE "x"
|
||||
# define PRIuGRUB_SIZE "u"
|
||||
#endif
|
||||
|
||||
#if GRUB_CPU_SIZEOF_LONG == 8
|
||||
|
|
|
@ -30,6 +30,7 @@ typedef struct grub_usb_controller_dev *grub_usb_controller_dev_t;
|
|||
typedef enum
|
||||
{
|
||||
GRUB_USB_ERR_NONE,
|
||||
GRUB_USB_ERR_WAIT,
|
||||
GRUB_USB_ERR_INTERNAL,
|
||||
GRUB_USB_ERR_STALL,
|
||||
GRUB_USB_ERR_DATA,
|
||||
|
@ -48,14 +49,6 @@ typedef enum
|
|||
GRUB_USB_SPEED_HIGH
|
||||
} grub_usb_speed_t;
|
||||
|
||||
enum
|
||||
{
|
||||
GRUB_USB_REQTYPE_CLASS_INTERFACE_OUT = 0x21,
|
||||
GRUB_USB_REQTYPE_VENDOR_OUT = 0x40,
|
||||
GRUB_USB_REQTYPE_CLASS_INTERFACE_IN = 0xa1,
|
||||
GRUB_USB_REQTYPE_VENDOR_IN = 0xc0
|
||||
};
|
||||
|
||||
/* Call HOOK with each device, until HOOK returns non-zero. */
|
||||
int grub_usb_iterate (int (*hook) (grub_usb_device_t dev));
|
||||
|
||||
|
@ -97,6 +90,7 @@ grub_usb_err_t
|
|||
grub_usb_root_hub (grub_usb_controller_t controller);
|
||||
|
||||
|
||||
|
||||
/* XXX: All handled by libusb for now. */
|
||||
struct grub_usb_controller_dev
|
||||
{
|
||||
|
@ -105,9 +99,15 @@ struct grub_usb_controller_dev
|
|||
|
||||
int (*iterate) (int (*hook) (grub_usb_controller_t dev));
|
||||
|
||||
grub_usb_err_t (*transfer) (grub_usb_controller_t dev,
|
||||
grub_usb_transfer_t transfer,
|
||||
int timeout, grub_size_t *actual);
|
||||
grub_usb_err_t (*setup_transfer) (grub_usb_controller_t dev,
|
||||
grub_usb_transfer_t transfer);
|
||||
|
||||
grub_usb_err_t (*check_transfer) (grub_usb_controller_t dev,
|
||||
grub_usb_transfer_t transfer,
|
||||
grub_size_t *actual);
|
||||
|
||||
grub_usb_err_t (*cancel_transfer) (grub_usb_controller_t dev,
|
||||
grub_usb_transfer_t transfer);
|
||||
|
||||
int (*hubports) (grub_usb_controller_t dev);
|
||||
|
||||
|
@ -116,6 +116,9 @@ struct grub_usb_controller_dev
|
|||
|
||||
grub_usb_speed_t (*detect_dev) (grub_usb_controller_t dev, int port, int *changed);
|
||||
|
||||
/* Per controller flag - port reset pending, don't do another reset */
|
||||
grub_uint64_t pending_reset;
|
||||
|
||||
/* The next host controller. */
|
||||
struct grub_usb_controller_dev *next;
|
||||
};
|
||||
|
@ -181,11 +184,19 @@ struct grub_usb_device
|
|||
/* Used by libusb wrapper. Schedulded for removal. */
|
||||
void *data;
|
||||
|
||||
/* Hub information. */
|
||||
|
||||
/* Array of children for a hub. */
|
||||
grub_usb_device_t *children;
|
||||
|
||||
/* Number of hub ports. */
|
||||
unsigned nports;
|
||||
|
||||
grub_usb_transfer_t hub_transfer;
|
||||
|
||||
grub_uint32_t statuschange;
|
||||
|
||||
struct grub_usb_desc_endp *hub_endpoint;
|
||||
};
|
||||
|
||||
|
||||
|
@ -266,5 +277,12 @@ grub_usb_err_t
|
|||
grub_usb_bulk_read_extended (grub_usb_device_t dev,
|
||||
int endpoint, grub_size_t size, char *data,
|
||||
int timeout, grub_size_t *actual);
|
||||
grub_usb_transfer_t
|
||||
grub_usb_bulk_read_background (grub_usb_device_t dev,
|
||||
int endpoint, grub_size_t size, void *data);
|
||||
grub_usb_err_t
|
||||
grub_usb_check_transfer (grub_usb_transfer_t trans, grub_size_t *actual);
|
||||
void
|
||||
grub_usb_cancel_transfer (grub_usb_transfer_t trans);
|
||||
|
||||
#endif /* GRUB_USB_H */
|
||||
|
|
|
@ -56,51 +56,89 @@ struct grub_usb_transfer
|
|||
|
||||
grub_transaction_type_t type;
|
||||
|
||||
grub_transfer_type_t dir;
|
||||
|
||||
struct grub_usb_device *dev;
|
||||
|
||||
struct grub_usb_transaction *transactions;
|
||||
|
||||
int last_trans;
|
||||
/* Index of last processed transaction in OHCI/UHCI driver. */
|
||||
|
||||
void *controller_data;
|
||||
|
||||
/* Used when finishing transfer to copy data back. */
|
||||
struct grub_pci_dma_chunk *data_chunk;
|
||||
void *data;
|
||||
};
|
||||
typedef struct grub_usb_transfer *grub_usb_transfer_t;
|
||||
|
||||
|
||||
#define GRUB_USB_REQTYPE_IN (1 << 7)
|
||||
#define GRUB_USB_REQTYPE_OUT (0 << 7)
|
||||
#define GRUB_USB_REQTYPE_STANDARD (0 << 5)
|
||||
#define GRUB_USB_REQTYPE_CLASS (1 << 5)
|
||||
#define GRUB_USB_REQTYPE_VENDOR (2 << 5)
|
||||
#define GRUB_USB_REQTYPE_TARGET_DEV (0 << 0)
|
||||
#define GRUB_USB_REQTYPE_TARGET_INTERF (1 << 0)
|
||||
#define GRUB_USB_REQTYPE_TARGET_ENDP (2 << 0)
|
||||
#define GRUB_USB_REQTYPE_TARGET_OTHER (3 << 0)
|
||||
|
||||
#define GRUB_USB_REQ_GET_STATUS 0x00
|
||||
#define GRUB_USB_REQ_CLEAR_FEATURE 0x01
|
||||
#define GRUB_USB_REQ_SET_FEATURE 0x03
|
||||
#define GRUB_USB_REQ_SET_ADDRESS 0x05
|
||||
#define GRUB_USB_REQ_GET_DESCRIPTOR 0x06
|
||||
#define GRUB_USB_REQ_SET_DESCRIPTOR 0x07
|
||||
#define GRUB_USB_REQ_GET_CONFIGURATION 0x08
|
||||
#define GRUB_USB_REQ_SET_CONFIGURATION 0x09
|
||||
#define GRUB_USB_REQ_GET_INTERFACE 0x0A
|
||||
#define GRUB_USB_REQ_SET_INTERFACE 0x0B
|
||||
#define GRUB_USB_REQ_SYNC_FRAME 0x0C
|
||||
enum
|
||||
{
|
||||
GRUB_USB_REQTYPE_TARGET_DEV = (0 << 0),
|
||||
GRUB_USB_REQTYPE_TARGET_INTERF = (1 << 0),
|
||||
GRUB_USB_REQTYPE_TARGET_ENDP = (2 << 0),
|
||||
GRUB_USB_REQTYPE_TARGET_OTHER = (3 << 0),
|
||||
GRUB_USB_REQTYPE_STANDARD = (0 << 5),
|
||||
GRUB_USB_REQTYPE_CLASS = (1 << 5),
|
||||
GRUB_USB_REQTYPE_VENDOR = (2 << 5),
|
||||
GRUB_USB_REQTYPE_OUT = (0 << 7),
|
||||
GRUB_USB_REQTYPE_IN = (1 << 7),
|
||||
GRUB_USB_REQTYPE_CLASS_INTERFACE_OUT = GRUB_USB_REQTYPE_TARGET_INTERF
|
||||
| GRUB_USB_REQTYPE_CLASS | GRUB_USB_REQTYPE_OUT,
|
||||
GRUB_USB_REQTYPE_VENDOR_OUT = GRUB_USB_REQTYPE_VENDOR | GRUB_USB_REQTYPE_OUT,
|
||||
GRUB_USB_REQTYPE_CLASS_INTERFACE_IN = GRUB_USB_REQTYPE_TARGET_INTERF
|
||||
| GRUB_USB_REQTYPE_CLASS | GRUB_USB_REQTYPE_IN,
|
||||
GRUB_USB_REQTYPE_VENDOR_IN = GRUB_USB_REQTYPE_VENDOR | GRUB_USB_REQTYPE_IN
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
GRUB_USB_REQ_GET_STATUS = 0x00,
|
||||
GRUB_USB_REQ_CLEAR_FEATURE = 0x01,
|
||||
GRUB_USB_REQ_SET_FEATURE = 0x03,
|
||||
GRUB_USB_REQ_SET_ADDRESS = 0x05,
|
||||
GRUB_USB_REQ_GET_DESCRIPTOR = 0x06,
|
||||
GRUB_USB_REQ_SET_DESCRIPTOR = 0x07,
|
||||
GRUB_USB_REQ_GET_CONFIGURATION = 0x08,
|
||||
GRUB_USB_REQ_SET_CONFIGURATION = 0x09,
|
||||
GRUB_USB_REQ_GET_INTERFACE = 0x0A,
|
||||
GRUB_USB_REQ_SET_INTERFACE = 0x0B,
|
||||
GRUB_USB_REQ_SYNC_FRAME = 0x0C
|
||||
};
|
||||
|
||||
#define GRUB_USB_FEATURE_ENDP_HALT 0x00
|
||||
#define GRUB_USB_FEATURE_DEV_REMOTE_WU 0x01
|
||||
#define GRUB_USB_FEATURE_TEST_MODE 0x02
|
||||
|
||||
#define GRUB_USB_HUB_FEATURE_PORT_RESET 0x04
|
||||
#define GRUB_USB_HUB_FEATURE_PORT_POWER 0x08
|
||||
#define GRUB_USB_HUB_FEATURE_C_CONNECTED 0x10
|
||||
enum
|
||||
{
|
||||
GRUB_USB_HUB_FEATURE_PORT_RESET = 0x04,
|
||||
GRUB_USB_HUB_FEATURE_PORT_POWER = 0x08,
|
||||
GRUB_USB_HUB_FEATURE_C_PORT_CONNECTED = 0x10,
|
||||
GRUB_USB_HUB_FEATURE_C_PORT_ENABLED = 0x11,
|
||||
GRUB_USB_HUB_FEATURE_C_PORT_SUSPEND = 0x12,
|
||||
GRUB_USB_HUB_FEATURE_C_PORT_OVERCURRENT = 0x13,
|
||||
GRUB_USB_HUB_FEATURE_C_PORT_RESET = 0x14
|
||||
};
|
||||
|
||||
#define GRUB_USB_HUB_STATUS_CONNECTED (1 << 0)
|
||||
#define GRUB_USB_HUB_STATUS_LOWSPEED (1 << 9)
|
||||
#define GRUB_USB_HUB_STATUS_HIGHSPEED (1 << 10)
|
||||
#define GRUB_USB_HUB_STATUS_C_CONNECTED (1 << 16)
|
||||
#define GRUB_USB_HUB_STATUS_C_PORT_RESET (1 << 20)
|
||||
enum
|
||||
{
|
||||
GRUB_USB_HUB_STATUS_PORT_CONNECTED = (1 << 0),
|
||||
GRUB_USB_HUB_STATUS_PORT_ENABLED = (1 << 1),
|
||||
GRUB_USB_HUB_STATUS_PORT_SUSPEND = (1 << 2),
|
||||
GRUB_USB_HUB_STATUS_PORT_OVERCURRENT = (1 << 3),
|
||||
GRUB_USB_HUB_STATUS_PORT_POWERED = (1 << 8),
|
||||
GRUB_USB_HUB_STATUS_PORT_LOWSPEED = (1 << 9),
|
||||
GRUB_USB_HUB_STATUS_PORT_HIGHSPEED = (1 << 10),
|
||||
GRUB_USB_HUB_STATUS_C_PORT_CONNECTED = (1 << 16),
|
||||
GRUB_USB_HUB_STATUS_C_PORT_ENABLED = (1 << 17),
|
||||
GRUB_USB_HUB_STATUS_C_PORT_SUSPEND = (1 << 18),
|
||||
GRUB_USB_HUB_STATUS_C_PORT_OVERCURRENT = (1 << 19),
|
||||
GRUB_USB_HUB_STATUS_C_PORT_RESET = (1 << 20)
|
||||
};
|
||||
|
||||
struct grub_usb_packet_setup
|
||||
{
|
||||
|
|
|
@ -38,20 +38,33 @@ struct grub_video_bitmap;
|
|||
/* If following is set render target contains currenly displayed image
|
||||
after swapping buffers (otherwise it contains previously displayed image).
|
||||
*/
|
||||
#define GRUB_VIDEO_MODE_TYPE_UPDATING_SWAP 0x00000080
|
||||
#define GRUB_VIDEO_MODE_TYPE_PURE_TEXT 0x00000040
|
||||
#define GRUB_VIDEO_MODE_TYPE_ALPHA 0x00000020
|
||||
#define GRUB_VIDEO_MODE_TYPE_DOUBLE_BUFFERED 0x00000010
|
||||
#define GRUB_VIDEO_MODE_TYPE_1BIT_BITMAP 0x00000004
|
||||
#define GRUB_VIDEO_MODE_TYPE_INDEX_COLOR 0x00000002
|
||||
#define GRUB_VIDEO_MODE_TYPE_RGB 0x00000001
|
||||
typedef enum grub_video_mode_type
|
||||
{
|
||||
GRUB_VIDEO_MODE_TYPE_RGB = 0x00000001,
|
||||
GRUB_VIDEO_MODE_TYPE_INDEX_COLOR = 0x00000002,
|
||||
GRUB_VIDEO_MODE_TYPE_1BIT_BITMAP = 0x00000004,
|
||||
GRUB_VIDEO_MODE_TYPE_YUV = 0x00000008,
|
||||
|
||||
/* Defines used to mask flags. */
|
||||
#define GRUB_VIDEO_MODE_TYPE_COLOR_MASK 0x0000000F
|
||||
/* Defines used to mask flags. */
|
||||
GRUB_VIDEO_MODE_TYPE_COLOR_MASK = 0x0000000F,
|
||||
|
||||
/* Defines used to specify requested bit depth. */
|
||||
#define GRUB_VIDEO_MODE_TYPE_DEPTH_MASK 0x0000ff00
|
||||
#define GRUB_VIDEO_MODE_TYPE_DEPTH_POS 8
|
||||
GRUB_VIDEO_MODE_TYPE_DOUBLE_BUFFERED = 0x00000010,
|
||||
GRUB_VIDEO_MODE_TYPE_ALPHA = 0x00000020,
|
||||
GRUB_VIDEO_MODE_TYPE_PURE_TEXT = 0x00000040,
|
||||
GRUB_VIDEO_MODE_TYPE_UPDATING_SWAP = 0x00000080,
|
||||
GRUB_VIDEO_MODE_TYPE_OPERATIONAL_MASK = 0x000000F0,
|
||||
|
||||
/* Defines used to specify requested bit depth. */
|
||||
GRUB_VIDEO_MODE_TYPE_DEPTH_MASK = 0x0000FF00,
|
||||
#define GRUB_VIDEO_MODE_TYPE_DEPTH_POS 8
|
||||
|
||||
GRUB_VIDEO_MODE_TYPE_UNKNOWN = 0x00010000,
|
||||
GRUB_VIDEO_MODE_TYPE_HERCULES = 0x00020000,
|
||||
GRUB_VIDEO_MODE_TYPE_PLANAR = 0x00040000,
|
||||
GRUB_VIDEO_MODE_TYPE_NONCHAIN4 = 0x00080000,
|
||||
GRUB_VIDEO_MODE_TYPE_CGA = 0x00100000,
|
||||
GRUB_VIDEO_MODE_TYPE_INFO_MASK = 0x00FF0000,
|
||||
} grub_video_mode_type_t;
|
||||
|
||||
/* The basic render target representing the whole display. This always
|
||||
renders to the back buffer when double-buffering is in use. */
|
||||
|
@ -103,7 +116,7 @@ struct grub_video_mode_info
|
|||
|
||||
/* Mode type bitmask. Contains information like is it Index color or
|
||||
RGB mode. */
|
||||
unsigned int mode_type;
|
||||
grub_video_mode_type_t mode_type;
|
||||
|
||||
/* Bits per pixel. */
|
||||
unsigned int bpp;
|
||||
|
@ -117,6 +130,9 @@ struct grub_video_mode_info
|
|||
/* In index color mode, number of colors. In RGB mode this is 256. */
|
||||
unsigned int number_of_colors;
|
||||
|
||||
unsigned int mode_number;
|
||||
#define GRUB_VIDEO_MODE_NUMBER_INVALID 0xffffffff
|
||||
|
||||
/* Optimization hint how binary data is coded. */
|
||||
enum grub_video_blit_format blit_format;
|
||||
|
||||
|
@ -225,7 +241,8 @@ struct grub_video_adapter
|
|||
grub_err_t (*fini) (void);
|
||||
|
||||
grub_err_t (*setup) (unsigned int width, unsigned int height,
|
||||
unsigned int mode_type, unsigned int mode_mask);
|
||||
grub_video_mode_type_t mode_type,
|
||||
grub_video_mode_type_t mode_mask);
|
||||
|
||||
grub_err_t (*get_info) (struct grub_video_mode_info *mode_info);
|
||||
|
||||
|
@ -282,6 +299,10 @@ struct grub_video_adapter
|
|||
grub_err_t (*set_active_render_target) (struct grub_video_render_target *target);
|
||||
|
||||
grub_err_t (*get_active_render_target) (struct grub_video_render_target **target);
|
||||
|
||||
int (*iterate) (int (*hook) (const struct grub_video_mode_info *info));
|
||||
|
||||
void (*print_adapter_specific_info) (void);
|
||||
};
|
||||
typedef struct grub_video_adapter *grub_video_adapter_t;
|
||||
|
||||
|
@ -398,8 +419,9 @@ grub_err_t EXPORT_FUNC (grub_video_set_mode) (const char *modestring,
|
|||
unsigned int modevalue);
|
||||
|
||||
static inline int
|
||||
grub_video_check_mode_flag (unsigned int flags, unsigned int mask,
|
||||
unsigned int flag, int def)
|
||||
grub_video_check_mode_flag (grub_video_mode_type_t flags,
|
||||
grub_video_mode_type_t mask,
|
||||
grub_video_mode_type_t flag, int def)
|
||||
{
|
||||
return (flag & mask) ? !! (flags & flag) : def;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue