kern
annotate include/kdef.h @ 77:a6513dc35f04
- started writing disk/ata code
- made the debug script rip the commandline arguments out of the run script so I won't have to keep them in sync
- added 64bit sized types in klibc/intypes.h
- temporarily commented out the processes init from main
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Tue, 06 Dec 2011 11:56:08 +0200 |
parents | |
children | 7ff2b4971216 |
rev | line source |
---|---|
nuclear@72 | 1 /* definitions that must be in-sync between kernel and user space */ |
nuclear@72 | 2 #ifndef KERNEL_DEFS_H_ |
nuclear@72 | 3 #define KERNEL_DEFS_H_ |
nuclear@72 | 4 |
nuclear@72 | 5 /* --- defines for sys/wait.h */ |
nuclear@72 | 6 #if defined(KERNEL) || defined(KDEF_WAIT_H) |
nuclear@72 | 7 #define WNOHANG 1 |
nuclear@72 | 8 |
nuclear@72 | 9 #define WEXITSTATUS(s) ((s) & _WSTATUS_MASK) |
nuclear@72 | 10 #define WCOREDUMP(s) ((s) & _WCORE_BIT) |
nuclear@72 | 11 |
nuclear@72 | 12 #define WIFEXITED(s) (_WREASON(s) == _WREASON_EXITED) |
nuclear@72 | 13 #define WIFSIGNALED(s) (_WREASON(s) == _WREASON_SIGNALED) |
nuclear@72 | 14 |
nuclear@72 | 15 /* implementation details */ |
nuclear@72 | 16 #define _WSTATUS_MASK 0xff |
nuclear@72 | 17 |
nuclear@72 | 18 #define _WREASON_SHIFT 8 |
nuclear@72 | 19 #define _WREASON_MASK 0xf00 |
nuclear@72 | 20 #define _WREASON(s) (((s) & _WREASON_MASK) >> _WREASON_SHIFT) |
nuclear@72 | 21 |
nuclear@72 | 22 #define _WREASON_EXITED 1 |
nuclear@72 | 23 #define _WREASON_SIGNALED 2 |
nuclear@72 | 24 |
nuclear@72 | 25 #define _WCORE_BIT 0x1000 |
nuclear@72 | 26 #endif /* sys/wait.h */ |
nuclear@72 | 27 |
nuclear@72 | 28 |
nuclear@72 | 29 |
nuclear@72 | 30 /* --- defines for errno.h */ |
nuclear@72 | 31 #if defined(KERNEL) || defined(KDEF_ERRNO_H) |
nuclear@72 | 32 #define EAGAIN 1 |
nuclear@72 | 33 #define EINVAL 2 |
nuclear@72 | 34 #define ECHILD 3 |
nuclear@72 | 35 #endif /* errno.h */ |
nuclear@72 | 36 |
nuclear@72 | 37 |
nuclear@72 | 38 /* --- defines for syscall.h */ |
nuclear@72 | 39 #if defined(KERNEL) || defined(KDEF_SYSCALL_H) |
nuclear@72 | 40 |
nuclear@72 | 41 #define SYSCALL_INT 0x80 |
nuclear@72 | 42 |
nuclear@72 | 43 #define SYS_HELLO 0 |
nuclear@72 | 44 #define SYS_SLEEP 1 |
nuclear@72 | 45 #define SYS_FORK 2 |
nuclear@72 | 46 #define SYS_EXIT 3 |
nuclear@72 | 47 #define SYS_WAITPID 4 |
nuclear@72 | 48 #define SYS_GETPID 5 |
nuclear@72 | 49 #define SYS_GETPPID 6 |
nuclear@72 | 50 |
nuclear@72 | 51 #define NUM_SYSCALLS 7 |
nuclear@72 | 52 |
nuclear@72 | 53 #endif /* syscall.h */ |
nuclear@72 | 54 |
nuclear@72 | 55 #endif /* KERNEL_DEFS_H_ */ |