-Fixed unwinding IPCs when saved state is running but partner is still

set
-Make IO Fpage helpers compatible to C
This commit is contained in:
Jan Stoess 2009-07-15 20:24:30 +02:00
parent cade634ac2
commit 3e7135a1cd
4 changed files with 15 additions and 7 deletions

View File

@ -452,7 +452,8 @@ static void do_xcpu_unwind_partner (cpu_mb_entry_t * entry)
return;
}
if (! tcb->get_saved_partner ().is_nilthread ())
if (! tcb->get_saved_partner ().is_nilthread () &&
tcb->get_saved_state().is_polling_or_waiting() )
{
// We have a nested IPC operation. Perform another unwind.
tcb->restore_state ();
@ -505,7 +506,7 @@ redo_unwind:
set_state (thread_state_t::running);
partner = get_partner_tcb ();
if (cstate.is_polling () || cstate.is_waiting ())
if (cstate.is_polling_or_waiting ())
{
// IPC operation has not yet started. I.e., partner is not
// yet involved.
@ -525,7 +526,8 @@ redo_unwind:
tag = tag.error_tag ();
}
if (! get_saved_partner ().is_nilthread ())
if (! get_saved_partner ().is_nilthread () &&
get_saved_state().is_polling_or_waiting())
{
// We're handling a nested IPC.
restore_state ();

View File

@ -90,6 +90,8 @@ public:
{ return state == waiting_timeout; }
bool is_polling()
{ return state == polling; }
bool is_polling_or_waiting()
{ return is_polling() || is_waiting(); }
bool is_locked_running()
{ return state == locked_running; }
bool is_locked_waiting()

View File

@ -59,12 +59,13 @@ L4_INLINE L4_Fpage_t L4_Fpage (L4_IoFpage_t f)
L4_INLINE L4_Fpage_t L4_IoFpage (L4_Word_t BasePort, int FpageSize)
{
L4_IoFpage_t fp;
L4_Fpage_t out;
L4_Word_t msb = __L4_Msb (FpageSize);
fp.X.p = BasePort;
fp.X.__two = 2;
fp.X.s = (1UL << msb) < (L4_Word_t) FpageSize ? msb + 1 : msb;
fp.X.rwx = L4_NoAccess;
L4_Fpage_t out;
out.raw = fp.raw;
return out;
}
@ -72,11 +73,12 @@ L4_INLINE L4_Fpage_t L4_IoFpage (L4_Word_t BasePort, int FpageSize)
L4_INLINE L4_Fpage_t L4_IoFpageLog2 (L4_Word_t BasePort, int FpageSize)
{
L4_IoFpage_t fp;
L4_Fpage_t out;
fp.X.p = BasePort;
fp.X.__two = 2;
fp.X.s = FpageSize;
fp.X.rwx = L4_NoAccess;
L4_Fpage_t out;
out.raw = fp.raw;
return out;
}

View File

@ -55,12 +55,13 @@ L4_INLINE L4_Fpage_t L4_Fpage (L4_IoFpage_t f)
L4_INLINE L4_Fpage_t L4_IoFpage (L4_Word_t BasePort, int FpageSize)
{
L4_IoFpage_t fp;
L4_Fpage_t out;
L4_Word_t msb = __L4_Msb (FpageSize);
fp.X.p = BasePort;
fp.X.__two = 2;
fp.X.s = (1UL << msb) < (L4_Word_t) FpageSize ? msb + 1 : msb;
fp.X.rwx = L4_NoAccess;
L4_Fpage_t out;
out.raw = fp.raw;
return out;
}
@ -68,11 +69,12 @@ L4_INLINE L4_Fpage_t L4_IoFpage (L4_Word_t BasePort, int FpageSize)
L4_INLINE L4_Fpage_t L4_IoFpageLog2 (L4_Word_t BasePort, int FpageSize)
{
L4_IoFpage_t fp;
L4_Fpage_t out;
fp.X.p = BasePort;
fp.X.__two = 2;
fp.X.s = FpageSize;
fp.X.rwx = L4_NoAccess;
L4_Fpage_t out;
out.raw = fp.raw;
return out;
}