kern

view include/kdef.h @ 94:b3351d018ac6

read/write superblock, get/put inode
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 11 Dec 2011 11:12:30 +0200
parents 083849df660b
children 07fe6a614185
line source
1 /* definitions that must be in-sync between kernel and user space */
2 #ifndef KERNEL_DEFS_H_
3 #define KERNEL_DEFS_H_
5 /* --- defines for sys/wait.h */
6 #if defined(KERNEL) || defined(KDEF_WAIT_H)
7 #define WNOHANG 1
9 #define WEXITSTATUS(s) ((s) & _WSTATUS_MASK)
10 #define WCOREDUMP(s) ((s) & _WCORE_BIT)
12 #define WIFEXITED(s) (_WREASON(s) == _WREASON_EXITED)
13 #define WIFSIGNALED(s) (_WREASON(s) == _WREASON_SIGNALED)
15 /* implementation details */
16 #define _WSTATUS_MASK 0xff
18 #define _WREASON_SHIFT 8
19 #define _WREASON_MASK 0xf00
20 #define _WREASON(s) (((s) & _WREASON_MASK) >> _WREASON_SHIFT)
22 #define _WREASON_EXITED 1
23 #define _WREASON_SIGNALED 2
25 #define _WCORE_BIT 0x1000
26 #endif /* sys/wait.h */
30 /* --- defines for errno.h */
31 #if defined(KERNEL) || defined(KDEF_ERRNO_H)
32 #define EFOO 1 /* I just like to return -1 some times :) */
34 #define EAGAIN 2
35 #define EINVAL 3
36 #define ECHILD 4
37 #define EBUSY 5
38 #define ENOMEM 6
39 #define EIO 7
40 #define ENOENT 8
42 #define EBUG 127 /* for missing features and known bugs */
43 #endif /* errno.h */
46 /* --- defines for syscall.h */
47 #if defined(KERNEL) || defined(KDEF_SYSCALL_H)
49 #define SYSCALL_INT 0x80
51 #define SYS_HELLO 0
52 #define SYS_SLEEP 1
53 #define SYS_FORK 2
54 #define SYS_EXIT 3
55 #define SYS_WAITPID 4
56 #define SYS_GETPID 5
57 #define SYS_GETPPID 6
58 #define SYS_MOUNT 7
59 #define SYS_UMOUNT 8
60 #define SYS_OPEN 9
61 #define SYS_CLOSE 10
62 #define SYS_READ 11
63 #define SYS_WRITE 12
64 #define SYS_LSEEK 13
66 /* keep this one more than the last syscall */
67 #define NUM_SYSCALLS 14
69 #endif /* syscall.h */
71 #endif /* KERNEL_DEFS_H_ */