UTCB create/destroy working.

Execve maps its utcb in mmap_segments. fork/clone does it as part of task_create
This commit is contained in:
Bahadir Balban
2009-05-01 17:48:54 +03:00
parent 260527c0a3
commit 952285d756
6 changed files with 6 additions and 7 deletions

View File

@@ -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)

View File

@@ -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;

View File

@@ -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);

View File

@@ -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);
}

View File

@@ -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)) {

View File

@@ -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) {