Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/omega-mv/blob/main/seed/modules/tests/caller.c # omega-mv Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance. Brought by drakestapleton Sign in to star 1 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `omega-mv / seed / modules / tests / caller.c` 23 lines ยท 919 bytes Raw Blame History 1 /* Independent test oracle, not a production dependency. */ 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 extern uint64_t invoke(void*,void*,void*,uint64_t,uint64_t,uint64_t); 10 extern void trap_entry(void); 11 int main(int argc,char **argv) { 12 if(argc!=3)return 90; 13 int fd=open(argv[1],O_RDONLY); struct stat st; 14 if(fd<0||fstat(fd,&st))return 91; 15 void *code=mmap(0,st.st_size,PROT_READ|PROT_EXEC,MAP_PRIVATE,fd,0); 16 void *stack=mmap(0,8*1024*1024,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANONYMOUS,-1,0); 17 if(code==MAP_FAILED||stack==MAP_FAILED)return 92; 18 uint64_t context[32]={0};context[2]=(uintptr_t)trap_entry; 19 uint64_t data[4]={3,5,7,11}; 20 uint64_t arg=strtoull(argv[2],0,10); 21 uint64_t r=invoke(code,(char*)stack+8*1024*1024,context,arg==999?(uintptr_t)data:arg,4,0); 22 printf("%llu\n",(unsigned long long)r);return 0; 23 }