diff --git a/tasks/mm0/include/task.h b/tasks/mm0/include/task.h index 66dc08e..e7e820d 100644 --- a/tasks/mm0/include/task.h +++ b/tasks/mm0/include/task.h @@ -28,6 +28,7 @@ #define DEFAULT_ENV_SIZE SZ_4K #define DEFAULT_STACK_SIZE SZ_32K #define DEFAULT_SHPAGE_SIZE PAGE_SIZE +#define TASK_SIZE 0x10000000 #define TCB_NO_SHARING 0 #define TCB_SHARED_VM (1 << 0) diff --git a/tasks/mm0/src/boot.c b/tasks/mm0/src/boot.c index d95b38f..422376b 100644 --- a/tasks/mm0/src/boot.c +++ b/tasks/mm0/src/boot.c @@ -82,7 +82,6 @@ int boottask_mmap_regions(struct tcb *task, struct vm_file *file) __pfn(DEFAULT_SHPAGE_SIZE)))) return (int)shm; - /* Task's utcb region */ task_setup_utcb(task); return 0; diff --git a/tasks/mm0/src/init.c b/tasks/mm0/src/init.c index 83f401e..241c7aa 100644 --- a/tasks/mm0/src/init.c +++ b/tasks/mm0/src/init.c @@ -57,8 +57,8 @@ int mm0_task_init(struct vm_file *f, unsigned long task_start, task->parent = task; /* - * The first UTCB address is already assigned - * by the microkernel for this pager. Ensure that we also got + * The first UTCB address is already assigned by the + * microkernel for this pager. Ensure that we also get * the same from our internal utcb bookkeeping. */ BUG_ON(task->utcb_address != UTCB_AREA_START); diff --git a/tasks/mm0/src/mmap.c b/tasks/mm0/src/mmap.c index daa3026..478c512 100644 --- a/tasks/mm0/src/mmap.c +++ b/tasks/mm0/src/mmap.c @@ -249,7 +249,7 @@ void *do_mmap(struct vm_file *mapfile, unsigned long file_offset, printf("Trying to map %d pages.\n", npages); return PTR_ERR(-EINVAL); } - if (npages > __pfn(task->stack_start - task->data_end)) { + if (npages > __pfn(TASK_SIZE)) { printf("Trying to map too many pages: %d\n", npages); return PTR_ERR(-ENOMEM); } diff --git a/tasks/mm0/src/task.c b/tasks/mm0/src/task.c index 17d1f05..3d0ae1b 100644 --- a/tasks/mm0/src/task.c +++ b/tasks/mm0/src/task.c @@ -350,7 +350,6 @@ struct tcb *task_create(struct tcb *parent, struct task_ids *ids, /* Set up a new utcb for new thread */ task_setup_utcb(task); - /* Set up parent-child relationship */ if ((share_flags & TCB_SHARED_PARENT) || (share_flags & TCB_SHARED_TGROUP)) { diff --git a/tasks/mm0/src/utcb.c b/tasks/mm0/src/utcb.c index 6f11f43..1a30b66 100644 --- a/tasks/mm0/src/utcb.c +++ b/tasks/mm0/src/utcb.c @@ -147,7 +147,7 @@ out: /* Assign task's utcb address */ task->utcb_address = slot; - printf("UTCB at 0x%x.\n", slot); + // printf("UTCB created at 0x%x.\n", slot); return 0; } @@ -160,7 +160,7 @@ int task_destroy_utcb(struct tcb *task) { struct utcb_desc *udesc; - printf("UTCB: Destroying 0x%x\n", task->utcb_address); + // printf("UTCB: Destroying 0x%x\n", task->utcb_address); /* Find the utcb descriptor slot first */ list_for_each_entry(udesc, &task->utcb_head->list, list) {