From 8a9208612eec8ddae4c418485d848ecfa0613699 Mon Sep 17 00:00:00 2001 From: Anton Kling Date: Mon, 30 Oct 2023 22:12:14 +0100 Subject: Meta: Move kernel and userland to their own folders. This is to allow both the kernel and the userland to share certain header files and to make the folder structure a bit more clear. --- libc/include/assert.h | 19 ------------ libc/include/errno.h | 85 --------------------------------------------------- libc/include/limits.h | 1 - libc/include/stdio.h | 9 ------ libc/include/stdlib.h | 0 libc/include/string.h | 19 ------------ libc/include/time.h | 6 ---- libc/include/types.h | 27 ---------------- 8 files changed, 166 deletions(-) delete mode 100644 libc/include/assert.h delete mode 100644 libc/include/errno.h delete mode 100644 libc/include/limits.h delete mode 100644 libc/include/stdio.h delete mode 100644 libc/include/stdlib.h delete mode 100644 libc/include/string.h delete mode 100644 libc/include/time.h delete mode 100644 libc/include/types.h (limited to 'libc/include') diff --git a/libc/include/assert.h b/libc/include/assert.h deleted file mode 100644 index 90a0be4..0000000 --- a/libc/include/assert.h +++ /dev/null @@ -1,19 +0,0 @@ -#include -#include - -#define assert(expr) \ - { \ - if (!(expr)) \ - aFailed(__FILE__, __LINE__); \ - } - -#define ASSERT_BUT_FIXME_PROPOGATE(expr) \ - { \ - if (!(expr)) \ - kprintf("Performing assert that should have been a propogated error."); \ - assert(expr); \ - } - -void aFailed(char *f, int l); -#define ASSERT_NOT_REACHED \ - { assert(0) } diff --git a/libc/include/errno.h b/libc/include/errno.h deleted file mode 100644 index 1ad1004..0000000 --- a/libc/include/errno.h +++ /dev/null @@ -1,85 +0,0 @@ -#ifndef ERRNO_H -#define ERRNO_H -// https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/errno.h.html -#define E2BIG 1 // Argument list too long. -#define EACCES 2 // Permission denied. -#define EADDRINUSE 3 // Address in use. -#define EADDRNOTAVAIL 4 // Address not available. -#define EAFNOSUPPORT 5 // Address family not supported. -#define EAGAIN 6 // Resource unavailable, try again. -#define EALREADY 7 // Connection already in progress. -#define EBADF 8 // Bad file descriptor. -#define EBADMSG 9 // Bad message. -#define EBUSY 10 // Device or resource busy. -#define ECANCELED 11 // Operation canceled. -#define ECHILD 12 // No child processes. -#define ECONNABORTED 13 // Connection aborted. -#define ECONNREFUSED 14 // Connection refused. -#define ECONNRESET 15 // Connection reset. -#define EDEADLK 16 // Resource deadlock would occur. -#define EDESTADDRREQ 17 // Destination address required. -#define EDOM 18 // Mathematics argument out of domain of function. -#define EDQUOT 19 // Reserved. -#define EEXIST 20 // File exists. -#define EFAULT 21 // Bad address. -#define EFBIG 22 // File too large. -#define EHOSTUNREACH 23 // Host is unreachable. -#define EIDRM 24 // Identifier removed. -#define EILSEQ 25 // Illegal byte sequence. -#define EINPROGRESS 26 // Operation in progress. -#define EINTR 27 // Interrupted function. -#define EINVAL 28 // Invalid argument. -#define EIO 29 // I/O error. -#define EISCONN 30 // Socket is connected. -#define EISDIR 31 // Is a directory. -#define ELOOP 32 // Too many levels of symbolic links. -#define EMFILE 33 // File descriptor value too large. -#define EMLINK 34 // Too many links. -#define EMSGSIZE 35 // Message too large. -#define EMULTIHOP 36 // Reserved. -#define ENAMETOOLONG 37 // Filename too long. -#define ENETDOWN 38 // Network is down. -#define ENETRESET 39 // Connection aborted by network. -#define ENETUNREACH 40 // Network unreachable. -#define ENFILE 41 // Too many files open in system. -#define ENOBUFS 42 // No buffer space available. -#define ENODATA 43 // No message is available on the STREAM head read queue. -#define ENODEV 44 // No such device. -#define ENOENT 45 // No such file or directory. -#define ENOEXEC 46 // Executable file format error. -#define ENOLCK 47 // No locks available. -#define ENOLINK 48 // Reserved. -#define ENOMEM 49 // Not enough space. -#define ENOMSG 50 // No message of the desired type. -#define ENOPROTOOPT 51 // Protocol not available. -#define ENOSPC 52 // No space left on device. -#define ENOSR 53 // No STREAM resources. -#define ENOSTR 54 // Not a STREAM. -#define ENOSYS 55 // Functionality not supported. -#define ENOTCONN 56 // The socket is not connected. -#define ENOTDIR 57 // Not a directory or a symbolic link to a directory. -#define ENOTEMPTY 58 // Directory not empty. -#define ENOTRECOVERABLE 59 // State not recoverable. -#define ENOTSOCK 60 // Not a socket. -#define ENOTSUP 61 // Not supported (may be the same value as. -#define ENOTTY 62 // Inappropriate I/O control operation. -#define ENXIO 63 // No such device or address. -#define EOPNOTSUPP ENOTSUP // Operation not supported on socket. -#define EOVERFLOW 65 // Value too large to be stored in data type. -#define EOWNERDEAD 66 // Previous owner died. -#define EPERM 67 // Operation not permitted. -#define EPIPE 68 // Broken pipe. -#define EPROTO 69 // Protocol error. -#define EPROTONOSUPPORT 70 // Protocol not supported. -#define EPROTOTYPE 71 // Protocol wrong type for socket. -#define ERANGE 72 // Result too large. -#define EROFS 73 // Read-only file system. -#define ESPIPE 74 // Invalid seek. -#define ESRCH 75 // No such process. -#define ESTALE 76 // Reserved. -#define ETIME 77 // Stream ioctl() timeout. -#define ETIMEDOUT 78 // Connection timed out. -#define ETXTBSY 79 // Text file busy. -#define EWOULDBLOCK EAGAIN // Operation would block. -#define EXDEV 81 // Cross-device link. -#endif diff --git a/libc/include/limits.h b/libc/include/limits.h deleted file mode 100644 index 05022ec..0000000 --- a/libc/include/limits.h +++ /dev/null @@ -1 +0,0 @@ -#define PATH_MAX 256 diff --git a/libc/include/stdio.h b/libc/include/stdio.h deleted file mode 100644 index f2bbb32..0000000 --- a/libc/include/stdio.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef STDIO_H -#define STDIO_H - -void putc(const char c); -int puts(char *str); -void delete_characther(void); -int kprintf(const char *format, ...); - -#endif diff --git a/libc/include/stdlib.h b/libc/include/stdlib.h deleted file mode 100644 index e69de29..0000000 diff --git a/libc/include/string.h b/libc/include/string.h deleted file mode 100644 index 7cee4b2..0000000 --- a/libc/include/string.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef STRING_H -#define STRING_H -#include -#include - -unsigned long strlen(const char *s); -void *memcpy(void *dest, const void *src, uint32_t n); -void *memset(void *dst, const unsigned char c, uint32_t n); -int memcmp(const void *s1, const void *s2, uint32_t n); -char *strcpy(char *d, const char *s); -int strcmp(const char *s1, const char *s2); -int isequal(const char *s1, const char *s2); -int isequal_n(const char *s1, const char *s2, uint32_t n); -char *copy_and_allocate_string(const char *s); -char *copy_and_allocate_user_string(const char *s); -char *strncpy(char *dest, const char *src, size_t n); -size_t strlcpy(char *dst, const char *src, size_t dsize); -char *strcat(char *s1, const char *s2); -#endif diff --git a/libc/include/time.h b/libc/include/time.h deleted file mode 100644 index 4e356d1..0000000 --- a/libc/include/time.h +++ /dev/null @@ -1,6 +0,0 @@ -#include - -struct timespec { - time_t tv_sec; // Seconds. - long tv_nsec; // Nanoseconds. -}; diff --git a/libc/include/types.h b/libc/include/types.h deleted file mode 100644 index ffcf281..0000000 --- a/libc/include/types.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef TYPES_H -#define TYPES_H -typedef unsigned int ino_t; - -typedef int mode_t; - -typedef int nlink_t; -typedef int uid_t; -typedef int gid_t; -typedef int id_t; - -typedef int blkcnt_t; -typedef int off_t; - -typedef int dev_t; -typedef unsigned int fsblkcnt_t; -typedef unsigned int fsfilcnt_t; -typedef unsigned int ino_t; -//typedef unsigned int size_t; - -typedef int blksize_t; -typedef int pid_t; -typedef int ssize_t; - -//typedef int clock_t; -typedef int time_t; -#endif -- cgit v1.2.3