mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 04:47:34 +00:00
Kernel: Consolidate a bunch of i386/x86_64 code paths
Add some arch-specific getters and setters that allow us to merge blocks that were previously specific to either ARCH(I386) or ARCH(X86_64).
This commit is contained in:
parent
3f5a42b3dd
commit
961f727448
6 changed files with 64 additions and 117 deletions
|
@ -299,13 +299,8 @@ bool handle_safe_access_fault(RegisterState& regs, FlatPtr fault_address)
|
|||
else
|
||||
return false;
|
||||
|
||||
#if ARCH(I386)
|
||||
regs.eip = ip;
|
||||
regs.edx = fault_address;
|
||||
#else
|
||||
regs.rip = ip;
|
||||
regs.rdx = fault_address;
|
||||
#endif
|
||||
regs.set_ip(ip);
|
||||
regs.set_dx(fault_address);
|
||||
return true;
|
||||
}
|
||||
if (ip >= (FlatPtr)&start_of_safemem_atomic_text && ip < (FlatPtr)&end_of_safemem_atomic_text) {
|
||||
|
@ -325,13 +320,8 @@ bool handle_safe_access_fault(RegisterState& regs, FlatPtr fault_address)
|
|||
else
|
||||
return false;
|
||||
|
||||
#if ARCH(I386)
|
||||
regs.eip = ip;
|
||||
regs.edx = 1;
|
||||
#else
|
||||
regs.rip = ip;
|
||||
regs.rdx = 1;
|
||||
#endif
|
||||
regs.set_ip(ip);
|
||||
regs.set_dx(1);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue