mirror of
git://projects.qi-hardware.com/iris.git
synced 2025-01-01 18:11:10 +02:00
more
This commit is contained in:
parent
305bc03711
commit
3fc672f50f
@ -48,9 +48,9 @@ extern "C" {
|
||||
#define CAP_THREAD_ALL_PRIV_RIGHTS (CAP_THREAD_ALL_RIGHTS | (1 << CAP_THREAD_REGISTER_INTERRUPT) | (1 << CAP_THREAD_GET_TOP_MEMORY))
|
||||
|
||||
/* These get/set_info are not arch-specific. */
|
||||
#define CAP_THREAD_INFO_PC 0
|
||||
#define CAP_THREAD_INFO_SP 1
|
||||
#define CAP_THREAD_INFO_FLAGS 2
|
||||
#define CAP_THREAD_INFO_PC ~0
|
||||
#define CAP_THREAD_INFO_SP ~1
|
||||
#define CAP_THREAD_INFO_FLAGS ~2
|
||||
/* Flag values for processor state */
|
||||
#define THREAD_FLAG_WAITING 0x80000000
|
||||
#define THREAD_FLAG_RUNNING 0x40000000
|
||||
|
20
invoke.ccp
20
invoke.ccp
@ -202,7 +202,8 @@ static void thread_invoke (unsigned target, unsigned protected_data, Capability
|
||||
value = &thread->sp
|
||||
break
|
||||
case CAP_THREAD_INFO_FLAGS:
|
||||
data[3] &= ~THREAD_FLAG_PRIV
|
||||
// It is not possible to set the PRIV flag, but it can be reset.
|
||||
data[2] &= ~THREAD_FLAG_PRIV
|
||||
value = &thread->flags
|
||||
if data[3] & ~THREAD_FLAG_USER:
|
||||
unsigned v = (*value & data[3]) | (data[2] & data[3])
|
||||
@ -233,7 +234,7 @@ static void thread_invoke (unsigned target, unsigned protected_data, Capability
|
||||
default:
|
||||
break
|
||||
|
||||
static void page_invoke (unsigned target, unsigned protected_data, Capability *cap, unsigned request, unsigned data):
|
||||
static void page_invoke (unsigned target, unsigned protected_data, Capability *cap, bool copy, unsigned request, unsigned data):
|
||||
Page *page
|
||||
Cappage *cappage
|
||||
if (target & CAPTYPE_MASK) == CAPTYPE_PAGE:
|
||||
@ -246,7 +247,8 @@ static void page_invoke (unsigned target, unsigned protected_data, Capability *c
|
||||
case CAP_PAGE_MAP:
|
||||
if !page:
|
||||
return
|
||||
// TODO
|
||||
page->address_space->map (page, data, target & CAP_PAGE_WRITE)
|
||||
break
|
||||
case CAP_PAGE_SHARE:
|
||||
// TODO
|
||||
case CAP_PAGE_SHARE_COW:
|
||||
@ -254,9 +256,13 @@ static void page_invoke (unsigned target, unsigned protected_data, Capability *c
|
||||
case CAP_PAGE_FORGET:
|
||||
// TODO
|
||||
case CAP_CAPPAGE_SET:
|
||||
if !cappage:
|
||||
if !cappage || data >= CAPPAGE_SIZE || !(target & CAP_PAGE_WRITE):
|
||||
return
|
||||
// TODO
|
||||
Capability *c = &cappage->page[data]
|
||||
c->invalidate ()
|
||||
// clone_capability needs a Memory, but doesn't use it when storage is provided.
|
||||
top_memory.clone_capability (cap, copy, c)
|
||||
break
|
||||
default:
|
||||
break
|
||||
|
||||
@ -315,13 +321,13 @@ static bool kernel_invoke (unsigned target, unsigned protected_data, unsigned d[
|
||||
thread_invoke (target, protected_data, c[1], d)
|
||||
break
|
||||
case CAPTYPE_PAGE:
|
||||
page_invoke (target, protected_data, c[1], d[0], d[1])
|
||||
page_invoke (target, protected_data, c[1], copy[1], d[0], d[1])
|
||||
break
|
||||
case CAPTYPE_CAPABILITY:
|
||||
capability_invoke (target, protected_data, c[1], d[0], d[1])
|
||||
break
|
||||
case CAPTYPE_CAPPAGE:
|
||||
page_invoke (target, protected_data, c[1], d[0], d[1])
|
||||
page_invoke (target, protected_data, c[1], copy[1], d[0], d[1])
|
||||
break
|
||||
default:
|
||||
panic (0x99337744, "invalid capability type invoked")
|
||||
|
Loading…
Reference in New Issue
Block a user