grub2/include/grub/xnu.h
proski 4241d2b13a 2009-05-04 Pavel Roskin <proski@gnu.org>
* disk/ata.c: Spelling fixes.
	* disk/raid.c: Likewise.
	* disk/usbms.c: Likewise.
	* disk/dmraid_nvidia.c: Likewise.
	* kern/ieee1275/openfw.c: Likewise.
	* kern/ieee1275/init.c: Likewise.
	* kern/ieee1275/cmain.c: Likewise.
	* boot/i386/pc/cdboot.S: Likewise.
	* video/readers/png.c: Likewise.
	* video/i386/pc/vbe.c: Likewise.
	* fs/udf.c: Likewise.
	* fs/hfs.c: Likewise.
	* fs/reiserfs.c: Likewise.
	* efiemu/runtime/efiemu.c: Likewise.
	* efiemu/main.c: Likewise.
	* efiemu/mm.c: Likewise.
	* include/grub/elf.h: Likewise.
	* include/grub/xnu.h: Likewise.
	* include/grub/usbdesc.h: Likewise.
	* include/grub/usb.h: Likewise.
	* include/grub/script_sh.h: Likewise.
	* include/grub/lib/LzmaEnc.h: Likewise.
	* include/grub/efiemu/efiemu.h: Likewise.
	* include/grub/command.h: Likewise.
	* normal/menu.c: Likewise.
	* normal/main.c: Likewise.
	* normal/datetime.c: Likewise.
	* bus/usb/uhci.c: Likewise.
	* mmap/i386/uppermem.c: Likewise.
	* mmap/mmap.c: Likewise.
	* commands/acpi.c: Likewise.
	* commands/test.c: Likewise.
	* partmap/apple.c: Likewise.
	* font/font.c: Likewise.
	* loader/sparc64/ieee1275/linux.c: Likewise.
	* loader/macho.c: Likewise.
	* loader/i386/bsd_trampoline.S: Likewise.
	* loader/i386/bsd.c: Likewise.
	* loader/xnu.c: Likewise.
	* term/i386/pc/vesafb.c: Likewise.
	* term/usb_keyboard.c: Likewise.
	* util/resolve.c: Likewise.
	* util/getroot.c: Likewise.
2009-05-04 20:06:05 +00:00

108 lines
3.3 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;
} __attribute__ ((packed));
struct grub_xnu_devtree_key *grub_xnu_create_key (struct grub_xnu_devtree_key **parent,
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 (void **start, grub_size_t *size);
struct grub_xnu_devtree_key *grub_xnu_create_value (struct grub_xnu_devtree_key **parent,
char *name);
void grub_xnu_lock (void);
void grub_xnu_unlock (void);
grub_err_t grub_xnu_resume (char *imagename);
struct grub_xnu_devtree_key *grub_xnu_find_key (struct grub_xnu_devtree_key *parent,
char *name);
grub_err_t grub_xnu_align_heap (int align);
grub_err_t grub_xnu_scan_dir_for_kexts (char *dirname, char *osbundlerequired,
int maxrecursion);
grub_err_t grub_xnu_load_kext_from_dir (char *dirname, char *osbundlerequired,
int maxrecursion);
void *grub_xnu_heap_malloc (int size);
extern grub_uint32_t grub_xnu_heap_real_start;
extern grub_size_t grub_xnu_heap_size;
extern char *grub_xnu_heap_start;
extern struct grub_video_bitmap *grub_xnu_bitmap;
#endif