feat: aarch64 port - fix build system obstacles, add exception handling, page tables

This commit is contained in:
daniel committed 2026-10-25 07:43:46 +01:00
1 parent aae4db01ad
commit 8b6379fb7e
19 files changed
+1207 -77

No files matched your search

+25
View File
@@ -187,7 +187,20 @@ namespace Pci {
Io::Out32(value, ConfigDataPort);
}
// Drivers reach config space through the Legacy* calls below. Without
// an I/O address space (ARM) there is no CF8/CFC mechanism, so they use
// ECAM there, at the access's own width (16/8-bit writes must not
// read-modify-write a neighbouring RW1C register).
static bool EcamCovers(uint8_t bus);
static bool UseEcamForLegacy(uint8_t bus) {
return !Io::HasPortIo && EcamCovers(bus);
}
uint32_t LegacyRead32(uint8_t bus, uint8_t device, uint8_t function, uint8_t offset) {
if (UseEcamForLegacy(bus)) {
return EcamRead32(g_ecamBase, bus, device, function, offset & 0xFC);
}
g_legacyConfigLock.Acquire();
uint32_t value = LegacyRead32Unlocked(bus, device, function, offset);
g_legacyConfigLock.Release();
@@ -205,12 +218,20 @@ namespace Pci {
}
void LegacyWrite32(uint8_t bus, uint8_t device, uint8_t function, uint8_t offset, uint32_t value) {
if (UseEcamForLegacy(bus)) {
EcamWrite32(g_ecamBase, bus, device, function, offset & 0xFC, value);
return;
}
g_legacyConfigLock.Acquire();
LegacyWrite32Unlocked(bus, device, function, offset, value);
g_legacyConfigLock.Release();
}
void LegacyWrite16(uint8_t bus, uint8_t device, uint8_t function, uint8_t offset, uint16_t value) {
if (UseEcamForLegacy(bus)) {
EcamWrite16(g_ecamBase, bus, device, function, offset & 0xFE, value);
return;
}
g_legacyConfigLock.Acquire();
uint32_t tmp = LegacyRead32Unlocked(bus, device, function, offset & 0xFC);
int shift = (offset & 2) * 8;
@@ -221,6 +242,10 @@ namespace Pci {
}
void LegacyWrite8(uint8_t bus, uint8_t device, uint8_t function, uint8_t offset, uint8_t value) {
if (UseEcamForLegacy(bus)) {
EcamWrite8(g_ecamBase, bus, device, function, offset, value);
return;
}
g_legacyConfigLock.Acquire();
uint32_t tmp = LegacyRead32Unlocked(bus, device, function, offset & 0xFC);
int shift = (offset & 3) * 8;