mirror of
https://github.com/drasko/codezero.git
synced 2026-03-17 01:31:49 +01:00
Capability replicate/split/destroy/grant working for test0 ipc.
Implemented a protocol between a client and its pager to request and get a capability to ipc to another client of the pager. Pager first ensures the request is valid from its client. It then tries to use a greater capability that it possesses, to produce a new capability that the client requested. Once the kernel validates the correct one and replicates/reduces it to client's need, it grants it to the client.
This commit is contained in:
@@ -105,11 +105,11 @@ void ipc_extended_test(void)
|
||||
cap.owner = parent;
|
||||
cap.resid = child;
|
||||
} else {
|
||||
cap.owner = child;
|
||||
cap.owner = getpid();
|
||||
cap.resid = parent;
|
||||
}
|
||||
cap.type = CAP_TYPE_IPC | CAP_RTYPE_THREAD;
|
||||
cap.access = CAP_IPC_EXTENDED;
|
||||
cap.access = CAP_IPC_EXTENDED | CAP_IPC_SEND | CAP_IPC_RECV;
|
||||
if ((err = cap_request_pager(&cap)) < 0) {
|
||||
printf("Ipc capability request failed. "
|
||||
"err = %d\n", err);
|
||||
|
||||
Reference in New Issue
Block a user