grub/include/grub/xnu.h
Vladimir 'phcoder' Serbinenko bf3a385792 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-30 16:20:13 +01:00

118 lines
3.7 KiB
C

/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2009 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GRUB is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GRUB_XNU_H
#define GRUB_XNU_H 1
#include <grub/bitmap.h>
/* Header of a hibernation image. */
struct grub_xnu_hibernate_header
{
/* Size of the image. Notice that file containing image is usually bigger. */
grub_uint64_t image_size;
grub_uint8_t unknown1[8];
/* Where to copy launchcode? */
grub_uint32_t launchcode_target_page;
/* How many pages of launchcode? */
grub_uint32_t launchcode_numpages;
/* Where to jump? */
grub_uint32_t entry_point;
/* %esp at start. */
grub_uint32_t stack;
grub_uint8_t unknown2[44];
#define GRUB_XNU_HIBERNATE_MAGIC 0x73696d65
grub_uint32_t magic;
grub_uint8_t unknown3[28];
/* This value is non-zero if page is encrypted. Unsupported. */
grub_uint64_t encoffset;
grub_uint8_t unknown4[360];
/* The size of additional header used to locate image without parsing FS.
Used only to skip it.
*/
grub_uint32_t extmapsize;
} __attribute__ ((packed));
/* In-memory structure for temporary keeping device tree. */
struct grub_xnu_devtree_key
{
char *name;
int datasize; /* -1 for not leaves. */
union
{
struct grub_xnu_devtree_key *first_child;
void *data;
};
struct grub_xnu_devtree_key *next;
};
/* A structure used in memory-map values. */
struct
grub_xnu_extdesc
{
grub_uint32_t addr;
grub_uint32_t size;
} __attribute__ ((packed));
/* Header describing extension in the memory. */
struct grub_xnu_extheader
{
grub_uint32_t infoplistaddr;
grub_uint32_t infoplistsize;
grub_uint32_t binaryaddr;
grub_uint32_t binarysize;
grub_uint32_t nameaddr;
grub_uint32_t namesize;
} __attribute__ ((packed));
struct grub_xnu_devtree_key *grub_xnu_create_key (struct grub_xnu_devtree_key **parent,
const char *name);
extern struct grub_xnu_devtree_key *grub_xnu_devtree_root;
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);
struct grub_xnu_devtree_key *grub_xnu_create_value (struct grub_xnu_devtree_key **parent,
const char *name);
void grub_xnu_lock (void);
void grub_xnu_unlock (void);
grub_err_t grub_xnu_resume (char *imagename);
grub_err_t grub_xnu_boot_resume (void);
struct grub_xnu_devtree_key *grub_xnu_find_key (struct grub_xnu_devtree_key *parent,
const char *name);
grub_err_t grub_xnu_align_heap (int align);
grub_err_t grub_xnu_scan_dir_for_kexts (char *dirname,
const char *osbundlerequired,
int maxrecursion);
grub_err_t grub_xnu_load_kext_from_dir (char *dirname,
const char *osbundlerequired,
int maxrecursion);
grub_err_t grub_xnu_heap_malloc (int size, void **src, grub_addr_t *target);
grub_err_t grub_xnu_fill_devicetree (void);
extern struct grub_relocator *grub_xnu_relocator;
extern grub_size_t grub_xnu_heap_size;
extern struct grub_video_bitmap *grub_xnu_bitmap;
typedef enum {GRUB_XNU_BITMAP_CENTER, GRUB_XNU_BITMAP_STRETCH}
grub_xnu_bitmap_mode_t;
extern grub_xnu_bitmap_mode_t grub_xnu_bitmap_mode;
extern int grub_xnu_is_64bit;
extern grub_addr_t grub_xnu_heap_target_start;
#endif