Add CheckApcDelivery to evaluate APC interrupt request or direct delivery

이 커밋은 다음에 포함됨:
2026-06-26 09:54:38 +02:00
부모 03f97d94ae
커밋 77c1138f7d
2개의 변경된 파일과 71개의 추가작업 그리고 0개의 파일을 삭제
+67
파일 보기
@@ -4,11 +4,78 @@
* FILE: xtoskrnl/ke/apc.cc
* DESCRIPTION: Kernel APC objects support
* DEVELOPERS: Rafal Kupiec <belliash@codingworkshop.eu.org>
* Aiken Harris <harraiken91@gmail.com>
*/
#include <xtos.hh>
/**
* Checks if a kernel APC can be delivered and initiates the delivery process.
*
* @return This routine does not return any value.
*
* @since XT 1.0
*/
XTAPI
VOID
KE::Apc::CheckApcDelivery(VOID)
{
PKTHREAD Thread;
/* Check if system is running at PASSIVE level */
if(KE::RunLevel::GetCurrentRunLevel() == PASSIVE_LEVEL)
{
/* Raise runlevel to APC level */
KE::RaiseRunLevel RunLevel(APC_LEVEL);
/* Deliver the APC */
DeliverApc(KernelMode, NULLPTR, NULLPTR);
}
else
{
/* Mark the current thread as having a pending kernel APC */
Thread = KE::Processor::GetCurrentThread();
Thread->ApcState.KernelApcPending = TRUE;
/* Request an APC software interrupt */
HL::Irq::SendSoftwareInterrupt(APC_LEVEL);
}
}
/**
* Delivers pending Asynchronous Procedure Calls (APCs) to the current executing thread.
*
* @param ProcessorMode
* Supplies the processor execution mode at the time the APC delivery was requested.
*
* @param ExceptionFrame
* Supplies an optional pointer to the exception frame if the APC is being delivered following an exception.
*
* @param TrapFrame
* Supplies an optional pointer to the trap frame if the APC is being delivered following an interrupt.
*
* @return This routine does not return any value.
*
* @since XT 1.0
*/
XTAPI
VOID
KE::Apc::DeliverApc(IN KPROCESSOR_MODE ProcessorMode,
IN PKEXCEPTION_FRAME ExceptionFrame,
IN PKTRAP_FRAME TrapFrame)
{
PKTHREAD Thread;
UNIMPLEMENTED;
/* Get the current thread */
Thread = KE::Processor::GetCurrentThread();
/* Clear the pending kernel APC flag */
Thread->ApcState.KernelApcPending = FALSE;
}
/**
* Initializes an APC object.
*