]> git.proxmox.com Git - grub2.git/blame - include/grub/i386/xnu.h
2009-08-28 Vladimir Serbinenko <phcoder@gmail.com>
[grub2.git] / include / grub / i386 / xnu.h
CommitLineData
64bf71d0 1/*
2 * GRUB -- GRand Unified Bootloader
3 * Copyright (C) 2009 Free Software Foundation, Inc.
4 *
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.
9 *
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.
14 *
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/>.
17 */
18
bbee0f2b 19#ifndef GRUB_CPU_XNU_H
20#define GRUB_CPU_XNU_H 1
21
64bf71d0 22#include <grub/err.h>
23
bbee0f2b 24#define GRUB_XNU_PAGESIZE 4096
25typedef grub_uint32_t grub_xnu_ptr_t;
26
27struct grub_xnu_boot_params
28{
b39f9d20 29 grub_uint16_t verminor;
30 grub_uint16_t vermajor;
bbee0f2b 31 /* Command line passed to xnu. */
b39f9d20 32 grub_uint8_t cmdline[1024];
bbee0f2b 33
34 /* Later are the same as EFI's get_memory_map (). */
b39f9d20 35 grub_xnu_ptr_t efi_mmap;
36 grub_uint32_t efi_mmap_size;
37 grub_uint32_t efi_mem_desc_size;
38 grub_uint32_t efi_mem_desc_version;
bbee0f2b 39
40 /* Later are video parameters. */
41 grub_xnu_ptr_t lfb_base;
42#define GRUB_XNU_VIDEO_SPLASH 1
43#define GRUB_XNU_VIDEO_TEXT_IN_VIDEO 2
b39f9d20 44 grub_uint32_t lfb_mode;
bbee0f2b 45 grub_uint32_t lfb_line_len;
46 grub_uint32_t lfb_width;
47 grub_uint32_t lfb_height;
48 grub_uint32_t lfb_depth;
49
50 /* Pointer to device tree and its len. */
51 grub_xnu_ptr_t devtree;
52 grub_uint32_t devtreelen;
b39f9d20 53
bbee0f2b 54 /* First used address by kernel or boot structures. */
55 grub_xnu_ptr_t heap_start;
b39f9d20 56 /* Last used address by kernel or boot structures minus previous value. */
bbee0f2b 57 grub_uint32_t heap_size;
b39f9d20 58
bbee0f2b 59 /* First memory page containing runtime code or data. */
60 grub_uint32_t efi_runtime_first_page;
61 /* First memory page containing runtime code or data minus previous value. */
62 grub_uint32_t efi_runtime_npages;
63 grub_uint32_t efi_system_table;
64 /* Size of grub_efi_uintn_t in bits. */
65 grub_uint8_t efi_uintnbits;
66} __attribute__ ((packed));
67#define GRUB_XNU_BOOTARGS_VERMINOR 4
68#define GRUB_XNU_BOOTARGS_VERMAJOR 1
69
70extern grub_uint32_t grub_xnu_entry_point;
71extern grub_uint32_t grub_xnu_stack;
72extern grub_uint32_t grub_xnu_arg1;
73extern char grub_xnu_cmdline[1024];
74grub_err_t grub_xnu_boot (void);
75grub_err_t grub_cpu_xnu_fill_devicetree (void);
76grub_err_t grub_xnu_set_video (struct grub_xnu_boot_params *bootparams_relloc);
77extern grub_uint32_t grub_xnu_heap_will_be_at;
78extern grub_uint8_t grub_xnu_launcher_start[];
79extern grub_uint8_t grub_xnu_launcher_end[];
80#endif