build: Remove dependency on GCC-specific -fplan9-extensions flag
diff --git a/stage23/Makefile b/stage23/Makefile
index f53fc7fd..7c3f7d88 100644
--- a/stage23/Makefile
+++ b/stage23/Makefile
@@ -45,7 +45,6 @@ S2CFLAGS = -Os -g -pipe -Wall -Wextra $(WERROR)
INTERNAL_CFLAGS := \
-std=gnu11 \
- -fplan9-extensions \
-ffreestanding \
-fno-stack-protector \
-fno-omit-frame-pointer \
diff --git a/stage23/fs/iso9660.s2.c b/stage23/fs/iso9660.s2.c
index cf4a3660..aa35ec8a 100644
--- a/stage23/fs/iso9660.s2.c
+++ b/stage23/fs/iso9660.s2.c
@@ -43,7 +43,7 @@ struct iso9660_volume_descriptor {
} __attribute__((packed));
struct iso9660_primary_volume {
- struct iso9660_volume_descriptor;
+ struct iso9660_volume_descriptor volume_descriptor;
union {
struct {
diff --git a/stage23/lib/acpi.c b/stage23/lib/acpi.c
index 28f35be7..1c4b6303 100644
--- a/stage23/lib/acpi.c
+++ b/stage23/lib/acpi.c
@@ -128,7 +128,7 @@ void acpi_get_smbios(void **smbios32, void **smbios64) {
void *acpi_get_table(const char *signature, int index) {
int cnt = 0;
- struct rsdp_rev2 *rsdp = acpi_get_rsdp();
+ struct rsdp *rsdp = acpi_get_rsdp();
if (rsdp == NULL)
return NULL;
@@ -143,7 +143,7 @@ void *acpi_get_table(const char *signature, int index) {
rsdt = (struct rsdt *)(uintptr_t)rsdp->rsdt_addr;
size_t entry_count =
- (rsdt->length - sizeof(struct sdt)) / (use_xsdt ? 8 : 4);
+ (rsdt->header.length - sizeof(struct sdt)) / (use_xsdt ? 8 : 4);
for (size_t i = 0; i < entry_count; i++) {
struct sdt *ptr;
diff --git a/stage23/lib/acpi.h b/stage23/lib/acpi.h
index 72d9a572..226ef6c4 100644
--- a/stage23/lib/acpi.h
+++ b/stage23/lib/acpi.h
@@ -24,10 +24,7 @@ struct rsdp {
char oem_id[6];
uint8_t rev;
uint32_t rsdt_addr;
-} __attribute__((packed));
-
-struct rsdp_rev2 {
- struct rsdp;
+ // Rev 2 only after this comment
uint32_t length;
uint64_t xsdt_addr;
uint8_t ext_checksum;
@@ -35,7 +32,7 @@ struct rsdp_rev2 {
} __attribute__((packed));
struct rsdt {
- struct sdt;
+ struct sdt header;
char ptrs_start[];
} __attribute__((packed));
diff --git a/stage23/sys/lapic.c b/stage23/sys/lapic.c
index b6d20640..ffe480d6 100644
--- a/stage23/sys/lapic.c
+++ b/stage23/sys/lapic.c
@@ -7,7 +7,7 @@
#include <lib/acpi.h>
struct dmar {
- struct sdt;
+ struct sdt header;
uint8_t host_address_width;
uint8_t flags;
uint8_t reserved[10];
diff --git a/stage23/sys/smp.c b/stage23/sys/smp.c
index 68957d36..d625b9a9 100644
--- a/stage23/sys/smp.c
+++ b/stage23/sys/smp.c
@@ -13,7 +13,7 @@
#include <mm/pmm.h>
struct madt {
- struct sdt;
+ struct sdt header;
uint32_t local_controller_addr;
uint32_t flags;
char madt_entries_begin[];
@@ -25,14 +25,14 @@ struct madt_header {
} __attribute__((packed));
struct madt_lapic {
- struct madt_header;
+ struct madt_header header;
uint8_t acpi_processor_uid;
uint8_t lapic_id;
uint32_t flags;
} __attribute__((packed));
struct madt_x2apic {
- struct madt_header;
+ struct madt_header header;
uint8_t reserved[2];
uint32_t x2apic_id;
uint32_t flags;
@@ -164,7 +164,7 @@ struct smp_information *init_smp(size_t header_hack_size,
size_t max_cpus = 0;
for (uint8_t *madt_ptr = (uint8_t *)madt->madt_entries_begin;
- (uintptr_t)madt_ptr < (uintptr_t)madt + madt->length;
+ (uintptr_t)madt_ptr < (uintptr_t)madt + madt->header.length;
madt_ptr += *(madt_ptr + 1)) {
switch (*madt_ptr) {
case 0: {
@@ -200,7 +200,7 @@ struct smp_information *init_smp(size_t header_hack_size,
// Try to start all APs
for (uint8_t *madt_ptr = (uint8_t *)madt->madt_entries_begin;
- (uintptr_t)madt_ptr < (uintptr_t)madt + madt->length;
+ (uintptr_t)madt_ptr < (uintptr_t)madt + madt->header.length;
madt_ptr += *(madt_ptr + 1)) {
switch (*madt_ptr) {
case 0: {
