File tree Expand file tree Collapse file tree 2 files changed +16
-7
lines changed Expand file tree Collapse file tree 2 files changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -106,6 +106,12 @@ namespace x86
106106 }
107107 }
108108
109+ [[noreturn]] static void ioapic_panic (uint32_t entry) {
110+ printf (" Entry: %u\n " , entry);
111+ assert (0 && " Could not match I/O APIC to entry" );
112+ std::abort ();
113+ }
114+
109115 inline IOapic& get_ioapic_for (uint32_t entry)
110116 {
111117 uint32_t current = 0 ;
@@ -115,8 +121,7 @@ namespace x86
115121 }
116122 current += a.entries ();
117123 }
118- printf (" Entry: %u\n " , entry);
119- assert (0 && " Could not match I/O APIC to entry" );
124+ ioapic_panic (entry);
120125 }
121126
122127 void IOAPIC::enable (uint8_t cpu, const ACPI::override_t & redir)
Original file line number Diff line number Diff line change @@ -206,9 +206,13 @@ static int prune_elf_symbols(char* location)
206206 assert (hdr->e_ident [EI_MAG2] == ELFMAG2);
207207 assert (hdr->e_ident [EI_MAG3] == ELFMAG3);
208208
209- if (hdr->e_ident [EI_CLASS] == ELFCLASS32)
210- return prune_elf32_symbols (location);
211- else if (hdr->e_ident [EI_CLASS] == ELFCLASS64)
212- return prune_elf64_symbols (location);
213- assert (0 && " Unknown ELF class" );
209+ switch (hdr->e_ident [EI_CLASS]) {
210+ case ELFCLASS32:
211+ return prune_elf32_symbols (location);
212+ case ELFCLASS64:
213+ return prune_elf64_symbols (location);
214+ default :
215+ assert (false && " Unknown ELF class" );
216+ return 0 ;
217+ }
214218}
You can’t perform that action at this time.
0 commit comments