merge mainline into arm
This commit is contained in:
commit
8e71d87482
490 changed files with 29659 additions and 8612 deletions
|
@ -79,6 +79,12 @@ struct grub_arc_display_status
|
|||
grub_arc_uchar_t reverse_video;
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
GRUB_ARC_COMPONENT_FLAG_OUT = 0x40,
|
||||
GRUB_ARC_COMPONENT_FLAG_IN = 0x20,
|
||||
};
|
||||
|
||||
struct grub_arc_component
|
||||
{
|
||||
grub_arc_enum_t class;
|
||||
|
@ -133,7 +139,9 @@ enum
|
|||
GRUB_ARC_COMPONENT_TYPE_POINTER,
|
||||
GRUB_ARC_COMPONENT_TYPE_KBD,
|
||||
GRUB_ARC_COMPONENT_TYPE_TERMINAL,
|
||||
#ifndef GRUB_CPU_WORDS_BIGENDIAN
|
||||
GRUB_ARC_COMPONENT_TYPE_OTHER_PERIPHERAL,
|
||||
#endif
|
||||
GRUB_ARC_COMPONENT_TYPE_LINE,
|
||||
GRUB_ARC_COMPONENT_TYPE_NET,
|
||||
GRUB_ARC_COMPONENT_TYPE_MEMORY_UNIT,
|
||||
|
@ -210,7 +218,7 @@ struct grub_arc_firmware_vector
|
|||
grub_arc_err_t (*seek) (grub_arc_fileno_t fileno,
|
||||
grub_arc_ularge_t *pos, grub_arc_enum_t mode);
|
||||
void *mount;
|
||||
void *getenvironmentvariable;
|
||||
const char * (*getenvironmentvariable) (const char *name);
|
||||
void *setenvironmentvariable;
|
||||
|
||||
/* 0x80. */
|
||||
|
@ -262,6 +270,11 @@ int EXPORT_FUNC (grub_arc_iterate_devs) (grub_arc_iterate_devs_hook_t hook,
|
|||
void *hook_data,
|
||||
int alt_names);
|
||||
|
||||
char *EXPORT_FUNC (grub_arc_alt_name_to_norm) (const char *name, const char *suffix);
|
||||
|
||||
int EXPORT_FUNC (grub_arc_is_device_serial) (const char *name, int alt_names);
|
||||
|
||||
|
||||
#define FOR_ARC_CHILDREN(comp, parent) for (comp = GRUB_ARC_FIRMWARE_VECTOR->getchild (parent); comp; comp = GRUB_ARC_FIRMWARE_VECTOR->getpeer (comp))
|
||||
|
||||
extern void grub_arcdisk_init (void);
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
You need at least three UTF-8 bytes to have 2 UTF-16 words (surrogate pairs).
|
||||
*/
|
||||
#define GRUB_MAX_UTF16_PER_UTF8 1
|
||||
#define GRUB_MAX_UTF8_PER_CODEPOINT 4
|
||||
|
||||
#define GRUB_UCS2_LIMIT 0x10000
|
||||
#define GRUB_UTF16_UPPER_SURROGATE(code) \
|
||||
|
@ -67,6 +68,14 @@ grub_utf8_process (grub_uint8_t c, grub_uint32_t *code, int *count)
|
|||
*code <<= 6;
|
||||
*code |= (c & GRUB_UINT8_6_TRAILINGBITS);
|
||||
(*count)--;
|
||||
/* Overlong. */
|
||||
if ((*count == 1 && *code <= 0x1f)
|
||||
|| (*count == 2 && *code <= 0xf))
|
||||
{
|
||||
*code = 0;
|
||||
*count = 0;
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
@ -80,6 +89,13 @@ grub_utf8_process (grub_uint8_t c, grub_uint32_t *code, int *count)
|
|||
{
|
||||
*count = 1;
|
||||
*code = c & GRUB_UINT8_5_TRAILINGBITS;
|
||||
/* Overlong */
|
||||
if (*code <= 1)
|
||||
{
|
||||
*count = 0;
|
||||
*code = 0;
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
if ((c & GRUB_UINT8_4_LEADINGBITS) == GRUB_UINT8_3_LEADINGBITS)
|
||||
|
|
|
@ -25,6 +25,8 @@
|
|||
#include <grub/err.h>
|
||||
#include <grub/types.h>
|
||||
#include <grub/device.h>
|
||||
/* For NULL. */
|
||||
#include <grub/mm.h>
|
||||
|
||||
/* These are used to set a device id. When you add a new disk device,
|
||||
you must define a new id for it here. */
|
||||
|
@ -206,6 +208,18 @@ EXPORT_FUNC(grub_disk_cache_get_performance) (unsigned long *hits, unsigned long
|
|||
extern void (* EXPORT_VAR(grub_disk_firmware_fini)) (void);
|
||||
extern int EXPORT_VAR(grub_disk_firmware_is_tainted);
|
||||
|
||||
static inline void
|
||||
grub_stop_disk_firmware (void)
|
||||
{
|
||||
/* To prevent two drivers operating on the same disks. */
|
||||
grub_disk_firmware_is_tainted = 1;
|
||||
if (grub_disk_firmware_fini)
|
||||
{
|
||||
grub_disk_firmware_fini ();
|
||||
grub_disk_firmware_fini = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
#if defined (GRUB_UTIL)
|
||||
void grub_lvm_init (void);
|
||||
void grub_ldm_init (void);
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include <grub/err.h>
|
||||
#include <grub/types.h>
|
||||
#include <grub/elf.h>
|
||||
#include <grub/list.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
@ -181,15 +182,41 @@ typedef struct grub_dl *grub_dl_t;
|
|||
grub_dl_t grub_dl_load_file (const char *filename);
|
||||
grub_dl_t EXPORT_FUNC(grub_dl_load) (const char *name);
|
||||
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
|
||||
grub_dl_t EXPORT_FUNC(grub_dl_load_core_noinit) (void *addr, grub_size_t size);
|
||||
int EXPORT_FUNC(grub_dl_unload) (grub_dl_t mod);
|
||||
void grub_dl_unload_unneeded (void);
|
||||
int EXPORT_FUNC(grub_dl_ref) (grub_dl_t mod);
|
||||
int EXPORT_FUNC(grub_dl_unref) (grub_dl_t mod);
|
||||
extern grub_dl_t EXPORT_VAR(grub_dl_head);
|
||||
|
||||
#ifndef GRUB_UTIL
|
||||
|
||||
#define FOR_DL_MODULES(var) FOR_LIST_ELEMENTS ((var), (grub_dl_head))
|
||||
|
||||
grub_dl_t EXPORT_FUNC(grub_dl_get) (const char *name);
|
||||
static inline void
|
||||
grub_dl_init (grub_dl_t mod)
|
||||
{
|
||||
if (mod->init)
|
||||
(mod->init) (mod);
|
||||
|
||||
mod->next = grub_dl_head;
|
||||
grub_dl_head = mod;
|
||||
}
|
||||
|
||||
static inline grub_dl_t
|
||||
grub_dl_get (const char *name)
|
||||
{
|
||||
grub_dl_t l;
|
||||
|
||||
FOR_DL_MODULES(l)
|
||||
if (grub_strcmp (name, l->name) == 0)
|
||||
return l;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
|
||||
int isfunc, grub_dl_t mod);
|
||||
|
||||
|
|
|
@ -553,8 +553,7 @@ typedef struct grub_efi_device_path grub_efi_device_path_protocol_t;
|
|||
|
||||
#define GRUB_EFI_DEVICE_PATH_TYPE(dp) ((dp)->type & 0x7f)
|
||||
#define GRUB_EFI_DEVICE_PATH_SUBTYPE(dp) ((dp)->subtype)
|
||||
#define GRUB_EFI_DEVICE_PATH_LENGTH(dp) \
|
||||
((dp)->length[0] | ((grub_efi_uint16_t) ((dp)->length[1]) << 8))
|
||||
#define GRUB_EFI_DEVICE_PATH_LENGTH(dp) (grub_get_unaligned16 ((dp)->length))
|
||||
|
||||
/* The End of Device Path nodes. */
|
||||
#define GRUB_EFI_END_DEVICE_PATH_TYPE (0xff & 0x7f)
|
||||
|
|
|
@ -53,7 +53,11 @@ enum grub_elf_load_flags
|
|||
{
|
||||
GRUB_ELF_LOAD_FLAGS_NONE = 0,
|
||||
GRUB_ELF_LOAD_FLAGS_LOAD_PT_DYNAMIC = 1,
|
||||
GRUB_ELF_LOAD_FLAGS_BITS = 6,
|
||||
GRUB_ELF_LOAD_FLAGS_ALL_BITS = 0,
|
||||
GRUB_ELF_LOAD_FLAGS_28BITS = 2,
|
||||
GRUB_ELF_LOAD_FLAGS_30BITS = 4,
|
||||
GRUB_ELF_LOAD_FLAGS_62BITS = 6,
|
||||
};
|
||||
grub_err_t grub_elf32_load (grub_elf_t, const char *filename,
|
||||
void *load_offset, enum grub_elf_load_flags flags, grub_addr_t *,
|
||||
|
|
|
@ -3,4 +3,7 @@ void EXPORT_FUNC (close) (void);
|
|||
void EXPORT_FUNC (read) (void);
|
||||
void EXPORT_FUNC (write) (void);
|
||||
void EXPORT_FUNC (ioctl) (void);
|
||||
|
||||
void EXPORT_FUNC (__errno_location) (void);
|
||||
void EXPORT_FUNC (strerror) (void);
|
||||
void EXPORT_FUNC (sysconf) (void);
|
||||
void EXPORT_FUNC (times) (void);
|
||||
|
|
|
@ -44,10 +44,8 @@
|
|||
extern int verbosity;
|
||||
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);
|
||||
|
@ -66,14 +64,6 @@ void EXPORT_FUNC(grub_util_warn) (const char *fmt, ...) __attribute__ ((format (
|
|||
void EXPORT_FUNC(grub_util_info) (const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
|
||||
void EXPORT_FUNC(grub_util_error) (const char *fmt, ...) __attribute__ ((format (printf, 1, 2), noreturn));
|
||||
|
||||
#ifndef HAVE_VASPRINTF
|
||||
int EXPORT_FUNC(vasprintf) (char **buf, const char *fmt, va_list ap);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_ASPRINTF
|
||||
int EXPORT_FUNC(asprintf) (char **buf, const char *fmt, ...);
|
||||
#endif
|
||||
|
||||
extern char * canonicalize_file_name (const char *path);
|
||||
|
||||
#ifdef HAVE_DEVICE_MAPPER
|
||||
|
|
|
@ -81,7 +81,7 @@ void grub_font_loader_init (void);
|
|||
|
||||
/* Load a font and add it to the beginning of the global font list.
|
||||
Returns: 0 upon success; nonzero upon failure. */
|
||||
int grub_font_load (const char *filename);
|
||||
grub_font_t EXPORT_FUNC(grub_font_load) (const char *filename);
|
||||
|
||||
/* Get the font that has the specified name. Font names are in the form
|
||||
"Family Name Bold Italic 14", where Bold and Italic are optional.
|
||||
|
|
|
@ -67,6 +67,8 @@ struct grub_gui_list_ops
|
|||
{
|
||||
void (*set_view_info) (void *self,
|
||||
grub_gfxmenu_view_t view);
|
||||
void (*refresh_list) (void *self,
|
||||
grub_gfxmenu_view_t view);
|
||||
};
|
||||
|
||||
struct grub_gui_progress_ops
|
||||
|
@ -110,6 +112,7 @@ grub_gfxmenu_timeout_unregister (grub_gui_component_t self)
|
|||
if (q->self == self)
|
||||
{
|
||||
*p = q->next;
|
||||
grub_free (q);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
217
include/grub/hfsplus.h
Normal file
217
include/grub/hfsplus.h
Normal file
|
@ -0,0 +1,217 @@
|
|||
|
||||
#include <grub/types.h>
|
||||
#include <grub/disk.h>
|
||||
|
||||
/* A HFS+ extent. */
|
||||
struct grub_hfsplus_extent
|
||||
{
|
||||
/* The first block of a file on disk. */
|
||||
grub_uint32_t start;
|
||||
/* The amount of blocks described by this extent. */
|
||||
grub_uint32_t count;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* The descriptor of a fork. */
|
||||
struct grub_hfsplus_forkdata
|
||||
{
|
||||
grub_uint64_t size;
|
||||
grub_uint32_t clumpsize;
|
||||
grub_uint32_t blocks;
|
||||
struct grub_hfsplus_extent extents[8];
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* The HFS+ Volume Header. */
|
||||
struct grub_hfsplus_volheader
|
||||
{
|
||||
grub_uint16_t magic;
|
||||
grub_uint16_t version;
|
||||
grub_uint32_t attributes;
|
||||
grub_uint8_t unused1[12];
|
||||
grub_uint32_t utime;
|
||||
grub_uint8_t unused2[16];
|
||||
grub_uint32_t blksize;
|
||||
grub_uint8_t unused3[60];
|
||||
grub_uint64_t num_serial;
|
||||
struct grub_hfsplus_forkdata allocations_file;
|
||||
struct grub_hfsplus_forkdata extents_file;
|
||||
struct grub_hfsplus_forkdata catalog_file;
|
||||
struct grub_hfsplus_forkdata attr_file;
|
||||
struct grub_hfsplus_forkdata startup_file;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct grub_hfsplus_compress_index
|
||||
{
|
||||
grub_uint32_t start;
|
||||
grub_uint32_t size;
|
||||
};
|
||||
|
||||
struct grub_hfsplus_file
|
||||
{
|
||||
struct grub_hfsplus_data *data;
|
||||
struct grub_hfsplus_extent extents[8];
|
||||
struct grub_hfsplus_extent resource_extents[8];
|
||||
grub_uint64_t size;
|
||||
grub_uint64_t resource_size;
|
||||
grub_uint32_t fileid;
|
||||
grub_int32_t mtime;
|
||||
int compressed;
|
||||
char *cbuf;
|
||||
struct grub_hfsplus_compress_index *compress_index;
|
||||
grub_uint32_t cbuf_block;
|
||||
grub_uint32_t compress_index_size;
|
||||
};
|
||||
|
||||
struct grub_hfsplus_btree
|
||||
{
|
||||
grub_uint32_t root;
|
||||
grub_size_t nodesize;
|
||||
|
||||
/* Catalog file node. */
|
||||
struct grub_hfsplus_file file;
|
||||
};
|
||||
|
||||
/* Information about a "mounted" HFS+ filesystem. */
|
||||
struct grub_hfsplus_data
|
||||
{
|
||||
struct grub_hfsplus_volheader volheader;
|
||||
grub_disk_t disk;
|
||||
|
||||
unsigned int log2blksize;
|
||||
|
||||
struct grub_hfsplus_btree catalog_tree;
|
||||
struct grub_hfsplus_btree extoverflow_tree;
|
||||
struct grub_hfsplus_btree attr_tree;
|
||||
|
||||
struct grub_hfsplus_file dirroot;
|
||||
struct grub_hfsplus_file opened_file;
|
||||
|
||||
/* This is the offset into the physical disk for an embedded HFS+
|
||||
filesystem (one inside a plain HFS wrapper). */
|
||||
grub_disk_addr_t embedded_offset;
|
||||
int case_sensitive;
|
||||
};
|
||||
|
||||
/* Internal representation of a catalog key. */
|
||||
struct grub_hfsplus_catkey_internal
|
||||
{
|
||||
grub_uint32_t parent;
|
||||
const grub_uint16_t *name;
|
||||
grub_size_t namelen;
|
||||
};
|
||||
|
||||
/* Internal representation of an extent overflow key. */
|
||||
struct grub_hfsplus_extkey_internal
|
||||
{
|
||||
grub_uint32_t fileid;
|
||||
grub_uint32_t start;
|
||||
grub_uint8_t type;
|
||||
};
|
||||
|
||||
struct grub_hfsplus_attrkey
|
||||
{
|
||||
grub_uint16_t keylen;
|
||||
grub_uint16_t unknown1[1];
|
||||
grub_uint32_t cnid;
|
||||
grub_uint16_t unknown2[2];
|
||||
grub_uint16_t namelen;
|
||||
grub_uint16_t name[0];
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct grub_hfsplus_attrkey_internal
|
||||
{
|
||||
grub_uint32_t cnid;
|
||||
const grub_uint16_t *name;
|
||||
grub_size_t namelen;
|
||||
};
|
||||
|
||||
struct grub_hfsplus_key_internal
|
||||
{
|
||||
union
|
||||
{
|
||||
struct grub_hfsplus_extkey_internal extkey;
|
||||
struct grub_hfsplus_catkey_internal catkey;
|
||||
struct grub_hfsplus_attrkey_internal attrkey;
|
||||
};
|
||||
};
|
||||
|
||||
/* The on disk layout of a catalog key. */
|
||||
struct grub_hfsplus_catkey
|
||||
{
|
||||
grub_uint16_t keylen;
|
||||
grub_uint32_t parent;
|
||||
grub_uint16_t namelen;
|
||||
grub_uint16_t name[30];
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* The on disk layout of an extent overflow file key. */
|
||||
struct grub_hfsplus_extkey
|
||||
{
|
||||
grub_uint16_t keylen;
|
||||
grub_uint8_t type;
|
||||
grub_uint8_t unused;
|
||||
grub_uint32_t fileid;
|
||||
grub_uint32_t start;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct grub_hfsplus_key
|
||||
{
|
||||
union
|
||||
{
|
||||
struct grub_hfsplus_extkey extkey;
|
||||
struct grub_hfsplus_catkey catkey;
|
||||
struct grub_hfsplus_attrkey attrkey;
|
||||
grub_uint16_t keylen;
|
||||
};
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct grub_hfsplus_btnode
|
||||
{
|
||||
grub_uint32_t next;
|
||||
grub_uint32_t prev;
|
||||
grub_int8_t type;
|
||||
grub_uint8_t height;
|
||||
grub_uint16_t count;
|
||||
grub_uint16_t unused;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* Return the offset of the record with the index INDEX, in the node
|
||||
NODE which is part of the B+ tree BTREE. */
|
||||
static inline grub_off_t
|
||||
grub_hfsplus_btree_recoffset (struct grub_hfsplus_btree *btree,
|
||||
struct grub_hfsplus_btnode *node, int index)
|
||||
{
|
||||
char *cnode = (char *) node;
|
||||
void *recptr;
|
||||
recptr = (&cnode[btree->nodesize - index * sizeof (grub_uint16_t) - 2]);
|
||||
return grub_be_to_cpu16 (grub_get_unaligned16 (recptr));
|
||||
}
|
||||
|
||||
/* Return a pointer to the record with the index INDEX, in the node
|
||||
NODE which is part of the B+ tree BTREE. */
|
||||
static inline struct grub_hfsplus_key *
|
||||
grub_hfsplus_btree_recptr (struct grub_hfsplus_btree *btree,
|
||||
struct grub_hfsplus_btnode *node, int index)
|
||||
{
|
||||
char *cnode = (char *) node;
|
||||
grub_off_t offset;
|
||||
offset = grub_hfsplus_btree_recoffset (btree, node, index);
|
||||
return (struct grub_hfsplus_key *) &cnode[offset];
|
||||
}
|
||||
|
||||
extern grub_err_t (*grub_hfsplus_open_compressed) (struct grub_hfsplus_file *node);
|
||||
extern grub_ssize_t (*grub_hfsplus_read_compressed) (struct grub_hfsplus_file *node,
|
||||
grub_off_t pos,
|
||||
grub_size_t len,
|
||||
char *buf);
|
||||
|
||||
grub_ssize_t
|
||||
grub_hfsplus_read_file (struct grub_hfsplus_file *node,
|
||||
grub_disk_read_hook_t read_hook, void *read_hook_data,
|
||||
grub_off_t pos, grub_size_t len, char *buf);
|
||||
grub_err_t
|
||||
grub_hfsplus_btree_search (struct grub_hfsplus_btree *btree,
|
||||
struct grub_hfsplus_key_internal *key,
|
||||
int (*compare_keys) (struct grub_hfsplus_key *keya,
|
||||
struct grub_hfsplus_key_internal *keyb),
|
||||
struct grub_hfsplus_btnode **matchnode,
|
||||
grub_off_t *keyoffset);
|
|
@ -54,18 +54,40 @@ struct grub_linuxbios_mainboard
|
|||
|
||||
struct grub_linuxbios_table_item
|
||||
{
|
||||
#define GRUB_LINUXBIOS_MEMBER_UNUSED 0x00
|
||||
#define GRUB_LINUXBIOS_MEMBER_MEMORY 0x01
|
||||
#define GRUB_LINUXBIOS_MEMBER_MAINBOARD 0x03
|
||||
#define GRUB_LINUXBIOS_MEMBER_CONSOLE 0x10
|
||||
#define GRUB_LINUXBIOS_MEMBER_LINK 0x11
|
||||
#define GRUB_LINUXBIOS_MEMBER_TIMESTAMPS 0x16
|
||||
#define GRUB_LINUXBIOS_MEMBER_CBMEMC 0x17
|
||||
grub_uint32_t tag;
|
||||
grub_uint32_t size;
|
||||
};
|
||||
typedef struct grub_linuxbios_table_item *grub_linuxbios_table_item_t;
|
||||
|
||||
enum
|
||||
{
|
||||
GRUB_LINUXBIOS_MEMBER_UNUSED = 0x00,
|
||||
GRUB_LINUXBIOS_MEMBER_MEMORY = 0x01,
|
||||
GRUB_LINUXBIOS_MEMBER_MAINBOARD = 0x03,
|
||||
GRUB_LINUXBIOS_MEMBER_CONSOLE = 0x10,
|
||||
GRUB_LINUXBIOS_MEMBER_LINK = 0x11,
|
||||
GRUB_LINUXBIOS_MEMBER_FRAMEBUFFER = 0x12,
|
||||
GRUB_LINUXBIOS_MEMBER_TIMESTAMPS = 0x16,
|
||||
GRUB_LINUXBIOS_MEMBER_CBMEMC = 0x17
|
||||
};
|
||||
|
||||
struct grub_linuxbios_table_framebuffer {
|
||||
grub_uint64_t lfb;
|
||||
grub_uint32_t width;
|
||||
grub_uint32_t height;
|
||||
grub_uint32_t pitch;
|
||||
grub_uint8_t bpp;
|
||||
|
||||
grub_uint8_t red_field_pos;
|
||||
grub_uint8_t red_mask_size;
|
||||
grub_uint8_t green_field_pos;
|
||||
grub_uint8_t green_mask_size;
|
||||
grub_uint8_t blue_field_pos;
|
||||
grub_uint8_t blue_mask_size;
|
||||
grub_uint8_t reserved_field_pos;
|
||||
grub_uint8_t reserved_mask_size;
|
||||
};
|
||||
|
||||
struct grub_linuxbios_mem_region
|
||||
{
|
||||
grub_uint64_t addr;
|
||||
|
|
|
@ -21,12 +21,12 @@
|
|||
|
||||
#include <grub/macho.h>
|
||||
|
||||
#define GRUB_MACHO_CPUTYPE_IS_HOST32(x) ((x)==0x00000007)
|
||||
#define GRUB_MACHO_CPUTYPE_IS_HOST64(x) ((x)==0x01000007)
|
||||
#define GRUB_MACHO_CPUTYPE_IS_HOST32(x) ((x) == GRUB_MACHO_CPUTYPE_IA32)
|
||||
#define GRUB_MACHO_CPUTYPE_IS_HOST64(x) ((x) == GRUB_MACHO_CPUTYPE_AMD64)
|
||||
#ifdef __x86_64__
|
||||
#define GRUB_MACHO_CPUTYPE_IS_HOST_CURRENT(x) ((x)==0x01000007)
|
||||
#define GRUB_MACHO_CPUTYPE_IS_HOST_CURRENT(x) ((x) == GRUB_MACHO_CPUTYPE_AMD64)
|
||||
#else
|
||||
#define GRUB_MACHO_CPUTYPE_IS_HOST_CURRENT(x) ((x)==0x00000007)
|
||||
#define GRUB_MACHO_CPUTYPE_IS_HOST_CURRENT(x) ((x) == GRUB_MACHO_CPUTYPE_IA32)
|
||||
#endif
|
||||
|
||||
struct grub_macho_thread32
|
||||
|
|
42
include/grub/ia64/reloc.h
Normal file
42
include/grub/ia64/reloc.h
Normal file
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2013 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_IA64_RELOC_H
|
||||
#define GRUB_IA64_RELOC_H 1
|
||||
|
||||
struct grub_ia64_trampoline;
|
||||
|
||||
void
|
||||
grub_ia64_add_value_to_slot_20b (grub_addr_t addr, grub_uint32_t value);
|
||||
void
|
||||
grub_ia64_add_value_to_slot_21 (grub_addr_t addr, grub_uint32_t value);
|
||||
void
|
||||
grub_ia64_make_trampoline (struct grub_ia64_trampoline *tr, grub_uint64_t addr);
|
||||
|
||||
struct grub_ia64_trampoline
|
||||
{
|
||||
/* nop.m */
|
||||
grub_uint8_t nop[5];
|
||||
/* movl r15 = addr*/
|
||||
grub_uint8_t addr_hi[6];
|
||||
grub_uint8_t e0;
|
||||
grub_uint8_t addr_lo[4];
|
||||
grub_uint8_t jump[0x20];
|
||||
};
|
||||
|
||||
#endif
|
|
@ -28,4 +28,7 @@ void grub_console_init_lately (void);
|
|||
/* Finish the console system. */
|
||||
void grub_console_fini (void);
|
||||
|
||||
const char *
|
||||
grub_ofserial_add_port (const char *name);
|
||||
|
||||
#endif /* ! GRUB_CONSOLE_MACHINE_HEADER */
|
||||
|
|
|
@ -78,6 +78,14 @@ extern grub_ieee1275_phandle_t EXPORT_VAR(grub_ieee1275_chosen);
|
|||
extern grub_ieee1275_ihandle_t EXPORT_VAR(grub_ieee1275_mmu);
|
||||
extern int (* EXPORT_VAR(grub_ieee1275_entry_fn)) (void *);
|
||||
|
||||
/* Static heap, used only if FORCE_CLAIM is set,
|
||||
happens on Open Hack'Ware. Should be in platform-specific
|
||||
header but is used only on PPC anyway.
|
||||
*/
|
||||
#define GRUB_IEEE1275_STATIC_HEAP_START 0x1000000
|
||||
#define GRUB_IEEE1275_STATIC_HEAP_LEN 0x1000000
|
||||
|
||||
|
||||
enum grub_ieee1275_flag
|
||||
{
|
||||
/* Old World Macintosh firmware fails seek when "dev:0" is opened. */
|
||||
|
|
|
@ -21,9 +21,9 @@
|
|||
|
||||
#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_VERSION 10
|
||||
|
||||
#define GRUB_KEYBOARD_LAYOUTS_ARRAY_SIZE 128
|
||||
#define GRUB_KEYBOARD_LAYOUTS_ARRAY_SIZE 160
|
||||
|
||||
struct grub_keyboard_layout
|
||||
{
|
||||
|
@ -129,6 +129,8 @@ typedef enum grub_keyboard_key
|
|||
GRUB_KEYBOARD_KEY_NUM0 = 0x62,
|
||||
GRUB_KEYBOARD_KEY_NUMDOT = 0x63,
|
||||
GRUB_KEYBOARD_KEY_102ND = 0x64,
|
||||
GRUB_KEYBOARD_KEY_JP_RO = 0x87,
|
||||
GRUB_KEYBOARD_KEY_JP_YEN = 0x89,
|
||||
GRUB_KEYBOARD_KEY_LEFT_CTRL = 0xe0,
|
||||
GRUB_KEYBOARD_KEY_LEFT_SHIFT = 0xe1,
|
||||
GRUB_KEYBOARD_KEY_LEFT_ALT = 0xe2,
|
||||
|
|
|
@ -35,7 +35,7 @@ void EXPORT_FUNC(grub_list_push) (grub_list_t *head, grub_list_t item);
|
|||
void EXPORT_FUNC(grub_list_remove) (grub_list_t item);
|
||||
|
||||
#define FOR_LIST_ELEMENTS(var, list) for ((var) = (list); (var); (var) = (var)->next)
|
||||
#define FOR_LIST_ELEMENTS_SAFE(var, nxt, list) for ((var) = (list), (nxt) = ((var) ? (var)->next : 0); (var); (var) = (nxt), (nxt) = (var)->next)
|
||||
#define FOR_LIST_ELEMENTS_SAFE(var, nxt, list) for ((var) = (list), (nxt) = ((var) ? (var)->next : 0); (var); (var) = (nxt), ((nxt) = (var) ? (var)->next : 0))
|
||||
|
||||
static inline void *
|
||||
grub_bad_type_cast_real (int line, const char *file)
|
||||
|
|
|
@ -26,8 +26,15 @@ struct grub_macho_fat_header
|
|||
grub_uint32_t magic;
|
||||
grub_uint32_t nfat_arch;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
enum
|
||||
{
|
||||
GRUB_MACHO_CPUTYPE_IA32 = 0x00000007,
|
||||
GRUB_MACHO_CPUTYPE_AMD64 = 0x01000007
|
||||
};
|
||||
|
||||
#define GRUB_MACHO_FAT_MAGIC 0xcafebabe
|
||||
#define GRUB_MACHO_FAT_EFI_MAGIC 0x0ef1fab9
|
||||
#define GRUB_MACHO_FAT_EFI_MAGIC 0x0ef1fab9U
|
||||
|
||||
typedef grub_uint32_t grub_macho_cpu_type_t;
|
||||
typedef grub_uint32_t grub_macho_cpu_subtype_t;
|
||||
|
|
|
@ -19,7 +19,11 @@
|
|||
#ifndef GRUB_MEMORY_MACHINE_HEADER
|
||||
#define GRUB_MEMORY_MACHINE_HEADER 1
|
||||
|
||||
#define GRUB_MACHINE_MEMORY_STACK_HIGH 0x8bfffff0
|
||||
#ifdef GRUB_CPU_MIPSEL
|
||||
#define GRUB_MACHINE_MEMORY_STACK_HIGH 0x806ffff0
|
||||
#else
|
||||
#define GRUB_MACHINE_MEMORY_STACK_HIGH 0x881ffff0
|
||||
#endif
|
||||
|
||||
#ifndef ASM_FILE
|
||||
|
||||
|
|
|
@ -392,7 +392,7 @@ void EXPORT_FUNC (__deregister_frame_info) (void);
|
|||
static inline char *
|
||||
grub_memchr (const void *p, int c, grub_size_t len)
|
||||
{
|
||||
const char *s = p;
|
||||
const char *s = (const char *) p;
|
||||
const char *e = s + len;
|
||||
|
||||
for (; s < e; s++)
|
||||
|
@ -437,10 +437,10 @@ void grub_halt (void) __attribute__ ((noreturn));
|
|||
#endif
|
||||
|
||||
#ifdef GRUB_MACHINE_EMU
|
||||
/* Flag to control module autoloading in normal mode. */
|
||||
extern int EXPORT_VAR(grub_no_autoload);
|
||||
/* Flag to check if module loading is available. */
|
||||
extern const int EXPORT_VAR(grub_no_modules);
|
||||
#else
|
||||
#define grub_no_autoload 0
|
||||
#define grub_no_modules 0
|
||||
#endif
|
||||
|
||||
static inline void
|
||||
|
|
|
@ -150,4 +150,14 @@ grub_dyncmd_get_cmd (grub_command_t cmd);
|
|||
void
|
||||
grub_gettext_reread_prefix (const char *val);
|
||||
|
||||
enum grub_human_size_type
|
||||
{
|
||||
GRUB_HUMAN_SIZE_NORMAL,
|
||||
GRUB_HUMAN_SIZE_SHORT,
|
||||
GRUB_HUMAN_SIZE_SPEED,
|
||||
};
|
||||
|
||||
const char *
|
||||
grub_get_human_size (grub_uint64_t size, enum grub_human_size_type type);
|
||||
|
||||
#endif /* ! GRUB_NORMAL_HEADER */
|
||||
|
|
|
@ -80,8 +80,8 @@
|
|||
#define GRUB_DECOMPRESSOR_MIPS_QEMU_MIPS_UNCOMPRESSED_ADDR 0x10
|
||||
#define GRUB_KERNEL_MIPS_QEMU_MIPS_TOTAL_MODULE_SIZE 0x08
|
||||
|
||||
#define GRUB_KERNEL_MIPS_ARC_LINK_ADDR 0x8bd00000
|
||||
|
||||
#define GRUB_KERNEL_MIPS_ARC_LINK_ADDR 0x88200000
|
||||
#define GRUB_KERNEL_MIPSEL_ARC_LINK_ADDR 0x80700000
|
||||
#define GRUB_KERNEL_MIPS_ARC_LINK_ALIGN 32
|
||||
|
||||
#define GRUB_DECOMPRESSOR_MIPS_ARC_COMPRESSED_SIZE 0x8
|
||||
|
@ -130,7 +130,11 @@
|
|||
|
||||
#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)
|
||||
#if defined (GRUB_MACHINE_ARC) && defined (GRUB_CPU_MIPSEL)
|
||||
#define GRUB_MACHINE_LINK_ADDR GRUB_KERNEL_MIPSEL_ARC_LINK_ADDR
|
||||
#else
|
||||
#define GRUB_MACHINE_LINK_ADDR GRUB_OFFSETS_CONCAT (GRUB_KERNEL_, GRUB_MACHINE, _LINK_ADDR)
|
||||
#endif
|
||||
|
||||
#define GRUB_DECOMPRESSOR_MACHINE_COMPRESSED_SIZE GRUB_OFFSETS_CONCAT (GRUB_DECOMPRESSOR_, GRUB_MACHINE, _COMPRESSED_SIZE)
|
||||
#define GRUB_DECOMPRESSOR_MACHINE_UNCOMPRESSED_SIZE GRUB_OFFSETS_CONCAT (GRUB_DECOMPRESSOR_, GRUB_MACHINE, _UNCOMPRESSED_SIZE)
|
||||
|
|
|
@ -81,6 +81,7 @@
|
|||
#define GRUB_PCI_STATUS_DEVSEL_TIMING_SHIFT 9
|
||||
#define GRUB_PCI_STATUS_DEVSEL_TIMING_MASK 0x0600
|
||||
#define GRUB_PCI_CLASS_SUBCLASS_VGA 0x0300
|
||||
#define GRUB_PCI_CLASS_SUBCLASS_USB 0x0c03
|
||||
|
||||
#ifndef ASM_FILE
|
||||
|
||||
|
|
|
@ -22,6 +22,10 @@
|
|||
#include <grub/misc.h>
|
||||
#include <grub/err.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct grub_priority_queue;
|
||||
typedef struct grub_priority_queue *grub_priority_queue_t;
|
||||
typedef int (*grub_comparator_t) (const void *a, const void *b);
|
||||
|
@ -33,4 +37,8 @@ void *grub_priority_queue_top (grub_priority_queue_t pq);
|
|||
void grub_priority_queue_pop (grub_priority_queue_t pq);
|
||||
grub_err_t grub_priority_queue_push (grub_priority_queue_t pq, const void *el);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -30,6 +30,9 @@
|
|||
#ifdef GRUB_MACHINE_IEEE1275
|
||||
#include <grub/ieee1275/ieee1275.h>
|
||||
#endif
|
||||
#ifdef GRUB_MACHINE_ARC
|
||||
#include <grub/arc/arc.h>
|
||||
#endif
|
||||
|
||||
struct grub_serial_port;
|
||||
struct grub_serial_config;
|
||||
|
@ -104,6 +107,13 @@ struct grub_serial_port
|
|||
#endif
|
||||
#ifdef GRUB_MACHINE_EFI
|
||||
struct grub_efi_serial_io_interface *interface;
|
||||
#endif
|
||||
#ifdef GRUB_MACHINE_ARC
|
||||
struct
|
||||
{
|
||||
grub_arc_fileno_t handle;
|
||||
int handle_valid;
|
||||
};
|
||||
#endif
|
||||
};
|
||||
grub_term_output_t term_out;
|
||||
|
@ -170,6 +180,12 @@ void grub_ofserial_init (void);
|
|||
void
|
||||
grub_efiserial_init (void);
|
||||
#endif
|
||||
#ifdef GRUB_MACHINE_ARC
|
||||
void
|
||||
grub_arcserial_init (void);
|
||||
const char *
|
||||
grub_arcserial_add_port (const char *path);
|
||||
#endif
|
||||
|
||||
struct grub_serial_port *grub_serial_find (const char *name);
|
||||
extern struct grub_serial_driver grub_ns8250_driver;
|
||||
|
|
|
@ -347,14 +347,6 @@ grub_term_border_width (struct grub_term_output *term)
|
|||
return grub_term_width (term) - GRUB_TERM_MARGIN * 2;
|
||||
}
|
||||
|
||||
/* The max column number of an entry. The last "-1" is for a
|
||||
continuation marker. */
|
||||
static inline int
|
||||
grub_term_entry_width (struct grub_term_output *term)
|
||||
{
|
||||
return grub_term_border_width (term) - GRUB_TERM_MARGIN * 2 - 1;
|
||||
}
|
||||
|
||||
static inline grub_uint16_t
|
||||
grub_term_getxy (struct grub_term_output *term)
|
||||
{
|
||||
|
|
|
@ -82,9 +82,7 @@ grub_err_t EXPORT_FUNC (grub_terminfo_output_register) (struct grub_term_output
|
|||
const char *type);
|
||||
grub_err_t EXPORT_FUNC (grub_terminfo_output_unregister) (struct grub_term_output *term);
|
||||
|
||||
#ifndef GRUB_MACHINE_EMU
|
||||
void grub_terminfo_init (void);
|
||||
void grub_terminfo_fini (void);
|
||||
#endif
|
||||
|
||||
#endif /* ! GRUB_TERMINFO_HEADER */
|
||||
|
|
|
@ -25,6 +25,13 @@
|
|||
#include <grub/types.h>
|
||||
#include <grub/symbol.h>
|
||||
|
||||
#include <grub/video.h>
|
||||
#include <grub/video_fb.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct grub_test
|
||||
{
|
||||
/* The next test. */
|
||||
|
@ -90,4 +97,29 @@ void grub_unit_test_fini (void);
|
|||
grub_test_unregister (#name); \
|
||||
}
|
||||
|
||||
void
|
||||
grub_video_checksum (const char *basename_in);
|
||||
void
|
||||
grub_video_checksum_end (void);
|
||||
void
|
||||
grub_terminal_input_fake_sequence (int *seq_in, int nseq_in);
|
||||
void
|
||||
grub_terminal_input_fake_sequence_end (void);
|
||||
const char *
|
||||
grub_video_checksum_get_modename (void);
|
||||
|
||||
|
||||
#define GRUB_TEST_VIDEO_SMALL_N_MODES 6
|
||||
#define GRUB_TEST_VIDEO_ALL_N_MODES 30
|
||||
|
||||
extern struct grub_video_mode_info grub_test_video_modes[GRUB_TEST_VIDEO_ALL_N_MODES];
|
||||
|
||||
int
|
||||
grub_test_use_gfxterm (void);
|
||||
void grub_test_use_gfxterm_end (void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ! GRUB_TEST_HEADER */
|
||||
|
|
|
@ -90,6 +90,8 @@ typedef grub_uint64_t grub_addr_t;
|
|||
typedef grub_uint64_t grub_size_t;
|
||||
typedef grub_int64_t grub_ssize_t;
|
||||
|
||||
# define GRUB_SIZE_MAX 18446744073709551615UL
|
||||
|
||||
# if GRUB_CPU_SIZEOF_LONG == 8
|
||||
# define PRIxGRUB_SIZE "lx"
|
||||
# define PRIxGRUB_ADDR "lx"
|
||||
|
@ -106,6 +108,8 @@ typedef grub_uint32_t grub_addr_t;
|
|||
typedef grub_uint32_t grub_size_t;
|
||||
typedef grub_int32_t grub_ssize_t;
|
||||
|
||||
# define GRUB_SIZE_MAX 4294967295UL
|
||||
|
||||
# define PRIxGRUB_SIZE "x"
|
||||
# define PRIxGRUB_ADDR "x"
|
||||
# define PRIuGRUB_SIZE "u"
|
||||
|
|
|
@ -132,21 +132,33 @@ enum grub_comb_type
|
|||
GRUB_UNICODE_COMB_MN = 255,
|
||||
};
|
||||
|
||||
struct grub_unicode_combining
|
||||
{
|
||||
grub_uint32_t code:21;
|
||||
enum grub_comb_type type:8;
|
||||
};
|
||||
/* This structure describes a glyph as opposed to character. */
|
||||
struct grub_unicode_glyph
|
||||
{
|
||||
grub_uint32_t base;
|
||||
grub_uint16_t variant:9;
|
||||
grub_uint8_t attributes:5;
|
||||
grub_size_t ncomb;
|
||||
grub_size_t orig_pos;
|
||||
struct grub_unicode_combining {
|
||||
grub_uint32_t code;
|
||||
enum grub_comb_type type;
|
||||
} *combining;
|
||||
grub_uint32_t base:23; /* minimum: 21 */
|
||||
grub_uint16_t variant:9; /* minimum: 9 */
|
||||
|
||||
grub_uint8_t attributes:5; /* minimum: 5 */
|
||||
grub_uint8_t bidi_level:6; /* minimum: 6 */
|
||||
enum grub_bidi_type bidi_type:5; /* minimum: :5 */
|
||||
|
||||
unsigned ncomb:8;
|
||||
/* Hint by unicode subsystem how wide this character usually is.
|
||||
Real width is determined by font. Set only in UTF-8 stream. */
|
||||
int estimated_width;
|
||||
int estimated_width:8;
|
||||
|
||||
grub_size_t orig_pos;
|
||||
union
|
||||
{
|
||||
struct grub_unicode_combining combining_inline[sizeof (void *)
|
||||
/ sizeof (struct grub_unicode_combining)];
|
||||
struct grub_unicode_combining *combining_ptr;
|
||||
};
|
||||
};
|
||||
|
||||
#define GRUB_UNICODE_GLYPH_ATTRIBUTE_MIRROR 0x1
|
||||
|
@ -253,6 +265,24 @@ grub_size_t
|
|||
grub_unicode_aglomerate_comb (const grub_uint32_t *in, grub_size_t inlen,
|
||||
struct grub_unicode_glyph *out);
|
||||
|
||||
static inline const struct grub_unicode_combining *
|
||||
grub_unicode_get_comb (const struct grub_unicode_glyph *in)
|
||||
{
|
||||
if (in->ncomb == 0)
|
||||
return NULL;
|
||||
if (in->ncomb > ARRAY_SIZE (in->combining_inline))
|
||||
return in->combining_ptr;
|
||||
return in->combining_inline;
|
||||
}
|
||||
|
||||
static inline void
|
||||
grub_unicode_destroy_glyph (struct grub_unicode_glyph *glyph)
|
||||
{
|
||||
if (glyph->ncomb > ARRAY_SIZE (glyph->combining_inline))
|
||||
grub_free (glyph->combining_ptr);
|
||||
glyph->ncomb = 0;
|
||||
}
|
||||
|
||||
static inline struct grub_unicode_glyph *
|
||||
grub_unicode_glyph_dup (const struct grub_unicode_glyph *in)
|
||||
{
|
||||
|
@ -260,20 +290,41 @@ grub_unicode_glyph_dup (const struct grub_unicode_glyph *in)
|
|||
if (!out)
|
||||
return NULL;
|
||||
grub_memcpy (out, in, sizeof (*in));
|
||||
if (in->combining)
|
||||
if (in->ncomb > ARRAY_SIZE (out->combining_inline))
|
||||
{
|
||||
out->combining = grub_malloc (in->ncomb * sizeof (out->combining[0]));
|
||||
if (!out->combining)
|
||||
out->combining_ptr = grub_malloc (in->ncomb * sizeof (out->combining_ptr[0]));
|
||||
if (!out->combining_ptr)
|
||||
{
|
||||
grub_free (out);
|
||||
return NULL;
|
||||
}
|
||||
grub_memcpy (out->combining, in->combining,
|
||||
in->ncomb * sizeof (out->combining[0]));
|
||||
grub_memcpy (out->combining_ptr, in->combining_ptr,
|
||||
in->ncomb * sizeof (out->combining_ptr[0]));
|
||||
}
|
||||
else
|
||||
grub_memcpy (&out->combining_inline, &in->combining_inline,
|
||||
sizeof (out->combining_inline));
|
||||
return out;
|
||||
}
|
||||
|
||||
static inline void
|
||||
grub_unicode_set_glyph (struct grub_unicode_glyph *out,
|
||||
const struct grub_unicode_glyph *in)
|
||||
{
|
||||
grub_memcpy (out, in, sizeof (*in));
|
||||
if (in->ncomb > ARRAY_SIZE (out->combining_inline))
|
||||
{
|
||||
out->combining_ptr = grub_malloc (in->ncomb * sizeof (out->combining_ptr[0]));
|
||||
if (!out->combining_ptr)
|
||||
return;
|
||||
grub_memcpy (out->combining_ptr, in->combining_ptr,
|
||||
in->ncomb * sizeof (out->combining_ptr[0]));
|
||||
}
|
||||
else
|
||||
grub_memcpy (&out->combining_inline, &in->combining_inline,
|
||||
sizeof (out->combining_inline));
|
||||
}
|
||||
|
||||
static inline struct grub_unicode_glyph *
|
||||
grub_unicode_glyph_from_code (grub_uint32_t code)
|
||||
{
|
||||
|
@ -287,6 +338,15 @@ grub_unicode_glyph_from_code (grub_uint32_t code)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static inline void
|
||||
grub_unicode_set_glyph_from_code (struct grub_unicode_glyph *glyph,
|
||||
grub_uint32_t code)
|
||||
{
|
||||
grub_memset (glyph, 0, sizeof (*glyph));
|
||||
|
||||
glyph->base = code;
|
||||
}
|
||||
|
||||
grub_uint32_t
|
||||
grub_unicode_mirror_code (grub_uint32_t in);
|
||||
grub_uint32_t
|
||||
|
|
|
@ -225,9 +225,9 @@ struct grub_usb_device
|
|||
struct grub_usb_desc_endp *hub_endpoint;
|
||||
|
||||
/* EHCI Split Transfer information */
|
||||
int port;
|
||||
int split_hubport;
|
||||
|
||||
int hubaddr;
|
||||
int split_hubaddr;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -101,6 +101,11 @@ enum grub_video_blit_format
|
|||
|
||||
/* When needed, decode color or just use value as is. */
|
||||
GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR,
|
||||
/* Like index but only 16-colors and F0 is a special value for transparency.
|
||||
Could be extended to 4 bits of alpha and 4 bits of color if necessary.
|
||||
Used internally for text rendering.
|
||||
*/
|
||||
GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR_ALPHA,
|
||||
|
||||
/* Two color bitmap; bits packed: rows are not padded to byte boundary. */
|
||||
GRUB_VIDEO_BLIT_FORMAT_1BIT_PACKED
|
||||
|
@ -283,6 +288,9 @@ typedef enum grub_video_driver_id
|
|||
GRUB_VIDEO_DRIVER_SDL,
|
||||
GRUB_VIDEO_DRIVER_SIS315PRO,
|
||||
GRUB_VIDEO_DRIVER_RADEON_FULOONG2E,
|
||||
GRUB_VIDEO_DRIVER_COREBOOT,
|
||||
GRUB_VIDEO_DRIVER_IEEE1275,
|
||||
GRUB_VIDEO_ADAPTER_CAPTURE
|
||||
} grub_video_driver_id_t;
|
||||
|
||||
typedef enum grub_video_adapter_prio
|
||||
|
@ -416,7 +424,7 @@ grub_err_t EXPORT_FUNC (grub_video_get_info) (struct grub_video_mode_info *mode_
|
|||
grub_err_t EXPORT_FUNC (grub_video_get_info_and_fini) (struct grub_video_mode_info *mode_info,
|
||||
void **framebuffer);
|
||||
|
||||
enum grub_video_blit_format grub_video_get_blit_format (struct grub_video_mode_info *mode_info);
|
||||
enum grub_video_blit_format EXPORT_FUNC(grub_video_get_blit_format) (struct grub_video_mode_info *mode_info);
|
||||
|
||||
grub_err_t grub_video_set_palette (unsigned int start, unsigned int count,
|
||||
struct grub_video_palette_data *palette_data);
|
||||
|
@ -542,4 +550,122 @@ extern void grub_video_sis315pro_fini (void);
|
|||
extern void grub_video_radeon_fuloong2e_fini (void);
|
||||
#endif
|
||||
|
||||
void
|
||||
grub_video_set_adapter (grub_video_adapter_t adapter);
|
||||
grub_video_adapter_t
|
||||
grub_video_get_adapter (void);
|
||||
grub_err_t
|
||||
grub_video_capture_start (const struct grub_video_mode_info *mode_info,
|
||||
struct grub_video_palette_data *palette,
|
||||
unsigned int palette_size);
|
||||
void
|
||||
grub_video_capture_end (void);
|
||||
|
||||
void *
|
||||
grub_video_capture_get_framebuffer (void);
|
||||
|
||||
extern grub_video_adapter_t EXPORT_VAR (grub_video_adapter_active);
|
||||
extern void (*grub_video_capture_refresh_cb) (void);
|
||||
|
||||
#define GRUB_VIDEO_MI_RGB555(x) \
|
||||
x.mode_type = GRUB_VIDEO_MODE_TYPE_RGB, \
|
||||
x.bpp = 15, \
|
||||
x.bytes_per_pixel = 2, \
|
||||
x.number_of_colors = 256, \
|
||||
x.red_mask_size = 5, \
|
||||
x.red_field_pos = 10, \
|
||||
x.green_mask_size = 5, \
|
||||
x.green_field_pos = 5, \
|
||||
x.blue_mask_size = 5, \
|
||||
x.blue_field_pos = 0
|
||||
|
||||
#define GRUB_VIDEO_MI_RGB565(x) \
|
||||
x.mode_type = GRUB_VIDEO_MODE_TYPE_RGB, \
|
||||
x.bpp = 16, \
|
||||
x.bytes_per_pixel = 2, \
|
||||
x.number_of_colors = 256, \
|
||||
x.red_mask_size = 5, \
|
||||
x.red_field_pos = 11, \
|
||||
x.green_mask_size = 6, \
|
||||
x.green_field_pos = 5, \
|
||||
x.blue_mask_size = 5, \
|
||||
x.blue_field_pos = 0
|
||||
|
||||
#define GRUB_VIDEO_MI_RGB888(x) \
|
||||
x.mode_type = GRUB_VIDEO_MODE_TYPE_RGB, \
|
||||
x.bpp = 24, \
|
||||
x.bytes_per_pixel = 3, \
|
||||
x.number_of_colors = 256, \
|
||||
x.red_mask_size = 8, \
|
||||
x.red_field_pos = 16, \
|
||||
x.green_mask_size = 8, \
|
||||
x.green_field_pos = 8, \
|
||||
x.blue_mask_size = 8, \
|
||||
x.blue_field_pos = 0
|
||||
|
||||
#define GRUB_VIDEO_MI_RGBA8888(x) \
|
||||
x.mode_type = GRUB_VIDEO_MODE_TYPE_RGB, \
|
||||
x.bpp = 32, \
|
||||
x.bytes_per_pixel = 4, \
|
||||
x.number_of_colors = 256, \
|
||||
x.reserved_mask_size = 8, \
|
||||
x.reserved_field_pos = 24, \
|
||||
x.red_mask_size = 8, \
|
||||
x.red_field_pos = 16, \
|
||||
x.green_mask_size = 8, \
|
||||
x.green_field_pos = 8, \
|
||||
x.blue_mask_size = 8, \
|
||||
x.blue_field_pos = 0
|
||||
|
||||
|
||||
#define GRUB_VIDEO_MI_BGR555(x) \
|
||||
x.mode_type = GRUB_VIDEO_MODE_TYPE_RGB, \
|
||||
x.bpp = 15, \
|
||||
x.bytes_per_pixel = 2, \
|
||||
x.number_of_colors = 256, \
|
||||
x.red_mask_size = 5, \
|
||||
x.red_field_pos = 0, \
|
||||
x.green_mask_size = 5, \
|
||||
x.green_field_pos = 5, \
|
||||
x.blue_mask_size = 5, \
|
||||
x.blue_field_pos = 10
|
||||
|
||||
#define GRUB_VIDEO_MI_BGR565(x) \
|
||||
x.mode_type = GRUB_VIDEO_MODE_TYPE_RGB, \
|
||||
x.bpp = 16, \
|
||||
x.bytes_per_pixel = 2, \
|
||||
x.number_of_colors = 256, \
|
||||
x.red_mask_size = 5, \
|
||||
x.red_field_pos = 0, \
|
||||
x.green_mask_size = 6, \
|
||||
x.green_field_pos = 5, \
|
||||
x.blue_mask_size = 5, \
|
||||
x.blue_field_pos = 11
|
||||
|
||||
#define GRUB_VIDEO_MI_BGR888(x) \
|
||||
x.mode_type = GRUB_VIDEO_MODE_TYPE_RGB, \
|
||||
x.bpp = 24, \
|
||||
x.bytes_per_pixel = 3, \
|
||||
x.number_of_colors = 256, \
|
||||
x.red_mask_size = 8, \
|
||||
x.red_field_pos = 0, \
|
||||
x.green_mask_size = 8, \
|
||||
x.green_field_pos = 8, \
|
||||
x.blue_mask_size = 8, \
|
||||
x.blue_field_pos = 16
|
||||
|
||||
#define GRUB_VIDEO_MI_BGRA8888(x) \
|
||||
x.mode_type = GRUB_VIDEO_MODE_TYPE_RGB, \
|
||||
x.bpp = 32, \
|
||||
x.bytes_per_pixel = 4, \
|
||||
x.number_of_colors = 256, \
|
||||
x.reserved_mask_size = 8, \
|
||||
x.reserved_field_pos = 24, \
|
||||
x.red_mask_size = 8, \
|
||||
x.red_field_pos = 0, \
|
||||
x.green_mask_size = 8, \
|
||||
x.green_field_pos = 8, \
|
||||
x.blue_mask_size = 8, \
|
||||
x.blue_field_pos = 16
|
||||
|
||||
#endif /* ! GRUB_VIDEO_HEADER */
|
||||
|
|
|
@ -31,45 +31,48 @@ struct grub_video_fbblit_info;
|
|||
struct grub_video_fbrender_target;
|
||||
|
||||
#define GRUB_VIDEO_FBSTD_NUMCOLORS 16
|
||||
extern struct grub_video_palette_data grub_video_fbstd_colors[GRUB_VIDEO_FBSTD_NUMCOLORS];
|
||||
#define GRUB_VIDEO_FBSTD_EXT_NUMCOLORS 256
|
||||
|
||||
extern struct grub_video_palette_data EXPORT_VAR(grub_video_fbstd_colors)[GRUB_VIDEO_FBSTD_EXT_NUMCOLORS];
|
||||
|
||||
grub_err_t
|
||||
grub_video_fb_init (void);
|
||||
EXPORT_FUNC(grub_video_fb_init) (void);
|
||||
|
||||
grub_err_t
|
||||
grub_video_fb_fini (void);
|
||||
EXPORT_FUNC(grub_video_fb_fini) (void);
|
||||
|
||||
grub_err_t
|
||||
grub_video_fb_get_info (struct grub_video_mode_info *mode_info);
|
||||
EXPORT_FUNC(grub_video_fb_get_info) (struct grub_video_mode_info *mode_info);
|
||||
|
||||
grub_err_t
|
||||
grub_video_fb_get_palette (unsigned int start, unsigned int count,
|
||||
struct grub_video_palette_data *palette_data);
|
||||
EXPORT_FUNC(grub_video_fb_get_palette) (unsigned int start, unsigned int count,
|
||||
struct grub_video_palette_data *palette_data);
|
||||
grub_err_t
|
||||
grub_video_fb_set_palette (unsigned int start, unsigned int count,
|
||||
struct grub_video_palette_data *palette_data);
|
||||
EXPORT_FUNC(grub_video_fb_set_palette) (unsigned int start, unsigned int count,
|
||||
struct grub_video_palette_data *palette_data);
|
||||
grub_err_t
|
||||
grub_video_fb_set_viewport (unsigned int x, unsigned int y,
|
||||
unsigned int width, unsigned int height);
|
||||
EXPORT_FUNC(grub_video_fb_set_viewport) (unsigned int x, unsigned int y,
|
||||
unsigned int width, unsigned int height);
|
||||
grub_err_t
|
||||
grub_video_fb_get_viewport (unsigned int *x, unsigned int *y,
|
||||
unsigned int *width, unsigned int *height);
|
||||
EXPORT_FUNC(grub_video_fb_get_viewport) (unsigned int *x, unsigned int *y,
|
||||
unsigned int *width,
|
||||
unsigned int *height);
|
||||
|
||||
grub_video_color_t
|
||||
grub_video_fb_map_color (grub_uint32_t color_name);
|
||||
EXPORT_FUNC(grub_video_fb_map_color) (grub_uint32_t color_name);
|
||||
|
||||
grub_video_color_t
|
||||
grub_video_fb_map_rgb (grub_uint8_t red, grub_uint8_t green,
|
||||
grub_uint8_t blue);
|
||||
EXPORT_FUNC(grub_video_fb_map_rgb) (grub_uint8_t red, grub_uint8_t green,
|
||||
grub_uint8_t blue);
|
||||
|
||||
grub_video_color_t
|
||||
grub_video_fb_map_rgba (grub_uint8_t red, grub_uint8_t green,
|
||||
grub_uint8_t blue, grub_uint8_t alpha);
|
||||
EXPORT_FUNC(grub_video_fb_map_rgba) (grub_uint8_t red, grub_uint8_t green,
|
||||
grub_uint8_t blue, grub_uint8_t alpha);
|
||||
|
||||
grub_err_t
|
||||
grub_video_fb_unmap_color (grub_video_color_t color,
|
||||
grub_uint8_t *red, grub_uint8_t *green,
|
||||
grub_uint8_t *blue, grub_uint8_t *alpha);
|
||||
EXPORT_FUNC(grub_video_fb_unmap_color) (grub_video_color_t color,
|
||||
grub_uint8_t *red, grub_uint8_t *green,
|
||||
grub_uint8_t *blue, grub_uint8_t *alpha);
|
||||
|
||||
void
|
||||
grub_video_fb_unmap_color_int (struct grub_video_fbblit_info * source,
|
||||
|
@ -78,42 +81,96 @@ grub_video_fb_unmap_color_int (struct grub_video_fbblit_info * source,
|
|||
grub_uint8_t *blue, grub_uint8_t *alpha);
|
||||
|
||||
grub_err_t
|
||||
grub_video_fb_fill_rect (grub_video_color_t color, int x, int y,
|
||||
unsigned int width, unsigned int height);
|
||||
EXPORT_FUNC(grub_video_fb_fill_rect) (grub_video_color_t color, int x, int y,
|
||||
unsigned int width, unsigned int height);
|
||||
|
||||
grub_err_t
|
||||
grub_video_fb_blit_bitmap (struct grub_video_bitmap *bitmap,
|
||||
EXPORT_FUNC(grub_video_fb_blit_bitmap) (struct grub_video_bitmap *bitmap,
|
||||
enum grub_video_blit_operators oper, int x, int y,
|
||||
int offset_x, int offset_y,
|
||||
unsigned int width, unsigned int height);
|
||||
|
||||
grub_err_t
|
||||
grub_video_fb_blit_render_target (struct grub_video_fbrender_target *source,
|
||||
EXPORT_FUNC(grub_video_fb_blit_render_target) (struct grub_video_fbrender_target *source,
|
||||
enum grub_video_blit_operators oper,
|
||||
int x, int y, int offset_x, int offset_y,
|
||||
unsigned int width, unsigned int height);
|
||||
|
||||
grub_err_t
|
||||
grub_video_fb_scroll (grub_video_color_t color, int dx, int dy);
|
||||
EXPORT_FUNC(grub_video_fb_scroll) (grub_video_color_t color, int dx, int dy);
|
||||
|
||||
grub_err_t
|
||||
grub_video_fb_create_render_target (struct grub_video_fbrender_target **result,
|
||||
EXPORT_FUNC(grub_video_fb_create_render_target) (struct grub_video_fbrender_target **result,
|
||||
unsigned int width, unsigned int height,
|
||||
unsigned int mode_type __attribute__ ((unused)));
|
||||
|
||||
grub_err_t
|
||||
grub_video_fb_create_render_target_from_pointer (struct grub_video_fbrender_target **result,
|
||||
EXPORT_FUNC(grub_video_fb_create_render_target_from_pointer) (struct grub_video_fbrender_target **result,
|
||||
const struct grub_video_mode_info *mode_info,
|
||||
void *ptr);
|
||||
|
||||
grub_err_t
|
||||
grub_video_fb_delete_render_target (struct grub_video_fbrender_target *target);
|
||||
EXPORT_FUNC(grub_video_fb_delete_render_target) (struct grub_video_fbrender_target *target);
|
||||
|
||||
grub_err_t
|
||||
grub_video_fb_get_active_render_target (struct grub_video_fbrender_target **target);
|
||||
EXPORT_FUNC(grub_video_fb_get_active_render_target) (struct grub_video_fbrender_target **target);
|
||||
|
||||
grub_err_t
|
||||
grub_video_fb_set_active_render_target (struct grub_video_fbrender_target *target);
|
||||
EXPORT_FUNC(grub_video_fb_set_active_render_target) (struct grub_video_fbrender_target *target);
|
||||
|
||||
void
|
||||
EXPORT_FUNC (grub_video_fbblit_blend_32bit_indexa) (struct grub_video_fbblit_info *dst,
|
||||
struct grub_video_fbblit_info *src,
|
||||
int x, int y,
|
||||
int width, int height,
|
||||
int offset_x, int offset_y);
|
||||
|
||||
void
|
||||
EXPORT_FUNC (grub_video_fbblit_blend_24bit_indexa) (struct grub_video_fbblit_info *dst,
|
||||
struct grub_video_fbblit_info *src,
|
||||
int x, int y,
|
||||
int width, int height,
|
||||
int offset_x, int offset_y);
|
||||
void
|
||||
EXPORT_FUNC (grub_video_fbblit_blend_16bit_indexa) (struct grub_video_fbblit_info *dst,
|
||||
struct grub_video_fbblit_info *src,
|
||||
int x, int y,
|
||||
int width, int height,
|
||||
int offset_x, int offset_y);
|
||||
void
|
||||
EXPORT_FUNC (grub_video_fbblit_blend_8bit_indexa) (struct grub_video_fbblit_info *dst,
|
||||
struct grub_video_fbblit_info *src,
|
||||
int x, int y,
|
||||
int width, int height,
|
||||
int offset_x, int offset_y);
|
||||
|
||||
|
||||
void
|
||||
EXPORT_FUNC (grub_video_fbblit_replace_32bit_indexa) (struct grub_video_fbblit_info *dst,
|
||||
struct grub_video_fbblit_info *src,
|
||||
int x, int y,
|
||||
int width, int height,
|
||||
int offset_x, int offset_y);
|
||||
|
||||
void
|
||||
EXPORT_FUNC (grub_video_fbblit_replace_24bit_indexa) (struct grub_video_fbblit_info *dst,
|
||||
struct grub_video_fbblit_info *src,
|
||||
int x, int y,
|
||||
int width, int height,
|
||||
int offset_x, int offset_y);
|
||||
|
||||
void
|
||||
EXPORT_FUNC (grub_video_fbblit_replace_16bit_indexa) (struct grub_video_fbblit_info *dst,
|
||||
struct grub_video_fbblit_info *src,
|
||||
int x, int y,
|
||||
int width, int height,
|
||||
int offset_x, int offset_y);
|
||||
void
|
||||
EXPORT_FUNC (grub_video_fbblit_replace_8bit_indexa) (struct grub_video_fbblit_info *dst,
|
||||
struct grub_video_fbblit_info *src,
|
||||
int x, int y,
|
||||
int width, int height,
|
||||
int offset_x, int offset_y);
|
||||
|
||||
typedef grub_err_t (*grub_video_fb_set_page_t) (int page);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue