FOC: Fix 'user_flags' on x86
Use carry bit in EFLAGS to pass thread state to ex_reg caller. Do not touch other bits, which might disable interrupts on kernel exit. Fixes ssumpf/foc#2.
This commit is contained in:
@@ -92,7 +92,10 @@ Thread::user_ip() const
|
|||||||
IMPLEMENT inline
|
IMPLEMENT inline
|
||||||
Mword
|
Mword
|
||||||
Thread::user_flags() const
|
Thread::user_flags() const
|
||||||
{ return state() & Thread_ready; }
|
{
|
||||||
|
// pass thread-ready state in carry flag (Thread_ready is bit 0)
|
||||||
|
return (regs()->flags() & ~Thread_ready) | (state() & Thread_ready);
|
||||||
|
}
|
||||||
|
|
||||||
/** Check if the pagefault occured at a special place: At some places in the
|
/** Check if the pagefault occured at a special place: At some places in the
|
||||||
kernel we want to ensure that a specific address is mapped. The regular
|
kernel we want to ensure that a specific address is mapped. The regular
|
||||||
|
|||||||
Reference in New Issue
Block a user