summaryrefslogtreecommitdiffhomepage
path: root/dev/Kernel/HALKit
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2025-03-14 22:26:42 +0100
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2025-03-14 22:26:42 +0100
commit6bbf5ad2058db4020ae20d6aba8f5b099dadc85f (patch)
treead39f25f27938729261f733d2addf839e8a110b3 /dev/Kernel/HALKit
parent1c4f8ae3804be72d947b0b96f90b9300515399bc (diff)
TQ-24 && TQ-16: Add build scripts for MBCI, MBCI+Flash, and UFS.
META: Along other tweaks and important ARM64 patches. Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'dev/Kernel/HALKit')
-rw-r--r--dev/Kernel/HALKit/AMD64/Storage/AHCI+Generic.cc (renamed from dev/Kernel/HALKit/AMD64/Storage/AHCI.cc)0
-rw-r--r--dev/Kernel/HALKit/AMD64/Storage/DMA+Generic.cc (renamed from dev/Kernel/HALKit/AMD64/Storage/DMA.cc)0
-rw-r--r--dev/Kernel/HALKit/AMD64/Storage/PIO+Generic.cc (renamed from dev/Kernel/HALKit/AMD64/Storage/PIO.cc)0
-rw-r--r--dev/Kernel/HALKit/ARM64/HalACPIFactoryInterface.cc3
-rw-r--r--dev/Kernel/HALKit/ARM64/HalDebugOutput.cc4
-rw-r--r--dev/Kernel/HALKit/ARM64/HalFlushTLB.S (renamed from dev/Kernel/HALKit/ARM64/HalPageInternal.S)0
-rw-r--r--dev/Kernel/HALKit/ARM64/HalKernelMain.cc2
-rw-r--r--dev/Kernel/HALKit/ARM64/HalPagingMgrARM64.cc4
-rw-r--r--dev/Kernel/HALKit/ARM64/Processor.h2
-rw-r--r--dev/Kernel/HALKit/ARM64/Storage/MBCI+Flash+IO+Generic.cc (renamed from dev/Kernel/HALKit/ARM64/Storage/MFlash+IO.cc)20
-rw-r--r--dev/Kernel/HALKit/ARM64/Storage/UFS+Generic.cc11
11 files changed, 30 insertions, 16 deletions
diff --git a/dev/Kernel/HALKit/AMD64/Storage/AHCI.cc b/dev/Kernel/HALKit/AMD64/Storage/AHCI+Generic.cc
index 874b7012..874b7012 100644
--- a/dev/Kernel/HALKit/AMD64/Storage/AHCI.cc
+++ b/dev/Kernel/HALKit/AMD64/Storage/AHCI+Generic.cc
diff --git a/dev/Kernel/HALKit/AMD64/Storage/DMA.cc b/dev/Kernel/HALKit/AMD64/Storage/DMA+Generic.cc
index 109b55af..109b55af 100644
--- a/dev/Kernel/HALKit/AMD64/Storage/DMA.cc
+++ b/dev/Kernel/HALKit/AMD64/Storage/DMA+Generic.cc
diff --git a/dev/Kernel/HALKit/AMD64/Storage/PIO.cc b/dev/Kernel/HALKit/AMD64/Storage/PIO+Generic.cc
index 62791aee..62791aee 100644
--- a/dev/Kernel/HALKit/AMD64/Storage/PIO.cc
+++ b/dev/Kernel/HALKit/AMD64/Storage/PIO+Generic.cc
diff --git a/dev/Kernel/HALKit/ARM64/HalACPIFactoryInterface.cc b/dev/Kernel/HALKit/ARM64/HalACPIFactoryInterface.cc
index 6dcfa9a2..8ca9ac06 100644
--- a/dev/Kernel/HALKit/ARM64/HalACPIFactoryInterface.cc
+++ b/dev/Kernel/HALKit/ARM64/HalACPIFactoryInterface.cc
@@ -17,9 +17,10 @@ namespace NeOS
{
}
- Void ACPIFactoryInterface::Shutdown()
+ BOOL ACPIFactoryInterface::Shutdown()
{
apm_send_io_command(kAPMPowerCommandShutdown, 0);
+ return NO;
}
/// @brief Reboot machine in either ACPI or by triple faulting.
diff --git a/dev/Kernel/HALKit/ARM64/HalDebugOutput.cc b/dev/Kernel/HALKit/ARM64/HalDebugOutput.cc
index 97621e23..8d54739f 100644
--- a/dev/Kernel/HALKit/ARM64/HalDebugOutput.cc
+++ b/dev/Kernel/HALKit/ARM64/HalDebugOutput.cc
@@ -11,7 +11,7 @@
namespace NeOS
{
- EXTERN_C void ke_io_write(const Char* bytes)
+ EXTERN_C void ke_io_write(IDeviceObject<const Char*>* self, const Char* bytes)
{
#ifdef __DEBUG__
if (*bytes == 0)
@@ -38,7 +38,7 @@ namespace NeOS
TerminalDevice::~TerminalDevice() = default;
- EXTERN_C void ke_io_read(const Char* bytes)
+ EXTERN_C void ke_io_read(IDeviceObject<const Char*>* self, const Char* bytes)
{
#ifdef __DEBUG__
SizeT index = 0;
diff --git a/dev/Kernel/HALKit/ARM64/HalPageInternal.S b/dev/Kernel/HALKit/ARM64/HalFlushTLB.S
index 8fcf40ff..8fcf40ff 100644
--- a/dev/Kernel/HALKit/ARM64/HalPageInternal.S
+++ b/dev/Kernel/HALKit/ARM64/HalFlushTLB.S
diff --git a/dev/Kernel/HALKit/ARM64/HalKernelMain.cc b/dev/Kernel/HALKit/ARM64/HalKernelMain.cc
index afb1cc0e..5a6d0dc2 100644
--- a/dev/Kernel/HALKit/ARM64/HalKernelMain.cc
+++ b/dev/Kernel/HALKit/ARM64/HalKernelMain.cc
@@ -18,6 +18,8 @@
#include <HALKit/ARM64/Processor.h>
#include <CFKit/Property.h>
+#include <HALKit/ARM64/ApplicationProcessor.h>
+
EXTERN_C void hal_init_platform(
NeOS::HEL::BootInfoHeader* handover_hdr)
{
diff --git a/dev/Kernel/HALKit/ARM64/HalPagingMgrARM64.cc b/dev/Kernel/HALKit/ARM64/HalPagingMgrARM64.cc
index e04b77cd..4ec45b51 100644
--- a/dev/Kernel/HALKit/ARM64/HalPagingMgrARM64.cc
+++ b/dev/Kernel/HALKit/ARM64/HalPagingMgrARM64.cc
@@ -45,7 +45,7 @@ namespace NeOS::HAL
/// @param phys_addr point to physical address.
/// @param flags the flags to put on the page.
/// @return Status code of page manipulation process.
- EXTERN_C Int32 mm_map_page(VoidPtr virtual_address, UInt32 flags)
+ EXTERN_C Int32 mm_map_page(VoidPtr virtual_address, VoidPtr physical_address, UInt32 flags)
{
if (!virtual_address ||
!flags)
@@ -73,7 +73,7 @@ namespace NeOS::HAL
{
NE_PAGE_STORE& page_store = NE_PAGE_STORE::The();
- // Update Internal store.
+ // Update internal store.
page_store.fInternalStore.fPde = nullptr;
page_store.fInternalStore.fPte = pt_entry;
diff --git a/dev/Kernel/HALKit/ARM64/Processor.h b/dev/Kernel/HALKit/ARM64/Processor.h
index 4dba5a8b..e79a99c7 100644
--- a/dev/Kernel/HALKit/ARM64/Processor.h
+++ b/dev/Kernel/HALKit/ARM64/Processor.h
@@ -36,7 +36,7 @@ namespace NeOS::HAL
/// @param phys_addr point to physical address.
/// @param flags the flags to put on the page.
/// @return Status code of page manip.
- EXTERN_C Int32 mm_map_page(VoidPtr virt_addr, UInt32 flags);
+ EXTERN_C Int32 mm_map_page(VoidPtr virtual_address, VoidPtr physical_address, UInt32 flags);
typedef UIntPtr Reg;
typedef Register64 Register;
diff --git a/dev/Kernel/HALKit/ARM64/Storage/MFlash+IO.cc b/dev/Kernel/HALKit/ARM64/Storage/MBCI+Flash+IO+Generic.cc
index 1335a9e4..3ccca867 100644
--- a/dev/Kernel/HALKit/ARM64/Storage/MFlash+IO.cc
+++ b/dev/Kernel/HALKit/ARM64/Storage/MBCI+Flash+IO+Generic.cc
@@ -11,10 +11,10 @@
#include <Mod/MFlash/MFlash.h>
#include <Mod/MBCI/MBCI.h>
-/// @file MFlash.cc
+/// @file MBCI+Flash.cc
/// @brief MBCI Flash support.
-#define kMaxFlashSlots (8U)
+#define MBCI_MAX_SLOTS (8U)
namespace NeOS
{
@@ -23,10 +23,10 @@ namespace NeOS
constexpr auto kFlashBridgeRevision = 1;
STATIC BOOL kFlashEnabled = NO;
- STATIC SizeT kFlashSize[kMaxFlashSlots] = {};
- STATIC SizeT kFlashSectorSz[kMaxFlashSlots] = {};
- STATIC IMBCIHost* kFlashMetaPackets[kMaxFlashSlots] = {};
- STATIC IMBCIHost* kFlashDataPackets[kMaxFlashSlots] = {};
+ STATIC SizeT kFlashSize[MBCI_MAX_SLOTS] = {};
+ STATIC SizeT kFlashSectorSz[MBCI_MAX_SLOTS] = {};
+ STATIC IMBCIHost* kFlashMetaPackets[MBCI_MAX_SLOTS] = {};
+ STATIC IMBCIHost* kFlashDataPackets[MBCI_MAX_SLOTS] = {};
STATIC Void drv_std_io(Int32 slot, UInt64 lba, Char* buf, SizeT sector_sz, SizeT buf_sz);
@@ -40,7 +40,7 @@ namespace NeOS
/// @return slot sector count.
SizeT drv_get_sector_count(Int32 slot)
{
- if (slot > kMaxFlashSlots)
+ if (slot > MBCI_MAX_SLOTS)
return 0;
return kFlashSectorSz[slot];
@@ -50,7 +50,7 @@ namespace NeOS
/// @return drive slot size
SizeT drv_get_size(Int32 slot)
{
- if (slot > kMaxFlashSlots)
+ if (slot > MBCI_MAX_SLOTS)
return 0;
return kFlashSize[slot];
@@ -59,7 +59,7 @@ namespace NeOS
/// @brief Enable flash memory at slot.
BOOL drv_enable_at(Int32 slot)
{
- if (slot > kMaxFlashSlots)
+ if (slot > MBCI_MAX_SLOTS)
return NO;
kFlashMetaPackets[slot]->InterruptEnable = YES;
@@ -72,7 +72,7 @@ namespace NeOS
/// @brief Disable flash memory at slot.
BOOL drv_disable_at(Int32 slot)
{
- if (slot > kMaxFlashSlots)
+ if (slot > MBCI_MAX_SLOTS)
return NO;
kFlashMetaPackets[slot]->InterruptEnable = NO;
diff --git a/dev/Kernel/HALKit/ARM64/Storage/UFS+Generic.cc b/dev/Kernel/HALKit/ARM64/Storage/UFS+Generic.cc
new file mode 100644
index 00000000..20d06671
--- /dev/null
+++ b/dev/Kernel/HALKit/ARM64/Storage/UFS+Generic.cc
@@ -0,0 +1,11 @@
+/* -------------------------------------------
+
+ Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved.
+
+------------------------------------------- */
+
+/// @file UFS.cc
+/// @brief UFS Flash Memory support.
+
+#define UFS_PCI_VENDOR_ID (0x01001) /* AKER */
+#define UFS_PCI_DEVICE_ID (0xAEAEA) /* AKER */ \ No newline at end of file