diff options
| author | Amlal <amlal.elmahrouss@icloud.com> | 2025-01-28 09:15:46 +0100 |
|---|---|---|
| committer | Amlal <amlal.elmahrouss@icloud.com> | 2025-01-28 09:15:46 +0100 |
| commit | 97d9cac7420ee032e8a2c4ae5e55963003516116 (patch) | |
| tree | bac5cf6e0488aa53dd9204003d9e982050f8f1a7 /dev/Kernel | |
| parent | 443197ebebaaeb13dbc31ee0303a0acffc45321d (diff) | |
ADD: RuntimeServices and format SATA.cc
Signed-off-by: Amlal <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'dev/Kernel')
| -rw-r--r-- | dev/Kernel/FirmwareKit/EFI/EFI.h | 16 | ||||
| -rw-r--r-- | dev/Kernel/HALKit/AMD64/Storage/SATA.cc | 14 |
2 files changed, 22 insertions, 8 deletions
diff --git a/dev/Kernel/FirmwareKit/EFI/EFI.h b/dev/Kernel/FirmwareKit/EFI/EFI.h index c96777d6..bbf990ce 100644 --- a/dev/Kernel/FirmwareKit/EFI/EFI.h +++ b/dev/Kernel/FirmwareKit/EFI/EFI.h @@ -610,6 +610,20 @@ struct EfiSimpleFilesystemProtocol EfiOpenVolume OpenVolume; }; +typedef struct EfiRuntimeServices +{ + EfiTableHeader SystemTable; + VoidPtr GetTime, SetTime, GetWakeupTime, SetWakeupTime, SetVirtualAddressMap, ConvertPointer; + UInt64(EFI_API* GetVariable)(const Char* Name, EfiGUID VendorGUID, UInt32* Attributes, UInt32* DataSize, VoidPtr Data); + VoidPtr GetNextVariable; + UInt64(EFI_API* SetVariable)(const Char* Name, EfiGUID VendorGUID, UInt32* Attributes, UInt32* DataSize, VoidPtr Data); + VoidPtr GetNextHighMonotonicCount; + VoidPtr ResetSystem; + VoidPtr UpdateCapsule; + VoidPtr QueryCapsuleCapabilites; + VoidPtr QueryVariableInfo; +} EfiRuntimeServices; + /** @brief The Structure that they give you when booting. */ @@ -624,7 +638,7 @@ typedef struct EfiSystemTable EfiSimpleTextOutputProtocol* ConOut; EfiHandlePtr StandardErrorHandle; VoidPtr StdErr; - VoidPtr RuntimeServices; + EfiRuntimeServices* RuntimeServices; EfiBootServices* BootServices; UInt64 NumberOfTableEntries; /// The configuration table (contains the RSD PTR entry.) diff --git a/dev/Kernel/HALKit/AMD64/Storage/SATA.cc b/dev/Kernel/HALKit/AMD64/Storage/SATA.cc index d2c0ee5b..74e1e8c1 100644 --- a/dev/Kernel/HALKit/AMD64/Storage/SATA.cc +++ b/dev/Kernel/HALKit/AMD64/Storage/SATA.cc @@ -68,14 +68,14 @@ static Kernel::Void drv_calculate_disk_geometry() noexcept drv_std_input_output<NO, YES, YES>(0, identify_data, 0, kib_cast(4)); - uint32_t lba28_sectors = (identify_data[61] << 16) | identify_data[60]; + uint32_t lba28_sectors = (identify_data[61] << 16) | identify_data[60]; - uint64_t lba48_sectors = ((uint64_t)identify_data[103] << 48) | - ((uint64_t)identify_data[102] << 32) | - ((uint64_t)identify_data[101] << 16) | - ((uint64_t)identify_data[100]); + uint64_t lba48_sectors = ((uint64_t)identify_data[103] << 48) | + ((uint64_t)identify_data[102] << 32) | + ((uint64_t)identify_data[101] << 16) | + ((uint64_t)identify_data[100]); - kCurrentDiskSectorCount = (lba48_sectors) ? lba48_sectors : lba28_sectors; + kCurrentDiskSectorCount = (lba48_sectors) ? lba48_sectors : lba28_sectors; for (Kernel::Int32 i = 0; i < 40; i += 2) { @@ -229,7 +229,7 @@ static Kernel::Void drv_std_input_output(Kernel::UInt64 lba, Kernel::UInt8* buff command_header->Cfl = sizeof(FisRegH2D) / sizeof(Kernel::UInt32); command_header->Write = Write; command_header->Prdtl = mib_cast(32) / mib_cast(4); - command_header->Prdbc = (1 << slot); + command_header->Prdbc = (1 << slot); volatile HbaCmdTbl* command_table = (volatile HbaCmdTbl*)((Kernel::UInt64)command_header->Ctba); |
