diff options
| author | Amlal El Mahrouss <amlalelmahrouss@icloud.com> | 2024-03-03 20:04:14 +0000 |
|---|---|---|
| committer | Amlal El Mahrouss <amlalelmahrouss@icloud.com> | 2024-03-03 20:04:14 +0000 |
| commit | 1be90ecf5c097c143ec90f463dbd73e7fa1ad3f9 (patch) | |
| tree | 658c8d5e27903155d582fb0e14b08dbe1094a4d4 /Private/HALKit | |
| parent | e93e0a0c548a407b7eadc8148687f626f2e26c42 (diff) | |
HCoreKrnl:HAL: Improve interrupt handling, found a solution to interrupt problem in C++; don't modify the stack on the C++ side.
Diffstat (limited to 'Private/HALKit')
| -rw-r--r-- | Private/HALKit/AMD64/HalInterruptHandlerAMD64.cxx | 19 | ||||
| -rw-r--r-- | Private/HALKit/AMD64/Processor.hpp | 2 |
2 files changed, 20 insertions, 1 deletions
diff --git a/Private/HALKit/AMD64/HalInterruptHandlerAMD64.cxx b/Private/HALKit/AMD64/HalInterruptHandlerAMD64.cxx new file mode 100644 index 00000000..b43ad8c0 --- /dev/null +++ b/Private/HALKit/AMD64/HalInterruptHandlerAMD64.cxx @@ -0,0 +1,19 @@ +/* ------------------------------------------- + + Copyright Mahrouss Logic + +------------------------------------------- */ + +//! @file InterruptHandler.cxx +//! @brief x64 interrupt handler. + +#include <ArchKit/ArchKit.hpp> + +/// @brief AMD64 Interrupt handler redirects interrupts to their handlers. +EXTERN_C ATTRIBUTE(naked) HCore::UIntPtr rt_handle_interrupts(HCore::UIntPtr rsp) +{ + HCore::HAL::StackFramePtr stackPtr = reinterpret_cast<HCore::HAL::StackFramePtr>(rsp); + HCORE_UNUSED(stackPtr); + + return rsp; +}
\ No newline at end of file diff --git a/Private/HALKit/AMD64/Processor.hpp b/Private/HALKit/AMD64/Processor.hpp index 93a9775a..e5e35f20 100644 --- a/Private/HALKit/AMD64/Processor.hpp +++ b/Private/HALKit/AMD64/Processor.hpp @@ -79,7 +79,7 @@ using interruptTrap = UIntPtr(UIntPtr sp); typedef UIntPtr Reg; -struct PACKED StackFrame { +struct PACKED StackFrame final { Reg IntNum, ErrCode; Reg Rdi, Rsi, Rbp, Rsp, Rbx, Rdx, Rcx, Rax; Reg R8, R9, R10, R11, R12, R13, R14, R15; |
