1/* 2 * Copyright 2017, Data61 3 * Commonwealth Scientific and Industrial Research Organisation (CSIRO) 4 * ABN 41 687 119 230. 5 * 6 * This software may be distributed and modified according to the terms of 7 * the BSD 2-Clause license. Note that NO WARRANTY is provided. 8 * See "LICENSE_BSD2.txt" for details. 9 * 10 * @TAG(DATA61_BSD) 11 */ 12 13#include <autoconf.h> 14#include <sel4muslcsys/gen_config.h> 15#include <stdio.h> 16#include <sel4/sel4.h> 17#include <stdlib.h> 18#include <stdarg.h> 19#include <utils/util.h> 20 21static void sel4_abort(void) 22{ 23#if defined(CONFIG_DEBUG_BUILD) && defined(CONFIG_LIB_SEL4_MUSLC_SYS_DEBUG_HALT) 24 printf("seL4 root server abort()ed\n"); 25 seL4_DebugHalt(); 26#endif 27 while (1); /* We don't return after this */ 28} 29 30long sys_exit(va_list ap) 31{ 32 abort(); 33 return 0; 34} 35 36long sys_rt_sigprocmask(va_list ap) 37{ 38 ZF_LOGV("Ignoring call to %s", __FUNCTION__); 39 return 0; 40} 41 42long sys_gettid(va_list ap) 43{ 44 ZF_LOGV("Ignoring call to %s", __FUNCTION__); 45 return 0; 46} 47 48long sys_getpid(va_list ap) 49{ 50 ZF_LOGV("Ignoring call to %s", __FUNCTION__); 51 return 0; 52} 53 54long sys_tgkill(va_list ap) 55{ 56 ZF_LOGV("%s assuming self kill", __FUNCTION__); 57 sel4_abort(); 58 return 0; 59} 60 61long sys_tkill(va_list ap) 62{ 63 ZF_LOGV("%s assuming self kill", __FUNCTION__); 64 sel4_abort(); 65 return 0; 66} 67 68long sys_exit_group(va_list ap) 69{ 70 ZF_LOGV("Ignoring call to %s", __FUNCTION__); 71 return 0; 72} 73