Syscalls now can take six arguments (XCC)
[akaros.git] / tests / arsc_test.c
1 #include <parlib.h>
2 #include <vcore.h>
3 #include <ros/syscall.h>
4 #include <arc.h>
5 #include <stdio.h>
6
7 int sys_cputs_async(const char *s, size_t len, syscall_desc_t* desc,                                              
8                      void (*cleanup_handler)(void*), void* cleanup_data)
9 {                                                                                                                     
10     // could just hardcode 4 0's, will eventually wrap this marshaller anyway                                         
11     syscall_req_t syscall = {SYS_cputs, 0, {(uint32_t)s, len, [2 ... (NUM_SYSCALL_ARGS-1)] 0} };                          
12     desc->cleanup = cleanup_handler;                                                                                  
13     desc->data = cleanup_data;                                                                                        
14     return async_syscall(&syscall, desc);                                                                             
15 }     
16 int main(int argc, char** argv){
17         int pid = sys_getpid();
18         char testme = 't';
19         printf ("single thread - init arsc \n");
20         init_arc();
21         async_desc_t desc1;
22         async_rsp_t rsp1;
23         syscall_rsp_t sysrsp;
24
25         syscall_desc_t* sysdesc = get_sys_desc (&desc1);
26         // cprintf_async(&desc1, "Cross-Core call 1, coming from process %08x\n", pid);
27         sys_cputs_async(&testme, 1, sysdesc, NULL, NULL);
28         waiton_syscall(sysdesc, &sysrsp);
29         printf ("single thread - dummy call \n");       
30 }