mirror of
https://github.com/drasko/codezero.git
synced 2026-05-05 10:01:30 +02:00
Brought mm0 initialization up to init_execve()
Changes: It is now possible to use do_mmap() from within mm0. - pager_new_virtual()/delete_virtual() return addresses that are disjoint from find_unmapped_area() used by mmap() interface for anonymous or not-fixed areas. - find_unmapped_area() now uses task->map_start task->map_end instead of task->start and task->end. task->start/end are still valid task space addresses for mmap(), but finding a new address is limited to map_start/map_end. - We have both interfaces because mmap() is only useful for backed-files. When the pager needs to access a user memory range for example, that is not backed by a file and thus we need to use pager_new_virtual() instead of mmap() for mapping.
This commit is contained in:
@@ -42,7 +42,7 @@
|
||||
#define MEMFS_TOTAL_SIZE SZ_4MB
|
||||
#define MEMFS_TOTAL_INODES 128
|
||||
#define MEMFS_TOTAL_BLOCKS 2000
|
||||
#define MEMFS_FMAX_BLOCKS 40
|
||||
#define MEMFS_FMAX_BLOCKS 60
|
||||
#define MEMFS_BLOCK_SIZE PAGE_SIZE
|
||||
#define MEMFS_MAGIC 0xB
|
||||
#define MEMFS_NAME "memfs"
|
||||
|
||||
@@ -9,6 +9,11 @@
|
||||
#include <vm_area.h>
|
||||
#include <init.h>
|
||||
#include <physmem.h>
|
||||
#include <linker.h>
|
||||
|
||||
#define PAGER_MMAP_SEGMENT SZ_4MB
|
||||
#define PAGER_MMAP_START (page_align_up(__stack))
|
||||
#define PAGER_MMAP_END (PAGER_MMAP_START + PAGER_MMAP_SEGMENT)
|
||||
|
||||
void init_mm_descriptors(struct page_bitmap *page_map,
|
||||
struct bootdesc *bootdesc, struct membank *membank);
|
||||
|
||||
@@ -166,4 +166,7 @@ struct tcb *task_create(struct tcb *orig,
|
||||
unsigned int ctrl_flags,
|
||||
unsigned int alloc_flags);
|
||||
|
||||
int prefault_range(struct tcb *task, unsigned long start,
|
||||
unsigned long end, unsigned int vm_flags);
|
||||
|
||||
#endif /* __TASK_H__ */
|
||||
|
||||
Reference in New Issue
Block a user