summaryrefslogtreecommitdiff
path: root/src/stem/mem/seg.h
diff options
context:
space:
mode:
authorAlexis211 <alexis211@gmail.com>2010-02-05 17:33:08 +0100
committerAlexis211 <alexis211@gmail.com>2010-02-05 17:33:08 +0100
commit674014901a1e90ce1587a7709fe9bf5893b0e36e (patch)
tree0696d09e4a185413df75f8e3ef413b5ae81a090d /src/stem/mem/seg.h
parent6d849bc12d6afe2fe239c5a7dc581ba76d67974b (diff)
downloadTCE-674014901a1e90ce1587a7709fe9bf5893b0e36e.tar.gz
TCE-674014901a1e90ce1587a7709fe9bf5893b0e36e.zip
Start work on syscalls, advanced tasking, segmentation
Diffstat (limited to 'src/stem/mem/seg.h')
-rw-r--r--src/stem/mem/seg.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/stem/mem/seg.h b/src/stem/mem/seg.h
new file mode 100644
index 0000000..022d38e
--- /dev/null
+++ b/src/stem/mem/seg.h
@@ -0,0 +1,40 @@
+#ifndef DEF_SEG_H
+#define DEF_SEG_H
+
+#include "paging.h"
+
+struct segment_map;
+struct segment {
+ void* seg_data;
+ int mappings;
+
+ struct segment_map* (*map)(struct segment* seg, struct page_directory* pagedir);
+ void (*unmap)(struct segment_map*);
+ void (*delete)(struct segment* seg);
+ int (*handle_fault)(struct segment_map* map, size_t addr, int write); //0 if ok, 1 if segfault
+};
+
+struct segment_map {
+ struct segment* seg;
+ struct page_directory* pagedir;
+ size_t start, len;
+ struct segment_map *next;
+};
+
+struct segment_map *seg_map(struct segment* seg, struct page_directory* pagedir);
+void seg_unmap(struct segment_map* map);
+
+/// ************************************* SIMPLESEG stuff *****************
+
+struct simpleseg {
+ int writable;
+ size_t start, len;
+};
+
+struct segment* simpleseg_make(size_t start, size_t len, int writable);
+struct segment_map* simpleseg_map(struct segment* seg, struct page_directory* pagedir);
+void simpleseg_unmap(struct segment_map*);
+void simpleseg_delete(struct segment *seg);
+int simpleseg_handleFault(struct segment_map* map, size_t addr, int write);
+
+#endif