merge mainline into legacy_parser

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2010-09-15 11:43:59 +02:00
commit 0cb2f2813f
124 changed files with 3369 additions and 1991 deletions

View file

@ -23,22 +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
/* This command accepts block arguments. */
#define GRUB_COMMAND_FLAG_BLOCKS 0x40
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;
@ -61,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;

View file

@ -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;

View file

@ -109,6 +109,109 @@
{ 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
}
#define GRUB_EFI_SAL_TABLE_GUID \
{ 0xeb9d2d32, 0x2d88, 0x11d3, \
{ 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
}
#define GRUB_EFI_HCDP_TABLE_GUID \
{ 0xf951938d, 0x620b, 0x42ef, \
{ 0x82, 0x79, 0xa8, 0x4b, 0x79, 0x61, 0x78, 0x98 } \
}
struct grub_efi_sal_system_table
{
grub_uint32_t signature;
grub_uint32_t total_table_len;
grub_uint16_t sal_rev;
grub_uint16_t entry_count;
grub_uint8_t checksum;
grub_uint8_t reserved1[7];
grub_uint16_t sal_a_version;
grub_uint16_t sal_b_version;
grub_uint8_t oem_id[32];
grub_uint8_t product_id[32];
grub_uint8_t reserved2[8];
grub_uint8_t entries[0];
};
enum
{
GRUB_EFI_SAL_SYSTEM_TABLE_TYPE_ENTRYPOINT_DESCRIPTOR = 0,
GRUB_EFI_SAL_SYSTEM_TABLE_TYPE_MEMORY_DESCRIPTOR = 1,
GRUB_EFI_SAL_SYSTEM_TABLE_TYPE_PLATFORM_FEATURES = 2,
GRUB_EFI_SAL_SYSTEM_TABLE_TYPE_TRANSLATION_REGISTER_DESCRIPTOR = 3,
GRUB_EFI_SAL_SYSTEM_TABLE_TYPE_PURGE_TRANSLATION_COHERENCE = 4,
GRUB_EFI_SAL_SYSTEM_TABLE_TYPE_AP_WAKEUP = 5
};
struct grub_efi_sal_system_table_entrypoint_descriptor
{
grub_uint8_t type;
grub_uint8_t pad[7];
grub_uint64_t pal_proc_addr;
grub_uint64_t sal_proc_addr;
grub_uint64_t global_data_ptr;
grub_uint64_t reserved[2];
};
struct grub_efi_sal_system_table_memory_descriptor
{
grub_uint8_t type;
grub_uint8_t sal_used;
grub_uint8_t attr;
grub_uint8_t ar;
grub_uint8_t attr_mask;
grub_uint8_t mem_type;
grub_uint8_t usage;
grub_uint8_t unknown;
grub_uint64_t addr;
grub_uint64_t len;
grub_uint64_t unknown2;
};
struct grub_efi_sal_system_table_platform_features
{
grub_uint8_t type;
grub_uint8_t flags;
grub_uint8_t reserved[14];
};
struct grub_efi_sal_system_table_translation_register_descriptor
{
grub_uint8_t type;
grub_uint8_t register_type;
grub_uint8_t register_number;
grub_uint8_t reserved[5];
grub_uint64_t addr;
grub_uint64_t page_size;
grub_uint64_t reserver;
};
struct grub_efi_sal_system_table_purge_translation_coherence
{
grub_uint8_t type;
grub_uint8_t reserved[3];
grub_uint32_t ndomains;
grub_uint64_t coherence;
};
struct grub_efi_sal_system_table_ap_wakeup
{
grub_uint8_t type;
grub_uint8_t mechanism;
grub_uint8_t reserved[6];
grub_uint64_t vector;
};
enum
{
GRUB_EFI_SAL_SYSTEM_TABLE_PLATFORM_FEATURE_BUSLOCK = 1,
GRUB_EFI_SAL_SYSTEM_TABLE_PLATFORM_FEATURE_IRQREDIRECT = 2,
GRUB_EFI_SAL_SYSTEM_TABLE_PLATFORM_FEATURE_IPIREDIRECT = 4,
GRUB_EFI_SAL_SYSTEM_TABLE_PLATFORM_FEATURE_ITCDRIFT = 8,
};
/* Enumerations. */
enum grub_efi_timer_delay
{

View file

@ -26,5 +26,6 @@ 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);
#endif /* ! GRUB_BIOSDISK_MACHINE_UTIL_HEADER */

View file

@ -57,14 +57,14 @@ 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,
unsigned flags,
grub_command_flags_t flags,
const char *summary,
const char *description,
const struct grub_arg_option *parser,

View file

@ -1,30 +0,0 @@
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2002,2004,2005,2007,2008 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GRUB is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GRUB_INIT_MACHINE_HEADER
#define GRUB_INIT_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);
#endif /* ! GRUB_INIT_MACHINE_HEADER */

View file

@ -190,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 */

View file

@ -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

View file

@ -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 */

View file

@ -74,9 +74,11 @@ typedef unsigned grub_uint32_t;
#if GRUB_CPU_SIZEOF_LONG == 8
typedef unsigned long grub_uint64_t;
# define PRIxGRUB_UINT64_T "lx"
# define PRIuGRUB_UINT64_T "lu"
#else
typedef unsigned long long grub_uint64_t;
# define PRIxGRUB_UINT64_T "llx"
# define PRIuGRUB_UINT64_T "llu"
#endif
/* Misc types. */

View file

@ -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;
}