summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-06-02 09:00:18 +0200
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-06-02 09:00:18 +0200
commitc34c46598c12b04b2877aa7290dd401cc40a29e3 (patch)
treea564821d683b1c906a7d1a8ad9152486bfab91e8
parent5bc5e4de0d4dcfc52c192315ca5c59a066d678d8 (diff)
ACPI: even error codes.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
-rw-r--r--Kernel/HALKit/AMD64/HalACPIFactoryInterface.cxx17
-rw-r--r--SDK/Libraries/CoreSystem/Headers/Defines.h4
-rw-r--r--SDK/Libraries/CoreSystem/Headers/Math.h2
3 files changed, 11 insertions, 12 deletions
diff --git a/Kernel/HALKit/AMD64/HalACPIFactoryInterface.cxx b/Kernel/HALKit/AMD64/HalACPIFactoryInterface.cxx
index adeeb10d..7bdec117 100644
--- a/Kernel/HALKit/AMD64/HalACPIFactoryInterface.cxx
+++ b/Kernel/HALKit/AMD64/HalACPIFactoryInterface.cxx
@@ -63,17 +63,15 @@ namespace NewOS
MUST_PASS(fRsdp);
if (!signature)
- return ErrorOr<voidPtr>{-2};
+ return ErrorOr<voidPtr>{-1};
if (*signature == 0)
- return ErrorOr<voidPtr>{-3};
+ return ErrorOr<voidPtr>{-1};
RSDP* rsdPtr = reinterpret_cast<RSDP*>(this->fRsdp);
if (rsdPtr->Revision <= 1)
- {
- return ErrorOr<voidPtr>{-4};
- }
+ return ErrorOr<voidPtr>{-1};
/// FIXME
RSDT* xsdt = (RSDT*)(rsdPtr->RsdtAddress);
@@ -82,15 +80,16 @@ namespace NewOS
if (num < 1)
{
- kcout << "ACPI: No entries." << endl;
- return ErrorOr<voidPtr>{-6};
+ /// stop here, we should have entries...
+ ke_stop(RUNTIME_CHECK_ACPI);
+ return ErrorOr<voidPtr>{-1};
}
this->fEntries = num;
kcout << "ACPI: Number of entries: " << number(this->fEntries) << endl;
kcout << "ACPI: Revision: " << number(xsdt->Revision) << endl;
- kcout << "ACPI: XSDT: " << xsdt->Signature << endl;
+ kcout << "ACPI: Signature: " << xsdt->Signature << endl;
kcout << "ACPI: Address of XSDT: " << hex_number((UIntPtr)xsdt) << endl;
const short cAcpiSignatureLength = 4;
@@ -111,7 +110,7 @@ namespace NewOS
}
}
- return ErrorOr<voidPtr>{nullptr};
+ return ErrorOr<voidPtr>{-1};
}
/***
diff --git a/SDK/Libraries/CoreSystem/Headers/Defines.h b/SDK/Libraries/CoreSystem/Headers/Defines.h
index a7e46234..713d6df8 100644
--- a/SDK/Libraries/CoreSystem/Headers/Defines.h
+++ b/SDK/Libraries/CoreSystem/Headers/Defines.h
@@ -32,6 +32,8 @@
#endif
+#include <Headers/Alert.h>
+
struct ApplicationInterface;
struct GUID;
@@ -231,5 +233,3 @@ typedef CharacterTypeUTF8 StrType255[255];
#ifndef kInvalidRef
#define kInvalidRef 0
#endif
-
-#include <Headers/Alert.h>
diff --git a/SDK/Libraries/CoreSystem/Headers/Math.h b/SDK/Libraries/CoreSystem/Headers/Math.h
index 0a13e86f..0079803e 100644
--- a/SDK/Libraries/CoreSystem/Headers/Math.h
+++ b/SDK/Libraries/CoreSystem/Headers/Math.h
@@ -9,7 +9,7 @@
#include <Headers/Defines.h>
///////////////////////////////////////////////////////////////////////
-/// Random functions ///
+/// Random number generators functions ///
///////////////////////////////////////////////////////////////////////
/// @brief Number generator helper.