diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2025-03-10 05:13:55 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2025-03-10 05:13:55 +0100 |
| commit | 7855b98f7cbe83d77f1625f7b5017060b97e5b75 (patch) | |
| tree | 4b77f69c677f76f86d15f1118e9590943b6d818e /dev/Kernel/KernelKit/PCI/IOArray+AMD64.inl | |
| parent | d9101d6a9658ac4ffcd5a4d747e0b95a5cc5cd30 (diff) | |
IMPL: I/O subsystem improvements and Dyld subsystem improvements.
- Add make_ports for IO.h
- Include PCI.h in Express.h
- Use this in DMA.inl
- Refactor NE_DLL_OBJECT to NE_DYLIB_OBJECT in IDylibObject.h
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'dev/Kernel/KernelKit/PCI/IOArray+AMD64.inl')
| -rw-r--r-- | dev/Kernel/KernelKit/PCI/IOArray+AMD64.inl | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/dev/Kernel/KernelKit/PCI/IOArray+AMD64.inl b/dev/Kernel/KernelKit/PCI/IOArray+AMD64.inl new file mode 100644 index 00000000..2630fa98 --- /dev/null +++ b/dev/Kernel/KernelKit/PCI/IOArray+AMD64.inl @@ -0,0 +1,54 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. + + File: IO-Impl-AMD64.h + Purpose: I/O for AMD64. + + Revision History: + + 30/01/24: Add file. (amlel) + 02/02/24: Update I/O routines. (amlel) + +------------------------------------------- */ + +namespace NeOS +{ + template <SizeT Sz> + template <typename T> + T IOArray<Sz>::In(SizeT index) + { + switch (sizeof(T)) + { +#ifdef __NE_AMD64__ + case 4: + return HAL::rt_in32(fPorts[index].Leak()); + case 2: + return HAL::rt_in16(fPorts[index].Leak()); + case 1: + return HAL::rt_in8(fPorts[index].Leak()); +#endif + default: + return 0xFFFF; + } + } + + template <SizeT Sz> + template <typename T> + void IOArray<Sz>::Out(SizeT index, T value) + { + switch (sizeof(T)) + { +#ifdef __NE_AMD64__ + case 4: + HAL::rt_out32(fPorts[index].Leak(), value); + case 2: + HAL::rt_out16(fPorts[index].Leak(), value); + case 1: + HAL::rt_out8(fPorts[index].Leak(), value); +#endif + default: + break; + } + } +} // namespace NeOS
\ No newline at end of file |
