Browse Source

Reorganize headers

K. Lange 2 years ago
parent
commit
1355502e6c
100 changed files with 200 additions and 217 deletions
  1. 16 16
      Makefile
  2. 3 3
      apps/background.c
  3. 1 1
      apps/bim.c
  4. 10 10
      apps/compositor.c
  5. 4 4
      apps/drawlines.c
  6. 1 1
      apps/font-server.c
  7. 1 1
      apps/ls.c
  8. 2 2
      apps/migrate.c
  9. 1 1
      apps/ps.c
  10. 2 2
      apps/pstree.c
  11. 3 3
      apps/sh.c
  12. 2 2
      apps/sysinfo.c
  13. 4 4
      apps/terminal-vga.c
  14. 9 11
      apps/terminal.c
  15. 1 1
      apps/yutani-query.c
  16. 3 3
      apps/yutani-test.c
  17. 5 5
      apps/yutani_int.h
  18. 0 0
      base/usr/include/kernel/args.h
  19. 0 0
      base/usr/include/kernel/ata.h
  20. 1 1
      kernel/include/bitset.h
  21. 2 2
      kernel/include/boot.h
  22. 1 1
      kernel/include/elf.h
  23. 2 2
      kernel/include/ext2.h
  24. 0 0
      base/usr/include/kernel/fs.h
  25. 3 3
      lib/hashmap.h
  26. 1 1
      kernel/include/ipv4.h
  27. 0 0
      base/usr/include/kernel/libc.h
  28. 1 1
      kernel/include/list.h
  29. 0 0
      base/usr/include/kernel/logging.h
  30. 1 1
      kernel/include/mem.h
  31. 0 0
      base/usr/include/kernel/mod/net.h
  32. 0 0
      base/usr/include/kernel/mod/rtl.h
  33. 1 1
      kernel/include/mod/shell.h
  34. 3 3
      kernel/include/mod/snd.h
  35. 1 1
      kernel/include/mod/sound.h
  36. 1 1
      kernel/include/mod/tmpfs.h
  37. 2 2
      kernel/include/module.h
  38. 0 0
      base/usr/include/kernel/mouse.h
  39. 1 1
      kernel/include/multiboot.h
  40. 0 0
      base/usr/include/kernel/pci.h
  41. 1 1
      kernel/include/pipe.h
  42. 1 1
      kernel/include/printf.h
  43. 3 4
      kernel/include/process.h
  44. 0 0
      base/usr/include/kernel/ringbuffer.h
  45. 2 2
      kernel/include/shm.h
  46. 2 2
      kernel/include/signal.h
  47. 8 8
      kernel/include/system.h
  48. 1 1
      kernel/include/task.h
  49. 0 0
      base/usr/include/kernel/tokenize.h
  50. 1 1
      kernel/include/tree.h
  51. 0 0
      base/usr/include/kernel/tss.h
  52. 1 1
      kernel/include/types.h
  53. 1 1
      kernel/include/ubsan.h
  54. 0 0
      base/usr/include/kernel/va_list.h
  55. 0 0
      base/usr/include/kernel/version.h
  56. 0 0
      base/usr/include/kernel/video.h
  57. 1 1
      base/usr/include/sys/termios.h
  58. 2 2
      lib/decorations.h
  59. 1 1
      lib/drawstring.h
  60. 0 0
      base/usr/include/toaru/graphics.h
  61. 3 2
      kernel/include/hashmap.h
  62. 0 0
      base/usr/include/toaru/kbd.h
  63. 1 1
      lib/list.h
  64. 0 0
      base/usr/include/toaru/mouse.h
  65. 0 0
      base/usr/include/toaru/pex.h
  66. 0 0
      base/usr/include/toaru/pthread.h
  67. 0 0
      base/usr/include/toaru/rline.h
  68. 0 0
      base/usr/include/toaru/spinlock.h
  69. 2 2
      lib/termemu.h
  70. 0 0
      base/usr/include/toaru/trace.h
  71. 1 1
      lib/tree.h
  72. 0 0
      base/usr/include/toaru/utf8decode.h
  73. 5 5
      lib/yutani.h
  74. 0 10
      base/usr/include/video.h
  75. 4 5
      decors/decor-fancy.c
  76. 0 1
      include
  77. 3 3
      kernel/cpu/gdt.c
  78. 2 2
      kernel/cpu/idt.c
  79. 4 4
      kernel/cpu/irq.c
  80. 4 4
      kernel/cpu/isr.c
  81. 1 1
      kernel/devices/cmos.c
  82. 2 2
      kernel/devices/fpu.c
  83. 4 3
      kernel/devices/pci.c
  84. 0 0
      kernel/devices/pci_list.h
  85. 3 3
      kernel/devices/timer.c
  86. 1 1
      kernel/ds/bitset.c
  87. 2 2
      kernel/ds/hashmap.c
  88. 3 3
      kernel/ds/list.c
  89. 3 3
      kernel/ds/ringbuffer.c
  90. 3 3
      kernel/ds/tree.c
  91. 5 5
      kernel/fs/pipe.c
  92. 6 6
      kernel/fs/ramdisk.c
  93. 9 9
      kernel/fs/tty.c
  94. 8 8
      kernel/fs/unixpipe.c
  95. 7 7
      kernel/fs/vfs.c
  96. 0 1
      kernel/include/errno_defs.h
  97. 0 1
      kernel/include/ioctl.h
  98. 0 1
      kernel/include/signal_defs.h
  99. 0 1
      kernel/include/syscall_nums.h
  100. 0 0
      kernel/include/termemu.h

