-
-
Save anonymous/8294aa47ad351e4d4066 to your computer and use it in GitHub Desktop.
Example syscall
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
seL4_MessageInfo_t syscall_create_ep(process* currproc) { | |
int err; | |
seL4_CPtr ep_cap; | |
seL4_Word ep_addr = ut_alloc(seL4_EndpointBits); | |
if (!ep_addr) { | |
printf("uh-oh 1\n"); | |
return prepare_response(1, 0); | |
} | |
err = cspace_ut_retype_addr(ep_addr, seL4_EndpointObject, | |
seL4_EndpointBits, currproc->croot, | |
&ep_cap); | |
if (err) { | |
printf("uh-oh 2\n"); | |
ut_free(ep_addr, seL4_EndpointBits); | |
return prepare_response(1, 0); | |
} | |
// TODO bookkeeping | |
return prepare_response(1, ep_cap); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment