aboutsummaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2016-07-15 23:12:14 +0200
committerAlex Auvolat <alex@adnab.me>2016-07-15 23:12:14 +0200
commit32407e728971006ed3d0885e01c22fb66c8adc57 (patch)
tree89483d39e8e2638383f815d4e73b647334fe2fe9 /src/lib
parentba4e59a1d687173ac5cfa74d26d71d6059dc6bc6 (diff)
downloadkogata-32407e728971006ed3d0885e01c22fb66c8adc57.tar.gz
kogata-32407e728971006ed3d0885e01c22fb66c8adc57.zip
Move stuff around, again
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/bam.lua6
-rw-r--r--src/lib/include/kogata/draw.h (renamed from src/lib/include/draw.h)2
-rw-r--r--src/lib/include/kogata/gip.h (renamed from src/lib/include/gip.h)4
-rw-r--r--src/lib/include/kogata/keyboard.h (renamed from src/lib/include/keyboard.h)0
-rw-r--r--src/lib/include/kogata/mainloop.h (renamed from src/lib/include/mainloop.h)2
-rw-r--r--src/lib/include/kogata/syscall.h (renamed from src/lib/include/syscall.h)2
-rw-r--r--src/lib/include/proto/gip.h2
-rw-r--r--src/lib/include/stdio.h2
-rw-r--r--src/lib/include/stdlib.h2
-rw-r--r--src/lib/libc/debug.c (renamed from src/lib/libkogata/debug.c)5
-rw-r--r--src/lib/libc/malloc.c (renamed from src/lib/libkogata/malloc.c)10
-rw-r--r--src/lib/libc/start.c (renamed from src/lib/libkogata/start.c)2
-rw-r--r--src/lib/libc/stdio.c (renamed from src/lib/libkogata/stdio.c)6
-rw-r--r--src/lib/libc/syscall.c (renamed from src/lib/libkogata/syscall.c)7
-rw-r--r--src/lib/libc/unistd.c (renamed from src/lib/libkogata/unistd.c)5
-rw-r--r--src/lib/libkogata/draw.c10
-rw-r--r--src/lib/libkogata/gip.c4
-rw-r--r--src/lib/libkogata/keyboard.c11
-rw-r--r--src/lib/libkogata/mainloop.c4
19 files changed, 44 insertions, 42 deletions
diff --git a/src/lib/bam.lua b/src/lib/bam.lua
index b8e51e4..cef678e 100644
--- a/src/lib/bam.lua
+++ b/src/lib/bam.lua
@@ -3,6 +3,8 @@ local function lib(name)
return Compile(user_settings, source)
end
-libkogata = {lib('libkogata'), common_libc, common_libalgo, common_libkogata}
+libc = {lib('libc'), common_libc, common_libkogata}
-liblua = lib('lua')
+libkogata = {lib('libkogata'), libc}
+
+liblua = {lib('lua'), libc}
diff --git a/src/lib/include/draw.h b/src/lib/include/kogata/draw.h
index 5296b92..fb9fe05 100644
--- a/src/lib/include/draw.h
+++ b/src/lib/include/kogata/draw.h
@@ -1,6 +1,6 @@
#pragma once
-#include <syscall.h>
+#include <kogata/syscall.h>
#include <proto/fb.h>
// ---- Generic drawing functions
diff --git a/src/lib/include/gip.h b/src/lib/include/kogata/gip.h
index 9c66091..1d1725a 100644
--- a/src/lib/include/gip.h
+++ b/src/lib/include/kogata/gip.h
@@ -2,10 +2,10 @@
// Not thread safe
-#include <hashtbl.h>
+#include <kogata/hashtbl.h>
+#include <kogata/mainloop.h>
#include <proto/gip.h>
-#include <mainloop.h>
typedef struct gip_handler gip_handler_t;
diff --git a/src/lib/include/keyboard.h b/src/lib/include/kogata/keyboard.h
index 63c6c2c..63c6c2c 100644
--- a/src/lib/include/keyboard.h
+++ b/src/lib/include/kogata/keyboard.h
diff --git a/src/lib/include/mainloop.h b/src/lib/include/kogata/mainloop.h
index 1e71ffb..2b447ef 100644
--- a/src/lib/include/mainloop.h
+++ b/src/lib/include/kogata/mainloop.h
@@ -4,7 +4,7 @@
// is to multiplex several IO operations on a
// single thread.
-#include <syscall.h>
+#include <kogata/syscall.h>
#define MAINLOOP_MAX_WR_BUFS 4
diff --git a/src/lib/include/syscall.h b/src/lib/include/kogata/syscall.h
index 07defdb..378dda2 100644
--- a/src/lib/include/syscall.h
+++ b/src/lib/include/kogata/syscall.h
@@ -9,7 +9,7 @@
#include <proto/fs.h>
#include <proto/token.h>
-#include <debug.h>
+#include <kogata/debug.h>
typedef void (*entry_t)(void*);
diff --git a/src/lib/include/proto/gip.h b/src/lib/include/proto/gip.h
index ca8b868..5cf0166 100644
--- a/src/lib/include/proto/gip.h
+++ b/src/lib/include/proto/gip.h
@@ -2,7 +2,7 @@
#include <proto/fb.h>
-#include <syscall.h>
+#include <kogata/syscall.h>
/*
Definition of the GIP protocol (Graphics Initiation Protocol).
diff --git a/src/lib/include/stdio.h b/src/lib/include/stdio.h
index f46add4..1e75270 100644
--- a/src/lib/include/stdio.h
+++ b/src/lib/include/stdio.h
@@ -2,7 +2,7 @@
#include <stdarg.h>
-#include <syscall.h>
+#include <kogata/syscall.h>
extern fd_t stdio;
diff --git a/src/lib/include/stdlib.h b/src/lib/include/stdlib.h
index 29d8661..30da9a6 100644
--- a/src/lib/include/stdlib.h
+++ b/src/lib/include/stdlib.h
@@ -1,6 +1,6 @@
#pragma once
-#include "malloc.h"
+#include <kogata/malloc.h>
#define EXIT_SUCCESS 0
#define EXIT_FAILURE 255
diff --git a/src/lib/libkogata/debug.c b/src/lib/libc/debug.c
index 847ecca..dc04fd3 100644
--- a/src/lib/libkogata/debug.c
+++ b/src/lib/libc/debug.c
@@ -1,8 +1,7 @@
#include <stdbool.h>
-#include <debug.h>
-
-#include <syscall.h>
+#include <kogata/debug.h>
+#include <kogata/syscall.h>
void sys_panic(const char* msg, const char* file, int line) {
dbg_printf("PANIC in user process\n %s\n at %s:%d\n", msg, file, line);
diff --git a/src/lib/libkogata/malloc.c b/src/lib/libc/malloc.c
index 3777123..cb983fd 100644
--- a/src/lib/libkogata/malloc.c
+++ b/src/lib/libc/malloc.c
@@ -1,10 +1,10 @@
-#include <malloc.h>
-#include <slab_alloc.h>
+#include <kogata/malloc.h>
+#include <kogata/slab_alloc.h>
-#include <string.h>
+#include <kogata/syscall.h>
+#include <kogata/region_alloc.h>
-#include <syscall.h>
-#include <region_alloc.h>
+#include <string.h>
static void* heap_alloc_pages(size_t s) {
void* addr = region_alloc(s, "Heap");
diff --git a/src/lib/libkogata/start.c b/src/lib/libc/start.c
index bd22d7a..49a6ca1 100644
--- a/src/lib/libkogata/start.c
+++ b/src/lib/libc/start.c
@@ -1,4 +1,4 @@
-#include <syscall.h>
+#include <kogata/syscall.h>
void malloc_setup();
diff --git a/src/lib/libkogata/stdio.c b/src/lib/libc/stdio.c
index 94dec22..22be78e 100644
--- a/src/lib/libkogata/stdio.c
+++ b/src/lib/libc/stdio.c
@@ -1,9 +1,9 @@
-#include <syscall.h>
#include <string.h>
-
-#include <printf.h>
#include <stdio.h>
+#include <kogata/syscall.h>
+#include <kogata/printf.h>
+
fd_t stdio = 1;
diff --git a/src/lib/libkogata/syscall.c b/src/lib/libc/syscall.c
index bf0b35e..61b3471 100644
--- a/src/lib/libkogata/syscall.c
+++ b/src/lib/libc/syscall.c
@@ -1,8 +1,9 @@
-#include <debug.h>
-#include <syscall.h>
+#include <kogata/debug.h>
+#include <kogata/syscall.h>
+
+#include <kogata/printf.h>
#include <string.h>
-#include <printf.h>
static inline uint32_t call(uint32_t a, uint32_t b, uint32_t c, uint32_t d, uint32_t ss, uint32_t dd) {
uint32_t ret;
diff --git a/src/lib/libkogata/unistd.c b/src/lib/libc/unistd.c
index 101e02e..5ae1735 100644
--- a/src/lib/libkogata/unistd.c
+++ b/src/lib/libc/unistd.c
@@ -1,9 +1,8 @@
#include <string.h>
-
-#include <syscall.h>
-
#include <unistd.h>
+#include <kogata/syscall.h>
+
char cwd_buf[256];
diff --git a/src/lib/libkogata/draw.c b/src/lib/libkogata/draw.c
index 2806df4..d988cb9 100644
--- a/src/lib/libkogata/draw.c
+++ b/src/lib/libkogata/draw.c
@@ -1,13 +1,13 @@
-#include <syscall.h>
-#include <malloc.h>
+#include <stdlib.h>
#include <string.h>
-#include <printf.h>
#include <proto/font_file.h>
-#include <region_alloc.h>
+#include <kogata/printf.h>
+#include <kogata/region_alloc.h>
-#include <draw.h>
+#include <kogata/syscall.h>
+#include <kogata/draw.h>
fb_t *g_fb_from_file(fd_t file, fb_info_t *geom) {
fb_t *ret = (fb_t*)malloc(sizeof(fb_t));
diff --git a/src/lib/libkogata/gip.c b/src/lib/libkogata/gip.c
index cdfeb71..5b1e44d 100644
--- a/src/lib/libkogata/gip.c
+++ b/src/lib/libkogata/gip.c
@@ -1,7 +1,7 @@
#include <string.h>
-#include <malloc.h>
+#include <stdlib.h>
-#include <gip.h>
+#include <kogata/gip.h>
typedef struct {
gip_reply_callback_t cb;
diff --git a/src/lib/libkogata/keyboard.c b/src/lib/libkogata/keyboard.c
index 505c048..e7fb08b 100644
--- a/src/lib/libkogata/keyboard.c
+++ b/src/lib/libkogata/keyboard.c
@@ -1,11 +1,12 @@
-#include <malloc.h>
+#include <stdlib.h>
#include <string.h>
-#include <printf.h>
-
-#include <syscall.h>
#include <proto/keyboard.h>
-#include <keyboard.h>
+
+#include <kogata/printf.h>
+#include <kogata/syscall.h>
+
+#include <kogata/keyboard.h>
// ---- Control keys that are not KBD_CHAR-able
diff --git a/src/lib/libkogata/mainloop.c b/src/lib/libkogata/mainloop.c
index 58966dd..bce1174 100644
--- a/src/lib/libkogata/mainloop.c
+++ b/src/lib/libkogata/mainloop.c
@@ -1,7 +1,7 @@
-#include <malloc.h>
+#include <stdlib.h>
#include <string.h>
-#include <mainloop.h>
+#include <kogata/mainloop.h>
mainloop_fd_t *mainloop_fds = 0;
bool mainloop_fds_change = false;