-#define BUILD_STACK_ADDR 0xfffe
-#define BUILD_CPU_COUNT_ADDR 0xf000
-#define BUILD_AP_BOOT_ADDR 0x10000
-#define BUILD_BSS_ADDR 0x40000
- /* 64 KB used to copy the BIOS to shadow RAM */
-#define BUILD_BIOS_TMP_ADDR 0x30000
-
-#define BUILD_PM_IO_BASE 0xb000
-#define BUILD_SMB_IO_BASE 0xb100
-#define BUILD_SMI_CMD_IO_ADDR 0xb2
-
-// Start of fixed addresses in 0xf0000 segment.
-#define BUILD_START_FIXED 0xe050
+#define BUILD_STACK_ADDR 0x7000
+#define BUILD_S3RESUME_STACK_ADDR 0x1000
+#define BUILD_AP_BOOT_ADDR 0x10000
+#define BUILD_EBDA_MINIMUM 0x90000
+#define BUILD_LOWRAM_END 0xa0000
+#define BUILD_ROM_START 0xc0000
+#define BUILD_BIOS_ADDR 0xf0000
+#define BUILD_BIOS_SIZE 0x10000
+// 32KB for shadow ram copying (works around emulator deficiencies)
+#define BUILD_BIOS_TMP_ADDR 0x30000
+#define BUILD_SMM_INIT_ADDR 0x38000
+#define BUILD_SMM_ADDR 0xa8000
+#define BUILD_SMM_SIZE 0x8000
+#define BUILD_MAX_HIGHMEM 0xe0000000
+
+#define BUILD_PCIMEM_START 0xe0000000
+#define BUILD_PCIMEM_END 0xfec00000 /* IOAPIC is mapped at */
+
+#define BUILD_IOAPIC_ADDR 0xfec00000
+#define BUILD_HPET_ADDRESS 0xfed00000
+#define BUILD_APIC_ADDR 0xfee00000
+
+// Important real-mode segments
+#define SEG_IVT 0x0000
+#define SEG_BDA 0x0040
+#define SEG_BIOS 0xf000
+
+// Segment definitions in protected mode (see rombios32_gdt in misc.c)
+#define SEG32_MODE32_CS (1 << 3)
+#define SEG32_MODE32_DS (2 << 3)
+#define SEG32_MODE16_CS (3 << 3)
+#define SEG32_MODE16_DS (4 << 3)
+#define SEG32_MODE16BIG_CS (5 << 3)
+#define SEG32_MODE16BIG_DS (6 << 3)