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:
Sebastian Sumpf
2013-03-14 17:03:35 +01:00
parent 1d8bc40fd9
commit 658efaee17

View File

@@ -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