1*433d6423SLionel Sambuc /* Function prototypes for the system library. The prototypes in this file 2*433d6423SLionel Sambuc * are undefined to NULL if the kernel call is not enabled in config.h. 3*433d6423SLionel Sambuc * The implementation is contained in src/kernel/system/. 4*433d6423SLionel Sambuc * 5*433d6423SLionel Sambuc * The system library allows to access system services by doing a kernel call. 6*433d6423SLionel Sambuc * System calls are transformed into request messages to the SYS task that is 7*433d6423SLionel Sambuc * responsible for handling the call. By convention, sys_call() is transformed 8*433d6423SLionel Sambuc * into a message with type SYS_CALL that is handled in a function do_call(). 9*433d6423SLionel Sambuc * 10*433d6423SLionel Sambuc * Changes: 11*433d6423SLionel Sambuc * Mar 01, 2010 SYS_CLEAR and SYS_EXIT split (Cristiano Giuffrida) 12*433d6423SLionel Sambuc * Jul 30, 2005 created SYS_INT86 to support BIOS driver (Philip Homburg) 13*433d6423SLionel Sambuc * Jul 13, 2005 created SYS_PRIVCTL to manage services (Jorrit N. Herder) 14*433d6423SLionel Sambuc * Jul 09, 2005 updated SYS_KILL to signal services (Jorrit N. Herder) 15*433d6423SLionel Sambuc * Jun 21, 2005 created SYS_NICE for nice(2) kernel call (Ben J. Gras) 16*433d6423SLionel Sambuc * Jun 21, 2005 created SYS_MEMSET to speed up exec(2) (Ben J. Gras) 17*433d6423SLionel Sambuc * Jan 20, 2005 updated SYS_COPY for virtual_copy() (Jorrit N. Herder) 18*433d6423SLionel Sambuc * Oct 24, 2004 created SYS_GETKSIG to support PM (Jorrit N. Herder) 19*433d6423SLionel Sambuc * Oct 10, 2004 created handler for unused calls (Jorrit N. Herder) 20*433d6423SLionel Sambuc * Sep 09, 2004 updated SYS_EXIT to let services exit (Jorrit N. Herder) 21*433d6423SLionel Sambuc * Aug 25, 2004 rewrote SYS_SETALARM to clean up code (Jorrit N. Herder) 22*433d6423SLionel Sambuc * Jul 13, 2004 created SYS_SEGCTL to support drivers (Jorrit N. Herder) 23*433d6423SLionel Sambuc * May 24, 2004 created SYS_SDEVIO to support drivers (Jorrit N. Herder) 24*433d6423SLionel Sambuc * May 24, 2004 created SYS_GETINFO to retrieve info (Jorrit N. Herder) 25*433d6423SLionel Sambuc * Apr 18, 2004 created SYS_VDEVIO to support drivers (Jorrit N. Herder) 26*433d6423SLionel Sambuc * Feb 24, 2004 created SYS_IRQCTL to support drivers (Jorrit N. Herder) 27*433d6423SLionel Sambuc * Feb 02, 2004 created SYS_DEVIO to support drivers (Jorrit N. Herder) 28*433d6423SLionel Sambuc */ 29*433d6423SLionel Sambuc 30*433d6423SLionel Sambuc #ifndef SYSTEM_H 31*433d6423SLionel Sambuc #define SYSTEM_H 32*433d6423SLionel Sambuc 33*433d6423SLionel Sambuc #include "kernel/kernel.h" 34*433d6423SLionel Sambuc 35*433d6423SLionel Sambuc int do_exec(struct proc * caller, message *m_ptr); 36*433d6423SLionel Sambuc #if ! USE_EXEC 37*433d6423SLionel Sambuc #define do_exec NULL 38*433d6423SLionel Sambuc #endif 39*433d6423SLionel Sambuc 40*433d6423SLionel Sambuc int do_fork(struct proc * caller, message *m_ptr); 41*433d6423SLionel Sambuc #if ! USE_FORK 42*433d6423SLionel Sambuc #define do_fork NULL 43*433d6423SLionel Sambuc #endif 44*433d6423SLionel Sambuc 45*433d6423SLionel Sambuc int do_clear(struct proc * caller, message *m_ptr); 46*433d6423SLionel Sambuc #if ! USE_CLEAR 47*433d6423SLionel Sambuc #define do_clear NULL 48*433d6423SLionel Sambuc #endif 49*433d6423SLionel Sambuc 50*433d6423SLionel Sambuc int do_trace(struct proc * caller, message *m_ptr); 51*433d6423SLionel Sambuc #if ! USE_TRACE 52*433d6423SLionel Sambuc #define do_trace NULL 53*433d6423SLionel Sambuc #endif 54*433d6423SLionel Sambuc 55*433d6423SLionel Sambuc int do_runctl(struct proc * caller, message *m_ptr); 56*433d6423SLionel Sambuc #if ! USE_RUNCTL 57*433d6423SLionel Sambuc #define do_runctl NULL 58*433d6423SLionel Sambuc #endif 59*433d6423SLionel Sambuc 60*433d6423SLionel Sambuc int do_update(struct proc * caller, message *m_ptr); 61*433d6423SLionel Sambuc #if ! USE_UPDATE 62*433d6423SLionel Sambuc #define do_update NULL 63*433d6423SLionel Sambuc #endif 64*433d6423SLionel Sambuc 65*433d6423SLionel Sambuc int do_exit(struct proc * caller, message *m_ptr); 66*433d6423SLionel Sambuc #if ! USE_EXIT 67*433d6423SLionel Sambuc #define do_exit NULL 68*433d6423SLionel Sambuc #endif 69*433d6423SLionel Sambuc 70*433d6423SLionel Sambuc int do_copy(struct proc * caller, message *m_ptr); 71*433d6423SLionel Sambuc #define do_vircopy do_copy 72*433d6423SLionel Sambuc #if ! (USE_VIRCOPY || USE_PHYSCOPY) 73*433d6423SLionel Sambuc #define do_copy NULL 74*433d6423SLionel Sambuc #endif 75*433d6423SLionel Sambuc 76*433d6423SLionel Sambuc int do_umap(struct proc * caller, message *m_ptr); 77*433d6423SLionel Sambuc #if ! USE_UMAP 78*433d6423SLionel Sambuc #define do_umap NULL 79*433d6423SLionel Sambuc #endif 80*433d6423SLionel Sambuc 81*433d6423SLionel Sambuc int do_umap_remote(struct proc * caller, message *m_ptr); 82*433d6423SLionel Sambuc #if ! USE_UMAP_REMOTE 83*433d6423SLionel Sambuc #define do_umap_remote NULL 84*433d6423SLionel Sambuc #endif 85*433d6423SLionel Sambuc 86*433d6423SLionel Sambuc int do_vumap(struct proc * caller, message *m_ptr); 87*433d6423SLionel Sambuc #if ! USE_VUMAP 88*433d6423SLionel Sambuc #define do_vumap NULL 89*433d6423SLionel Sambuc #endif 90*433d6423SLionel Sambuc 91*433d6423SLionel Sambuc int do_memset(struct proc * caller, message *m_ptr); 92*433d6423SLionel Sambuc #if ! USE_MEMSET 93*433d6423SLionel Sambuc #define do_memset NULL 94*433d6423SLionel Sambuc #endif 95*433d6423SLionel Sambuc 96*433d6423SLionel Sambuc int do_abort(struct proc * caller, message *m_ptr); 97*433d6423SLionel Sambuc #if ! USE_ABORT 98*433d6423SLionel Sambuc #define do_abort NULL 99*433d6423SLionel Sambuc #endif 100*433d6423SLionel Sambuc 101*433d6423SLionel Sambuc int do_getinfo(struct proc * caller, message *m_ptr); 102*433d6423SLionel Sambuc #if ! USE_GETINFO 103*433d6423SLionel Sambuc #define do_getinfo NULL 104*433d6423SLionel Sambuc #endif 105*433d6423SLionel Sambuc 106*433d6423SLionel Sambuc int do_privctl(struct proc * caller, message *m_ptr); 107*433d6423SLionel Sambuc #if ! USE_PRIVCTL 108*433d6423SLionel Sambuc #define do_privctl NULL 109*433d6423SLionel Sambuc #endif 110*433d6423SLionel Sambuc 111*433d6423SLionel Sambuc int do_irqctl(struct proc * caller, message *m_ptr); 112*433d6423SLionel Sambuc #if ! USE_IRQCTL 113*433d6423SLionel Sambuc #define do_irqctl NULL 114*433d6423SLionel Sambuc #endif 115*433d6423SLionel Sambuc 116*433d6423SLionel Sambuc int do_devio(struct proc * caller, message *m_ptr); 117*433d6423SLionel Sambuc #if ! USE_DEVIO 118*433d6423SLionel Sambuc #define do_devio NULL 119*433d6423SLionel Sambuc #endif 120*433d6423SLionel Sambuc 121*433d6423SLionel Sambuc int do_vdevio(struct proc * caller, message *m_ptr); 122*433d6423SLionel Sambuc #if ! USE_VDEVIO 123*433d6423SLionel Sambuc #define do_vdevio NULL 124*433d6423SLionel Sambuc #endif 125*433d6423SLionel Sambuc 126*433d6423SLionel Sambuc int do_sdevio(struct proc * caller, message *m_ptr); 127*433d6423SLionel Sambuc #if ! USE_SDEVIO 128*433d6423SLionel Sambuc #define do_sdevio NULL 129*433d6423SLionel Sambuc #endif 130*433d6423SLionel Sambuc 131*433d6423SLionel Sambuc int do_kill(struct proc * caller, message *m_ptr); 132*433d6423SLionel Sambuc #if ! USE_KILL 133*433d6423SLionel Sambuc #define do_kill NULL 134*433d6423SLionel Sambuc #endif 135*433d6423SLionel Sambuc 136*433d6423SLionel Sambuc int do_getksig(struct proc * caller, message *m_ptr); 137*433d6423SLionel Sambuc #if ! USE_GETKSIG 138*433d6423SLionel Sambuc #define do_getksig NULL 139*433d6423SLionel Sambuc #endif 140*433d6423SLionel Sambuc 141*433d6423SLionel Sambuc int do_endksig(struct proc * caller, message *m_ptr); 142*433d6423SLionel Sambuc #if ! USE_ENDKSIG 143*433d6423SLionel Sambuc #define do_endksig NULL 144*433d6423SLionel Sambuc #endif 145*433d6423SLionel Sambuc 146*433d6423SLionel Sambuc int do_sigsend(struct proc * caller, message *m_ptr); 147*433d6423SLionel Sambuc #if ! USE_SIGSEND 148*433d6423SLionel Sambuc #define do_sigsend NULL 149*433d6423SLionel Sambuc #endif 150*433d6423SLionel Sambuc 151*433d6423SLionel Sambuc int do_sigreturn(struct proc * caller, message *m_ptr); 152*433d6423SLionel Sambuc #if ! USE_SIGRETURN 153*433d6423SLionel Sambuc #define do_sigreturn NULL 154*433d6423SLionel Sambuc #endif 155*433d6423SLionel Sambuc 156*433d6423SLionel Sambuc int do_times(struct proc * caller, message *m_ptr); 157*433d6423SLionel Sambuc #if ! USE_TIMES 158*433d6423SLionel Sambuc #define do_times NULL 159*433d6423SLionel Sambuc #endif 160*433d6423SLionel Sambuc 161*433d6423SLionel Sambuc int do_setalarm(struct proc * caller, message *m_ptr); 162*433d6423SLionel Sambuc #if ! USE_SETALARM 163*433d6423SLionel Sambuc #define do_setalarm NULL 164*433d6423SLionel Sambuc #endif 165*433d6423SLionel Sambuc 166*433d6423SLionel Sambuc int do_stime(struct proc * caller, message *m_ptr); 167*433d6423SLionel Sambuc int do_settime(struct proc * caller, message *m_ptr); 168*433d6423SLionel Sambuc 169*433d6423SLionel Sambuc int do_vtimer(struct proc * caller, message *m_ptr); 170*433d6423SLionel Sambuc #if ! USE_VTIMER 171*433d6423SLionel Sambuc #define do_vtimer NULL 172*433d6423SLionel Sambuc #endif 173*433d6423SLionel Sambuc 174*433d6423SLionel Sambuc int do_safecopy_to(struct proc * caller, message *m_ptr); 175*433d6423SLionel Sambuc int do_safecopy_from(struct proc * caller, message *m_ptr); 176*433d6423SLionel Sambuc int do_vsafecopy(struct proc * caller, message *m_ptr); 177*433d6423SLionel Sambuc int do_iopenable(struct proc * caller, message *m_ptr); 178*433d6423SLionel Sambuc int do_vmctl(struct proc * caller, message *m_ptr); 179*433d6423SLionel Sambuc int do_setgrant(struct proc * caller, message *m_ptr); 180*433d6423SLionel Sambuc int do_readbios(struct proc * caller, message *m_ptr); 181*433d6423SLionel Sambuc 182*433d6423SLionel Sambuc int do_safememset(struct proc * caller, message *m_ptr); 183*433d6423SLionel Sambuc 184*433d6423SLionel Sambuc int do_sprofile(struct proc * caller, message *m_ptr); 185*433d6423SLionel Sambuc #if ! SPROFILE 186*433d6423SLionel Sambuc #define do_sprofile NULL 187*433d6423SLionel Sambuc #endif 188*433d6423SLionel Sambuc 189*433d6423SLionel Sambuc int do_getmcontext(struct proc * caller, message *m_ptr); 190*433d6423SLionel Sambuc int do_setmcontext(struct proc * caller, message *m_ptr); 191*433d6423SLionel Sambuc #if ! USE_MCONTEXT 192*433d6423SLionel Sambuc #define do_getmcontext NULL 193*433d6423SLionel Sambuc #define do_setmcontext NULL 194*433d6423SLionel Sambuc #endif 195*433d6423SLionel Sambuc 196*433d6423SLionel Sambuc int do_schedule(struct proc * caller, message *m_ptr); 197*433d6423SLionel Sambuc int do_schedctl(struct proc * caller, message *m_ptr); 198*433d6423SLionel Sambuc 199*433d6423SLionel Sambuc int do_statectl(struct proc * caller, message *m_ptr); 200*433d6423SLionel Sambuc #if ! USE_STATECTL 201*433d6423SLionel Sambuc #define do_statectl NULL 202*433d6423SLionel Sambuc #endif 203*433d6423SLionel Sambuc 204*433d6423SLionel Sambuc int do_padconf(struct proc * caller, message *m_ptr); 205*433d6423SLionel Sambuc #if ! USE_PADCONF 206*433d6423SLionel Sambuc #define do_padconf NULL 207*433d6423SLionel Sambuc #endif 208*433d6423SLionel Sambuc 209*433d6423SLionel Sambuc #endif /* SYSTEM_H */ 210*433d6423SLionel Sambuc 211