mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 07:47:35 +00:00
Kernel: Share Processor class (and others) across architectures
About half of the Processor code is common across architectures, so let's share it with a templated base class. Also, other code that can be shared in some ways, like FPUState and TrapFrame functions, is adjusted here. Functions which cannot be shared trivially (without internal refactoring) are left alone for now.
This commit is contained in:
parent
0b824ab7a6
commit
398d271a46
26 changed files with 943 additions and 860 deletions
|
@ -105,15 +105,6 @@ void write_dr6(FlatPtr);
|
|||
FlatPtr read_dr7();
|
||||
void write_dr7(FlatPtr);
|
||||
|
||||
ALWAYS_INLINE static bool is_kernel_mode()
|
||||
{
|
||||
u16 cs;
|
||||
asm volatile(
|
||||
"mov %%cs, %[cs] \n"
|
||||
: [cs] "=g"(cs));
|
||||
return (cs & 3) == 0;
|
||||
}
|
||||
|
||||
ALWAYS_INLINE void read_tsc(u32& lsw, u32& msw)
|
||||
{
|
||||
asm volatile("rdtsc"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue