nuclear@72: /* definitions that must be in-sync between kernel and user space */ nuclear@72: #ifndef KERNEL_DEFS_H_ nuclear@72: #define KERNEL_DEFS_H_ nuclear@72: nuclear@72: /* --- defines for sys/wait.h */ nuclear@72: #if defined(KERNEL) || defined(KDEF_WAIT_H) nuclear@72: #define WNOHANG 1 nuclear@72: nuclear@72: #define WEXITSTATUS(s) ((s) & _WSTATUS_MASK) nuclear@72: #define WCOREDUMP(s) ((s) & _WCORE_BIT) nuclear@72: nuclear@72: #define WIFEXITED(s) (_WREASON(s) == _WREASON_EXITED) nuclear@72: #define WIFSIGNALED(s) (_WREASON(s) == _WREASON_SIGNALED) nuclear@72: nuclear@72: /* implementation details */ nuclear@72: #define _WSTATUS_MASK 0xff nuclear@72: nuclear@72: #define _WREASON_SHIFT 8 nuclear@72: #define _WREASON_MASK 0xf00 nuclear@72: #define _WREASON(s) (((s) & _WREASON_MASK) >> _WREASON_SHIFT) nuclear@72: nuclear@72: #define _WREASON_EXITED 1 nuclear@72: #define _WREASON_SIGNALED 2 nuclear@72: nuclear@72: #define _WCORE_BIT 0x1000 nuclear@72: #endif /* sys/wait.h */ nuclear@72: nuclear@72: nuclear@72: nuclear@72: /* --- defines for errno.h */ nuclear@72: #if defined(KERNEL) || defined(KDEF_ERRNO_H) nuclear@72: #define EAGAIN 1 nuclear@72: #define EINVAL 2 nuclear@72: #define ECHILD 3 nuclear@90: nuclear@90: #define EBUG 255 /* not implemented yet */ nuclear@72: #endif /* errno.h */ nuclear@72: nuclear@72: nuclear@72: /* --- defines for syscall.h */ nuclear@72: #if defined(KERNEL) || defined(KDEF_SYSCALL_H) nuclear@72: nuclear@72: #define SYSCALL_INT 0x80 nuclear@72: nuclear@72: #define SYS_HELLO 0 nuclear@72: #define SYS_SLEEP 1 nuclear@72: #define SYS_FORK 2 nuclear@72: #define SYS_EXIT 3 nuclear@72: #define SYS_WAITPID 4 nuclear@72: #define SYS_GETPID 5 nuclear@72: #define SYS_GETPPID 6 nuclear@90: #define SYS_MOUNT 7 nuclear@90: #define SYS_UMOUNT 8 nuclear@90: #define SYS_OPEN 9 nuclear@90: #define SYS_CLOSE 10 nuclear@90: #define SYS_READ 11 nuclear@90: #define SYS_WRITE 12 nuclear@90: #define SYS_LSEEK 13 nuclear@72: nuclear@90: /* keep this one more than the last syscall */ nuclear@90: #define NUM_SYSCALLS 14 nuclear@72: nuclear@72: #endif /* syscall.h */ nuclear@72: nuclear@72: #endif /* KERNEL_DEFS_H_ */