mirror of
https://github.com/drasko/codezero.git
synced 2026-01-12 10:53:16 +01:00
Capability checking for thread_control, exregs, mutex, cap_control,
ipc, and map system calls.
The visualised model is implemented in code that compiles, but
actual functionality hasn't been tested.
Need to add:
- Dynamic assignment of initial resources matching with what's
defined in the configuration.
- A paged-thread-group, since that would be a logical group of
seperation from a capability point-of-view.
- Resource ids for various tasks. E.g.
- Memory capabilities don't have target resources.
- Thread capability assumes current container for THREAD_CREATE.
- Mutex syscall assumes current thread (this one may not need
any changing)
- cap_control syscall assumes current thread. It may happen to
be that another thread's capability list is manipulated.
Last but not least:
- A simple and easy-to-use userspace library for dynamic expansion
of resource domains as new resources are created such as threads.
50 lines
1.3 KiB
C
50 lines
1.3 KiB
C
/*
|
|
* Exchange registers system call data.
|
|
*
|
|
* Copyright (C) 2008 Bahadir Balban
|
|
*/
|
|
#ifndef __EXREGS_H__
|
|
#define __EXREGS_H__
|
|
|
|
#include <l4/macros.h>
|
|
#include INC_GLUE(syscall.h)
|
|
#include INC_GLUE(context.h)
|
|
#include <l4/types.h>
|
|
|
|
#define EXREGS_SET_PAGER 1
|
|
#define EXREGS_SET_UTCB 2
|
|
#define EXREGS_VALID_REGULAR_REGS \
|
|
(FIELD_TO_BIT(exregs_context_t, r0) | \
|
|
FIELD_TO_BIT(exregs_context_t, r1) | \
|
|
FIELD_TO_BIT(exregs_context_t, r2) | \
|
|
FIELD_TO_BIT(exregs_context_t, r3) | \
|
|
FIELD_TO_BIT(exregs_context_t, r4) | \
|
|
FIELD_TO_BIT(exregs_context_t, r5) | \
|
|
FIELD_TO_BIT(exregs_context_t, r6) | \
|
|
FIELD_TO_BIT(exregs_context_t, r7) | \
|
|
FIELD_TO_BIT(exregs_context_t, r8) | \
|
|
FIELD_TO_BIT(exregs_context_t, r9) | \
|
|
FIELD_TO_BIT(exregs_context_t, r10) | \
|
|
FIELD_TO_BIT(exregs_context_t, r11) | \
|
|
FIELD_TO_BIT(exregs_context_t, r12) | \
|
|
FIELD_TO_BIT(exregs_context_t, lr)) \
|
|
|
|
#define EXREGS_VALID_SP \
|
|
FIELD_TO_BIT(exregs_context_t, sp) \
|
|
|
|
#define EXREGS_VALID_PC \
|
|
FIELD_TO_BIT(exregs_context_t, pc) \
|
|
|
|
/* Structure passed by userspace pagers for exchanging registers */
|
|
struct exregs_data {
|
|
exregs_context_t context;
|
|
u32 valid_vect;
|
|
u32 flags;
|
|
l4id_t pagerid;
|
|
unsigned long utcb_address;
|
|
};
|
|
|
|
|
|
|
|
#endif /* __EXREGS_H__ */
|