summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/acpi/Acpi.cpp16
-rw-r--r--drivers/acpi/Acpi.h8
2 files changed, 13 insertions, 11 deletions
diff --git a/drivers/acpi/Acpi.cpp b/drivers/acpi/Acpi.cpp
index 207c9bb..6551c6a 100644
--- a/drivers/acpi/Acpi.cpp
+++ b/drivers/acpi/Acpi.cpp
@@ -3,10 +3,10 @@
const char *Rsdp::signatureString = "RSD PTR ";
const uint8 Rsdp::validFieldRevision = 2;
-const memAddr Rsdp::romAreaStart = 0xe0000;
-const memAddr Rsdp::romAreaEnd = 0xfffff;
-const memAddr Rsdp::ebdaAreaStart = 0x80000;
-const memAddr Rsdp::ebdaAreaEnd = 0x803ff;
+const uintptr Rsdp::romAreaStart = 0xe0000;
+const uintptr Rsdp::romAreaEnd = 0xfffff;
+const uintptr Rsdp::ebdaAreaStart = 0x80000;
+const uintptr Rsdp::ebdaAreaEnd = 0x803ff;
const uint8 Rsdp::checksunFieldSize = 20;
const uint8 Entry::size = 4;
const uint8 sizeWithoutIcs = 44;
@@ -45,7 +45,7 @@ uint8 Rsdp::checksumCheck() const
uint8 check = 0;
for(uint32 offset = 0; offset < checksunFieldSize; offset++)
{
- check += *(uint8 *)((memAddr)this + offset);
+ check += *(uint8 *)((uintptr)this + offset);
}
return check;
};
@@ -55,13 +55,15 @@ uint8 DescHeader::checksumCheck() const
uint8 check = 0;
for(uint32 offset = 0; offset < length; offset++)
{
- check += *(uint8 *)((memAddr)this + offset);
+ check += *(uint8 *)((uintptr)this + offset);
}
return check;
};
const Ics *Madt::getIcs(uint8 index) const
{
+ if(header.checksumCheck()) return nullptr;
+
uint32 icsBytesRemain = header.getLength() - ::sizeWithoutIcs;
uint16 indexAmass = 0;
const Ics *icsPtr = (Ics *)(&icsBegin);
@@ -73,7 +75,7 @@ const Ics *Madt::getIcs(uint8 index) const
{
icsBytesRemain -= icsPtr->getLength();
indexAmass++;
- icsPtr = (Ics *)((memAddr)icsPtr + icsPtr->getLength());
+ icsPtr = (Ics *)((uintptr)icsPtr + icsPtr->getLength());
}
}
diff --git a/drivers/acpi/Acpi.h b/drivers/acpi/Acpi.h
index 6a5c806..506ab99 100644
--- a/drivers/acpi/Acpi.h
+++ b/drivers/acpi/Acpi.h
@@ -154,10 +154,10 @@ class Rsdp
const static uint8 validFieldRevision;
// RSDP memory address areas in IA-PC systems
const static char *signatureString;
- const static memAddr romAreaStart;
- const static memAddr romAreaEnd;
- const static memAddr ebdaAreaStart;
- const static memAddr ebdaAreaEnd;
+ const static uintptr romAreaStart;
+ const static uintptr romAreaEnd;
+ const static uintptr ebdaAreaStart;
+ const static uintptr ebdaAreaEnd;
private:
const static uint8 checksunFieldSize;
const char signature[8];