diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2025-01-31 19:05:36 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2025-01-31 19:05:36 +0100 |
| commit | d0c7a3e05a1bb5c9cffd1a0946e403d3a8e37e63 (patch) | |
| tree | 686f7f3c99a08a7bebfc925839f0f9d882177c54 /dev/Kernel/HALKit/AMD64 | |
| parent | 9c1e80e1bb3a8d549a9053f0d7bf4afb0c806f80 (diff) | |
Match the changes in OpenNE, (without reusing it)
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'dev/Kernel/HALKit/AMD64')
| -rw-r--r-- | dev/Kernel/HALKit/AMD64/HalInterruptAPI.asm | 38 | ||||
| -rw-r--r-- | dev/Kernel/HALKit/AMD64/HalKernelMain.cc | 4 | ||||
| -rw-r--r-- | dev/Kernel/HALKit/AMD64/HalPagingMgrAMD64.cc | 16 | ||||
| -rw-r--r-- | dev/Kernel/HALKit/AMD64/PCI/Device.cc | 24 | ||||
| -rw-r--r-- | dev/Kernel/HALKit/AMD64/PCI/Iterator.cc | 6 | ||||
| -rw-r--r-- | dev/Kernel/HALKit/AMD64/Paging.h | 10 | ||||
| -rw-r--r-- | dev/Kernel/HALKit/AMD64/Processor.h | 6 | ||||
| -rw-r--r-- | dev/Kernel/HALKit/AMD64/Storage/SATA.cc | 2 |
8 files changed, 53 insertions, 53 deletions
diff --git a/dev/Kernel/HALKit/AMD64/HalInterruptAPI.asm b/dev/Kernel/HALKit/AMD64/HalInterruptAPI.asm index 75a2b537..4776a155 100644 --- a/dev/Kernel/HALKit/AMD64/HalInterruptAPI.asm +++ b/dev/Kernel/HALKit/AMD64/HalInterruptAPI.asm @@ -14,8 +14,8 @@ %define kInterruptId 50 %macro IntExp 1 -global __ZKA_INT_%1 -__ZKA_INT_%1: +global __NE_INT_%1 +__NE_INT_%1: cld mov al, 0x20 @@ -32,8 +32,8 @@ __ZKA_INT_%1: %endmacro %macro IntNormal 1 -global __ZKA_INT_%1 -__ZKA_INT_%1: +global __NE_INT_%1 +__NE_INT_%1: cld mov al, 0x20 @@ -60,7 +60,7 @@ extern idt_handle_breakpoint section .text -__ZKA_INT_0: +__NE_INT_0: cld mov al, 0x20 @@ -70,7 +70,7 @@ __ZKA_INT_0: o64 iret -__ZKA_INT_1: +__NE_INT_1: cld mov al, 0x20 @@ -84,7 +84,7 @@ __ZKA_INT_1: o64 iret -__ZKA_INT_2: +__NE_INT_2: cld mov al, 0x20 @@ -99,7 +99,7 @@ __ZKA_INT_2: o64 iret ;; @brief Triggers a breakpoint and freeze the process. RIP is also fetched. -__ZKA_INT_3: +__NE_INT_3: cld mov al, 0x20 @@ -113,7 +113,7 @@ __ZKA_INT_3: o64 iret -__ZKA_INT_4: +__NE_INT_4: cld mov al, 0x20 @@ -128,7 +128,7 @@ __ZKA_INT_4: o64 iret -__ZKA_INT_5: +__NE_INT_5: cld mov al, 0x20 @@ -139,7 +139,7 @@ __ZKA_INT_5: o64 iret ;; Invalid opcode interrupt -__ZKA_INT_6: +__NE_INT_6: cld mov al, 0x20 @@ -153,7 +153,7 @@ __ZKA_INT_6: o64 iret -__ZKA_INT_7: +__NE_INT_7: cld mov al, 0x20 @@ -168,7 +168,7 @@ __ZKA_INT_7: o64 iret ;; Invalid opcode interrupt -__ZKA_INT_8: +__NE_INT_8: cld mov al, 0x20 @@ -189,7 +189,7 @@ IntExp 11 IntExp 12 -__ZKA_INT_13: +__NE_INT_13: cld mov al, 0x20 @@ -204,7 +204,7 @@ __ZKA_INT_13: o64 iret -__ZKA_INT_14: +__NE_INT_14: cld mov al, 0x20 @@ -241,7 +241,7 @@ IntNormal 31 [extern idt_handle_scheduler] -__ZKA_INT_32: +__NE_INT_32: cld mov al, 0x20 @@ -281,7 +281,7 @@ IntNormal 49 [extern hal_system_call_enter] [extern hal_kernel_call_enter] -__ZKA_INT_50: +__NE_INT_50: cld mov al, 0x20 @@ -301,7 +301,7 @@ __ZKA_INT_50: o64 iret -__ZKA_INT_51: +__NE_INT_51: cld mov al, 0x20 @@ -404,6 +404,6 @@ section .data kInterruptVectorTable: %assign i 0 %rep 256 - dq __ZKA_INT_%+i + dq __NE_INT_%+i %assign i i+1 %endrep diff --git a/dev/Kernel/HALKit/AMD64/HalKernelMain.cc b/dev/Kernel/HALKit/AMD64/HalKernelMain.cc index e982714d..dbac3e72 100644 --- a/dev/Kernel/HALKit/AMD64/HalKernelMain.cc +++ b/dev/Kernel/HALKit/AMD64/HalKernelMain.cc @@ -68,7 +68,7 @@ EXTERN_C void hal_init_platform( STATIC CONST auto kGDTEntriesCount = 6; /* GDT, mostly descriptors for user and kernel segments. */ - STATIC Kernel::HAL::Detail::ZKA_GDT_ENTRY ALIGN(0x08) kGDTArray[kGDTEntriesCount] = { + STATIC Kernel::HAL::Detail::NE_GDT_ENTRY ALIGN(0x08) kGDTArray[kGDTEntriesCount] = { {.fLimitLow = 0, .fBaseLow = 0, .fBaseMid = 0, .fAccessByte = 0x00, .fFlags = 0x00, .fBaseHigh = 0}, // Null entry {.fLimitLow = 0x0, .fBaseLow = 0, .fBaseMid = 0, .fAccessByte = 0x9A, .fFlags = 0xAF, .fBaseHigh = 0}, // Kernel code {.fLimitLow = 0x0, .fBaseLow = 0, .fBaseMid = 0, .fAccessByte = 0x92, .fFlags = 0xCF, .fBaseHigh = 0}, // Kernel data @@ -80,7 +80,7 @@ EXTERN_C void hal_init_platform( Kernel::HAL::RegisterGDT gdt_reg; gdt_reg.Base = reinterpret_cast<Kernel::UIntPtr>(kGDTArray); - gdt_reg.Limit = (sizeof(Kernel::HAL::Detail::ZKA_GDT_ENTRY) * kGDTEntriesCount) - 1; + gdt_reg.Limit = (sizeof(Kernel::HAL::Detail::NE_GDT_ENTRY) * kGDTEntriesCount) - 1; //! GDT will load hal_read_init after it successfully loads the segments. Kernel::HAL::GDTLoader gdt_loader; diff --git a/dev/Kernel/HALKit/AMD64/HalPagingMgrAMD64.cc b/dev/Kernel/HALKit/AMD64/HalPagingMgrAMD64.cc index 97bf07f8..149fdceb 100644 --- a/dev/Kernel/HALKit/AMD64/HalPagingMgrAMD64.cc +++ b/dev/Kernel/HALKit/AMD64/HalPagingMgrAMD64.cc @@ -17,7 +17,7 @@ namespace Kernel::HAL /***********************************************************************************/ /// \brief Page store type. /***********************************************************************************/ - struct ZKA_PAGE_STORE final + struct NE_PAGE_STORE final { struct { @@ -43,9 +43,9 @@ namespace Kernel::HAL return pte && pte->User; } - static ZKA_PAGE_STORE& The() + static NE_PAGE_STORE& The() { - static ZKA_PAGE_STORE the; + static NE_PAGE_STORE the; return the; } }; @@ -62,7 +62,7 @@ namespace Kernel::HAL kcout << (pte->User ? "User" : "Not User") << endl; } - STATIC Int32 mmi_map_page_table_entry(VoidPtr virtual_address, UInt32 flags, ZKA_PTE* pt_entry, ZKA_PDE* pd_entry); + STATIC Int32 mmi_map_page_table_entry(VoidPtr virtual_address, UInt32 flags, NE_PTE* pt_entry, NE_PDE* pd_entry); /***********************************************************************************/ /// @brief Maps or allocates a page from virtual_address. @@ -83,7 +83,7 @@ namespace Kernel::HAL UInt64 cr3 = (UInt64)hal_read_cr3(); - ZKA_PAGE_STORE& page_store = ZKA_PAGE_STORE::The(); + NE_PAGE_STORE& page_store = NE_PAGE_STORE::The(); // Extract the indices from the virtual address UInt64 pml4_index = ((UIntPtr)virtual_address >> 39) & cPmlIndexMask; @@ -118,7 +118,7 @@ namespace Kernel::HAL UInt64 pt_entry = (pt_base + pt_index * cPmlEntrySize); // Lastly, grab the pte entry. - ZKA_PDE* pde_struct = reinterpret_cast<ZKA_PDE*>(pt_base); + NE_PDE* pde_struct = reinterpret_cast<NE_PDE*>(pt_base); return mmi_map_page_table_entry(virtual_address, flags, pde_struct->fEntries[pt_entry], pde_struct); } @@ -127,7 +127,7 @@ namespace Kernel::HAL /// @brief Maps flags for a specific pte. /// @internal Internal function. /***********************************************************************************/ - STATIC Int32 mmi_map_page_table_entry(VoidPtr virtual_address, UInt32 flags, ZKA_PTE* pt_entry, ZKA_PDE* pd_entry) + STATIC Int32 mmi_map_page_table_entry(VoidPtr virtual_address, UInt32 flags, NE_PTE* pt_entry, NE_PDE* pd_entry) { if (!pt_entry) return 1; @@ -153,7 +153,7 @@ namespace Kernel::HAL mmi_page_status(pt_entry); - ZKA_PAGE_STORE& page_store = ZKA_PAGE_STORE::The(); + NE_PAGE_STORE& page_store = NE_PAGE_STORE::The(); // Update Internal store. diff --git a/dev/Kernel/HALKit/AMD64/PCI/Device.cc b/dev/Kernel/HALKit/AMD64/PCI/Device.cc index d02c7e22..1f9f420a 100644 --- a/dev/Kernel/HALKit/AMD64/PCI/Device.cc +++ b/dev/Kernel/HALKit/AMD64/PCI/Device.cc @@ -7,7 +7,7 @@ #include <ArchKit/ArchKit.h> #include <KernelKit/PCI/Device.h> -Kernel::UInt ZKA_PCIReadRaw(Kernel::UInt bar, Kernel::UShort bus, Kernel::UShort dev, Kernel::UShort fun) +Kernel::UInt NE_PCIReadRaw(Kernel::UInt bar, Kernel::UShort bus, Kernel::UShort dev, Kernel::UShort fun) { Kernel::UInt target = 0x80000000 | ((Kernel::UInt)bus << 16) | ((Kernel::UInt)dev << 11) | ((Kernel::UInt)fun << 8) | @@ -19,7 +19,7 @@ Kernel::UInt ZKA_PCIReadRaw(Kernel::UInt bar, Kernel::UShort bus, Kernel::UShort return Kernel::HAL::rt_in32((Kernel::UShort)Kernel::PCI::PciConfigKind::ConfigData); } -void ZKA_PCISetCfgTarget(Kernel::UInt bar, Kernel::UShort bus, Kernel::UShort dev, Kernel::UShort fun) +void NE_PCISetCfgTarget(Kernel::UInt bar, Kernel::UShort bus, Kernel::UShort dev, Kernel::UShort fun) { Kernel::UInt target = 0x80000000 | ((Kernel::UInt)bus << 16) | ((Kernel::UInt)dev << 11) | ((Kernel::UInt)fun << 8) | @@ -45,7 +45,7 @@ namespace Kernel::PCI UInt Device::Read(UInt bar, Size sz) { - ZKA_PCISetCfgTarget(bar, fBus, fDevice, fFunction); + NE_PCISetCfgTarget(bar, fBus, fDevice, fFunction); if (sz == 4) return HAL::rt_in32((UShort)PciConfigKind::ConfigData + (bar & 3)); @@ -59,7 +59,7 @@ namespace Kernel::PCI void Device::Write(UInt bar, UIntPtr data, Size sz) { - ZKA_PCISetCfgTarget(bar, fBus, fDevice, fFunction); + NE_PCISetCfgTarget(bar, fBus, fDevice, fFunction); if (sz == 4) HAL::rt_out32((UShort)PciConfigKind::ConfigData + (fBar & 3), (UInt)data); @@ -71,37 +71,37 @@ namespace Kernel::PCI UShort Device::DeviceId() { - return (UShort)(ZKA_PCIReadRaw(0x0 >> 16, fBus, fDevice, fFunction)); + return (UShort)(NE_PCIReadRaw(0x0 >> 16, fBus, fDevice, fFunction)); } UShort Device::VendorId() { - return (UShort)(ZKA_PCIReadRaw(0x0, fBus, fDevice, fFunction) >> 16); + return (UShort)(NE_PCIReadRaw(0x0, fBus, fDevice, fFunction) >> 16); } UShort Device::InterfaceId() { - return (UShort)(ZKA_PCIReadRaw(0x0, fBus, fDevice, fFunction) >> 16); + return (UShort)(NE_PCIReadRaw(0x0, fBus, fDevice, fFunction) >> 16); } UChar Device::Class() { - return (UChar)(ZKA_PCIReadRaw(0x08, fBus, fDevice, fFunction) >> 24); + return (UChar)(NE_PCIReadRaw(0x08, fBus, fDevice, fFunction) >> 24); } UChar Device::Subclass() { - return (UChar)(ZKA_PCIReadRaw(0x08, fBus, fDevice, fFunction) >> 16); + return (UChar)(NE_PCIReadRaw(0x08, fBus, fDevice, fFunction) >> 16); } UChar Device::ProgIf() { - return (UChar)(ZKA_PCIReadRaw(0x08, fBus, fDevice, fFunction) >> 8); + return (UChar)(NE_PCIReadRaw(0x08, fBus, fDevice, fFunction) >> 8); } UChar Device::HeaderType() { - return (UChar)(ZKA_PCIReadRaw(0xC, fBus, fDevice, fFunction) >> 16); + return (UChar)(NE_PCIReadRaw(0xC, fBus, fDevice, fFunction) >> 16); } void Device::EnableMmio(UInt32 bar_in) @@ -118,7 +118,7 @@ namespace Kernel::PCI UIntPtr Device::Bar(UInt32 bar_in) { - UInt32 bar = ZKA_PCIReadRaw(bar_in, fBus, fDevice, fFunction); + UInt32 bar = NE_PCIReadRaw(bar_in, fBus, fDevice, fFunction); return bar; } diff --git a/dev/Kernel/HALKit/AMD64/PCI/Iterator.cc b/dev/Kernel/HALKit/AMD64/PCI/Iterator.cc index f0289cdf..1cbdf1ba 100644 --- a/dev/Kernel/HALKit/AMD64/PCI/Iterator.cc +++ b/dev/Kernel/HALKit/AMD64/PCI/Iterator.cc @@ -11,11 +11,11 @@ namespace Kernel::PCI Iterator::Iterator(const Types::PciDeviceKind& type) { // probe devices. - for (int bus = 0; bus < ZKA_BUS_COUNT; ++bus) + for (int bus = 0; bus < NE_BUS_COUNT; ++bus) { - for (int device = 0; device < ZKA_DEVICE_COUNT; ++device) + for (int device = 0; device < NE_DEVICE_COUNT; ++device) { - for (int function = 0; function < ZKA_FUNCTION_COUNT; ++function) + for (int function = 0; function < NE_FUNCTION_COUNT; ++function) { auto bar = 0x00; diff --git a/dev/Kernel/HALKit/AMD64/Paging.h b/dev/Kernel/HALKit/AMD64/Paging.h index e58d2466..abba54b1 100644 --- a/dev/Kernel/HALKit/AMD64/Paging.h +++ b/dev/Kernel/HALKit/AMD64/Paging.h @@ -42,7 +42,7 @@ EXTERN_C Kernel::VoidPtr hal_read_cr3(); // @brief Page table. namespace Kernel::HAL { /// @brief Final page entry (Not PML, PDPT) - struct PACKED ZKA_PTE final + struct PACKED NE_PTE final { UInt64 Present : 1; UInt64 Wr : 1; @@ -83,9 +83,9 @@ namespace Kernel::HAL } } // namespace Detail - struct ZKA_PDE final + struct NE_PDE final { - ZKA_PTE* ALIGN(kPageAlign) fEntries[kPageMax]; + NE_PTE* ALIGN(kPageAlign) fEntries[kPageMax]; }; auto mm_alloc_bitmap(Boolean wr, Boolean user, SizeT size, Bool is_page) -> VoidPtr; @@ -94,6 +94,6 @@ namespace Kernel::HAL namespace Kernel { - typedef HAL::ZKA_PTE PTE; - typedef HAL::ZKA_PDE PDE; + typedef HAL::NE_PTE PTE; + typedef HAL::NE_PDE PDE; } // namespace Kernel diff --git a/dev/Kernel/HALKit/AMD64/Processor.h b/dev/Kernel/HALKit/AMD64/Processor.h index 311d2738..fdd872d9 100644 --- a/dev/Kernel/HALKit/AMD64/Processor.h +++ b/dev/Kernel/HALKit/AMD64/Processor.h @@ -260,7 +260,7 @@ namespace Kernel::HAL namespace Detail { /* @brief TSS struct. */ - struct ZKA_TSS final + struct NE_TSS final { UInt32 fReserved1; UInt64 fRsp0; @@ -283,7 +283,7 @@ namespace Kernel::HAL @brief Global descriptor table entry, either null, code or data. */ - struct PACKED ZKA_GDT_ENTRY final + struct PACKED NE_GDT_ENTRY final { UInt16 fLimitLow; UInt16 fBaseLow; @@ -304,7 +304,7 @@ namespace Kernel::HAL ~APICController() = default; - ZKA_COPY_DEFAULT(APICController); + NE_COPY_DEFAULT(APICController); public: UInt32 Read(UInt32 reg) noexcept; diff --git a/dev/Kernel/HALKit/AMD64/Storage/SATA.cc b/dev/Kernel/HALKit/AMD64/Storage/SATA.cc index a3b8992f..5db4dfc8 100644 --- a/dev/Kernel/HALKit/AMD64/Storage/SATA.cc +++ b/dev/Kernel/HALKit/AMD64/Storage/SATA.cc @@ -81,7 +81,7 @@ Kernel::Boolean drv_std_init(Kernel::UInt16& PortsImplemented) PCI::Iterator iterator(Types::PciDeviceKind::MassStorageController); - for (SizeT device_index = 0; device_index < ZKA_BUS_COUNT; ++device_index) + for (SizeT device_index = 0; device_index < NE_BUS_COUNT; ++device_index) { kPCIDevice = iterator[device_index].Leak(); // And then leak the reference. |
