Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <sel4/sel4.h>
- #include <stdio.h>
- #define CSPACE_DEPTH 32
- #define CDEPTH CSPACE_DEPTH
- #define CSPACE (0x2) // bad guess work?
- #define RECV_CAP (0x3)
- // seL4_SetCapReceivePath(REFOS_CSPACE, recv_cslot, REFOS_CSPACE_DEPTH)
- seL4_CPtr parent_ep;
- #define cnode 0
- int main(int argc, char **argv) {
- printf("----------------------------------------------------------\n");
- printf("-- app started --\n");
- printf("----------------------------------------------------------\n");
- parent_ep = (seL4_CPtr)atol(argv[0]);
- seL4_MessageInfo_t msg = seL4_MessageInfo_new(0, 0, 1, 0);
- seL4_SetCapReceivePath(CSPACE, RECV_CAP, CDEPTH);
- seL4_MessageInfo_t ret = seL4_Call(parent_ep, msg);
- seL4_Uint64 extra_caps = seL4_MessageInfo_get_extraCaps(ret);
- printf("app got reply: extraCaps=%d, r0=0x%x\n", extra_caps, seL4_GetMR(0));
- seL4_CPtr ep = seL4_GetCap(0);
- printf("ep got cap: 0x%x\n", ep);
- seL4_Word badge;
- msg = seL4_Recv(ep, &badge);
- printf("mesage from %d: 0x%x\n", badge, seL4_GetMR(0));
- return 0;
- }
Add Comment
Please, Sign In to add comment