blob: 79013b268ef577b807a7712b59efbc1eef42409e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
/* ========================================
Copyright (C) 2024-2025, Amlal El Mahrouss, licensed under the Apache 2.0 license.
======================================== */
#include <HALKit/AMD64/Processor.h>
#include <modules/ACPI/ACPIFactoryInterface.h>
namespace Kernel::HAL {
/***********************************************************************************/
/// Constructors.
/***********************************************************************************/
LAPICDmaWrapper::LAPICDmaWrapper(VoidPtr base) : fApic(base) {}
LAPICDmaWrapper::~LAPICDmaWrapper() = default;
/***********************************************************************************/
/// @brief Read from APIC controller.
/// @param reg register.
/***********************************************************************************/
UInt32 LAPICDmaWrapper::Read(UInt16 reg) {
MUST_PASS(this->fApic);
UInt32 volatile* io_apic = (UInt32 volatile*) this->fApic;
return io_apic[reg];
}
/***********************************************************************************/
/// @brief Write to APIC controller.
/// @param reg register.
/// @param value value.
/***********************************************************************************/
Void LAPICDmaWrapper::Write(UInt16 reg, UInt32 value) {
MUST_PASS(this->fApic);
UInt32 volatile* io_apic = (UInt32 volatile*) this->fApic;
io_apic[reg] = value;
}
} // namespace Kernel::HAL
|