1
0
mirror of git://projects.qi-hardware.com/iris.git synced 2024-07-01 01:26:43 +03:00

refix bugs

This commit is contained in:
Bas Wijnen 2009-06-10 23:10:30 +02:00
parent 8445be58dd
commit 159e576174

View File

@ -19,6 +19,8 @@
#include "kernel.hh"
Capability *Memory::find_capability (unsigned code, bool *copy):
if !code:
return NULL
*copy = code & 2 ? true : false
if code & 1:
// Cappage capability
@ -645,22 +647,19 @@ static bool kernel_invoke (unsigned target, unsigned protected_data, Capability:
// data[0] is the request.
// cap[0] is the reply capability
// other parameters' meanings depend on the operation.
if !((1 << c->data[0]) & target & ~REQUEST_MASK):
// You are not allowed to perform this operation.
return true
if (target & (CAPTYPE_MASK | (1 << CAP_RECEIVER_CALL))) == (CAPTYPE_RECEIVER | (1 << CAP_RECEIVER_CALL)):
// This is a call capability.
reply_receiver = (Receiver *)protected_data
reply_receiver->protected_only = !(target & (1 << CAP_RECEIVER_CALL_ASYNC))
Capability *c0 = c->cap[0]
if ~(unsigned)c0->target & ~KERNEL_MASK:
if ((unsigned)c0->target & ~KERNEL_MASK) != 0:
Capability r
fill_cap (&r, protected_data, reply_receiver->reply_protected_data)
c->cap[0] = &r
c->copy[0] = true
bool ret = kernel_invoke ((unsigned)c0->target, c0->protected_data, c, c0)
c0->target->send_message (c0->protected_data, c)
r.invalidate ()
return ret
return true
else:
// Kernel call: don't create actual capablities.
reply = NULL
@ -677,6 +676,9 @@ static bool kernel_invoke (unsigned target, unsigned protected_data, Capability:
self->sibling_next->invalidate ()
self->invalidate ()
return true
if !((1 << c->data[0]) & target & ~REQUEST_MASK):
// You are not allowed to perform this operation.
return true
reply = c->cap[0]
if c->data[0] == CAP_DEGRADE:
reply_cap (target & c->data[1], protected_data)