diff options
author | Alexis211 <alexis211@gmail.com> | 2010-03-02 17:21:32 +0100 |
---|---|---|
committer | Alexis211 <alexis211@gmail.com> | 2010-03-02 17:21:32 +0100 |
commit | 6266a24cd2f71a0bad0e55c1eedd480790868c0f (patch) | |
tree | cc0c8c9f36ffa29ee3a1aa3ebafaff05f654e442 /src/kernel/mem | |
parent | 3e1998280319e8060e797ca39b3b0b1bc766d569 (diff) | |
download | TCE-6266a24cd2f71a0bad0e55c1eedd480790868c0f.tar.gz TCE-6266a24cd2f71a0bad0e55c1eedd480790868c0f.zip |
old uncommited changes commited
Diffstat (limited to 'src/kernel/mem')
-rw-r--r-- | src/kernel/mem/seg.c | 6 | ||||
-rw-r--r-- | src/kernel/mem/seg.h | 7 |
2 files changed, 7 insertions, 6 deletions
diff --git a/src/kernel/mem/seg.c b/src/kernel/mem/seg.c index 1452d61..aa71564 100644 --- a/src/kernel/mem/seg.c +++ b/src/kernel/mem/seg.c @@ -1,8 +1,8 @@ #include "seg.h" #include "mem.h" -struct segment_map *seg_map(struct segment* seg, struct page_directory *pagedir) { - struct segment_map *sm = seg->map(seg, pagedir); +struct segment_map *seg_map(struct segment* seg, struct page_directory *pagedir, size_t offset) { + struct segment_map *sm = seg->map(seg, pagedir, offset); if (sm == 0) return 0; seg->mappings++; sm->seg = seg; @@ -45,7 +45,7 @@ struct segment* simpleseg_make(size_t start, size_t len, int writable) { return se; } -struct segment_map* simpleseg_map(struct segment* seg, struct page_directory* pagedir) { +struct segment_map* simpleseg_map(struct segment* seg, struct page_directory* pagedir, size_t offset) { struct segment_map *sm = kmalloc(sizeof(struct segment_map)); sm->start = ((struct simpleseg*)(seg->seg_data))->start; sm->len = ((struct simpleseg*)(seg->seg_data))->len; diff --git a/src/kernel/mem/seg.h b/src/kernel/mem/seg.h index 022d38e..4d6660f 100644 --- a/src/kernel/mem/seg.h +++ b/src/kernel/mem/seg.h @@ -8,7 +8,7 @@ struct segment { void* seg_data; int mappings; - struct segment_map* (*map)(struct segment* seg, struct page_directory* pagedir); + struct segment_map* (*map)(struct segment* seg, struct page_directory* pagedir, size_t offset); 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 @@ -21,7 +21,8 @@ struct segment_map { struct segment_map *next; }; -struct segment_map *seg_map(struct segment* seg, struct page_directory* pagedir); +//parameter offset in seg_map needs not be used +struct segment_map *seg_map(struct segment* seg, struct page_directory* pagedir, size_t offset); void seg_unmap(struct segment_map* map); /// ************************************* SIMPLESEG stuff ***************** @@ -32,7 +33,7 @@ struct simpleseg { }; struct segment* simpleseg_make(size_t start, size_t len, int writable); -struct segment_map* simpleseg_map(struct segment* seg, struct page_directory* pagedir); +struct segment_map* simpleseg_map(struct segment* seg, struct page_directory* pagedir, size_t offset); void simpleseg_unmap(struct segment_map*); void simpleseg_delete(struct segment *seg); int simpleseg_handleFault(struct segment_map* map, size_t addr, int write); |