|
|
1.1 ! root 1: /* (-lgl ! 2: * COHERENT 386 Device Driver Kit release 2.0 ! 3: * Copyright (c) 1982, 1992 by Mark Williams Company. ! 4: * All rights reserved. May not be copied without permission. ! 5: -lgl) */ ! 6: /* ! 7: * Header for system call table. ! 8: */ ! 9: ! 10: #ifndef __KERNEL_SYSTAB_H__ ! 11: #define __KERNEL_SYSTAB_H__ ! 12: ! 13: #include <common/ccompat.h> ! 14: #include <common/gregset.h> ! 15: ! 16: #if _I386 ! 17: #include <kernel/param.h> ! 18: #else ! 19: #include <kernel/const.h> ! 20: #endif ! 21: ! 22: /* ! 23: * Type of a system call function; note that we prototype a function here that ! 24: * takes 6 arguments plus a pointer to a register set. In fact, the calling ! 25: * sequence is different, but this seems more appropriate than "..." for an ! 26: * argument list. ! 27: * ! 28: * Either method is non-portable, but this one should work in more cases. To ! 29: * make it work in all cases, we need a selective dispatch based on the real ! 30: * number of arguments. ! 31: */ ! 32: ! 33: typedef long (* __sysfunc_t) __PROTO ((int _arg1, int _arg2, ! 34: int _arg3, int _arg4, ! 35: int _arg5, int _arg6, ! 36: gregset_t * _regsetp)); ! 37: typedef long (* __sysfunc0_t) __PROTO ((gregset_t * _regsetp)); ! 38: typedef long (* __sysfunc1_t) __PROTO ((int _arg1, ! 39: gregset_t * _regsetp)); ! 40: typedef long (* __sysfunc2_t) __PROTO ((int _arg1, int _arg2, ! 41: gregset_t * _regsetp)); ! 42: typedef long (* __sysfunc3_t) __PROTO ((int _arg1, int _arg2, ! 43: int _arg3, ! 44: gregset_t * _regsetp)); ! 45: typedef long (* __sysfunc4_t) __PROTO ((int _arg1, int _arg2, ! 46: int _arg3, int _arg4, ! 47: gregset_t * _regsetp)); ! 48: typedef long (* __sysfunc5_t) __PROTO ((int _arg1, int _arg2, ! 49: int _arg3, int _arg4, ! 50: int _arg5, ! 51: gregset_t * _regsetp)); ! 52: ! 53: /* ! 54: * Function return types, as in the "s_type" member below. ! 55: */ ! 56: ! 57: enum { ! 58: __SYSCALL_INT = 2, ! 59: __SYSCALL_LONG = 4 ! 60: }; ! 61: ! 62: ! 63: /* ! 64: * System call table structure. ! 65: */ ! 66: ! 67: struct systab { ! 68: #if _I386 ! 69: unsigned char s_nargs; /* number of arguments */ ! 70: #else ! 71: char s_alen; /* Size of argument list */ ! 72: #endif ! 73: char s_type; /* Type returned by function */ ! 74: __sysfunc_t s_func; /* Function */ ! 75: }; ! 76: ! 77: ! 78: #define __DOSYSCALL(argc,func,args,regsetp) \ ! 79: ((argc) == 0 ? (* (__sysfunc0_t) (func)) (regsetp) : \ ! 80: (argc) == 1 ? (* (__sysfunc1_t) (func)) ((args) [0], (regsetp)) : \ ! 81: (argc) == 2 ? (* (__sysfunc2_t) (func)) ((args) [0], (args) [1], \ ! 82: (regsetp)) : \ ! 83: (argc) == 3 ? (* (__sysfunc3_t) (func)) ((args) [0], (args) [1], \ ! 84: (args) [2], (regsetp)) : \ ! 85: (argc) == 4 ? (* (__sysfunc4_t) (func)) ((args) [0], (args) [1], \ ! 86: (args) [2], (args) [3], \ ! 87: (regsetp)) : \ ! 88: (argc) == 5 ? (* (__sysfunc5_t) (func)) ((args) [0], (args) [1], \ ! 89: (args) [2], (args) [3], \ ! 90: (args) [4], (regsetp)) : \ ! 91: (argc) == 6 ? (* (func)) ((args) [0], (args) [1], (args) [2], \ ! 92: (args) [3], (args) [4], (args) [5], \ ! 93: (regsetp)) : \ ! 94: (panic ("Bad number of system call arguments"), 0)) ! 95: ! 96: ! 97: /* ! 98: * System call table. ! 99: */ ! 100: ! 101: extern struct systab sysitab [NMICALL]; ! 102: extern struct systab sys286tab [NMICALL]; ! 103: extern struct systab h28itab [H28CALL]; ! 104: extern struct systab cohcall; ! 105: ! 106: #endif /* ! defined (__KERNEL_SYSTAB_H__) */ ! 107:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.