diff options
Diffstat (limited to 'Kernel/Arch/x86/Processor.h')
-rw-r--r-- | Kernel/Arch/x86/Processor.h | 77 |
1 files changed, 1 insertions, 76 deletions
diff --git a/Kernel/Arch/x86/Processor.h b/Kernel/Arch/x86/Processor.h index a1b6bf97e2..719aa4ebcb 100644 --- a/Kernel/Arch/x86/Processor.h +++ b/Kernel/Arch/x86/Processor.h @@ -21,13 +21,9 @@ namespace Kernel { class ProcessorInfo; +struct ProcessorMessage; struct ProcessorMessageEntry; -enum class ProcessorSpecificDataID { - MemoryManager, - __Count, -}; - #if ARCH(X86_64) # define MSR_FS_BASE 0xc0000100 # define MSR_GS_BASE 0xc0000101 @@ -44,64 +40,6 @@ struct [[gnu::aligned(16)]] FPUState u8 buffer[512]; }; -struct ProcessorMessage { - using CallbackFunction = Function<void()>; - - enum Type { - FlushTlb, - Callback, - }; - Type type; - Atomic<u32> refs; - union { - ProcessorMessage* next; // only valid while in the pool - alignas(CallbackFunction) u8 callback_storage[sizeof(CallbackFunction)]; - struct { - Memory::PageDirectory const* page_directory; - u8* ptr; - size_t page_count; - } flush_tlb; - }; - - volatile bool async; - - ProcessorMessageEntry* per_proc_entries; - - CallbackFunction& callback_value() - { - return *bit_cast<CallbackFunction*>(&callback_storage); - } - - void invoke_callback() - { - VERIFY(type == Type::Callback); - callback_value()(); - } -}; - -struct ProcessorMessageEntry { - ProcessorMessageEntry* next; - 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()(); - } -}; - class Processor; // Note: We only support 64 processors at most at the moment, // so allocate 64 slots of inline capacity in the container. @@ -441,17 +379,4 @@ public: static StringView platform_string(); }; -template<typename T> -class ProcessorSpecific { -public: - static void initialize() - { - Processor::current().set_specific(T::processor_specific_data_id(), new T); - } - static T& get() - { - return *Processor::current().get_specific<T>(); - } -}; - } |