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

Kernel: Abstract Processor::assume_context flags using InterruptsState

The details of the specific interrupt bits that must be turned on are
irrelevant to the sys$execve implementation. Abstract it away to the
Processor implementations using the InterruptsState enum.
This commit is contained in:
Idan Horowitz 2023-04-02 03:26:57 +03:00 committed by Andrew Kaster
parent 6ad8f4bb11
commit a349570a04
5 changed files with 9 additions and 13 deletions

View file

@ -55,6 +55,7 @@ struct [[gnu::aligned(64), gnu::packed]] FPUState
u8 ext_save_area[256];
};
enum class InterruptsState;
class Processor;
// Note: We only support 64 processors at most at the moment,
// so allocate 64 slots of inline capacity in the container.
@ -414,7 +415,7 @@ public:
[[noreturn]] void initialize_context_switching(Thread& initial_thread);
NEVER_INLINE void switch_context(Thread*& from_thread, Thread*& to_thread);
[[noreturn]] static void assume_context(Thread& thread, FlatPtr flags);
[[noreturn]] static void assume_context(Thread& thread, InterruptsState new_interrupts_state);
FlatPtr init_context(Thread& thread, bool leave_crit);
static ErrorOr<Vector<FlatPtr, 32>> capture_stack_trace(Thread& thread, size_t max_frames = 0);