@@ -129,7 +129,8 @@ static status_t platform_parse_multiboot_info(size_t *found_mem_arenas) {
129129
130130 /* bump the multiboot pointer up to the kernel mapping */
131131 /* TODO: test that it's within range of the kernel mapping */
132- const multiboot_info_t * multiboot_info = (void * )((uintptr_t )_multiboot_info + KERNEL_BASE );
132+ const multiboot_info_t *multiboot_info =
133+ reinterpret_cast <const multiboot_info_t *>((uintptr_t )_multiboot_info + KERNEL_BASE);
133134
134135 dprintf (SPEW, " \t flags %#x\n " , multiboot_info->flags );
135136
@@ -154,7 +155,7 @@ static status_t platform_parse_multiboot_info(size_t *found_mem_arenas) {
154155 // more modern multiboot mmap array
155156 if (multiboot_info->flags & MB_INFO_MMAP) {
156157 const memory_map_t *mmap = (const memory_map_t *)(uintptr_t )multiboot_info->mmap_addr ;
157- mmap = (void * )((uintptr_t )mmap + KERNEL_BASE );
158+ mmap = (const memory_map_t *)((uintptr_t )mmap + KERNEL_BASE);
158159
159160 dprintf (SPEW, " PC: multiboot memory map, length %u:\n " , multiboot_info->mmap_length );
160161 parse_multiboot_mmap (mmap, multiboot_info->mmap_length , found_mem_arenas);
@@ -185,8 +186,10 @@ void platform_early_init(void) {
185186 /* get the debug output working */
186187 platform_init_debug_early ();
187188
189+ #if WITH_LEGACY_PC_CONSOLE
188190 /* get the text console working */
189191 platform_init_console ();
192+ #endif
190193
191194 /* initialize the interrupt controller */
192195 platform_init_interrupts ();
@@ -220,21 +223,24 @@ void platform_early_init(void) {
220223}
221224
222225void local_apic_callback (const void *_entry, size_t entry_len) {
223- const struct acpi_madt_local_apic_entry * entry = _entry ;
226+ const struct acpi_madt_local_apic_entry *entry =
227+ reinterpret_cast <const struct acpi_madt_local_apic_entry *>(_entry);
224228
225229 printf (" \t LOCAL APIC id %d, processor id %d, flags %#x\n " , entry->apic_id , entry->processor_id ,
226230 entry->flags );
227231}
228232
229233void io_apic_callback (const void *_entry, size_t entry_len) {
230- const struct acpi_madt_io_apic_entry * entry = _entry ;
234+ const struct acpi_madt_io_apic_entry *entry =
235+ reinterpret_cast <const struct acpi_madt_io_apic_entry *>(_entry);
231236
232237 printf (" \t IO APIC id %d, address %#x gsi base %u\n " , entry->io_apic_id , entry->io_apic_address ,
233238 entry->global_system_interrupt_base );
234239}
235240
236241void int_source_override_callback (const void *_entry, size_t entry_len) {
237- const struct acpi_madt_int_source_override_entry * entry = _entry ;
242+ const struct acpi_madt_int_source_override_entry *entry =
243+ reinterpret_cast <const struct acpi_madt_int_source_override_entry *>(_entry);
238244
239245 printf (" \t INT OVERRIDE bus %u, source %u, gsi %u, flags %#x\n " , entry->bus , entry->source ,
240246 entry->global_sys_interrupt , entry->flags );
@@ -264,7 +270,8 @@ void platform_init(void) {
264270 (const struct acpi_mcfg_table *)acpi_get_table_by_sig (ACPI_MCFG_SIG);
265271 if (table) {
266272 if (table->header .length >= sizeof (*table) + sizeof (struct acpi_mcfg_entry )) {
267- const struct acpi_mcfg_entry * entry = (const void * )(table + 1 );
273+ const struct acpi_mcfg_entry *entry =
274+ reinterpret_cast <const struct acpi_mcfg_entry *>(table + 1 );
268275 printf (" PCI MCFG: segment %#hx bus [%hhu...%hhu] address %#llx\n " , entry->segment ,
269276 entry->start_bus , entry->end_bus , entry->base_address );
270277
@@ -292,8 +299,9 @@ void platform_init(void) {
292299}
293300
294301#if WITH_LIB_MINIP
302+ extern " C" status_t e1000_register_with_minip (void );
303+
295304void _start_minip (uint level) {
296- extern status_t e1000_register_with_minip (void );
297305 status_t err = e1000_register_with_minip ();
298306 if (err == NO_ERROR) {
299307 minip_start_dhcp ();
0 commit comments