diff options
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/ll.c | 4 | ||||
-rw-r--r-- | src/lib/ll.h | 24 | ||||
-rw-r--r-- | src/lib/mem.c | 4 | ||||
-rw-r--r-- | src/lib/mem.h | 25 | ||||
-rw-r--r-- | src/lib/q.c | 4 | ||||
-rw-r--r-- | src/lib/q.h | 30 | ||||
-rw-r--r-- | src/lib/strings.c | 2 | ||||
-rw-r--r-- | src/lib/strings.h | 10 |
8 files changed, 7 insertions, 96 deletions
diff --git a/src/lib/ll.c b/src/lib/ll.c index 7f1a47e..4eaa291 100644 --- a/src/lib/ll.c +++ b/src/lib/ll.c @@ -1,5 +1,5 @@ -#include "../lib/ll.h" -#include "../lib/mem.h" +#include <lib/ll.h> +#include <lib/mem.h> struct LL* new_ll(void* val) { diff --git a/src/lib/ll.h b/src/lib/ll.h deleted file mode 100644 index ab4148d..0000000 --- a/src/lib/ll.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef LIB_LL_H -#define LIB_LL_H - -struct LL { - struct LL* prev; - struct LL* next; - void* data; -}; - -struct LL* new_ll(void* val); -void push_ll(struct LL* l, void* val); -void remove_ll(struct LL* l, unsigned long idx); - -#define show_ll(L, TYPE) { \ - struct LL* t = L; \ - do { \ - uart_hex(*(TYPE*)t->data); \ - t = t->next; \ - if (t != l) \ - uart_char(' '); \ - } while (t != l); \ -} - -#endif diff --git a/src/lib/mem.c b/src/lib/mem.c index 2b495ef..f8a8cc5 100644 --- a/src/lib/mem.c +++ b/src/lib/mem.c @@ -1,5 +1,5 @@ -#include "../lib/mem.h" -#include "../drivers/uart.h" +#include <drivers/uart.h> +#include <lib/mem.h> void memshow32(unsigned long* addr, unsigned int n) { diff --git a/src/lib/mem.h b/src/lib/mem.h deleted file mode 100644 index 5c5cc94..0000000 --- a/src/lib/mem.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef LIB_MEM_H -#define LIB_MEM_H - -struct MemTab { - unsigned char size; - unsigned char in_use; - void* data; -} __attribute__((packed)); - -void memcpy(unsigned char* src, unsigned char* dest, unsigned int n); -unsigned char memcmp(unsigned char* a, unsigned char* b, unsigned int n); - -void memshow32(unsigned long* addr, unsigned int n); -void memcpy32(unsigned long* src, unsigned long* dest, unsigned int n); -unsigned char memcmp32(unsigned long* a, unsigned long* b, unsigned int n); - -void* malloc(unsigned char size); -void* malloca(unsigned char size, unsigned char amnt); -void free(void* memloc); -void* heap_base(void); -void* heap_top(void); -void heap_info(void); -void heap_info_u(void); - -#endif diff --git a/src/lib/q.c b/src/lib/q.c index 1f5a871..ebae2b9 100644 --- a/src/lib/q.c +++ b/src/lib/q.c @@ -1,5 +1,5 @@ -#include "../lib/q.h" -#include "../lib/mem.h" +#include <lib/q.h> +#include <lib/mem.h> struct Q_base* new_q() { diff --git a/src/lib/q.h b/src/lib/q.h deleted file mode 100644 index cf75c6d..0000000 --- a/src/lib/q.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef LIB_Q_H -#define LIB_Q_H - -struct Q_base { - struct Q* next; - struct Q* last; -}; - -struct Q { - struct Q* next; - void* data; -}; - -struct Q_base* new_q(); -void push_q(struct Q_base* qb, void* val); -void pop_q(struct Q_base* qb); - -#define show_q(QQ, TYPE) { \ - if (QQ->next != 0) { \ - struct Q* t = QQ->next; \ - while (t->next != 0) { \ - uart_hex(*(TYPE*)t->data); \ - t = t->next; \ - uart_char(' '); \ - } \ - uart_hex(*(TYPE*)t->data); \ - } \ -} - -#endif diff --git a/src/lib/strings.c b/src/lib/strings.c index 94b315f..8b83c9f 100644 --- a/src/lib/strings.c +++ b/src/lib/strings.c @@ -1,4 +1,4 @@ -#include "../lib/strings.h" +#include <lib/strings.h> unsigned long strlen(string_t s) { diff --git a/src/lib/strings.h b/src/lib/strings.h deleted file mode 100644 index 1bbcac8..0000000 --- a/src/lib/strings.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef LIB_STRINGS_H -#define LIB_STRINGS_H - -#define string_t char* - -unsigned long strlen(string_t s); -unsigned char strcmp(string_t a, string_t b); -unsigned char strcmpn(string_t a, string_t b, unsigned int n); - -#endif |