54
53
/* Switch from phase 1 (counting) to phase 2 (real job) */
55
54
grub_efiemu_alloc_syms ();
56
55
grub_efiemu_mm_do_alloc ();
56
grub_efiemu_write_sym_markers ();
58
58
grub_efiemu_system_table32 = 0;
59
59
grub_efiemu_system_table64 = 0;
81
81
= (struct SUFFIX (grub_efi_system_table) *)
82
82
((grub_uint8_t *) grub_efiemu_mm_obtain_request (handle) + off);
84
/* compute CRC32 of runtime_services */
85
if ((err = grub_efiemu_resolve_symbol ("efiemu_runtime_services",
88
runtime_services = (struct SUFFIX (grub_efiemu_runtime_services) *)
89
((grub_uint8_t *) grub_efiemu_mm_obtain_request (handle) + off);
90
runtime_services->hdr.crc32 = 0;
91
runtime_services->hdr.crc32 = grub_getcrc32
92
(0, runtime_services, runtime_services->hdr.header_size);
94
84
/* Put pointer to the list of configuration tables in system table */
95
85
grub_efiemu_write_value
96
86
(&(SUFFIX (grub_efiemu_system_table)->configuration_table), 0,
113
103
conftables[i].vendor_table = PTR_TO_UINT64 (cur->data);
106
err = SUFFIX (grub_efiemu_crc) ();
109
grub_efiemu_unload ();
113
grub_dprintf ("efiemu","system_table = %p, conftables = %p (%d entries)\n",
114
SUFFIX (grub_efiemu_system_table), conftables, cntconftables);
116
return GRUB_ERR_NONE;
120
SUFFIX (grub_efiemu_crc) (void)
125
struct SUFFIX (grub_efiemu_runtime_services) *runtime_services;
127
/* compute CRC32 of runtime_services */
128
err = grub_efiemu_resolve_symbol ("efiemu_runtime_services",
133
runtime_services = (struct SUFFIX (grub_efiemu_runtime_services) *)
134
((grub_uint8_t *) grub_efiemu_mm_obtain_request (handle) + off);
135
runtime_services->hdr.crc32 = 0;
136
runtime_services->hdr.crc32 = grub_getcrc32
137
(0, runtime_services, runtime_services->hdr.header_size);
139
err = grub_efiemu_resolve_symbol ("efiemu_system_table", &handle, &off);
116
143
/* compute CRC32 of system table */
117
144
SUFFIX (grub_efiemu_system_table)->hdr.crc32 = 0;
118
145
SUFFIX (grub_efiemu_system_table)->hdr.crc32
119
146
= grub_getcrc32 (0, SUFFIX (grub_efiemu_system_table),
120
147
SUFFIX (grub_efiemu_system_table)->hdr.header_size);
122
grub_dprintf ("efiemu","system_table = %p, runtime_services = %p,"
123
" conftables = %p (%d entries)\n",
124
SUFFIX (grub_efiemu_system_table), runtime_services,
125
conftables, cntconftables);
149
grub_dprintf ("efiemu","system_table = %p, runtime_services = %p\n",
150
SUFFIX (grub_efiemu_system_table), runtime_services);
127
152
return GRUB_ERR_NONE;