tkernel_2/include/sys/syscall.h | bare source | permlink (0.00 seconds) |
1: /* 2: *---------------------------------------------------------------------- 3: * T-Kernel 2.0 Software Package 4: * 5: * Copyright 2011 by Ken Sakamura. 6: * This software is distributed under the latest version of T-License 2.x. 7: *---------------------------------------------------------------------- 8: * 9: * Released by T-Engine Forum(http://www.t-engine.org/) at 2011/05/17. 10: * Modified by TRON Forum(http://www.tron.org/) at 2015/06/01. 11: * 12: *---------------------------------------------------------------------- 13: */ 14: 15: /* 16: * @(#)syscall.h (sys) 17: * 18: * System call interface common definition 19: */ 20: 21: #ifndef __SYS_SYSCALL_H__ 22: #define __SYS_SYSCALL_H__ 23: 24: #include <basic.h> 25: #include <sys/queue.h> 26: 27: #ifdef __cplusplus 28: extern "C" { 29: #endif 30: 31: /* 32: * Function number 33: */ 34: typedef struct { 35: #if BIGENDIAN 36: UW funcno:16; /* Function number in SVC */ 37: UW parsize:8; /* Parameter W size */ 38: UW svcno:8; /* SVC number */ 39: #else 40: UW svcno:8; /* SVC number */ 41: UW parsize:8; /* Parameter W size */ 42: UW funcno:16; /* Function number in SVC */ 43: #endif 44: } EFN; 45: 46: typedef union { 47: EFN efn; 48: UW w; 49: } FunctionNumber; 50: 51: /* 52: * Command packet format (header portion) 53: * Optional data is added after this header if necessary. 54: */ 55: typedef struct { 56: QUEUE q; /* For queue connection */ 57: FunctionNumber fno; /* Function number */ 58: ID tid; /* Call task ID */ 59: W ret; /* Return value */ 60: void *para; /* Pointer to argument list */ 61: } SyscallCmdPacket; 62: 63: /* 64: * Rendezvous call classification 65: */ 66: typedef enum { 67: Syscall_APL = 0x00000001, /* Call from application */ 68: Syscall_OS = 0x00000002, /* Call from within OS */ 69: Syscall_OWN = 0x00000004 /* Self-originated redirect, 70: re-call, or other */ 71: } SyscallPattern; 72: 73: #ifdef __cplusplus 74: } 75: #endif 76: #endif /* __SYS_SYSCALL_H__ */