+ 16 - 16
Makefile

@@ -50,10 +50,10 @@ cdrom/mod:
 
 MODULES = $(patsubst modules/%.c,cdrom/mod/%.ko,$(wildcard modules/*.c))
 
-HEADERS = $(shell find kernel/include/ -type f -name '*.h')
+HEADERS = $(shell find base/usr/include/kernel -type f -name '*.h')
 
 cdrom/mod/%.ko: modules/%.c ${HEADERS} | cdrom/mod
-	${KCC} -T modules/link.ld -I./kernel/include -nostdlib ${KCFLAGS} -c -o $@ $<
+	${KCC} -T modules/link.ld -nostdlib ${KCFLAGS} -c -o $@ $<
 
 modules: ${MODULES}
 
@@ -61,7 +61,7 @@ kernel/%.o: kernel/%.S
 	${KAS} ${ASFLAGS} $< -o $@
 
 kernel/%.o: kernel/%.c ${HEADERS}
-	${KCC} ${KCFLAGS} -nostdlib -g -I./kernel/include -c -o $@ $<
+	${KCC} ${KCFLAGS} -nostdlib -g -c -o $@ $<
 
 # Root Filesystem
 
@@ -102,48 +102,48 @@ base/lib/ld.so: linker/linker.c base/lib/libc.a | dirs
 
 # Shared Libraries
 
-base/lib/libtoaru_graphics.so: lib/graphics.c lib/graphics.h
+base/lib/libtoaru_graphics.so: lib/graphics.c base/usr/include/toaru/graphics.h
 	$(CC) -o $@ $(CFLAGS) -shared -fPIC $<
 
-base/lib/libtoaru_list.so: lib/list.c lib/list.h
+base/lib/libtoaru_list.so: lib/list.c base/usr/include/toaru/list.h
 	$(CC) -o $@ $(CFLAGS) -shared -fPIC $<
 
-base/lib/libtoaru_tree.so: lib/tree.c lib/tree.h base/lib/libtoaru_list.so
+base/lib/libtoaru_tree.so: lib/tree.c base/usr/include/toaru/tree.h base/lib/libtoaru_list.so
 	$(CC) -o $@ $(CFLAGS) -shared -fPIC $< -ltoaru_list
 
-base/lib/libtoaru_hashmap.so: lib/hashmap.c lib/hashmap.h base/lib/libtoaru_list.so
+base/lib/libtoaru_hashmap.so: lib/hashmap.c base/usr/include/toaru/hashmap.h base/lib/libtoaru_list.so
 	$(CC) -o $@ $(CFLAGS) -shared -fPIC $< -ltoaru_list
 
-base/lib/libtoaru_kbd.so: lib/kbd.c lib/kbd.h
+base/lib/libtoaru_kbd.so: lib/kbd.c base/usr/include/toaru/kbd.h
 	$(CC) -o $@ $(CFLAGS) -shared -fPIC $<
 
-base/lib/libtoaru_pthread.so: lib/pthread.c lib/pthread.h
+base/lib/libtoaru_pthread.so: lib/pthread.c base/usr/include/toaru/pthread.h
 	$(CC) -o $@ $(CFLAGS) -shared -fPIC $<
 
-base/lib/libtoaru_pex.so: lib/pex.c lib/pex.h
+base/lib/libtoaru_pex.so: lib/pex.c base/usr/include/toaru/pex.h
 	$(CC) -o $@ $(CFLAGS) -shared -fPIC $<
 
 base/lib/libtoaru_dlfcn.so: lib/dlfcn.c
 	$(CC) -o $@ $(CFLAGS) -shared -fPIC $<
 
-base/lib/libtoaru_yutani.so: lib/yutani.c lib/yutani.h base/lib/libtoaru_graphics.so
+base/lib/libtoaru_yutani.so: lib/yutani.c base/usr/include/toaru/yutani.h base/lib/libtoaru_graphics.so
 	$(CC) -o $@ $(CFLAGS) -shared -fPIC $< -ltoaru_graphics
 
-base/lib/libtoaru_rline.so: lib/rline.c lib/rline.h base/lib/libtoaru_kbd.so
+base/lib/libtoaru_rline.so: lib/rline.c base/usr/include/toaru/rline.h base/lib/libtoaru_kbd.so
 	$(CC) -o $@ $(CFLAGS) -shared -fPIC $< -ltoaru_kbd
 
-base/lib/libtoaru_termemu.so: lib/termemu.c lib/termemu.h base/lib/libtoaru_graphics.so
+base/lib/libtoaru_termemu.so: lib/termemu.c base/usr/include/toaru/termemu.h base/lib/libtoaru_graphics.so
 	$(CC) -o $@ $(CFLAGS) -shared -fPIC $< -ltoaru_graphics
 
-base/lib/libtoaru_drawstring.so: lib/drawstring.c lib/drawstring.h base/lib/libtoaru_graphics.so
+base/lib/libtoaru_drawstring.so: lib/drawstring.c base/usr/include/toaru/drawstring.h base/lib/libtoaru_graphics.so
 	$(CC) -o $@ $(CFLAGS) -shared -fPIC $< -ltoaru_graphics
 
-base/lib/libtoaru_decorations.so: lib/decorations.c lib/decorations.h base/lib/libtoaru_graphics.so
+base/lib/libtoaru_decorations.so: lib/decorations.c base/usr/include/toaru/decorations.h base/lib/libtoaru_graphics.so
 	$(CC) -o $@ $(CFLAGS) -shared -fPIC $< -ltoaru_graphics
 
 # Decoration Themes
 
-base/lib/libtoaru-decor-fancy.so: decors/decor-fancy.c lib/decorations.h base/lib/libtoaru_graphics.so base/lib/libtoaru_decorations.so base/lib/libtoaru_drawstring.so
+base/lib/libtoaru-decor-fancy.so: decors/decor-fancy.c base/usr/include/toaru/decorations.h base/lib/libtoaru_graphics.so base/lib/libtoaru_decorations.so base/lib/libtoaru_drawstring.so
 	$(CC) -o $@ $(CFLAGS) -shared -fPIC $< -ltoaru_decorations -ltoaru_drawstring -ltoaru_graphics
 
 # Init

+ 3 - 3
apps/background.c

@@ -2,9 +2,9 @@
 #include <unistd.h>
 #include <sys/utsname.h>
 
-#include "lib/yutani.h"
-#include "lib/graphics.h"
-#include "lib/drawstring.h"
+#include <toaru/yutani.h>
+#include <toaru/graphics.h>
+#include <toaru/drawstring.h>
 
 #define PANEL_HEIGHT 24
 

+ 1 - 1
apps/bim.c

@@ -31,7 +31,7 @@
 
 #include <wchar.h>
 
-#include "lib/utf8decode.h"
+#include <toaru/utf8decode.h>
 
 #define BLOCK_SIZE 256
 #define ENTER_KEY     '\n'

+ 10 - 10
apps/compositor.c

@@ -30,19 +30,19 @@
 #include <sys/stat.h>
 #include <sys/time.h>
 
-#include "lib/graphics.h"
-#include "lib/pthread.h"
-#include "lib/mouse.h"
-#include "lib/kbd.h"
-#include "lib/pex.h"
-#include "lib/yutani.h"
-#include "lib/hashmap.h"
-#include "lib/list.h"
-#include "lib/spinlock.h"
+#include <toaru/graphics.h>
+#include <toaru/pthread.h>
+#include <toaru/mouse.h>
+#include <toaru/kbd.h>
+#include <toaru/pex.h>
+#include <toaru/yutani.h>
+#include <toaru/hashmap.h>
+#include <toaru/list.h>
+#include <toaru/spinlock.h>
 
 #define _DEBUG_YUTANI
 #ifdef _DEBUG_YUTANI
-#include "lib/trace.h"
+#include <toaru/trace.h>
 #define TRACE_APP_NAME "yutani"
 #else
 #define TRACE(msg,...)

+ 4 - 4
apps/drawlines.c

@@ -12,12 +12,12 @@
 #include <syscall.h>
 #include <unistd.h>
 
-#include "lib/yutani.h"
-#include "lib/graphics.h"
-#include "lib/pthread.h"
+#include <toaru/yutani.h>
+#include <toaru/graphics.h>
+#include <toaru/pthread.h>
 
 #define TRACE_APP_NAME "drawlines"
-#include "lib/trace.h"
+#include <toaru/trace.h>
 
 static int left, top, width, height;
 

+ 1 - 1
apps/font-server.c

@@ -4,7 +4,7 @@
 #include <unistd.h>
 #include <syscall.h>
 
-#include "lib/trace.h"
+#include <toaru/trace.h>
 #define TRACE_APP_NAME "font-server"
 
 #define FONT_PATH "/usr/share/fonts/"

+ 1 - 1
apps/ls.c

@@ -30,7 +30,7 @@
 //#include "lib/trace.h"
 #define TRACE(...)
 
-#include "lib/list.h"
+#include <toaru/list.h>
 
 #define MIN_COL_SPACING 2
 

+ 2 - 2
apps/migrate.c

@@ -8,8 +8,8 @@
 #include <sys/stat.h>
 #include <sys/ioctl.h>
 
-#include "lib/trace.h"
-#include "lib/hashmap.h"
+#include <toaru/trace.h>
+#include <toaru/hashmap.h>
 #define TRACE_APP_NAME "migrate"
 
 #define CHUNK_SIZE 4096

+ 1 - 1
apps/ps.c

@@ -20,7 +20,7 @@
 #include <dirent.h>
 #include <pwd.h>
 
-#include "lib/list.h"
+#include <toaru/list.h>
 
 #define LINE_LEN 4096
 

+ 2 - 2
apps/pstree.c

@@ -19,8 +19,8 @@
 #include <unistd.h>
 #include <dirent.h>
 
-#include "lib/list.h"
-#include "lib/tree.h"
+#include <toaru/list.h>
+#include <toaru/tree.h>
 
 typedef struct process {
 	int pid;

+ 3 - 3
apps/sh.c

@@ -33,9 +33,9 @@
 
 #include <_xlog.h>
 
-#include "lib/list.h"
-#include "lib/kbd.h"
-#include "lib/rline.h"
+#include <toaru/list.h>
+#include <toaru/kbd.h>
+#include <toaru/rline.h>
 
 #define PIPE_TOKEN "\xFF\xFFPIPE\xFF\xFF"
 #define STAR_TOKEN "\xFF\xFFSTAR\xFF\xFF"

+ 2 - 2
apps/sysinfo.c

@@ -12,8 +12,8 @@
 #include <unistd.h>
 #include <sys/utsname.h>
 
-#include "lib/graphics.h"
-#include "lib/termemu.h"
+#include <toaru/graphics.h>
+#include <toaru/termemu.h>
 
 #include "toaru_logo.h"
 

+ 4 - 4
apps/terminal-vga.c

@@ -24,10 +24,10 @@
 
 #include <wchar.h>
 
-#include "lib/utf8decode.h"
-#include "lib/kbd.h"
-#include "lib/graphics.h"
-#include "lib/termemu.h"
+#include <toaru/utf8decode.h>
+#include <toaru/kbd.h>
+#include <toaru/graphics.h>
+#include <toaru/termemu.h>
 
 #include "vga-palette.h"
 

+ 9 - 11
apps/terminal.c

@@ -34,17 +34,15 @@
 #include <wchar.h>
 
 #define TRACE_APP_NAME "terminal"
-#include "lib/trace.h"
-
-#include "lib/utf8decode.h"
-
-#include "lib/yutani.h"
-#include "lib/decorations.h"
-#include "lib/graphics.h"
-#include "lib/kbd.h"
-#include "lib/termemu.h"
-#include "lib/spinlock.h"
-#include "lib/list.h"
+#include <toaru/trace.h>
+#include <toaru/utf8decode.h>
+#include <toaru/yutani.h>
+#include <toaru/decorations.h>
+#include <toaru/graphics.h>
+#include <toaru/kbd.h>
+#include <toaru/termemu.h>
+#include <toaru/spinlock.h>
+#include <toaru/list.h>
 
 #include "terminal-palette.h"
 #include "terminal-font.h"

+ 1 - 1
apps/yutani-query.c

@@ -1,7 +1,7 @@
 #include <stdio.h>
 #include <getopt.h>
 
-#include "lib/yutani.h"
+#include <toaru/yutani.h>
 
 yutani_t * yctx;
 

+ 3 - 3
apps/yutani-test.c

@@ -13,9 +13,9 @@
 #include <syscall.h>
 #include <unistd.h>
 
-#include "lib/yutani.h"
-#include "lib/graphics.h"
-#include "lib/pthread.h"
+#include <toaru/yutani.h>
+#include <toaru/graphics.h>
+#include <toaru/pthread.h>
 
 static int left, top, width, height;
 

+ 5 - 5
apps/yutani_int.h

@@ -1,10 +1,10 @@
 #pragma once
 
-#include "lib/yutani.h"
-#include "lib/list.h"
-#include "lib/hashmap.h"
-#include "lib/graphics.h"
-#include "lib/kbd.h"
+#include <toaru/yutani.h>
+#include <toaru/list.h>
+#include <toaru/hashmap.h>
+#include <toaru/graphics.h>
+#include <toaru/kbd.h>
 
 #define MOUSE_SCALE 3
 #define MOUSE_OFFSET_X 26

kernel/include/args.h → base/usr/include/kernel/args.h


kernel/include/ata.h → base/usr/include/kernel/ata.h


+ 1 - 1
kernel/include/bitset.h

@@ -2,7 +2,7 @@
  */
 #pragma once
 
-#include <system.h>
+#include <kernel/system.h>
 
 typedef struct {
 	unsigned char *data;

+ 2 - 2
kernel/include/boot.h

@@ -8,7 +8,7 @@
  * information from that bootloader.
  *
  */
-#include <system.h>
+#include <kernel/system.h>
 
 /*
  * Multiboot
@@ -16,5 +16,5 @@
  * Also supported natively by QEMU and a few
  * other emulators.
  */
-#include <multiboot.h>
+#include <kernel/multiboot.h>
 

+ 1 - 1
kernel/include/elf.h

@@ -11,7 +11,7 @@
  * require different header files for definitions
  */
 #ifdef _KERNEL_
-#	include <types.h>
+#	include <kernel/types.h>
 #else
 #	include <stdint.h>
 #endif

+ 2 - 2
kernel/include/ext2.h

@@ -3,10 +3,10 @@
 #pragma once
 
 #ifdef _KERNEL_
-#	include <types.h>
+#	include <kernel/types.h>
 #else
 #	ifdef BOOTLOADER
-#		include <types.h>
+#		include <kernel/types.h>
 #	else
 #		include <stdint.h>
 #	endif

kernel/include/fs.h → base/usr/include/kernel/fs.h


+ 3 - 3
lib/hashmap.h

@@ -1,10 +1,10 @@
 #pragma once
 
-#include "list.h"
-
 #ifdef _KERNEL_
-#	include <system.h>
+#	include <kernel/list.h>
+#	include <kernel/system.h>
 #else
+#	include <toaru/list.h>
 #	include <string.h>
 #	include <stddef.h>
 #	include <stdlib.h>

+ 1 - 1
kernel/include/ipv4.h

@@ -1,6 +1,6 @@
 #pragma once
 
-#include <system.h>
+#include <kernel/system.h>
 
 struct ethernet_packet {
 	uint8_t destination[6];

kernel/include/libc.h → base/usr/include/kernel/libc.h


+ 1 - 1
kernel/include/list.h

@@ -5,7 +5,7 @@
 #pragma once
 
 #ifdef _KERNEL_
-#	include <types.h>
+#	include <kernel/types.h>
 #else
 #	include <stdint.h>
 #	include <stddef.h>

kernel/include/logging.h → base/usr/include/kernel/logging.h


+ 1 - 1
kernel/include/mem.h

@@ -3,7 +3,7 @@
 
 #pragma once
 
-#include <types.h>
+#include <kernel/types.h>
 
 extern uintptr_t heap_end;
 

kernel/include/mod/net.h → base/usr/include/kernel/mod/net.h


kernel/include/mod/rtl.h → base/usr/include/kernel/mod/rtl.h


+ 1 - 1
kernel/include/mod/shell.h

@@ -1,7 +1,7 @@
 #ifndef KERNEL_MOD_SHELL_H
 #define KERNEL_MOD_SHELL_H
 
-#include <fs.h>
+#include <kernel/fs.h>
 
 /*
  * We're going to have a list of shell commands.

+ 3 - 3
kernel/include/mod/snd.h

@@ -4,9 +4,9 @@
 /* The format isn't really used for anything right now */
 #define SND_FORMAT_L16SLE 0  /* Linear 16-bit signed little endian */
 
-#include <mod/sound.h>
-#include <logging.h>
-#include <system.h>
+#include <kernel/mod/sound.h>
+#include <kernel/logging.h>
+#include <kernel/system.h>
 
 #define SND_KNOB_VENDOR 1024
 

+ 1 - 1
kernel/include/mod/sound.h

@@ -1,6 +1,6 @@
 #pragma once
 
-#include "../../../include/stdint.h"
+#include <stdint.h>
 
 #define SND_MAX_KNOBS 256
 #define SND_KNOB_NAME_SIZE 256

+ 1 - 1
kernel/include/mod/tmpfs.h

@@ -1,6 +1,6 @@
 #ifndef _TMPFS_H__
 #define _TMPFS_H__
-#include <fs.h>
+#include <kernel/fs.h>
 
 fs_node_t * tmpfs_create(char * name);
 

+ 2 - 2
kernel/include/module.h

@@ -1,7 +1,7 @@
 #pragma once
 
-#include <types.h>
-#include <hashmap.h>
+#include <kernel/types.h>
+#include <kernel/hashmap.h>
 
 typedef struct {
     char * name;

kernel/include/mouse.h → base/usr/include/kernel/mouse.h


+ 1 - 1
kernel/include/multiboot.h

@@ -2,7 +2,7 @@
  */
 #pragma once
 
-#include <system.h>
+#include <kernel/system.h>
 
 #define MULTIBOOT_MAGIC        0x1BADB002
 #define MULTIBOOT_EAX_MAGIC    0x2BADB002

kernel/include/pci.h → base/usr/include/kernel/pci.h


+ 1 - 1
kernel/include/pipe.h

@@ -5,7 +5,7 @@
 
 #pragma once
 
-#include <types.h>
+#include <kernel/types.h>
 
 typedef struct _pipe_device {
 	uint8_t * buffer;

+ 1 - 1
kernel/include/printf.h

@@ -1,6 +1,6 @@
 #pragma once
 
-#include <fs.h>
+#include <kernel/fs.h>
 
 extern size_t vasprintf(char * buf, const char *fmt, va_list args);
 extern int    sprintf(char *buf, const char *fmt, ...);

+ 3 - 4
kernel/include/process.h

@@ -3,10 +3,9 @@
 
 #pragma once
 
-//#include <system.h>
-#include <tree.h>
-#include <signal.h>
-#include <task.h>
+#include <kernel/tree.h>
+#include <kernel/signal.h>
+#include <kernel/task.h>
 
 #define KERNEL_STACK_SIZE 0x8000
 

kernel/include/ringbuffer.h → base/usr/include/kernel/ringbuffer.h


+ 2 - 2
kernel/include/shm.h

@@ -2,8 +2,8 @@
  */
 #pragma once
 
-#include <system.h>
-#include <types.h>
+#include <kernel/system.h>
+#include <kernel/types.h>
 
 #define SHM_PATH_SEPARATOR "."
 

+ 2 - 2
kernel/include/signal.h

@@ -3,9 +3,9 @@
 
 #pragma once
 
-#include <types.h>
+#include <kernel/types.h>
 void return_from_signal_handler(void);
 void fix_signal_stacks(void);
 
-#include <signal_defs.h>
+#include <sys/signal_defs.h>
 

+ 8 - 8
kernel/include/system.h

@@ -2,13 +2,13 @@
  */
 #pragma once
 
-#include <types.h>
-#include <fs.h>
-#include <va_list.h>
-#include <list.h>
-#include <task.h>
-#include <process.h>
-#include <libc.h>
+#include <kernel/types.h>
+#include <kernel/fs.h>
+#include <kernel/va_list.h>
+#include <kernel/list.h>
+#include <kernel/task.h>
+#include <kernel/process.h>
+#include <kernel/libc.h>
 
 #define ASSUME(cond) __extension__ ({ if (!(cond)) { __builtin_unreachable(); } })
 
@@ -230,5 +230,5 @@ extern int send_signal(pid_t process, uint32_t signal);
 extern void validate(void * ptr);
 extern int validate_safe(void * ptr);
 
-#include <errno_defs.h>
+#include <errno.h>
 

+ 1 - 1
kernel/include/task.h

@@ -1,6 +1,6 @@
 #pragma once
 
-#include <types.h>
+#include <kernel/types.h>
 
 typedef struct page {
 	unsigned int present:1;

kernel/include/tokenize.h → base/usr/include/kernel/tokenize.h


+ 1 - 1
kernel/include/tree.h

@@ -4,7 +4,7 @@
  */
 #pragma once
 
-#include "list.h"
+#include <kernel/list.h>
 
 typedef struct tree_node {
 	void * value;

kernel/include/tss.h → base/usr/include/kernel/tss.h


+ 1 - 1
kernel/include/types.h

@@ -6,7 +6,7 @@
 
 #define NULL ((void *)0UL)
 
-#include "../../include/stdint.h"
+#include <stdint.h>
 
 typedef unsigned long size_t;
 #define CHAR_BIT 8

+ 1 - 1
kernel/include/ubsan.h

@@ -1,6 +1,6 @@
 #pragma once
 
-#include <types.h>
+#include <kernel/types.h>
 
 struct TypeDescriptor  {
 	uint16_t type_kind;

kernel/include/va_list.h → base/usr/include/kernel/va_list.h


kernel/include/version.h → base/usr/include/kernel/version.h


kernel/include/video.h → base/usr/include/kernel/video.h


+ 1 - 1
base/usr/include/sys/termios.h

@@ -3,7 +3,7 @@
 #ifndef _KERNEL_
 #include <sys/types.h>
 #else
-#include <types.h>
+#include <kernel/types.h>
 #endif
 
 /* Technically part of ioctl */

+ 2 - 2
lib/decorations.h

@@ -6,8 +6,8 @@
 
 #pragma once
 
-#include "graphics.h"
-#include "yutani.h"
+#include <toaru/graphics.h>
+#include <toaru/yutani.h>
 
 extern uint32_t decor_top_height;
 extern uint32_t decor_bottom_height;

+ 1 - 1
lib/drawstring.h

@@ -1,5 +1,5 @@
 #pragma once
-#include "lib/graphics.h"
+#include <toaru/graphics.h>
 
 void draw_string(gfx_context_t * ctx, int x, int y, uint32_t _fg, char * str);
 int draw_string_width(char * str);

lib/graphics.h → base/usr/include/toaru/graphics.h


+ 3 - 2
kernel/include/hashmap.h

@@ -1,10 +1,11 @@
 #pragma once
 
-#include "list.h"
 
 #ifdef _KERNEL_
-#	include <system.h>
+#	include <kernel/list.h>
+#	include <kernel/system.h>
 #else
+#	include <toaru/list.h>
 #	include <string.h>
 #	include <stddef.h>
 #	include <stdlib.h>

lib/kbd.h → base/usr/include/toaru/kbd.h


+ 1 - 1
lib/list.h

@@ -5,7 +5,7 @@
 #pragma once
 
 #ifdef _KERNEL_
-#	include <types.h>
+#	include <kernel/types.h>
 #else
 #	include <stdint.h>
 #	include <stddef.h>

lib/mouse.h → base/usr/include/toaru/mouse.h


lib/pex.h → base/usr/include/toaru/pex.h


lib/pthread.h → base/usr/include/toaru/pthread.h


lib/rline.h → base/usr/include/toaru/rline.h


lib/spinlock.h → base/usr/include/toaru/spinlock.h


+ 2 - 2
lib/termemu.h

@@ -1,9 +1,9 @@
 #pragma once
 
 #ifdef _KERNEL_
-# include <types.h>
+#	include <kernel/types.h>
 #else
-#include <stdint.h>
+#	include <stdint.h>
 #endif
 
 #define TERM_BUF_LEN 128

lib/trace.h → base/usr/include/toaru/trace.h


+ 1 - 1
lib/tree.h

@@ -4,7 +4,7 @@
  */
 #pragma once
 
-#include "list.h"
+#include <toaru/list.h>
 
 typedef struct tree_node {
 	void * value;

lib/utf8decode.h → base/usr/include/toaru/utf8decode.h


+ 5 - 5
lib/yutani.h

@@ -3,11 +3,11 @@
 #include <stdio.h>
 #include <stdint.h>
 
-#include "hashmap.h"
-#include "graphics.h"
-#include "kbd.h"
-#include "mouse.h"
-#include "list.h"
+#include <toaru/hashmap.h>
+#include <toaru/graphics.h>
+#include <toaru/kbd.h>
+#include <toaru/mouse.h>
+#include <toaru/list.h>
 
 #define YUTANI_SHMKEY(server_ident,buf,sz,win) sprintf(buf, "sys.%s.%d", server_ident, win->bufid);
 #define YUTANI_SHMKEY_EXP(server_ident,buf,sz,bufid) sprintf(buf, "sys.%s.%d", server_ident, bufid);

+ 0 - 10
base/usr/include/video.h

@@ -1,10 +0,0 @@
-#pragma once
-
-#define IO_VID_WIDTH  0x5001
-#define IO_VID_HEIGHT 0x5002
-#define IO_VID_DEPTH  0x5003
-#define IO_VID_ADDR   0x5004
-#define IO_VID_SIGNAL 0x5005
-#define IO_VID_SET    0x5006
-#define IO_VID_STRIDE 0x5007
-

+ 4 - 5
decors/decor-fancy.c

@@ -1,10 +1,9 @@
 #include <stdint.h>
 
-#include "lib/yutani.h"
-#include "lib/graphics.h"
-//#include "lib/shmemfonts.h"
-#include "lib/decorations.h"
-#include "lib/drawstring.h"
+#include <toaru/yutani.h>
+#include <toaru/graphics.h>
+#include <toaru/decorations.h>
+#include <toaru/drawstring.h>
 
 #define INACTIVE 9
 

+ 0 - 1
include

@@ -1 +0,0 @@
-base/usr/include

+ 3 - 3
kernel/cpu/gdt.c

@@ -7,9 +7,9 @@
  * Global Descriptor Tables module
  *
  */
-#include <system.h>
-#include <logging.h>
-#include <tss.h>
+#include <kernel/system.h>
+#include <kernel/logging.h>
+#include <kernel/tss.h>
 
 typedef struct {
 	/* Limits */

+ 2 - 2
kernel/cpu/idt.c

@@ -7,8 +7,8 @@
  * Interrupt Descriptor Tables
  *
  */
-#include <system.h>
-#include <logging.h>
+#include <kernel/system.h>
+#include <kernel/logging.h>
 
 typedef struct {
 	uint16_t base_low;

+ 4 - 4
kernel/cpu/irq.c

@@ -7,10 +7,10 @@
  * Interrupt Requests
  *
  */
-#include <system.h>
-#include <logging.h>
-#include <module.h>
-#include <printf.h>
+#include <kernel/system.h>
+#include <kernel/logging.h>
+#include <kernel/module.h>
+#include <kernel/printf.h>
 
 /* Programmable interrupt controller */
 #define PIC1           0x20

+ 4 - 4
kernel/cpu/isr.c

@@ -6,10 +6,10 @@
  *
  * Interrupt Service Requests
  */
-#include <system.h>
-#include <logging.h>
-#include <module.h>
-#include <printf.h>
+#include <kernel/system.h>
+#include <kernel/logging.h>
+#include <kernel/module.h>
+#include <kernel/printf.h>
 
 /* The count is treated as is when setting up IDT gates. However there is an
  * additional ISR for the system call vector which is handled explicitly since

+ 1 - 1
kernel/devices/cmos.c

@@ -7,7 +7,7 @@
  *
  */
 
-#include <system.h>
+#include <kernel/system.h>
 
 /* CMOS values are stored like so:
  * Say it's 8:42 AM, then the values are stored as:

+ 2 - 2
kernel/devices/fpu.c

@@ -15,8 +15,8 @@
  * FPU states are per kernel thread.
  *
  */
-#include <system.h>
-#include <logging.h>
+#include <kernel/system.h>
+#include <kernel/logging.h>
 
 #define NO_LAZY_FPU
 

+ 4 - 3
kernel/devices/pci.c

@@ -6,9 +6,10 @@
  * ToAruOS PCI Initialization
  */
 
-#include <system.h>
-#include <pci.h>
-#include <pci_list.h>
+#include <kernel/system.h>
+#include <kernel/pci.h>
+
+#include "pci_list.h"
 
 
 void pci_write_field(uint32_t device, int field, int size, uint32_t value) {

kernel/include/pci_list.h → kernel/devices/pci_list.h


+ 3 - 3
kernel/devices/timer.c

@@ -5,9 +5,9 @@
  *
  * Programmable Interrupt Timer
  */
-#include <system.h>
-#include <logging.h>
-#include <process.h>
+#include <kernel/system.h>
+#include <kernel/logging.h>
+#include <kernel/process.h>
 
 #define PIT_A 0x40
 #define PIT_B 0x41

+ 1 - 1
kernel/ds/bitset.c

@@ -4,7 +4,7 @@
  * Copyright (C) 2015 Dale Weiler
  *               2015 Kevin Lange
  */
-#include "bitset.h"
+#include <kernel/bitset.h>
 
 #define CEIL(NUMBER, BASE) \
 	(((NUMBER) + (BASE) - 1) & ~((BASE) - 1))

+ 2 - 2
kernel/ds/hashmap.c

@@ -3,8 +3,8 @@
  * of the NCSA / University of Illinois License - see LICENSE.md
  * Copyright (C) 2013-2014 Kevin Lange
  */
-#include "list.h"
-#include "hashmap.h"
+#include <kernel/list.h>
+#include <kernel/hashmap.h>
 
 unsigned int hashmap_string_hash(void * _key) {
 	unsigned int hash = 0;

+ 3 - 3
kernel/ds/list.c

@@ -6,13 +6,13 @@
  * General-purpose list implementations.
  */
 
-#include "list.h"
-
 #ifdef _KERNEL_
-#	include <system.h>
+#	include <kernel/list.h>
+#	include <kernel/system.h>
 #else
 #	include <stddef.h>
 #	include <stdlib.h>
+#	include <toaru/list.h>
 #endif
 
 void list_destroy(list_t * list) {

+ 3 - 3
kernel/ds/ringbuffer.c

@@ -3,9 +3,9 @@
  * of the NCSA / University of Illinois License - see LICENSE.md
  * Copyright (C) 2013-2014 Kevin Lange
  */
-#include <system.h>
-#include <ringbuffer.h>
-#include <process.h>
+#include <kernel/system.h>
+#include <kernel/ringbuffer.h>
+#include <kernel/process.h>
 
 size_t ring_buffer_unread(ring_buffer_t * ring_buffer) {
 	if (ring_buffer->read_ptr == ring_buffer->write_ptr) {

+ 3 - 3
kernel/ds/tree.c

@@ -6,11 +6,11 @@
  * General-purpose tree implementation
  */
 
-#include "tree.h"
-
 #ifdef _KERNEL_
-#	include <system.h>
+#	include <kernel/tree.h>
+#	include <kernel/system.h>
 #else
+#	include <toaru/tree.h>
 #	include <stddef.h>
 #	include <stdlib.h>
 #endif

+ 5 - 5
kernel/fs/pipe.c

@@ -7,11 +7,11 @@
  *
  */
 
-#include <system.h>
-#include <fs.h>
-#include <printf.h>
-#include <pipe.h>
-#include <logging.h>
+#include <kernel/system.h>
+#include <kernel/fs.h>
+#include <kernel/printf.h>
+#include <kernel/pipe.h>
+#include <kernel/logging.h>
 
 #define DEBUG_PIPES 0
 

+ 6 - 6
kernel/fs/ramdisk.c

@@ -8,12 +8,12 @@
  * Provide raw block access to files loaded into kernel memory.
  */
 
-#include <system.h>
-#include <logging.h>
-#include <module.h>
-#include <fs.h>
-#include <printf.h>
-#include <mem.h>
+#include <kernel/system.h>
+#include <kernel/logging.h>
+#include <kernel/module.h>
+#include <kernel/fs.h>
+#include <kernel/printf.h>
+#include <kernel/mem.h>
 
 static uint32_t read_ramdisk(fs_node_t *node, uint32_t offset, uint32_t size, uint8_t *buffer);
 static uint32_t write_ramdisk(fs_node_t *node, uint32_t offset, uint32_t size, uint8_t *buffer);

+ 9 - 9
kernel/fs/tty.c

@@ -3,15 +3,15 @@
  * of the NCSA / University of Illinois License - see LICENSE.md
  * Copyright (C) 2013-2014 Kevin Lange
  */
-#include <system.h>
-#include <fs.h>
-#include <pipe.h>
-#include <logging.h>
-#include <printf.h>
-
-#include <ioctl.h>
-#include <termios.h>
-#include <ringbuffer.h>
+#include <kernel/system.h>
+#include <kernel/fs.h>
+#include <kernel/pipe.h>
+#include <kernel/logging.h>
+#include <kernel/printf.h>
+#include <kernel/ringbuffer.h>
+
+#include <sys/ioctl.h>
+#include <sys/termios.h>
 
 #define TTY_BUFFER_SIZE 4096
 //4096

+ 8 - 8
kernel/fs/unixpipe.c

@@ -3,14 +3,14 @@
  * of the NCSA / University of Illinois License - see LICENSE.md
  * Copyright (C) 2014 Kevin Lange
  */
-#include <system.h>
-#include <fs.h>
-#include <pipe.h>
-#include <logging.h>
-#include <printf.h>
-
-#include <ioctl.h>
-#include <ringbuffer.h>
+#include <kernel/system.h>
+#include <kernel/fs.h>
+#include <kernel/pipe.h>
+#include <kernel/logging.h>
+#include <kernel/printf.h>
+#include <kernel/ringbuffer.h>
+
+#include <sys/ioctl.h>
 
 #define UNIX_PIPE_BUFFER 512
 

+ 7 - 7
kernel/fs/vfs.c

@@ -8,13 +8,13 @@
  * Virtual File System
  *
  */
-#include <system.h>
-#include <fs.h>
-#include <printf.h>
-#include <list.h>
-#include <process.h>
-#include <logging.h>
-#include <hashmap.h>
+#include <kernel/system.h>
+#include <kernel/fs.h>
+#include <kernel/printf.h>
+#include <kernel/list.h>
+#include <kernel/process.h>
+#include <kernel/logging.h>
+#include <kernel/hashmap.h>
 
 #define MAX_SYMLINK_DEPTH 8
 #define MAX_SYMLINK_SIZE 4096

+ 0 - 1
kernel/include/errno_defs.h

@@ -1 +0,0 @@
-../../include/errno.h

+ 0 - 1
kernel/include/ioctl.h

@@ -1 +0,0 @@
-../../include/sys/ioctl.h

+ 0 - 1
kernel/include/signal_defs.h

@@ -1 +0,0 @@
-../../include/sys/signal_defs.h

+ 0 - 1
kernel/include/syscall_nums.h

@@ -1 +0,0 @@
-../../include/syscall_nums.h

+ 0 - 0
kernel/include/termemu.h


Some files were not shown because too many files changed in this diff