syscall.h

00001 /*
00002  * Copyright (C) 2001,2002,2003,2004,2005 Philippe Gerum <rpm@xenomai.org>.
00003  *
00004  * RTAI/fusion is free software; you can redistribute it and/or modify
00005  * it under the terms of the GNU General Public License as published
00006  * by the Free Software Foundation; either version 2 of the License,
00007  * or (at your option) any later version.
00008  *
00009  * RTAI/fusion is distributed in the hope that it will be useful, but
00010  * WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with RTAI/fusion; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
00017  * 02111-1307, USA.
00018  */
00019 
00020 #ifndef _RTAI_ASM_GENERIC_SYSCALL_H
00021 #define _RTAI_ASM_GENERIC_SYSCALL_H
00022 
00023 /* RTAI/fusion multiplexer syscall. */
00024 #define __xn_sys_mux        555 /* Must fit within 15bit */
00025 /* RTAI/fusion nucleus syscalls. */
00026 #define __xn_sys_bind       0   /* muxid = bind_to_interface(magic,infp) */
00027 #define __xn_sys_completion 1   /* xnshadow_completion(&completion) */
00028 #define __xn_sys_migrate    2   /* switched = xnshadow_relax/harden() */
00029 #define __xn_sys_barrier    3   /* started = xnshadow_wait_barrier(&entry,&cookie) */
00030 
00031 #define XENOMAI_LINUX_DOMAIN  0
00032 #define XENOMAI_RTAI_DOMAIN   1
00033 
00034 typedef struct xnsysinfo {
00035 
00036     unsigned long long cpufreq; /* CPU frequency */
00037     unsigned long tickval;      /* Tick duration (ns) */
00038 
00039 } xnsysinfo_t;
00040 
00041 typedef struct xninquiry {
00042 
00043     char name[32];
00044     int prio;
00045     unsigned long status;
00046     void *khandle;
00047     void *uhandle;
00048 
00049 } xninquiry_t;
00050 
00051 #ifdef __KERNEL__
00052 
00053 #include <linux/types.h>
00054 
00055 struct task_struct;
00056 
00057 #define XENOMAI_MAX_SYSENT 255
00058 
00059 typedef struct _xnsysent {
00060 
00061     int (*svc)(struct task_struct *task,
00062                struct pt_regs *regs);
00063 
00064 /* Syscall must run into the Linux domain. */
00065 #define __xn_exec_lostage    0x1
00066 /* Syscall must run into the RTAI domain. */
00067 #define __xn_exec_histage    0x2
00068 /* Shadow syscall; caller must be mapped. */
00069 #define __xn_exec_shadow     0x4
00070 /* Switch back toggle; caller must return to its original mode. */
00071 #define __xn_exec_switchback 0x8
00072 /* Exec in current domain. */
00073 #define __xn_exec_current    0x10
00074 /* Exec in conforming domain, RTAI for fusion threads, Linux otherwise. */
00075 #define __xn_exec_conforming 0x20
00076 /* Context-agnostic syscall. */
00077 #define __xn_exec_any        0x0
00078 /* Short-hand for shadow init syscall. */
00079 #define __xn_exec_init       __xn_exec_lostage
00080 /* Short-hand for shadow syscall in RTAI space. */
00081 #define __xn_exec_primary   (__xn_exec_shadow|__xn_exec_histage)
00082 /* Short-hand for shadow syscall in Linux space. */
00083 #define __xn_exec_secondary (__xn_exec_shadow|__xn_exec_lostage)
00084 
00085     u_long flags;
00086 
00087 } xnsysent_t;
00088 
00089 extern int nkgkptd;
00090 
00091 #define xnshadow_ptd(t)    ((t)->ptd[nkgkptd])
00092 #define xnshadow_thread(t) ((xnthread_t *)xnshadow_ptd(t))
00093 
00094 #else /* !__KERNEL__ */
00095 
00096 #include <sys/types.h>
00097 
00098 #endif /* __KERNEL__ */
00099 
00100 typedef struct xncompletion {
00101 
00102     long syncflag;              /* Semaphore variable. */
00103     pid_t pid;                  /* Single waiter ID. */
00104 
00105 } xncompletion_t;
00106 
00107 #endif /* !_RTAI_ASM_GENERIC_SYSCALL_H */

Generated on Wed Jun 22 22:54:02 2005 for RTAI Fusion API by  doxygen 1.4.1