pop gs
POP_GPR
add rsp, 2*8 ; Dummy error code and IRQ num
+; xchg bx, bx
iretq
[extern ci_offsetof_tThread_KernelStack]
pop r11
pop rcx
pop rsp ; Change back to user stack
+ ; TODO: Determine if user is 64 or 32 bit
+
+; xchg bx, bx
+ db 0x48 ; REX, nasm doesn't have a sysretq opcode
sysret
[section .data]
{
// TODO: Implement Copy-on-Write
#if 1
- if( PAGEMAPLVL4(Addr>39) & PF_PRESENT
- && PAGEDIRPTR(Addr>>30) & PF_PRESENT
- && PAGEDIR(Addr>>21) & PF_PRESENT
- && PAGETABLE(Addr>>12) & PF_PRESENT
- && PAGETABLE(Addr>>12) & PF_COW )
+ if( PAGEMAPLVL4(Addr>>39) & PF_PRESENT
+ && PAGEDIRPTR (Addr>>30) & PF_PRESENT
+ && PAGEDIR (Addr>>21) & PF_PRESENT
+ && PAGETABLE (Addr>>12) & PF_PRESENT
+ && PAGETABLE (Addr>>12) & PF_COW )
{
tPAddr paddr;
if(MM_GetRefCount( PAGETABLE(Addr>>12) & PADDR_MASK ) == 1)