Skip to content

Commit

Permalink
FOC: Fix 'user_flags' on x86
Browse files Browse the repository at this point in the history
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 #2.
  • Loading branch information
ssumpf committed Mar 14, 2013
1 parent 1d8bc40 commit 658efae
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion kernel/fiasco/src/kern/ia32/thread-ia32.cpp
Expand Up @@ -92,7 +92,10 @@ Thread::user_ip() const
IMPLEMENT inline
Mword
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
kernel we want to ensure that a specific address is mapped. The regular
Expand Down

0 comments on commit 658efae

Please sign in to comment.