Indentation fix, cleanup.
[AROS.git] / arch / all-pc / boot / grub2-aros / include / grub / xnu.h
blobb7a7f450cbcf0ed21fb190463432fe5db79c386c
1 /*
2 * GRUB -- GRand Unified Bootloader
3 * Copyright (C) 2009 Free Software Foundation, Inc.
5 * GRUB is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * GRUB is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
19 #ifndef GRUB_XNU_H
20 #define GRUB_XNU_H 1
22 #include <grub/bitmap.h>
24 /* Header of a hibernation image. */
25 struct grub_xnu_hibernate_header
27 /* Size of the image. Notice that file containing image is usually bigger. */
28 grub_uint64_t image_size;
29 grub_uint8_t unknown1[8];
30 /* Where to copy launchcode? */
31 grub_uint32_t launchcode_target_page;
32 /* How many pages of launchcode? */
33 grub_uint32_t launchcode_numpages;
34 /* Where to jump? */
35 grub_uint32_t entry_point;
36 /* %esp at start. */
37 grub_uint32_t stack;
38 grub_uint8_t unknown2[44];
39 #define GRUB_XNU_HIBERNATE_MAGIC 0x73696d65
40 grub_uint32_t magic;
41 grub_uint8_t unknown3[28];
42 /* This value is non-zero if page is encrypted. Unsupported. */
43 grub_uint64_t encoffset;
44 grub_uint8_t unknown4[360];
45 /* The size of additional header used to locate image without parsing FS.
46 Used only to skip it.
48 grub_uint32_t extmapsize;
49 } GRUB_PACKED;
51 /* In-memory structure for temporary keeping device tree. */
52 struct grub_xnu_devtree_key
54 char *name;
55 int datasize; /* -1 for not leaves. */
56 union
58 struct grub_xnu_devtree_key *first_child;
59 void *data;
61 struct grub_xnu_devtree_key *next;
64 /* A structure used in memory-map values. */
65 struct
66 grub_xnu_extdesc
68 grub_uint32_t addr;
69 grub_uint32_t size;
70 } GRUB_PACKED;
72 /* Header describing extension in the memory. */
73 struct grub_xnu_extheader
75 grub_uint32_t infoplistaddr;
76 grub_uint32_t infoplistsize;
77 grub_uint32_t binaryaddr;
78 grub_uint32_t binarysize;
79 grub_uint32_t nameaddr;
80 grub_uint32_t namesize;
81 } GRUB_PACKED;
83 struct grub_xnu_devtree_key *grub_xnu_create_key (struct grub_xnu_devtree_key **parent,
84 const char *name);
86 extern struct grub_xnu_devtree_key *grub_xnu_devtree_root;
88 void grub_xnu_free_devtree (struct grub_xnu_devtree_key *cur);
90 grub_err_t grub_xnu_writetree_toheap (grub_addr_t *target, grub_size_t *size);
91 struct grub_xnu_devtree_key *grub_xnu_create_value (struct grub_xnu_devtree_key **parent,
92 const char *name);
94 void grub_xnu_lock (void);
95 void grub_xnu_unlock (void);
96 grub_err_t grub_xnu_resume (char *imagename);
97 grub_err_t grub_xnu_boot_resume (void);
98 struct grub_xnu_devtree_key *grub_xnu_find_key (struct grub_xnu_devtree_key *parent,
99 const char *name);
100 grub_err_t grub_xnu_align_heap (int align);
101 grub_err_t grub_xnu_scan_dir_for_kexts (char *dirname,
102 const char *osbundlerequired,
103 int maxrecursion);
104 grub_err_t grub_xnu_load_kext_from_dir (char *dirname,
105 const char *osbundlerequired,
106 int maxrecursion);
107 grub_err_t grub_xnu_heap_malloc (int size, void **src, grub_addr_t *target);
108 grub_err_t grub_xnu_fill_devicetree (void);
109 extern struct grub_relocator *grub_xnu_relocator;
111 extern grub_size_t grub_xnu_heap_size;
112 extern struct grub_video_bitmap *grub_xnu_bitmap;
113 typedef enum {GRUB_XNU_BITMAP_CENTER, GRUB_XNU_BITMAP_STRETCH}
114 grub_xnu_bitmap_mode_t;
115 extern grub_xnu_bitmap_mode_t grub_xnu_bitmap_mode;
116 extern int grub_xnu_is_64bit;
117 extern grub_addr_t grub_xnu_heap_target_start;
118 extern int grub_xnu_darwin_version;
119 #endif