1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 12:47:45 +00:00

Kernel: Extract DeferredCallEntry from Arch/Processor.h

This commit is contained in:
Hendiadyoin1 2021-12-07 00:52:54 +01:00 committed by Brian Gianforcaro
parent 235a2b35d6
commit 556b516182
3 changed files with 34 additions and 20 deletions

View file

@ -8,6 +8,7 @@
#pragma once
#include <AK/Function.h>
#include <Kernel/Arch/DeferredCallEntry.h>
namespace Kernel {
@ -16,8 +17,6 @@ class PageDirectory;
}
struct ProcessorMessageEntry;
struct DeferredCallEntry;
enum class ProcessorSpecificDataID {
MemoryManager,
__Count,
@ -62,24 +61,6 @@ struct ProcessorMessageEntry {
ProcessorMessage* msg;
};
struct DeferredCallEntry {
using HandlerFunction = Function<void()>;
DeferredCallEntry* next;
alignas(HandlerFunction) u8 handler_storage[sizeof(HandlerFunction)];
bool was_allocated;
HandlerFunction& handler_value()
{
return *bit_cast<HandlerFunction*>(&handler_storage);
}
void invoke_handler()
{
handler_value()();
}
};
}
#if ARCH(X86_64) || ARCH(I386)