Ejemplo n.º 1
0
void _start(void) {
  int retval = UNTYPED_SYSCALL(TEST_SYSCALL_INVOKE)();
  if (retval != 123) {
    /* This sandbox is so simple that we have no way of printing a
       failure message. */
    SimpleAbort();
  }
  int para = UNTYPED_SYSCALL(TEST_SYSCALL_GET_INT)();
  int ans = isPrime(para);
  // report ans 
  if (ans){
    UNTYPED_SYSCALL(TEST_SYSCALL_REP_TRUE)();
  }else{
    UNTYPED_SYSCALL(TEST_SYSCALL_REP_FALSE)();  
  }
  /* now it will be terminated*/
  UNTYPED_SYSCALL(TEST_SYSCALL_EXIT)();
  /* Should not reach here. */
  SimpleAbort();
}
Ejemplo n.º 2
0
void _start(void) {
  while (1) {
    UNTYPED_SYSCALL(SINGLE_STEP_TEST_SYSCALL)();
  }
}