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