Merge mainline into mbtag
This commit is contained in:
commit
df32be8cc1
141 changed files with 5978 additions and 5414 deletions
|
@ -102,6 +102,7 @@ union grub_aout_header
|
|||
#define AOUT_MID_I386 134 /* i386 BSD binary */
|
||||
#define AOUT_MID_SPARC 138 /* sparc */
|
||||
#define AOUT_MID_HP200 200 /* hp200 (68010) BSD binary */
|
||||
#define AOUT_MID_SUN 0x103
|
||||
#define AOUT_MID_HP300 300 /* hp300 (68020+68881) BSD binary */
|
||||
#define AOUT_MID_HPUX 0x20C /* hp200/300 HP-UX binary */
|
||||
#define AOUT_MID_HPUX800 0x20B /* hp800 HP-UX binary */
|
||||
|
@ -114,10 +115,14 @@ union grub_aout_header
|
|||
#define AOUT_GETMID(header) ((header).a_midmag >> 16) & 0x03ff)
|
||||
#define AOUT_GETFLAG(header) ((header).a_midmag >> 26) & 0x3f)
|
||||
|
||||
#ifndef GRUB_UTIL
|
||||
|
||||
int EXPORT_FUNC(grub_aout_get_type) (union grub_aout_header *header);
|
||||
|
||||
grub_err_t EXPORT_FUNC(grub_aout_load) (grub_file_t file, int offset,
|
||||
grub_addr_t load_addr, int load_size,
|
||||
grub_addr_t bss_end_addr);
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* ! GRUB_AOUT_HEADER */
|
||||
|
|
89
include/grub/bsdlabel.h
Normal file
89
include/grub/bsdlabel.h
Normal file
|
@ -0,0 +1,89 @@
|
|||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 1999,2000,2001,2002,2004,2007 Free Software Foundation, Inc.
|
||||
*
|
||||
* GRUB is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GRUB is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef GRUB_BSDLABEL_PARTITION_HEADER
|
||||
#define GRUB_BSDLABEL_PARTITION_HEADER 1
|
||||
|
||||
/* Constants for BSD disk label. */
|
||||
#define GRUB_PC_PARTITION_BSD_LABEL_SECTOR 1
|
||||
#define GRUB_PC_PARTITION_BSD_LABEL_MAGIC 0x82564557
|
||||
|
||||
/* BSD partition types. */
|
||||
#define GRUB_PC_PARTITION_BSD_TYPE_UNUSED 0
|
||||
#define GRUB_PC_PARTITION_BSD_TYPE_SWAP 1
|
||||
#define GRUB_PC_PARTITION_BSD_TYPE_V6 2
|
||||
#define GRUB_PC_PARTITION_BSD_TYPE_V7 3
|
||||
#define GRUB_PC_PARTITION_BSD_TYPE_SYSV 4
|
||||
#define GRUB_PC_PARTITION_BSD_TYPE_V71K 5
|
||||
#define GRUB_PC_PARTITION_BSD_TYPE_V8 6
|
||||
#define GRUB_PC_PARTITION_BSD_TYPE_BSDFFS 7
|
||||
#define GRUB_PC_PARTITION_BSD_TYPE_MSDOS 8
|
||||
#define GRUB_PC_PARTITION_BSD_TYPE_BSDLFS 9
|
||||
#define GRUB_PC_PARTITION_BSD_TYPE_OTHER 10
|
||||
#define GRUB_PC_PARTITION_BSD_TYPE_HPFS 11
|
||||
#define GRUB_PC_PARTITION_BSD_TYPE_ISO9660 12
|
||||
#define GRUB_PC_PARTITION_BSD_TYPE_BOOT 13
|
||||
|
||||
/* FreeBSD-specific types. */
|
||||
#define GRUB_PC_PARTITION_FREEBSD_TYPE_VINUM 14
|
||||
#define GRUB_PC_PARTITION_FREEBSD_TYPE_RAID 15
|
||||
#define GRUB_PC_PARTITION_FREEBSD_TYPE_JFS2 21
|
||||
|
||||
/* NetBSD-specific types. */
|
||||
#define GRUB_PC_PARTITION_NETBSD_TYPE_ADOS 14
|
||||
#define GRUB_PC_PARTITION_NETBSD_TYPE_HFS 15
|
||||
#define GRUB_PC_PARTITION_NETBSD_TYPE_FILECORE 16
|
||||
#define GRUB_PC_PARTITION_NETBSD_TYPE_EXT2FS 17
|
||||
#define GRUB_PC_PARTITION_NETBSD_TYPE_NTFS 18
|
||||
#define GRUB_PC_PARTITION_NETBSD_TYPE_RAID 19
|
||||
#define GRUB_PC_PARTITION_NETBSD_TYPE_CCD 20
|
||||
#define GRUB_PC_PARTITION_NETBSD_TYPE_JFS2 21
|
||||
#define GRUB_PC_PARTITION_NETBSD_TYPE_APPLEUFS 22
|
||||
|
||||
/* OpenBSD-specific types. */
|
||||
#define GRUB_PC_PARTITION_OPENBSD_TYPE_ADOS 14
|
||||
#define GRUB_PC_PARTITION_OPENBSD_TYPE_HFS 15
|
||||
#define GRUB_PC_PARTITION_OPENBSD_TYPE_FILECORE 16
|
||||
#define GRUB_PC_PARTITION_OPENBSD_TYPE_EXT2FS 17
|
||||
#define GRUB_PC_PARTITION_OPENBSD_TYPE_NTFS 18
|
||||
#define GRUB_PC_PARTITION_OPENBSD_TYPE_RAID 19
|
||||
|
||||
/* The BSD partition entry. */
|
||||
struct grub_partition_bsd_entry
|
||||
{
|
||||
grub_uint32_t size;
|
||||
grub_uint32_t offset;
|
||||
grub_uint32_t fragment_size;
|
||||
grub_uint8_t fs_type;
|
||||
grub_uint8_t fs_fragments;
|
||||
grub_uint16_t fs_cylinders;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* The BSD disk label. Only define members useful for GRUB. */
|
||||
struct grub_partition_bsd_disk_label
|
||||
{
|
||||
grub_uint32_t magic;
|
||||
grub_uint8_t padding[128];
|
||||
grub_uint32_t magic2;
|
||||
grub_uint16_t checksum;
|
||||
grub_uint16_t num_partitions;
|
||||
grub_uint32_t boot_size;
|
||||
grub_uint32_t superblock_size;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
#endif /* ! GRUB_PC_PARTITION_HEADER */
|
|
@ -33,10 +33,17 @@ struct grub_datetime
|
|||
};
|
||||
|
||||
/* Return date and time. */
|
||||
#ifdef GRUB_MACHINE_EMU
|
||||
grub_err_t EXPORT_FUNC(grub_get_datetime) (struct grub_datetime *datetime);
|
||||
|
||||
/* Set date and time. */
|
||||
grub_err_t EXPORT_FUNC(grub_set_datetime) (struct grub_datetime *datetime);
|
||||
#else
|
||||
grub_err_t grub_get_datetime (struct grub_datetime *datetime);
|
||||
|
||||
/* Set date and time. */
|
||||
grub_err_t grub_set_datetime (struct grub_datetime *datetime);
|
||||
#endif
|
||||
|
||||
int grub_get_weekday (struct grub_datetime *datetime);
|
||||
char *grub_get_weekday_name (struct grub_datetime *datetime);
|
||||
|
|
|
@ -91,7 +91,12 @@ grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
|
|||
int EXPORT_FUNC(grub_dl_unload) (grub_dl_t mod);
|
||||
void grub_dl_unload_unneeded (void);
|
||||
void grub_dl_unload_all (void);
|
||||
#ifdef GRUB_UTIL
|
||||
#if defined (GRUB_MACHINE_EMU) || defined (GRUB_UTIL)
|
||||
#define GRUB_NO_MODULES 1
|
||||
#else
|
||||
#define GRUB_NO_MODULES 0
|
||||
#endif
|
||||
#if GRUB_NO_MODULES
|
||||
static inline int
|
||||
grub_dl_ref (grub_dl_t mod)
|
||||
{
|
||||
|
@ -116,7 +121,7 @@ grub_err_t grub_dl_register_symbol (const char *name, void *addr,
|
|||
grub_err_t grub_arch_dl_check_header (void *ehdr);
|
||||
grub_err_t grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr);
|
||||
|
||||
#if defined (_mips) && ! defined (GRUB_UTIL)
|
||||
#if defined (_mips) && ! defined (GRUB_UTIL) && !defined (GRUB_MACHINE_EMU)
|
||||
#define GRUB_LINKER_HAVE_INIT 1
|
||||
void grub_arch_dl_init_linker (void);
|
||||
#endif
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
extern const char *(*EXPORT_VAR(grub_gettext)) (const char *s);
|
||||
|
||||
/* NLS can be disabled through the configure --disable-nls option. */
|
||||
#if ENABLE_NLS
|
||||
#if (defined(ENABLE_NLS) && ENABLE_NLS)
|
||||
|
||||
# ifdef GRUB_UTIL
|
||||
|
||||
|
@ -34,7 +34,7 @@ extern const char *(*EXPORT_VAR(grub_gettext)) (const char *s);
|
|||
|
||||
# endif /* GRUB_UTIL */
|
||||
|
||||
#else /* ! ENABLE_NLS */
|
||||
#else /* ! (defined(ENABLE_NLS) && ENABLE_NLS) */
|
||||
|
||||
/* Disabled NLS.
|
||||
The casts to 'const char *' serve the purpose of producing warnings
|
||||
|
@ -47,7 +47,7 @@ extern const char *(*EXPORT_VAR(grub_gettext)) (const char *s);
|
|||
# define grub_gettext(str) ((const char *) (str))
|
||||
# endif /* GRUB_UTIL */
|
||||
|
||||
#endif /* ENABLE_NLS */
|
||||
#endif /* (defined(ENABLE_NLS) && ENABLE_NLS) */
|
||||
|
||||
#ifdef GRUB_UTIL
|
||||
# define _(str) gettext(str)
|
||||
|
|
1
include/grub/i386/efi/serial.h
Normal file
1
include/grub/i386/efi/serial.h
Normal file
|
@ -0,0 +1 @@
|
|||
#include <grub/i386/coreboot/serial.h>
|
|
@ -180,4 +180,8 @@ EXPORT_FUNC(grub_ieee1275_map) (grub_addr_t phys, grub_addr_t virt,
|
|||
char *EXPORT_FUNC(grub_ieee1275_encode_devname) (const char *path);
|
||||
char *EXPORT_FUNC(grub_ieee1275_get_filename) (const char *path);
|
||||
|
||||
int EXPORT_FUNC(grub_ieee1275_devices_iterate) (int (*hook)
|
||||
(struct grub_ieee1275_devalias *
|
||||
alias));
|
||||
|
||||
#endif /* ! GRUB_IEEE1275_HEADER */
|
||||
|
|
|
@ -59,6 +59,8 @@ extern grub_addr_t grub_arch_modules_addr (void);
|
|||
|
||||
extern void EXPORT_FUNC(grub_module_iterate) (int (*hook) (struct grub_module_header *));
|
||||
|
||||
grub_addr_t grub_modules_get_end (void);
|
||||
|
||||
/* The start point of the C code. */
|
||||
void grub_main (void);
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ grub_bad_type_cast_real (int line, const char *file)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#define grub_bad_type_cast() grub_bad_type_cast_real(__LINE__, __FILE__)
|
||||
#define grub_bad_type_cast() grub_bad_type_cast_real(__LINE__, GRUB_FILE)
|
||||
|
||||
#define GRUB_FIELD_MATCH(ptr, type, field) \
|
||||
((char *) &(ptr)->field == (char *) &((type) (ptr))->field)
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
#define ARRAY_SIZE(array) (sizeof (array) / sizeof (array[0]))
|
||||
#define COMPILE_TIME_ASSERT(cond) switch (0) { case 1: case !(cond): ; }
|
||||
|
||||
#define grub_dprintf(condition, fmt, args...) grub_real_dprintf(__FILE__, __LINE__, condition, fmt, ## args)
|
||||
#define grub_dprintf(condition, fmt, args...) grub_real_dprintf(GRUB_FILE, __LINE__, condition, fmt, ## args)
|
||||
/* XXX: If grub_memmove is too slow, we must implement grub_memcpy. */
|
||||
#define grub_memcpy(d,s,n) grub_memmove ((d), (s), (n))
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ void *EXPORT_FUNC(grub_realloc) (void *ptr, grub_size_t size);
|
|||
void *EXPORT_FUNC(grub_memalign) (grub_size_t align, grub_size_t size);
|
||||
|
||||
/* For debugging. */
|
||||
#if defined(MM_DEBUG) && !defined(GRUB_UTIL)
|
||||
#if defined(MM_DEBUG) && !defined(GRUB_UTIL) && !defined (GRUB_MACHINE_EMU)
|
||||
/* Set this variable to 1 when you want to trace all memory function calls. */
|
||||
extern int EXPORT_VAR(grub_mm_debug);
|
||||
|
||||
|
@ -44,19 +44,19 @@ void grub_mm_dump_free (void);
|
|||
void grub_mm_dump (unsigned lineno);
|
||||
|
||||
#define grub_malloc(size) \
|
||||
grub_debug_malloc (__FILE__, __LINE__, size)
|
||||
grub_debug_malloc (GRUB_FILE, __LINE__, size)
|
||||
|
||||
#define grub_zalloc(size) \
|
||||
grub_debug_zalloc (__FILE__, __LINE__, size)
|
||||
grub_debug_zalloc (GRUB_FILE, __LINE__, size)
|
||||
|
||||
#define grub_realloc(ptr,size) \
|
||||
grub_debug_realloc (__FILE__, __LINE__, ptr, size)
|
||||
grub_debug_realloc (GRUB_FILE, __LINE__, ptr, size)
|
||||
|
||||
#define grub_memalign(align,size) \
|
||||
grub_debug_memalign (__FILE__, __LINE__, align, size)
|
||||
grub_debug_memalign (GRUB_FILE, __LINE__, align, size)
|
||||
|
||||
#define grub_free(ptr) \
|
||||
grub_debug_free (__FILE__, __LINE__, ptr)
|
||||
grub_debug_free (GRUB_FILE, __LINE__, ptr)
|
||||
|
||||
void *EXPORT_FUNC(grub_debug_malloc) (const char *file, int line,
|
||||
grub_size_t size);
|
||||
|
|
|
@ -53,75 +53,6 @@
|
|||
#define GRUB_PC_PARTITION_TYPE_GPT_DISK 0xee
|
||||
#define GRUB_PC_PARTITION_TYPE_LINUX_RAID 0xfd
|
||||
|
||||
/* Constants for BSD disk label. */
|
||||
#define GRUB_PC_PARTITION_BSD_LABEL_SECTOR 1
|
||||
#define GRUB_PC_PARTITION_BSD_LABEL_MAGIC 0x82564557
|
||||
#define GRUB_PC_PARTITION_BSD_MAX_ENTRIES 8
|
||||
|
||||
/* BSD partition types. */
|
||||
#define GRUB_PC_PARTITION_BSD_TYPE_UNUSED 0
|
||||
#define GRUB_PC_PARTITION_BSD_TYPE_SWAP 1
|
||||
#define GRUB_PC_PARTITION_BSD_TYPE_V6 2
|
||||
#define GRUB_PC_PARTITION_BSD_TYPE_V7 3
|
||||
#define GRUB_PC_PARTITION_BSD_TYPE_SYSV 4
|
||||
#define GRUB_PC_PARTITION_BSD_TYPE_V71K 5
|
||||
#define GRUB_PC_PARTITION_BSD_TYPE_V8 6
|
||||
#define GRUB_PC_PARTITION_BSD_TYPE_BSDFFS 7
|
||||
#define GRUB_PC_PARTITION_BSD_TYPE_MSDOS 8
|
||||
#define GRUB_PC_PARTITION_BSD_TYPE_BSDLFS 9
|
||||
#define GRUB_PC_PARTITION_BSD_TYPE_OTHER 10
|
||||
#define GRUB_PC_PARTITION_BSD_TYPE_HPFS 11
|
||||
#define GRUB_PC_PARTITION_BSD_TYPE_ISO9660 12
|
||||
#define GRUB_PC_PARTITION_BSD_TYPE_BOOT 13
|
||||
|
||||
/* FreeBSD-specific types. */
|
||||
#define GRUB_PC_PARTITION_FREEBSD_TYPE_VINUM 14
|
||||
#define GRUB_PC_PARTITION_FREEBSD_TYPE_RAID 15
|
||||
#define GRUB_PC_PARTITION_FREEBSD_TYPE_JFS2 21
|
||||
|
||||
/* NetBSD-specific types. */
|
||||
#define GRUB_PC_PARTITION_NETBSD_TYPE_ADOS 14
|
||||
#define GRUB_PC_PARTITION_NETBSD_TYPE_HFS 15
|
||||
#define GRUB_PC_PARTITION_NETBSD_TYPE_FILECORE 16
|
||||
#define GRUB_PC_PARTITION_NETBSD_TYPE_EXT2FS 17
|
||||
#define GRUB_PC_PARTITION_NETBSD_TYPE_NTFS 18
|
||||
#define GRUB_PC_PARTITION_NETBSD_TYPE_RAID 19
|
||||
#define GRUB_PC_PARTITION_NETBSD_TYPE_CCD 20
|
||||
#define GRUB_PC_PARTITION_NETBSD_TYPE_JFS2 21
|
||||
#define GRUB_PC_PARTITION_NETBSD_TYPE_APPLEUFS 22
|
||||
|
||||
/* OpenBSD-specific types. */
|
||||
#define GRUB_PC_PARTITION_OPENBSD_TYPE_ADOS 14
|
||||
#define GRUB_PC_PARTITION_OPENBSD_TYPE_HFS 15
|
||||
#define GRUB_PC_PARTITION_OPENBSD_TYPE_FILECORE 16
|
||||
#define GRUB_PC_PARTITION_OPENBSD_TYPE_EXT2FS 17
|
||||
#define GRUB_PC_PARTITION_OPENBSD_TYPE_NTFS 18
|
||||
#define GRUB_PC_PARTITION_OPENBSD_TYPE_RAID 19
|
||||
|
||||
/* The BSD partition entry. */
|
||||
struct grub_msdos_partition_bsd_entry
|
||||
{
|
||||
grub_uint32_t size;
|
||||
grub_uint32_t offset;
|
||||
grub_uint32_t fragment_size;
|
||||
grub_uint8_t fs_type;
|
||||
grub_uint8_t fs_fragments;
|
||||
grub_uint16_t fs_cylinders;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* The BSD disk label. Only define members useful for GRUB. */
|
||||
struct grub_msdos_partition_disk_label
|
||||
{
|
||||
grub_uint32_t magic;
|
||||
grub_uint8_t padding[128];
|
||||
grub_uint32_t magic2;
|
||||
grub_uint16_t checksum;
|
||||
grub_uint16_t num_partitions;
|
||||
grub_uint32_t boot_size;
|
||||
grub_uint32_t superblock_size;
|
||||
struct grub_msdos_partition_bsd_entry entries[GRUB_PC_PARTITION_BSD_MAX_ENTRIES];
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* The partition entry. */
|
||||
struct grub_msdos_partition_entry
|
||||
{
|
||||
|
@ -168,23 +99,6 @@ struct grub_msdos_partition_mbr
|
|||
} __attribute__ ((packed));
|
||||
|
||||
|
||||
struct grub_msdos_partition
|
||||
{
|
||||
/* The DOS partition number. */
|
||||
int dos_part;
|
||||
|
||||
/* The BSD partition number (a == 0). */
|
||||
int bsd_part;
|
||||
|
||||
/* The DOS partition type. */
|
||||
int dos_type;
|
||||
|
||||
/* The BSD partition type. */
|
||||
int bsd_type;
|
||||
|
||||
/* The offset of the extended partition. */
|
||||
unsigned long ext_offset;
|
||||
};
|
||||
|
||||
static inline int
|
||||
grub_msdos_partition_is_empty (int type)
|
||||
|
@ -200,12 +114,4 @@ grub_msdos_partition_is_extended (int type)
|
|||
|| type == GRUB_PC_PARTITION_TYPE_LINUX_EXTENDED);
|
||||
}
|
||||
|
||||
static inline int
|
||||
grub_msdos_partition_is_bsd (int type)
|
||||
{
|
||||
return (type == GRUB_PC_PARTITION_TYPE_FREEBSD
|
||||
|| type == GRUB_PC_PARTITION_TYPE_OPENBSD
|
||||
|| type == GRUB_PC_PARTITION_TYPE_NETBSD);
|
||||
}
|
||||
|
||||
#endif /* ! GRUB_PC_PARTITION_HEADER */
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#define GRUB_PART_HEADER 1
|
||||
|
||||
#include <grub/dl.h>
|
||||
#include <grub/list.h>
|
||||
|
||||
struct grub_disk;
|
||||
|
||||
|
@ -28,6 +29,9 @@ typedef struct grub_partition *grub_partition_t;
|
|||
/* Partition map type. */
|
||||
struct grub_partition_map
|
||||
{
|
||||
/* The next partition map type. */
|
||||
struct grub_partition_map *next;
|
||||
|
||||
/* The name of the partition map type. */
|
||||
const char *name;
|
||||
|
||||
|
@ -35,22 +39,15 @@ struct grub_partition_map
|
|||
grub_err_t (*iterate) (struct grub_disk *disk,
|
||||
int (*hook) (struct grub_disk *disk,
|
||||
const grub_partition_t partition));
|
||||
|
||||
/* Return the partition named STR on the disk DISK. */
|
||||
grub_partition_t (*probe) (struct grub_disk *disk,
|
||||
const char *str);
|
||||
|
||||
/* Return the name of the partition PARTITION. */
|
||||
char *(*get_name) (const grub_partition_t partition);
|
||||
|
||||
/* The next partition map type. */
|
||||
struct grub_partition_map *next;
|
||||
};
|
||||
typedef struct grub_partition_map *grub_partition_map_t;
|
||||
|
||||
/* Partition description. */
|
||||
struct grub_partition
|
||||
{
|
||||
/* The partition number. */
|
||||
int number;
|
||||
|
||||
/* The start sector. */
|
||||
grub_disk_addr_t start;
|
||||
|
||||
|
@ -63,8 +60,8 @@ struct grub_partition
|
|||
/* The index of this partition in the partition table. */
|
||||
int index;
|
||||
|
||||
/* Partition map type specific data. */
|
||||
void *data;
|
||||
/* Parent partition map. */
|
||||
struct grub_partition *parent;
|
||||
|
||||
/* The type partition map. */
|
||||
grub_partition_map_t partmap;
|
||||
|
@ -77,17 +74,36 @@ int EXPORT_FUNC(grub_partition_iterate) (struct grub_disk *disk,
|
|||
const grub_partition_t partition));
|
||||
char *EXPORT_FUNC(grub_partition_get_name) (const grub_partition_t partition);
|
||||
|
||||
int EXPORT_FUNC(grub_partition_map_iterate) (int (*hook) (const grub_partition_map_t partmap));
|
||||
|
||||
void EXPORT_FUNC(grub_partition_map_register) (grub_partition_map_t partmap);
|
||||
extern grub_partition_map_t EXPORT_VAR(grub_partition_map_list);
|
||||
|
||||
void EXPORT_FUNC(grub_partition_map_unregister) (grub_partition_map_t partmap);
|
||||
static inline void
|
||||
grub_partition_map_register (grub_partition_map_t partmap)
|
||||
{
|
||||
grub_list_push (GRUB_AS_LIST_P (&grub_partition_map_list),
|
||||
GRUB_AS_LIST (partmap));
|
||||
}
|
||||
|
||||
static inline void
|
||||
grub_partition_map_unregister (grub_partition_map_t partmap)
|
||||
{
|
||||
grub_list_remove (GRUB_AS_LIST_P (&grub_partition_map_list),
|
||||
GRUB_AS_LIST (partmap));
|
||||
}
|
||||
|
||||
#define FOR_PARTITION_MAPS(var) for (var = grub_partition_map_list; var; var = var->next)
|
||||
|
||||
|
||||
static inline grub_disk_addr_t
|
||||
grub_partition_get_start (const grub_partition_t p)
|
||||
{
|
||||
return p->start;
|
||||
grub_partition_t part;
|
||||
grub_uint64_t part_start = 0;
|
||||
|
||||
for (part = p; part; part = part->parent)
|
||||
part_start += part->start;
|
||||
|
||||
return part_start;
|
||||
}
|
||||
|
||||
static inline grub_uint64_t
|
||||
|
|
|
@ -68,7 +68,7 @@
|
|||
|
||||
typedef grub_uint32_t grub_pci_id_t;
|
||||
|
||||
#ifdef GRUB_UTIL
|
||||
#ifdef GRUB_MACHINE_EMU
|
||||
#include <grub/pciutils.h>
|
||||
#else
|
||||
typedef grub_uint32_t grub_pci_address_t;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* normal_parser.h */
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2005,2007,2009 Free Software Foundation, Inc.
|
||||
* Copyright (C) 2005,2007,2009,2010 Free Software Foundation, Inc.
|
||||
*
|
||||
* GRUB is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -45,8 +45,11 @@ struct grub_script
|
|||
|
||||
typedef enum
|
||||
{
|
||||
GRUB_SCRIPT_ARG_TYPE_STR,
|
||||
GRUB_SCRIPT_ARG_TYPE_VAR
|
||||
GRUB_SCRIPT_ARG_TYPE_VAR,
|
||||
GRUB_SCRIPT_ARG_TYPE_TEXT,
|
||||
GRUB_SCRIPT_ARG_TYPE_DQVAR,
|
||||
GRUB_SCRIPT_ARG_TYPE_DQSTR,
|
||||
GRUB_SCRIPT_ARG_TYPE_SQSTR
|
||||
} grub_script_arg_type_t;
|
||||
|
||||
/* A part of an argument. */
|
||||
|
@ -103,6 +106,21 @@ struct grub_script_cmdif
|
|||
struct grub_script_cmd *exec_on_false;
|
||||
};
|
||||
|
||||
/* A for statement. */
|
||||
struct grub_script_cmdfor
|
||||
{
|
||||
struct grub_script_cmd cmd;
|
||||
|
||||
/* The name used as looping variable. */
|
||||
struct grub_script_arg *name;
|
||||
|
||||
/* The words loop iterates over. */
|
||||
struct grub_script_arglist *words;
|
||||
|
||||
/* The command list executed in each loop. */
|
||||
struct grub_script_cmd *list;
|
||||
};
|
||||
|
||||
/* A menu entry generate statement. */
|
||||
struct grub_script_cmd_menuentry
|
||||
{
|
||||
|
@ -121,12 +139,6 @@ struct grub_script_cmd_menuentry
|
|||
/* State of the lexer as passed to the lexer. */
|
||||
struct grub_lexer_param
|
||||
{
|
||||
/* Set to 0 when the lexer is done. */
|
||||
int done;
|
||||
|
||||
/* State of the state machine. */
|
||||
grub_parser_state_t state;
|
||||
|
||||
/* Function used by the lexer to get a new line when more input is
|
||||
expected, but not available. */
|
||||
grub_reader_getline_t getline;
|
||||
|
@ -137,10 +149,6 @@ struct grub_lexer_param
|
|||
depleted. */
|
||||
int refs;
|
||||
|
||||
/* The character stream that has to be parsed. */
|
||||
char *script;
|
||||
char *newscript; /* XXX */
|
||||
|
||||
/* While walking through the databuffer, `record' the characters to
|
||||
this other buffer. It can be used to edit the menu entry at a
|
||||
later moment. */
|
||||
|
@ -157,13 +165,31 @@ struct grub_lexer_param
|
|||
/* Size of RECORDING. */
|
||||
int recordlen;
|
||||
|
||||
/* The token that is already parsed but not yet returned. */
|
||||
int tokenonhold;
|
||||
/* End of file reached. */
|
||||
int eof;
|
||||
|
||||
/* Was the last token a newline? */
|
||||
int was_newline;
|
||||
/* Merge multiple word tokens. */
|
||||
int merge_start;
|
||||
int merge_end;
|
||||
|
||||
/* Part of a multi-part token. */
|
||||
char *text;
|
||||
unsigned used;
|
||||
unsigned size;
|
||||
|
||||
/* Type of text. */
|
||||
grub_script_arg_type_t type;
|
||||
|
||||
/* Flex scanner. */
|
||||
void *yyscanner;
|
||||
|
||||
/* Flex scanner buffer. */
|
||||
void *buffer;
|
||||
};
|
||||
|
||||
#define GRUB_LEXER_INITIAL_TEXT_SIZE 32
|
||||
#define GRUB_LEXER_INITIAL_RECORD_SIZE 256
|
||||
|
||||
/* State of the parser as passes to the parser. */
|
||||
struct grub_parser_param
|
||||
{
|
||||
|
@ -202,6 +228,12 @@ grub_script_create_cmdif (struct grub_parser_param *state,
|
|||
struct grub_script_cmd *exec_on_true,
|
||||
struct grub_script_cmd *exec_on_false);
|
||||
|
||||
struct grub_script_cmd *
|
||||
grub_script_create_cmdfor (struct grub_parser_param *state,
|
||||
struct grub_script_arg *name,
|
||||
struct grub_script_arglist *words,
|
||||
struct grub_script_cmd *list);
|
||||
|
||||
struct grub_script_cmd *
|
||||
grub_script_create_cmdmenu (struct grub_parser_param *state,
|
||||
struct grub_script_arglist *arglist,
|
||||
|
@ -223,12 +255,16 @@ void grub_script_free (struct grub_script *script);
|
|||
struct grub_script *grub_script_create (struct grub_script_cmd *cmd,
|
||||
struct grub_script_mem *mem);
|
||||
|
||||
struct grub_lexer_param *grub_script_lexer_init (char *s,
|
||||
struct grub_lexer_param *grub_script_lexer_init (struct grub_parser_param *parser,
|
||||
char *script,
|
||||
grub_reader_getline_t getline);
|
||||
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_lexer_param *);
|
||||
char *grub_script_lexer_record_stop (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 *);
|
||||
void grub_script_lexer_record (struct grub_parser_param *, char *);
|
||||
|
||||
/* Functions to track allocated memory. */
|
||||
struct grub_script_mem *grub_script_mem_record (struct grub_parser_param *state);
|
||||
|
@ -246,6 +282,7 @@ void grub_script_yyerror (struct grub_parser_param *, char const *);
|
|||
grub_err_t grub_script_execute_cmdline (struct grub_script_cmd *cmd);
|
||||
grub_err_t grub_script_execute_cmdblock (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_menuentry (struct grub_script_cmd *cmd);
|
||||
|
||||
/* Execute any GRUB pre-parsed command or script. */
|
||||
|
@ -284,7 +321,7 @@ int grub_script_function_iterate (int (*iterate) (grub_script_function_t));
|
|||
int grub_script_function_call (grub_script_function_t func,
|
||||
int argc, char **args);
|
||||
|
||||
char *
|
||||
grub_script_execute_argument_to_string (struct grub_script_arg *arg);
|
||||
char **
|
||||
grub_script_execute_arglist_to_argv (struct grub_script_arglist *arglist, int *count);
|
||||
|
||||
#endif /* ! GRUB_NORMAL_PARSER_HEADER */
|
||||
|
|
|
@ -25,7 +25,8 @@
|
|||
#define BOOTDEV_REG %l6
|
||||
#define PIC_REG %l7
|
||||
|
||||
#define SCRATCH_PAD 0x10000
|
||||
#define SCRATCH_PAD_BOOT 0x5000
|
||||
#define SCRATCH_PAD_DISKBOOT 0x4000
|
||||
|
||||
#define GET_ABS(symbol, reg) \
|
||||
add PIC_REG, (symbol - pic_base), reg
|
||||
|
@ -51,7 +52,7 @@
|
|||
|
||||
#define GRUB_BOOT_MACHINE_LIST_SIZE 12
|
||||
|
||||
#define GRUB_BOOT_MACHINE_IMAGE_ADDRESS 0x200000
|
||||
#define GRUB_BOOT_MACHINE_IMAGE_ADDRESS 0x4400
|
||||
|
||||
#define GRUB_BOOT_MACHINE_KERNEL_ADDR 0x4200
|
||||
|
||||
|
|
|
@ -43,4 +43,6 @@ extern int EXPORT_FUNC(grub_ieee1275_alloc_physmem) (grub_addr_t *paddr,
|
|||
grub_size_t size,
|
||||
grub_uint32_t align);
|
||||
|
||||
extern grub_addr_t EXPORT_VAR (grub_ieee1275_original_stack);
|
||||
|
||||
#endif /* ! GRUB_IEEE1275_MACHINE_HEADER */
|
||||
|
|
|
@ -39,8 +39,24 @@
|
|||
/* End of the data section. */
|
||||
#define GRUB_KERNEL_MACHINE_DATA_END 0x114
|
||||
|
||||
#define GRUB_KERNEL_MACHINE_RAW_SIZE 0
|
||||
#define GRUB_KERNEL_MACHINE_STACK_SIZE 0x40000
|
||||
|
||||
#define GRUB_PLATFORM_IMAGE_FORMATS "raw, aout"
|
||||
#define GRUB_PLATFORM_IMAGE_DEFAULT_FORMAT "raw"
|
||||
|
||||
#define GRUB_PLATFORM_IMAGE_DEFAULT GRUB_PLATFORM_IMAGE_RAW
|
||||
|
||||
#ifndef ASM_FILE
|
||||
|
||||
typedef enum {
|
||||
GRUB_PLATFORM_IMAGE_RAW,
|
||||
GRUB_PLATFORM_IMAGE_AOUT
|
||||
}
|
||||
grub_platform_image_format_t;
|
||||
#define GRUB_PLATFORM_IMAGE_RAW GRUB_PLATFORM_IMAGE_RAW
|
||||
#define GRUB_PLATFORM_IMAGE_AOUT GRUB_PLATFORM_IMAGE_AOUT
|
||||
|
||||
#include <grub/symbol.h>
|
||||
#include <grub/types.h>
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ void grub_test_nonzero (int cond, const char *file,
|
|||
|
||||
/* Macro to fill in location details and an optional error message. */
|
||||
#define grub_test_assert(cond, ...) \
|
||||
grub_test_nonzero(cond, __FILE__, __FUNCTION__, __LINE__, \
|
||||
grub_test_nonzero(cond, GRUB_FILE, __FUNCTION__, __LINE__, \
|
||||
## __VA_ARGS__, \
|
||||
"assert failed: %s", #cond)
|
||||
|
||||
|
|
1
include/grub/x86_64/efi/serial.h
Normal file
1
include/grub/x86_64/efi/serial.h
Normal file
|
@ -0,0 +1 @@
|
|||
#include <grub/i386/coreboot/serial.h>
|
Loading…
Add table
Add a link
Reference in a new issue