summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/Acpi.cpp
diff options
context:
space:
mode:
authorAlexey Gavrilov <rebovas@yahoo.com>2024-03-27 19:49:10 +0700
committerAlexey Gavrilov <rebovas@yahoo.com>2024-03-27 19:49:10 +0700
commite51dea0b6e34c2959b3b0f4a5db6b11d4b619960 (patch)
treee6a457ec4b2758c0c3bef78df475ad52d92a7ab4 /drivers/acpi/Acpi.cpp
parente0bac2387b373316337b177fe8aa9851b0d5e870 (diff)
Some updates: rename memAddr, define architecture
Diffstat (limited to 'drivers/acpi/Acpi.cpp')
-rw-r--r--drivers/acpi/Acpi.cpp16
1 files changed, 9 insertions, 7 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());
}
}