~ubuntu-branches/ubuntu/trusty/grub2/trusty

« back to all changes in this revision

Viewing changes to include/grub/macho.h

  • Committer: Package Import Robot
  • Author(s): Colin Watson
  • Date: 2014-01-16 15:18:04 UTC
  • mfrom: (17.6.38 experimental)
  • Revision ID: package-import@ubuntu.com-20140116151804-3foouk7fpqcq3sxx
Tags: 2.02~beta2-2
* Convert patch handling to git-dpm.
* Add bi-endian support to ELF parser (Tomohiro B Berry).
* Adjust restore_mkdevicemap.patch to mark get_kfreebsd_version as static,
  to appease "gcc -Werror=missing-prototypes".
* Cherry-pick from upstream:
  - Change grub-macbless' manual page section to 8.
* Install grub-glue-efi, grub-macbless, grub-render-label, and
  grub-syslinux2cfg.
* grub-shell: Pass -no-pad to xorriso when building floppy images.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
{
26
26
  grub_uint32_t magic;
27
27
  grub_uint32_t nfat_arch;
28
 
} __attribute__ ((packed));
 
28
} GRUB_PACKED;
 
29
 
 
30
enum
 
31
  {
 
32
    GRUB_MACHO_CPUTYPE_IA32 = 0x00000007,
 
33
    GRUB_MACHO_CPUTYPE_AMD64 = 0x01000007
 
34
  };
 
35
 
29
36
#define GRUB_MACHO_FAT_MAGIC 0xcafebabe
 
37
#define GRUB_MACHO_FAT_EFI_MAGIC 0x0ef1fab9U
30
38
 
31
39
typedef grub_uint32_t grub_macho_cpu_type_t;
32
40
typedef grub_uint32_t grub_macho_cpu_subtype_t;
39
47
  grub_uint32_t offset;
40
48
  grub_uint32_t size;
41
49
  grub_uint32_t align;
42
 
} __attribute__ ((packed));
 
50
} GRUB_PACKED;
43
51
 
44
52
/* File header for 32-bit. Always in native-endian. */
45
53
struct grub_macho_header32
52
60
  grub_uint32_t ncmds;
53
61
  grub_uint32_t sizeofcmds;
54
62
  grub_uint32_t flags;
55
 
} __attribute__ ((packed));
 
63
} GRUB_PACKED;
56
64
 
57
65
/* File header for 64-bit. Always in native-endian. */
58
66
struct grub_macho_header64
66
74
  grub_uint32_t sizeofcmds;
67
75
  grub_uint32_t flags;
68
76
  grub_uint32_t reserved;
69
 
} __attribute__ ((packed));
 
77
} GRUB_PACKED;
70
78
 
71
79
/* Common header of Mach-O commands. */
72
80
struct grub_macho_cmd
73
81
{
74
82
  grub_uint32_t cmd;
75
83
  grub_uint32_t cmdsize;
76
 
} __attribute__ ((packed));
 
84
} GRUB_PACKED;
77
85
 
78
86
typedef grub_uint32_t grub_macho_vmprot_t;
79
87
 
92
100
  grub_macho_vmprot_t initprot;
93
101
  grub_uint32_t nsects;
94
102
  grub_uint32_t flags;
95
 
} __attribute__ ((packed));
 
103
} GRUB_PACKED;
96
104
 
97
105
/* 64-bit segment command. */
98
106
struct grub_macho_segment64
109
117
  grub_macho_vmprot_t initprot;
110
118
  grub_uint32_t nsects;
111
119
  grub_uint32_t flags;
112
 
} __attribute__ ((packed));
 
120
} GRUB_PACKED;
113
121
 
114
122
#define GRUB_MACHO_CMD_THREAD     5
115
123
 
129
137
  struct grub_macho_header32 thin32;
130
138
  struct grub_macho_header64 thin64;
131
139
  struct grub_macho_lzss_header lzss;
132
 
} __attribute__ ((packed));
 
140
} GRUB_PACKED;
 
141
 
 
142
struct grub_macho_thread32
 
143
{
 
144
  grub_uint32_t cmd;
 
145
  grub_uint32_t cmdsize;
 
146
  grub_uint8_t unknown1[48];
 
147
  grub_uint32_t entry_point;
 
148
  grub_uint8_t unknown2[20];
 
149
} GRUB_PACKED;
 
150
 
 
151
struct grub_macho_thread64
 
152
{
 
153
  grub_uint32_t cmd;
 
154
  grub_uint32_t cmdsize;
 
155
  grub_uint8_t unknown1[0x88];
 
156
  grub_uint64_t entry_point;
 
157
  grub_uint8_t unknown2[0x20];
 
158
} GRUB_PACKED;
133
159
 
134
160
#define GRUB_MACHO_LZSS_OFFSET 0x180
135
161