summaryrefslogtreecommitdiff
path: root/src/library
diff options
context:
space:
mode:
authorAlexis211 <alexis211@gmail.com>2010-03-23 16:34:36 +0100
committerAlexis211 <alexis211@gmail.com>2010-03-23 16:34:36 +0100
commitcbadacbb881200b601c7b53b29aa0c1b78747692 (patch)
treec3230c4d2dc8f75d126826954b80a37770ad26c7 /src/library
parent6266a24cd2f71a0bad0e55c1eedd480790868c0f (diff)
downloadTCE-cbadacbb881200b601c7b53b29aa0c1b78747692.tar.gz
TCE-cbadacbb881200b601c7b53b29aa0c1b78747692.zip
More work on IPC
Diffstat (limited to 'src/library')
-rw-r--r--src/library/Makefile4
-rw-r--r--src/library/gc/syscall.c (renamed from src/library/grapes/syscall.c)14
-rw-r--r--src/library/grapes/syscall.h12
-rw-r--r--src/library/start.c2
4 files changed, 16 insertions, 16 deletions
diff --git a/src/library/Makefile b/src/library/Makefile
index c562dec..74eb525 100644
--- a/src/library/Makefile
+++ b/src/library/Makefile
@@ -1,13 +1,13 @@
.PHONY: clean, mrproper
CC = gcc
-CFLAGS = -nostdlib -nostartfiles -nodefaultlibs -fno-builtin -fno-stack-protector -Wall -Wextra
+CFLAGS = -nostdlib -nostartfiles -nodefaultlibs -fno-builtin -fno-stack-protector -Wall -Wextra -I../include
LD = ld
LDFLAGS = -r
Library = grapes.o
-Objects = grapes/syscall.o \
+Objects = gc/syscall.o \
start.o
all: $(Library)
diff --git a/src/library/grapes/syscall.c b/src/library/gc/syscall.c
index 38adc01..e1ef3cd 100644
--- a/src/library/grapes/syscall.c
+++ b/src/library/gc/syscall.c
@@ -1,4 +1,4 @@
-#include "syscall.h"
+#include <gc/syscall.h>
static int call(unsigned a, unsigned b, unsigned c, unsigned d, unsigned e, unsigned f) {
unsigned ret;
@@ -33,3 +33,15 @@ void thread_new(void (*entry)(void*), void *data) {
void irq_wait(int number) {
call(6, number, 0, 0, 0, 0);
}
+
+int proc_priv() {
+ return call(7, 0, 0, 0, 0, 0);
+}
+
+int shm_create(size_t offset, size_t length) {
+ return call(8, offset, length, 0, 0, 0);
+}
+
+int shm_delete(size_t offset) {
+ return call(9, offset, 0, 0, 0, 0);
+}
diff --git a/src/library/grapes/syscall.h b/src/library/grapes/syscall.h
deleted file mode 100644
index d2f80e5..0000000
--- a/src/library/grapes/syscall.h
+++ /dev/null
@@ -1,12 +0,0 @@
-#ifndef DEF_SYSCALL_H
-#define DEF_SYSCALL_H
-
-void thread_exit();
-void schedule();
-void thread_sleep(int time);
-void process_exit(int retval);
-void printk(char* str);
-void thread_new(void (*entry)(void*), void *data);
-void irq_wait(int number);
-
-#endif
diff --git a/src/library/start.c b/src/library/start.c
index 8f83a23..b3c5541 100644
--- a/src/library/start.c
+++ b/src/library/start.c
@@ -1,4 +1,4 @@
-#include "grapes/syscall.h"
+#include <gc/syscall.h>
extern int main();