a bunch of old work on the ide3 driver. doesn't work right, but kind of there.
[newos.git] / include / newos / errors.h
blobca5c501caea26e360657432c55bdb9391569aca9
1 /*
2 ** Copyright 2001, Travis Geiselbrecht. All rights reserved.
3 ** Distributed under the terms of the NewOS License.
4 */
5 #ifndef _SYS_ERRORS_H
6 #define _SYS_ERRORS_H
8 #define NO_ERROR 0
10 /* General errors */
11 #define ERR_GENERAL (-1)
12 #define ERR_NO_MEMORY (ERR_GENERAL-1)
13 #define ERR_IO_ERROR (ERR_GENERAL-2)
14 #define ERR_INVALID_ARGS (ERR_GENERAL-3) // do not change, used in kernel/arch/i386/arch_interrupts.S
15 #define ERR_TIMED_OUT (ERR_GENERAL-4)
16 #define ERR_NOT_ALLOWED (ERR_GENERAL-5)
17 #define ERR_PERMISSION_DENIED (ERR_GENERAL-6)
18 #define ERR_INVALID_BINARY (ERR_GENERAL-7)
19 #define ERR_INVALID_HANDLE (ERR_GENERAL-8)
20 #define ERR_NO_MORE_HANDLES (ERR_GENERAL-9)
21 #define ERR_UNIMPLEMENTED (ERR_GENERAL-10)
22 #define ERR_TOO_BIG (ERR_GENERAL-11)
23 #define ERR_NOT_FOUND (ERR_GENERAL-12)
24 #define ERR_NOT_IMPLEMENTED (ERR_GENERAL-13)
25 #define ERR_OUT_OF_RANGE (ERR_GENERAL-14)
26 #define ERR_BAD_SYSCALL (ERR_GENERAL-15)
27 #define ERR_INTERRUPTED (ERR_GENERAL-16)
29 /* Semaphore errors */
30 #define ERR_SEM_GENERAL (-1024)
31 #define ERR_SEM_DELETED (ERR_SEM_GENERAL-1)
32 #define ERR_SEM_TIMED_OUT (ERR_SEM_GENERAL-2)
33 #define ERR_SEM_OUT_OF_SLOTS (ERR_SEM_GENERAL-3)
34 #define ERR_SEM_NOT_ACTIVE (ERR_SEM_GENERAL-4)
35 #define ERR_SEM_NOT_INTERRUPTABLE (ERR_SEM_GENERAL-5)
36 #define ERR_SEM_NOT_FOUND (ERR_SEM_GENERAL-6)
38 /* Tasker errors */
39 #define ERR_TASK_GENERAL (-2048)
40 #define ERR_TASK_PROC_DELETED (ERR_TASK_GENERAL-1)
41 #define ERR_TASK_THREAD_KILLED (ERR_TASK_GENERAL-2)
43 /* VFS errors */
44 #define ERR_VFS_GENERAL (-3072)
45 #define ERR_VFS_INVALID_FS (ERR_VFS_GENERAL-1)
46 #define ERR_VFS_NOT_MOUNTPOINT (ERR_VFS_GENERAL-2)
47 #define ERR_VFS_PATH_NOT_FOUND (ERR_VFS_GENERAL-3)
48 #define ERR_VFS_INSUFFICIENT_BUF (ERR_VFS_GENERAL-4)
49 #define ERR_VFS_READONLY_FS (ERR_VFS_GENERAL-5)
50 #define ERR_VFS_ALREADY_EXISTS (ERR_VFS_GENERAL-6)
51 #define ERR_VFS_FS_BUSY (ERR_VFS_GENERAL-7)
52 #define ERR_VFS_FD_TABLE_FULL (ERR_VFS_GENERAL-8)
53 #define ERR_VFS_CROSS_FS_RENAME (ERR_VFS_GENERAL-9)
54 #define ERR_VFS_DIR_NOT_EMPTY (ERR_VFS_GENERAL-10)
55 #define ERR_VFS_NOT_DIR (ERR_VFS_GENERAL-11)
56 #define ERR_VFS_WRONG_STREAM_TYPE (ERR_VFS_GENERAL-12)
57 #define ERR_VFS_ALREADY_MOUNTPOINT (ERR_VFS_GENERAL-13)
58 #define ERR_VFS_IS_DIR (ERR_VFS_GENERAL-14)
60 /* VM errors */
61 #define ERR_VM_GENERAL (-4096)
62 #define ERR_VM_INVALID_ASPACE (ERR_VM_GENERAL-1)
63 #define ERR_VM_INVALID_REGION (ERR_VM_GENERAL-2)
64 #define ERR_VM_BAD_ADDRESS (ERR_VM_GENERAL-3)
65 #define ERR_VM_PF_FATAL (ERR_VM_GENERAL-4)
66 #define ERR_VM_PF_BAD_ADDRESS (ERR_VM_GENERAL-5)
67 #define ERR_VM_PF_BAD_PERM (ERR_VM_GENERAL-6)
68 #define ERR_VM_PAGE_NOT_PRESENT (ERR_VM_GENERAL-7)
69 #define ERR_VM_NO_REGION_SLOT (ERR_VM_GENERAL-8)
70 #define ERR_VM_WOULD_OVERCOMMIT (ERR_VM_GENERAL-9)
71 #define ERR_VM_BAD_USER_MEMORY (ERR_VM_GENERAL-10)
73 /* Elf errors */
74 #define ERR_ELF_GENERAL (-5120)
75 #define ERR_ELF_RESOLVING_SYMBOL (ERR_ELF_GENERAL-1)
77 /* Ports errors */
78 #define ERR_PORT_GENERAL (-6144)
79 #define ERR_PORT_DELETED (ERR_PORT_GENERAL-1)
80 #define ERR_PORT_OUT_OF_SLOTS (ERR_PORT_GENERAL-2)
81 #define ERR_PORT_NOT_ACTIVE (ERR_PORT_GENERAL-3)
82 #define ERR_PORT_CLOSED (ERR_PORT_GENERAL-4)
83 #define ERR_PORT_TIMED_OUT (ERR_PORT_GENERAL-5)
84 #define ERR_PORT_NOT_FOUND (ERR_PORT_GENERAL-6)
86 /* Net errors */
87 #define ERR_NET_GENERAL (-7168)
88 #define ERR_NET_FAILED_ARP (ERR_NET_GENERAL-1)
89 #define ERR_NET_BAD_PACKET (ERR_NET_GENERAL-2)
90 #define ERR_NET_ARP_QUEUED (ERR_NET_GENERAL-3)
91 #define ERR_NET_NO_ROUTE (ERR_NET_GENERAL-4)
92 #define ERR_NET_SOCKET_ALREADY_BOUND (ERR_NET_GENERAL-5)
93 #define ERR_NET_ALREADY_CONNECTED (ERR_NET_GENERAL-6)
94 #define ERR_NET_CONNECTION_REFUSED (ERR_NET_GENERAL-7)
95 #define ERR_NET_NOT_CONNECTED (ERR_NET_GENERAL-8)
96 #define ERR_NET_REMOTE_CLOSE (ERR_NET_GENERAL-9)
97 #define ERR_NET_NOT_LISTENING (ERR_NET_GENERAL-10)
98 #define ERR_NET_BAD_ADDRESS (ERR_NET_GENERAL-11)
100 /* Pipe errors */
101 #define ERR_PIPE_GENERAL (-8192)
102 #define ERR_PIPE_WIDOW (ERR_PIPE_GENERAL-1)
104 /* Device errors */
105 #define ERR_DEV_GENERAL (-9216)
106 #define ERR_DEV_TIMED_OUT (ERR_DEV_GENERAL-1)
107 #define ERR_DEV_HARDWARE_ERROR (ERR_DEV_GENERAL-2)
108 #define ERR_DEV_BUSY (ERR_DEV_GENERAL-3)
110 #endif