Add missing const qualifiers.
* grub-core/commands/i386/pc/sendkey.c (keysym): Add missing const. * grub-core/commands/lspci.c (grub_pci_classname): Likewise. * grub-core/commands/menuentry.c (hotkey_aliases): Likewise. * grub-core/disk/lvm.c (grub_lvm_getvalue): Likewise. (grub_lvm_check_flag): Likewise. * grub-core/efiemu/i386/coredetect.c (grub_efiemu_get_default_core_name): Likewise * grub-core/efiemu/main.c (grub_efiemu_autocore): Likewise. * grub-core/fs/hfsplus.c (grub_hfsplus_catkey_internal): Likewise. * grub-core/fs/ntfs.c (fixup): Likewise. * grub-core/fs/xfs.c (grub_xfs_iterate_dir): Likewise. * grub-core/fs/zfs/zfs.c (decomp_entry): Likewise. (fzap_lookup): Likewise. (zap_lookup): Likewise. * grub-core/gnulib/regcomp.c (init_dfa): Likewise. * grub-core/lib/legacy_parse.c (check_option): Likewise. * grub-core/lib/posix_wrap/langinfo.h (nl_langinfo): Likewise. * grub-core/loader/i386/bsd.c (grub_bsd_add_meta): Likewise. (grub_freebsd_add_meta_module): Likewise. (grub_cmd_freebsd_module): Likewise. * grub-core/loader/i386/xnu.c (tbl_alias): Likewise. * grub-core/loader/xnu.c (grub_xnu_register_memory): Likewise. (grub_xnu_writetree_get_size): Likewise. (grub_xnu_writetree_toheap_real): Likewise. (grub_xnu_find_key): Likewise. (grub_xnu_create_key): Likewise. (grub_xnu_create_value): Likewise. (grub_xnu_register_memory): Likewise. (grub_xnu_check_os_bundle_required): Likewise. (grub_xnu_scan_dir_for_kexts): Likewise. (grub_xnu_load_kext_from_dir): Likewise. * grub-core/normal/color.c (color_list): Likewise. * grub-core/normal/completion.c (current_word): Likewise. * grub-core/normal/menu_entry.c (insert_string): Likewise. * grub-core/term/serial.c (grub_serial_find): Likewise. * grub-core/term/tparm.c (grub_terminfo_tparm): Likewise. * include/grub/efiemu/efiemu.h (grub_efiemu_get_default_core_name): Likewise. * include/grub/i386/bsd.h (grub_bsd_add_meta): Likewise. (grub_freebsd_add_meta_module): Likewise. * include/grub/lib/arg.h (grub_arg_option): Likewise. * include/grub/net.h (grub_net_card_driver): Likewise. (grub_net_card): Likewise. (grub_net_app_protocol): Likewise. * include/grub/parttool.h (grub_parttool_argdesc): Likewise. * include/grub/serial.h (grub_serial_find): Likewise. * include/grub/tparm.h (grub_terminfo_tparm): Likewise. * include/grub/xnu.h (grub_xnu_create_key): Likewise. (grub_xnu_create_value): Likewise. (grub_xnu_find_key): Likewise. (grub_xnu_scan_dir_for_kexts): Likewise. (grub_xnu_load_kext_from_dir): Likewise. * include/grub/zfs/zio_checksum.h (zio_checksum_t): Moved from here ... * grub-core/fs/zfs/zfs.c (zio_checksum_t): ...here. * include/grub/zfs/zio_checksum.h (zio_checksum_info): Moved from here ... * grub-core/fs/zfs/zfs.c (zio_checksum_info): ... here. Added missing const.
This commit is contained in:
parent
112b483765
commit
bf3a385792
31 changed files with 143 additions and 74 deletions
63
ChangeLog
63
ChangeLog
|
@ -1,3 +1,66 @@
|
||||||
|
2011-11-30 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
|
Add missing const qualifiers.
|
||||||
|
|
||||||
|
* grub-core/commands/i386/pc/sendkey.c (keysym): Add missing const.
|
||||||
|
* grub-core/commands/lspci.c (grub_pci_classname): Likewise.
|
||||||
|
* grub-core/commands/menuentry.c (hotkey_aliases): Likewise.
|
||||||
|
* grub-core/disk/lvm.c (grub_lvm_getvalue): Likewise.
|
||||||
|
(grub_lvm_check_flag): Likewise.
|
||||||
|
* grub-core/efiemu/i386/coredetect.c
|
||||||
|
(grub_efiemu_get_default_core_name): Likewise
|
||||||
|
* grub-core/efiemu/main.c (grub_efiemu_autocore): Likewise.
|
||||||
|
* grub-core/fs/hfsplus.c (grub_hfsplus_catkey_internal): Likewise.
|
||||||
|
* grub-core/fs/ntfs.c (fixup): Likewise.
|
||||||
|
* grub-core/fs/xfs.c (grub_xfs_iterate_dir): Likewise.
|
||||||
|
* grub-core/fs/zfs/zfs.c (decomp_entry): Likewise.
|
||||||
|
(fzap_lookup): Likewise.
|
||||||
|
(zap_lookup): Likewise.
|
||||||
|
* grub-core/gnulib/regcomp.c (init_dfa): Likewise.
|
||||||
|
* grub-core/lib/legacy_parse.c (check_option): Likewise.
|
||||||
|
* grub-core/lib/posix_wrap/langinfo.h (nl_langinfo): Likewise.
|
||||||
|
* grub-core/loader/i386/bsd.c (grub_bsd_add_meta): Likewise.
|
||||||
|
(grub_freebsd_add_meta_module): Likewise.
|
||||||
|
(grub_cmd_freebsd_module): Likewise.
|
||||||
|
* grub-core/loader/i386/xnu.c (tbl_alias): Likewise.
|
||||||
|
* grub-core/loader/xnu.c (grub_xnu_register_memory): Likewise.
|
||||||
|
(grub_xnu_writetree_get_size): Likewise.
|
||||||
|
(grub_xnu_writetree_toheap_real): Likewise.
|
||||||
|
(grub_xnu_find_key): Likewise.
|
||||||
|
(grub_xnu_create_key): Likewise.
|
||||||
|
(grub_xnu_create_value): Likewise.
|
||||||
|
(grub_xnu_register_memory): Likewise.
|
||||||
|
(grub_xnu_check_os_bundle_required): Likewise.
|
||||||
|
(grub_xnu_scan_dir_for_kexts): Likewise.
|
||||||
|
(grub_xnu_load_kext_from_dir): Likewise.
|
||||||
|
* grub-core/normal/color.c (color_list): Likewise.
|
||||||
|
* grub-core/normal/completion.c (current_word): Likewise.
|
||||||
|
* grub-core/normal/menu_entry.c (insert_string): Likewise.
|
||||||
|
* grub-core/term/serial.c (grub_serial_find): Likewise.
|
||||||
|
* grub-core/term/tparm.c (grub_terminfo_tparm): Likewise.
|
||||||
|
* include/grub/efiemu/efiemu.h (grub_efiemu_get_default_core_name):
|
||||||
|
Likewise.
|
||||||
|
* include/grub/i386/bsd.h (grub_bsd_add_meta): Likewise.
|
||||||
|
(grub_freebsd_add_meta_module): Likewise.
|
||||||
|
* include/grub/lib/arg.h (grub_arg_option): Likewise.
|
||||||
|
* include/grub/net.h (grub_net_card_driver): Likewise.
|
||||||
|
(grub_net_card): Likewise.
|
||||||
|
(grub_net_app_protocol): Likewise.
|
||||||
|
* include/grub/parttool.h (grub_parttool_argdesc): Likewise.
|
||||||
|
* include/grub/serial.h (grub_serial_find): Likewise.
|
||||||
|
* include/grub/tparm.h (grub_terminfo_tparm): Likewise.
|
||||||
|
* include/grub/xnu.h (grub_xnu_create_key): Likewise.
|
||||||
|
(grub_xnu_create_value): Likewise.
|
||||||
|
(grub_xnu_find_key): Likewise.
|
||||||
|
(grub_xnu_scan_dir_for_kexts): Likewise.
|
||||||
|
(grub_xnu_load_kext_from_dir): Likewise.
|
||||||
|
|
||||||
|
* include/grub/zfs/zio_checksum.h (zio_checksum_t): Moved from here ...
|
||||||
|
* grub-core/fs/zfs/zfs.c (zio_checksum_t): ...here.
|
||||||
|
* include/grub/zfs/zio_checksum.h (zio_checksum_info):
|
||||||
|
Moved from here ...
|
||||||
|
* grub-core/fs/zfs/zfs.c (zio_checksum_info): ... here. Added missing const.
|
||||||
|
|
||||||
2011-11-28 Colin Watson <cjwatson@ubuntu.com>
|
2011-11-28 Colin Watson <cjwatson@ubuntu.com>
|
||||||
|
|
||||||
* util/getroot.c (find_root_device_from_libzfs): Use xasprintf.
|
* util/getroot.c (find_root_device_from_libzfs): Use xasprintf.
|
||||||
|
|
|
@ -63,8 +63,8 @@ static grub_uint32_t andmask = 0xffffffff, ormask = 0;
|
||||||
struct
|
struct
|
||||||
keysym
|
keysym
|
||||||
{
|
{
|
||||||
char *unshifted_name; /* the name in unshifted state */
|
const char *unshifted_name; /* the name in unshifted state */
|
||||||
char *shifted_name; /* the name in shifted state */
|
const char *shifted_name; /* the name in shifted state */
|
||||||
unsigned char unshifted_ascii; /* the ascii code in unshifted state */
|
unsigned char unshifted_ascii; /* the ascii code in unshifted state */
|
||||||
unsigned char shifted_ascii; /* the ascii code in shifted state */
|
unsigned char shifted_ascii; /* the ascii code in shifted state */
|
||||||
unsigned char keycode; /* keyboard scancode */
|
unsigned char keycode; /* keyboard scancode */
|
||||||
|
|
|
@ -29,7 +29,7 @@ struct grub_pci_classname
|
||||||
{
|
{
|
||||||
int class;
|
int class;
|
||||||
int subclass;
|
int subclass;
|
||||||
char *desc;
|
const char *desc;
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct grub_pci_classname grub_pci_classes[] =
|
static const struct grub_pci_classname grub_pci_classes[] =
|
||||||
|
|
|
@ -40,7 +40,7 @@ static const struct grub_arg_option options[] =
|
||||||
|
|
||||||
static struct
|
static struct
|
||||||
{
|
{
|
||||||
char *name;
|
const char *name;
|
||||||
int key;
|
int key;
|
||||||
} hotkey_aliases[] =
|
} hotkey_aliases[] =
|
||||||
{
|
{
|
||||||
|
|
|
@ -44,7 +44,7 @@ static int is_lv_readable (struct grub_lvm_lv *lv);
|
||||||
at the number. In case STR is not found, *P will be NULL and the
|
at the number. In case STR is not found, *P will be NULL and the
|
||||||
return value will be 0. */
|
return value will be 0. */
|
||||||
static int
|
static int
|
||||||
grub_lvm_getvalue (char **p, char *str)
|
grub_lvm_getvalue (char **p, const char *str)
|
||||||
{
|
{
|
||||||
*p = grub_strstr (*p, str);
|
*p = grub_strstr (*p, str);
|
||||||
if (! *p)
|
if (! *p)
|
||||||
|
@ -69,7 +69,7 @@ grub_lvm_checkvalue (char **p, char *str, char *tmpl)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int
|
static int
|
||||||
grub_lvm_check_flag (char *p, char *str, char *flag)
|
grub_lvm_check_flag (char *p, const char *str, const char *flag)
|
||||||
{
|
{
|
||||||
int len_str = grub_strlen (str), len_flag = grub_strlen (flag);
|
int len_str = grub_strlen (str), len_flag = grub_strlen (flag);
|
||||||
while (1)
|
while (1)
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
#define bit_LM (1 << 29)
|
#define bit_LM (1 << 29)
|
||||||
|
|
||||||
char *
|
const char *
|
||||||
grub_efiemu_get_default_core_name (void)
|
grub_efiemu_get_default_core_name (void)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -227,7 +227,7 @@ grub_efiemu_autocore (void)
|
||||||
{
|
{
|
||||||
const char *prefix;
|
const char *prefix;
|
||||||
char *filename;
|
char *filename;
|
||||||
char *suffix;
|
const char *suffix;
|
||||||
grub_err_t err;
|
grub_err_t err;
|
||||||
|
|
||||||
if (grub_efiemu_sizeof_uintn_t () != 0)
|
if (grub_efiemu_sizeof_uintn_t () != 0)
|
||||||
|
|
|
@ -181,7 +181,7 @@ enum grub_hfsplus_filetype
|
||||||
struct grub_hfsplus_catkey_internal
|
struct grub_hfsplus_catkey_internal
|
||||||
{
|
{
|
||||||
grub_uint32_t parent;
|
grub_uint32_t parent;
|
||||||
char *name;
|
const char *name;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Internal representation of an extent overflow key. */
|
/* Internal representation of an extent overflow key. */
|
||||||
|
|
|
@ -47,7 +47,7 @@ static grub_dl_t my_mod;
|
||||||
grub_ntfscomp_func_t grub_ntfscomp_func;
|
grub_ntfscomp_func_t grub_ntfscomp_func;
|
||||||
|
|
||||||
static grub_err_t
|
static grub_err_t
|
||||||
fixup (struct grub_ntfs_data *data, char *buf, int len, char *magic)
|
fixup (struct grub_ntfs_data *data, char *buf, int len, const char *magic)
|
||||||
{
|
{
|
||||||
int ss;
|
int ss;
|
||||||
char *pu;
|
char *pu;
|
||||||
|
|
|
@ -451,9 +451,9 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir,
|
||||||
grub_fshelp_node_t node))
|
grub_fshelp_node_t node))
|
||||||
{
|
{
|
||||||
struct grub_fshelp_node *diro = (struct grub_fshelp_node *) dir;
|
struct grub_fshelp_node *diro = (struct grub_fshelp_node *) dir;
|
||||||
auto int NESTED_FUNC_ATTR call_hook (grub_uint64_t ino, char *filename);
|
auto int NESTED_FUNC_ATTR call_hook (grub_uint64_t ino, const char *filename);
|
||||||
|
|
||||||
int NESTED_FUNC_ATTR call_hook (grub_uint64_t ino, char *filename)
|
int NESTED_FUNC_ATTR call_hook (grub_uint64_t ino, const char *filename)
|
||||||
{
|
{
|
||||||
struct grub_fshelp_node *fdiro;
|
struct grub_fshelp_node *fdiro;
|
||||||
|
|
||||||
|
|
|
@ -131,10 +131,26 @@ typedef grub_err_t zfs_decomp_func_t (void *s_start, void *d_start,
|
||||||
grub_size_t s_len, grub_size_t d_len);
|
grub_size_t s_len, grub_size_t d_len);
|
||||||
typedef struct decomp_entry
|
typedef struct decomp_entry
|
||||||
{
|
{
|
||||||
char *name;
|
const char *name;
|
||||||
zfs_decomp_func_t *decomp_func;
|
zfs_decomp_func_t *decomp_func;
|
||||||
} decomp_entry_t;
|
} decomp_entry_t;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Signature for checksum functions.
|
||||||
|
*/
|
||||||
|
typedef void zio_checksum_t(const void *data, grub_uint64_t size,
|
||||||
|
grub_zfs_endian_t endian, zio_cksum_t *zcp);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Information about each checksum function.
|
||||||
|
*/
|
||||||
|
typedef struct zio_checksum_info {
|
||||||
|
zio_checksum_t *ci_func; /* checksum function for each byteorder */
|
||||||
|
int ci_correctable; /* number of correctable bits */
|
||||||
|
int ci_eck; /* uses zio embedded checksum? */
|
||||||
|
const char *ci_name; /* descriptive name */
|
||||||
|
} zio_checksum_info_t;
|
||||||
|
|
||||||
typedef struct dnode_end
|
typedef struct dnode_end
|
||||||
{
|
{
|
||||||
dnode_phys_t dn;
|
dnode_phys_t dn;
|
||||||
|
@ -1933,8 +1949,8 @@ zap_verify (zap_phys_t *zap, grub_zfs_endian_t endian)
|
||||||
/* XXX */
|
/* XXX */
|
||||||
static grub_err_t
|
static grub_err_t
|
||||||
fzap_lookup (dnode_end_t * zap_dnode, zap_phys_t * zap,
|
fzap_lookup (dnode_end_t * zap_dnode, zap_phys_t * zap,
|
||||||
char *name, grub_uint64_t * value, struct grub_zfs_data *data,
|
const char *name, grub_uint64_t * value,
|
||||||
int case_insensitive)
|
struct grub_zfs_data *data, int case_insensitive)
|
||||||
{
|
{
|
||||||
void *l;
|
void *l;
|
||||||
grub_uint64_t hash, idx, blkid;
|
grub_uint64_t hash, idx, blkid;
|
||||||
|
@ -2096,7 +2112,7 @@ fzap_iterate (dnode_end_t * zap_dnode, zap_phys_t * zap,
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
static grub_err_t
|
static grub_err_t
|
||||||
zap_lookup (dnode_end_t * zap_dnode, char *name, grub_uint64_t * val,
|
zap_lookup (dnode_end_t * zap_dnode, const char *name, grub_uint64_t *val,
|
||||||
struct grub_zfs_data *data, int case_insensitive)
|
struct grub_zfs_data *data, int case_insensitive)
|
||||||
{
|
{
|
||||||
grub_uint64_t block_type;
|
grub_uint64_t block_type;
|
||||||
|
|
|
@ -851,7 +851,7 @@ init_dfa (re_dfa_t *dfa, size_t pat_len)
|
||||||
{
|
{
|
||||||
__re_size_t table_size;
|
__re_size_t table_size;
|
||||||
#ifndef _LIBC
|
#ifndef _LIBC
|
||||||
char *codeset_name;
|
const char *codeset_name;
|
||||||
#endif
|
#endif
|
||||||
#ifdef RE_ENABLE_I18N
|
#ifdef RE_ENABLE_I18N
|
||||||
size_t max_i18n_object_size = MAX (sizeof (wchar_t), sizeof (wctype_t));
|
size_t max_i18n_object_size = MAX (sizeof (wchar_t), sizeof (wctype_t));
|
||||||
|
|
|
@ -402,7 +402,7 @@ adjust_file (const char *in, grub_size_t len)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
check_option (const char *a, char *b, grub_size_t len)
|
check_option (const char *a, const char *b, grub_size_t len)
|
||||||
{
|
{
|
||||||
if (grub_strlen (b) != len)
|
if (grub_strlen (b) != len)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
typedef enum { CODESET } nl_item;
|
typedef enum { CODESET } nl_item;
|
||||||
|
|
||||||
static inline char *
|
static inline const char *
|
||||||
nl_langinfo (nl_item item)
|
nl_langinfo (nl_item item)
|
||||||
{
|
{
|
||||||
switch (item)
|
switch (item)
|
||||||
|
|
|
@ -206,7 +206,7 @@ grub_bsd_get_device (grub_uint32_t * biosdev,
|
||||||
}
|
}
|
||||||
|
|
||||||
grub_err_t
|
grub_err_t
|
||||||
grub_bsd_add_meta (grub_uint32_t type, void *data, grub_uint32_t len)
|
grub_bsd_add_meta (grub_uint32_t type, const void *data, grub_uint32_t len)
|
||||||
{
|
{
|
||||||
struct bsd_tag *newtag;
|
struct bsd_tag *newtag;
|
||||||
|
|
||||||
|
@ -383,10 +383,11 @@ grub_bsd_add_mmap (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
grub_err_t
|
grub_err_t
|
||||||
grub_freebsd_add_meta_module (char *filename, char *type, int argc, char **argv,
|
grub_freebsd_add_meta_module (const char *filename, const char *type,
|
||||||
|
int argc, char **argv,
|
||||||
grub_addr_t addr, grub_uint32_t size)
|
grub_addr_t addr, grub_uint32_t size)
|
||||||
{
|
{
|
||||||
char *name;
|
const char *name;
|
||||||
name = grub_strrchr (filename, '/');
|
name = grub_strrchr (filename, '/');
|
||||||
if (name)
|
if (name)
|
||||||
name++;
|
name++;
|
||||||
|
@ -1806,7 +1807,7 @@ grub_cmd_freebsd_module (grub_command_t cmd __attribute__ ((unused)),
|
||||||
grub_file_t file = 0;
|
grub_file_t file = 0;
|
||||||
int modargc;
|
int modargc;
|
||||||
char **modargv;
|
char **modargv;
|
||||||
char *type;
|
const char *type;
|
||||||
grub_err_t err;
|
grub_err_t err;
|
||||||
void *src;
|
void *src;
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ grub_uint32_t grub_xnu_entry_point, grub_xnu_arg1, grub_xnu_stack;
|
||||||
struct tbl_alias
|
struct tbl_alias
|
||||||
{
|
{
|
||||||
grub_efi_guid_t guid;
|
grub_efi_guid_t guid;
|
||||||
char *name;
|
const char *name;
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct tbl_alias table_aliases[] =
|
static struct tbl_alias table_aliases[] =
|
||||||
|
|
|
@ -50,7 +50,7 @@ grub_size_t grub_xnu_heap_size = 0;
|
||||||
struct grub_relocator *grub_xnu_relocator;
|
struct grub_relocator *grub_xnu_relocator;
|
||||||
|
|
||||||
static grub_err_t
|
static grub_err_t
|
||||||
grub_xnu_register_memory (char *prefix, int *suffix,
|
grub_xnu_register_memory (const char *prefix, int *suffix,
|
||||||
grub_addr_t addr, grub_size_t size);
|
grub_addr_t addr, grub_size_t size);
|
||||||
grub_err_t
|
grub_err_t
|
||||||
grub_xnu_heap_malloc (int size, void **src, grub_addr_t *target)
|
grub_xnu_heap_malloc (int size, void **src, grub_addr_t *target)
|
||||||
|
@ -103,7 +103,8 @@ grub_xnu_free_devtree (struct grub_xnu_devtree_key *cur)
|
||||||
|
|
||||||
/* Compute the size of device tree in xnu format. */
|
/* Compute the size of device tree in xnu format. */
|
||||||
static grub_size_t
|
static grub_size_t
|
||||||
grub_xnu_writetree_get_size (struct grub_xnu_devtree_key *start, char *name)
|
grub_xnu_writetree_get_size (struct grub_xnu_devtree_key *start,
|
||||||
|
const char *name)
|
||||||
{
|
{
|
||||||
grub_size_t ret;
|
grub_size_t ret;
|
||||||
struct grub_xnu_devtree_key *cur;
|
struct grub_xnu_devtree_key *cur;
|
||||||
|
@ -134,7 +135,8 @@ grub_xnu_writetree_get_size (struct grub_xnu_devtree_key *start, char *name)
|
||||||
/* Write devtree in XNU format at curptr assuming the head is named NAME.*/
|
/* Write devtree in XNU format at curptr assuming the head is named NAME.*/
|
||||||
static void *
|
static void *
|
||||||
grub_xnu_writetree_toheap_real (void *curptr,
|
grub_xnu_writetree_toheap_real (void *curptr,
|
||||||
struct grub_xnu_devtree_key *start, char *name)
|
struct grub_xnu_devtree_key *start,
|
||||||
|
const char *name)
|
||||||
{
|
{
|
||||||
struct grub_xnu_devtree_key *cur;
|
struct grub_xnu_devtree_key *cur;
|
||||||
int nkeys = 0, nvals = 0;
|
int nkeys = 0, nvals = 0;
|
||||||
|
@ -249,7 +251,7 @@ grub_xnu_writetree_toheap (grub_addr_t *target, grub_size_t *size)
|
||||||
|
|
||||||
/* Find a key or value in parent key. */
|
/* Find a key or value in parent key. */
|
||||||
struct grub_xnu_devtree_key *
|
struct grub_xnu_devtree_key *
|
||||||
grub_xnu_find_key (struct grub_xnu_devtree_key *parent, char *name)
|
grub_xnu_find_key (struct grub_xnu_devtree_key *parent, const char *name)
|
||||||
{
|
{
|
||||||
struct grub_xnu_devtree_key *cur;
|
struct grub_xnu_devtree_key *cur;
|
||||||
for (cur = parent; cur; cur = cur->next)
|
for (cur = parent; cur; cur = cur->next)
|
||||||
|
@ -259,7 +261,7 @@ grub_xnu_find_key (struct grub_xnu_devtree_key *parent, char *name)
|
||||||
}
|
}
|
||||||
|
|
||||||
struct grub_xnu_devtree_key *
|
struct grub_xnu_devtree_key *
|
||||||
grub_xnu_create_key (struct grub_xnu_devtree_key **parent, char *name)
|
grub_xnu_create_key (struct grub_xnu_devtree_key **parent, const char *name)
|
||||||
{
|
{
|
||||||
struct grub_xnu_devtree_key *ret;
|
struct grub_xnu_devtree_key *ret;
|
||||||
ret = grub_xnu_find_key (*parent, name);
|
ret = grub_xnu_find_key (*parent, name);
|
||||||
|
@ -285,7 +287,7 @@ grub_xnu_create_key (struct grub_xnu_devtree_key **parent, char *name)
|
||||||
}
|
}
|
||||||
|
|
||||||
struct grub_xnu_devtree_key *
|
struct grub_xnu_devtree_key *
|
||||||
grub_xnu_create_value (struct grub_xnu_devtree_key **parent, char *name)
|
grub_xnu_create_value (struct grub_xnu_devtree_key **parent, const char *name)
|
||||||
{
|
{
|
||||||
struct grub_xnu_devtree_key *ret;
|
struct grub_xnu_devtree_key *ret;
|
||||||
ret = grub_xnu_find_key (*parent, name);
|
ret = grub_xnu_find_key (*parent, name);
|
||||||
|
@ -562,7 +564,7 @@ grub_cmd_xnu_kernel64 (grub_command_t cmd __attribute__ ((unused)),
|
||||||
/* Register a memory in a memory map under name PREFIXSUFFIX
|
/* Register a memory in a memory map under name PREFIXSUFFIX
|
||||||
and increment SUFFIX. */
|
and increment SUFFIX. */
|
||||||
static grub_err_t
|
static grub_err_t
|
||||||
grub_xnu_register_memory (char *prefix, int *suffix,
|
grub_xnu_register_memory (const char *prefix, int *suffix,
|
||||||
grub_addr_t addr, grub_size_t size)
|
grub_addr_t addr, grub_size_t size)
|
||||||
{
|
{
|
||||||
struct grub_xnu_devtree_key *chosen;
|
struct grub_xnu_devtree_key *chosen;
|
||||||
|
@ -918,7 +920,8 @@ grub_cmd_xnu_ramdisk (grub_command_t cmd __attribute__ ((unused)),
|
||||||
/* Returns true if the kext should be loaded according to plist
|
/* Returns true if the kext should be loaded according to plist
|
||||||
and osbundlereq. Also fill BINNAME. */
|
and osbundlereq. Also fill BINNAME. */
|
||||||
static int
|
static int
|
||||||
grub_xnu_check_os_bundle_required (char *plistname, char *osbundlereq,
|
grub_xnu_check_os_bundle_required (char *plistname,
|
||||||
|
const char *osbundlereq,
|
||||||
char **binname)
|
char **binname)
|
||||||
{
|
{
|
||||||
grub_file_t file;
|
grub_file_t file;
|
||||||
|
@ -1033,7 +1036,7 @@ grub_xnu_check_os_bundle_required (char *plistname, char *osbundlereq,
|
||||||
|
|
||||||
/* Load all loadable kexts placed under DIRNAME and matching OSBUNDLEREQUIRED */
|
/* Load all loadable kexts placed under DIRNAME and matching OSBUNDLEREQUIRED */
|
||||||
grub_err_t
|
grub_err_t
|
||||||
grub_xnu_scan_dir_for_kexts (char *dirname, char *osbundlerequired,
|
grub_xnu_scan_dir_for_kexts (char *dirname, const char *osbundlerequired,
|
||||||
int maxrecursion)
|
int maxrecursion)
|
||||||
{
|
{
|
||||||
grub_device_t dev;
|
grub_device_t dev;
|
||||||
|
@ -1099,7 +1102,7 @@ grub_xnu_scan_dir_for_kexts (char *dirname, char *osbundlerequired,
|
||||||
|
|
||||||
/* Load extension DIRNAME. (extensions are directories in xnu) */
|
/* Load extension DIRNAME. (extensions are directories in xnu) */
|
||||||
grub_err_t
|
grub_err_t
|
||||||
grub_xnu_load_kext_from_dir (char *dirname, char *osbundlerequired,
|
grub_xnu_load_kext_from_dir (char *dirname, const char *osbundlerequired,
|
||||||
int maxrecursion)
|
int maxrecursion)
|
||||||
{
|
{
|
||||||
grub_device_t dev;
|
grub_device_t dev;
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
#include <grub/i18n.h>
|
#include <grub/i18n.h>
|
||||||
|
|
||||||
/* Borrowed from GRUB Legacy */
|
/* Borrowed from GRUB Legacy */
|
||||||
static char *color_list[16] =
|
static const char *color_list[16] =
|
||||||
{
|
{
|
||||||
"black",
|
"black",
|
||||||
"blue",
|
"blue",
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
#include <grub/extcmd.h>
|
#include <grub/extcmd.h>
|
||||||
|
|
||||||
/* The current word. */
|
/* The current word. */
|
||||||
static char *current_word;
|
static const char *current_word;
|
||||||
|
|
||||||
/* The matched string. */
|
/* The matched string. */
|
||||||
static char *match;
|
static char *match;
|
||||||
|
|
|
@ -317,7 +317,7 @@ update_screen_all (struct screen *screen,
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
insert_string (struct screen *screen, char *s, int update)
|
insert_string (struct screen *screen, const char *s, int update)
|
||||||
{
|
{
|
||||||
int region_start = screen->num_lines;
|
int region_start = screen->num_lines;
|
||||||
int region_column = 0;
|
int region_column = 0;
|
||||||
|
@ -397,7 +397,7 @@ insert_string (struct screen *screen, char *s, int update)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* All but LF. */
|
/* All but LF. */
|
||||||
char *p;
|
const char *p;
|
||||||
struct line *current_linep;
|
struct line *current_linep;
|
||||||
int size;
|
int size;
|
||||||
int orig_num[screen->nterms], new_num[screen->nterms];
|
int orig_num[screen->nterms], new_num[screen->nterms];
|
||||||
|
|
|
@ -126,7 +126,7 @@ static struct grub_term_output grub_serial_term_output =
|
||||||
|
|
||||||
|
|
||||||
struct grub_serial_port *
|
struct grub_serial_port *
|
||||||
grub_serial_find (char *name)
|
grub_serial_find (const char *name)
|
||||||
{
|
{
|
||||||
struct grub_serial_port *port;
|
struct grub_serial_port *port;
|
||||||
|
|
||||||
|
@ -157,7 +157,7 @@ grub_cmd_serial (grub_extcmd_context_t ctxt, int argc, char **args)
|
||||||
{
|
{
|
||||||
struct grub_arg_list *state = ctxt->state;
|
struct grub_arg_list *state = ctxt->state;
|
||||||
char pname[40];
|
char pname[40];
|
||||||
char *name = NULL;
|
const char *name = NULL;
|
||||||
struct grub_serial_port *port;
|
struct grub_serial_port *port;
|
||||||
struct grub_serial_config config;
|
struct grub_serial_config config;
|
||||||
grub_err_t err;
|
grub_err_t err;
|
||||||
|
|
|
@ -745,7 +745,7 @@ tparam_internal(const char *string, va_list ap)
|
||||||
return (out_buff);
|
return (out_buff);
|
||||||
}
|
}
|
||||||
|
|
||||||
char *
|
const char *
|
||||||
grub_terminfo_tparm (const char *string, ...)
|
grub_terminfo_tparm (const char *string, ...)
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
|
|
@ -272,7 +272,7 @@ grub_err_t grub_efiemu_write_value (void * addr, grub_uint32_t value,
|
||||||
grub_err_t grub_efiemu_write_sym_markers (void);
|
grub_err_t grub_efiemu_write_sym_markers (void);
|
||||||
grub_err_t grub_efiemu_pnvram (void);
|
grub_err_t grub_efiemu_pnvram (void);
|
||||||
grub_err_t grub_efiemu_prepare (void);
|
grub_err_t grub_efiemu_prepare (void);
|
||||||
char *grub_efiemu_get_default_core_name (void);
|
const char *grub_efiemu_get_default_core_name (void);
|
||||||
void grub_efiemu_pnvram_cmd_unregister (void);
|
void grub_efiemu_pnvram_cmd_unregister (void);
|
||||||
grub_err_t grub_efiemu_autocore (void);
|
grub_err_t grub_efiemu_autocore (void);
|
||||||
grub_err_t grub_efiemu_crc32 (void);
|
grub_err_t grub_efiemu_crc32 (void);
|
||||||
|
|
|
@ -94,8 +94,8 @@ grub_err_t grub_netbsd_load_elf_meta64 (struct grub_relocator *relocator,
|
||||||
grub_addr_t *kern_end);
|
grub_addr_t *kern_end);
|
||||||
|
|
||||||
grub_err_t grub_bsd_add_meta (grub_uint32_t type,
|
grub_err_t grub_bsd_add_meta (grub_uint32_t type,
|
||||||
void *data, grub_uint32_t len);
|
const void *data, grub_uint32_t len);
|
||||||
grub_err_t grub_freebsd_add_meta_module (char *filename, char *type,
|
grub_err_t grub_freebsd_add_meta_module (const char *filename, const char *type,
|
||||||
int argc, char **argv,
|
int argc, char **argv,
|
||||||
grub_addr_t addr, grub_uint32_t size);
|
grub_addr_t addr, grub_uint32_t size);
|
||||||
|
|
||||||
|
|
|
@ -53,8 +53,8 @@ struct grub_arg_option
|
||||||
const char *longarg;
|
const char *longarg;
|
||||||
int shortarg;
|
int shortarg;
|
||||||
int flags;
|
int flags;
|
||||||
char *doc;
|
const char *doc;
|
||||||
char *arg;
|
const char *arg;
|
||||||
grub_arg_type_t type;
|
grub_arg_type_t type;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,7 @@ struct grub_net_card;
|
||||||
struct grub_net_card_driver
|
struct grub_net_card_driver
|
||||||
{
|
{
|
||||||
struct grub_net_card_driver *next;
|
struct grub_net_card_driver *next;
|
||||||
char *name;
|
const char *name;
|
||||||
grub_err_t (*open) (const struct grub_net_card *dev);
|
grub_err_t (*open) (const struct grub_net_card *dev);
|
||||||
void (*close) (const struct grub_net_card *dev);
|
void (*close) (const struct grub_net_card *dev);
|
||||||
grub_err_t (*send) (const struct grub_net_card *dev,
|
grub_err_t (*send) (const struct grub_net_card *dev,
|
||||||
|
@ -89,7 +89,7 @@ typedef struct grub_net_packets
|
||||||
struct grub_net_card
|
struct grub_net_card
|
||||||
{
|
{
|
||||||
struct grub_net_card *next;
|
struct grub_net_card *next;
|
||||||
char *name;
|
const char *name;
|
||||||
struct grub_net_card_driver *driver;
|
struct grub_net_card_driver *driver;
|
||||||
grub_net_link_level_address_t default_address;
|
grub_net_link_level_address_t default_address;
|
||||||
grub_net_card_flags_t flags;
|
grub_net_card_flags_t flags;
|
||||||
|
@ -188,7 +188,7 @@ typedef struct grub_net_socket *grub_net_socket_t;
|
||||||
struct grub_net_app_protocol
|
struct grub_net_app_protocol
|
||||||
{
|
{
|
||||||
struct grub_net_app_protocol *next;
|
struct grub_net_app_protocol *next;
|
||||||
char *name;
|
const char *name;
|
||||||
grub_err_t (*dir) (grub_device_t device, const char *path,
|
grub_err_t (*dir) (grub_device_t device, const char *path,
|
||||||
int (*hook) (const char *filename,
|
int (*hook) (const char *filename,
|
||||||
const struct grub_dirhook_info *info));
|
const struct grub_dirhook_info *info));
|
||||||
|
|
|
@ -21,8 +21,8 @@
|
||||||
|
|
||||||
struct grub_parttool_argdesc
|
struct grub_parttool_argdesc
|
||||||
{
|
{
|
||||||
char *name;
|
const char *name;
|
||||||
char *desc;
|
const char *desc;
|
||||||
enum {GRUB_PARTTOOL_ARG_END, GRUB_PARTTOOL_ARG_BOOL, GRUB_PARTTOOL_ARG_VAL}
|
enum {GRUB_PARTTOOL_ARG_END, GRUB_PARTTOOL_ARG_BOOL, GRUB_PARTTOOL_ARG_VAL}
|
||||||
type;
|
type;
|
||||||
};
|
};
|
||||||
|
|
|
@ -143,7 +143,7 @@ grub_serial_config_defaults (struct grub_serial_port *port)
|
||||||
|
|
||||||
void grub_ns8250_init (void);
|
void grub_ns8250_init (void);
|
||||||
char *grub_serial_ns8250_add_port (grub_port_t port);
|
char *grub_serial_ns8250_add_port (grub_port_t port);
|
||||||
struct grub_serial_port *grub_serial_find (char *name);
|
struct grub_serial_port *grub_serial_find (const char *name);
|
||||||
extern struct grub_serial_driver grub_ns8250_driver;
|
extern struct grub_serial_driver grub_ns8250_driver;
|
||||||
void EXPORT_FUNC(grub_serial_unregister_driver) (struct grub_serial_driver *driver);
|
void EXPORT_FUNC(grub_serial_unregister_driver) (struct grub_serial_driver *driver);
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,6 @@
|
||||||
#define GRUB_TPARM_HEADER 1
|
#define GRUB_TPARM_HEADER 1
|
||||||
|
|
||||||
/* Function prototypes. */
|
/* Function prototypes. */
|
||||||
char *grub_terminfo_tparm (const char *string, ...);
|
const char *grub_terminfo_tparm (const char *string, ...);
|
||||||
|
|
||||||
#endif /* ! GRUB_TPARM_HEADER */
|
#endif /* ! GRUB_TPARM_HEADER */
|
||||||
|
|
|
@ -81,7 +81,7 @@ struct grub_xnu_extheader
|
||||||
} __attribute__ ((packed));
|
} __attribute__ ((packed));
|
||||||
|
|
||||||
struct grub_xnu_devtree_key *grub_xnu_create_key (struct grub_xnu_devtree_key **parent,
|
struct grub_xnu_devtree_key *grub_xnu_create_key (struct grub_xnu_devtree_key **parent,
|
||||||
char *name);
|
const char *name);
|
||||||
|
|
||||||
extern struct grub_xnu_devtree_key *grub_xnu_devtree_root;
|
extern struct grub_xnu_devtree_key *grub_xnu_devtree_root;
|
||||||
|
|
||||||
|
@ -89,18 +89,20 @@ void grub_xnu_free_devtree (struct grub_xnu_devtree_key *cur);
|
||||||
|
|
||||||
grub_err_t grub_xnu_writetree_toheap (grub_addr_t *target, grub_size_t *size);
|
grub_err_t grub_xnu_writetree_toheap (grub_addr_t *target, grub_size_t *size);
|
||||||
struct grub_xnu_devtree_key *grub_xnu_create_value (struct grub_xnu_devtree_key **parent,
|
struct grub_xnu_devtree_key *grub_xnu_create_value (struct grub_xnu_devtree_key **parent,
|
||||||
char *name);
|
const char *name);
|
||||||
|
|
||||||
void grub_xnu_lock (void);
|
void grub_xnu_lock (void);
|
||||||
void grub_xnu_unlock (void);
|
void grub_xnu_unlock (void);
|
||||||
grub_err_t grub_xnu_resume (char *imagename);
|
grub_err_t grub_xnu_resume (char *imagename);
|
||||||
grub_err_t grub_xnu_boot_resume (void);
|
grub_err_t grub_xnu_boot_resume (void);
|
||||||
struct grub_xnu_devtree_key *grub_xnu_find_key (struct grub_xnu_devtree_key *parent,
|
struct grub_xnu_devtree_key *grub_xnu_find_key (struct grub_xnu_devtree_key *parent,
|
||||||
char *name);
|
const char *name);
|
||||||
grub_err_t grub_xnu_align_heap (int align);
|
grub_err_t grub_xnu_align_heap (int align);
|
||||||
grub_err_t grub_xnu_scan_dir_for_kexts (char *dirname, char *osbundlerequired,
|
grub_err_t grub_xnu_scan_dir_for_kexts (char *dirname,
|
||||||
|
const char *osbundlerequired,
|
||||||
int maxrecursion);
|
int maxrecursion);
|
||||||
grub_err_t grub_xnu_load_kext_from_dir (char *dirname, char *osbundlerequired,
|
grub_err_t grub_xnu_load_kext_from_dir (char *dirname,
|
||||||
|
const char *osbundlerequired,
|
||||||
int maxrecursion);
|
int maxrecursion);
|
||||||
grub_err_t grub_xnu_heap_malloc (int size, void **src, grub_addr_t *target);
|
grub_err_t grub_xnu_heap_malloc (int size, void **src, grub_addr_t *target);
|
||||||
grub_err_t grub_xnu_fill_devicetree (void);
|
grub_err_t grub_xnu_fill_devicetree (void);
|
||||||
|
|
|
@ -23,22 +23,6 @@
|
||||||
#ifndef _SYS_ZIO_CHECKSUM_H
|
#ifndef _SYS_ZIO_CHECKSUM_H
|
||||||
#define _SYS_ZIO_CHECKSUM_H
|
#define _SYS_ZIO_CHECKSUM_H
|
||||||
|
|
||||||
/*
|
|
||||||
* Signature for checksum functions.
|
|
||||||
*/
|
|
||||||
typedef void zio_checksum_t(const void *data, grub_uint64_t size,
|
|
||||||
grub_zfs_endian_t endian, zio_cksum_t *zcp);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Information about each checksum function.
|
|
||||||
*/
|
|
||||||
typedef struct zio_checksum_info {
|
|
||||||
zio_checksum_t *ci_func; /* checksum function for each byteorder */
|
|
||||||
int ci_correctable; /* number of correctable bits */
|
|
||||||
int ci_eck; /* uses zio embedded checksum? */
|
|
||||||
char *ci_name; /* descriptive name */
|
|
||||||
} zio_checksum_info_t;
|
|
||||||
|
|
||||||
extern void zio_checksum_SHA256 (const void *, grub_uint64_t,
|
extern void zio_checksum_SHA256 (const void *, grub_uint64_t,
|
||||||
grub_zfs_endian_t endian, zio_cksum_t *);
|
grub_zfs_endian_t endian, zio_cksum_t *);
|
||||||
extern void fletcher_2 (const void *, grub_uint64_t, grub_zfs_endian_t endian,
|
extern void fletcher_2 (const void *, grub_uint64_t, grub_zfs_endian_t endian,
|
||||||
|
|
Loading…
Reference in a new issue