/trunk/kernel/arch/amd64/include/proc/task.h |
---|
39,8 → 39,10 |
#include <adt/bitmap.h> |
typedef struct { |
count_t iomapver; /**< I/O Permission bitmap Generation counter. */ |
bitmap_t iomap; /**< I/O Permission bitmap. */ |
/** I/O Permission bitmap Generation counter. */ |
count_t iomapver; |
/** I/O Permission bitmap. */ |
bitmap_t iomap; |
} task_arch_t; |
#endif |
/trunk/kernel/arch/amd64/src/ddi/ddi.c |
---|
74,13 → 74,15 |
if (!newmap) |
return ENOMEM; |
bitmap_initialize(&oldiomap, task->arch.iomap.map, task->arch.iomap.bits); |
bitmap_initialize(&oldiomap, task->arch.iomap.map, |
task->arch.iomap.bits); |
bitmap_initialize(&task->arch.iomap, newmap, bits); |
/* |
* Mark the new range inaccessible. |
*/ |
bitmap_set_range(&task->arch.iomap, oldiomap.bits, bits - oldiomap.bits); |
bitmap_set_range(&task->arch.iomap, oldiomap.bits, |
bits - oldiomap.bits); |
/* |
* In case there really existed smaller iomap, |
87,7 → 89,8 |
* copy its contents and deallocate it. |
*/ |
if (oldiomap.bits) { |
bitmap_copy(&task->arch.iomap, &oldiomap, oldiomap.bits); |
bitmap_copy(&task->arch.iomap, &oldiomap, |
oldiomap.bits); |
free(oldiomap.map); |
} |
} |
127,11 → 130,12 |
bitmap_t iomap; |
ASSERT(TASK->arch.iomap.map); |
bitmap_initialize(&iomap, CPU->arch.tss->iomap, TSS_IOMAP_SIZE * 8); |
bitmap_initialize(&iomap, CPU->arch.tss->iomap, |
TSS_IOMAP_SIZE * 8); |
bitmap_copy(&iomap, &TASK->arch.iomap, TASK->arch.iomap.bits); |
/* |
* It is safe to set the trailing eight bits because of the extra |
* convenience byte in TSS_IOMAP_SIZE. |
* It is safe to set the trailing eight bits because of the |
* extra convenience byte in TSS_IOMAP_SIZE. |
*/ |
bitmap_set_range(&iomap, ALIGN_UP(TASK->arch.iomap.bits, 8), 8); |
} |
/trunk/kernel/arch/ia32/include/proc/task.h |
---|
39,8 → 39,10 |
#include <adt/bitmap.h> |
typedef struct { |
count_t iomapver; /**< I/O Permission bitmap Generation counter. */ |
bitmap_t iomap; /**< I/O Permission bitmap. */ |
/** I/O Permission bitmap Generation counter. */ |
count_t iomapver; |
/** I/O Permission bitmap. */ |
bitmap_t iomap; |
} task_arch_t; |
#endif |
/trunk/kernel/arch/ia32/src/ddi/ddi.c |
---|
75,13 → 75,15 |
if (!newmap) |
return ENOMEM; |
bitmap_initialize(&oldiomap, task->arch.iomap.map, task->arch.iomap.bits); |
bitmap_initialize(&oldiomap, task->arch.iomap.map, |
task->arch.iomap.bits); |
bitmap_initialize(&task->arch.iomap, newmap, bits); |
/* |
* Mark the new range inaccessible. |
*/ |
bitmap_set_range(&task->arch.iomap, oldiomap.bits, bits - oldiomap.bits); |
bitmap_set_range(&task->arch.iomap, oldiomap.bits, |
bits - oldiomap.bits); |
/* |
* In case there really existed smaller iomap, |
88,7 → 90,8 |
* copy its contents and deallocate it. |
*/ |
if (oldiomap.bits) { |
bitmap_copy(&task->arch.iomap, &oldiomap, oldiomap.bits); |
bitmap_copy(&task->arch.iomap, &oldiomap, |
oldiomap.bits); |
free(oldiomap.map); |
} |
} |
128,11 → 131,12 |
task_t *task = TASK; |
ASSERT(TASK->arch.iomap.map); |
bitmap_initialize(&iomap, CPU->arch.tss->iomap, TSS_IOMAP_SIZE * 8); |
bitmap_initialize(&iomap, CPU->arch.tss->iomap, |
TSS_IOMAP_SIZE * 8); |
bitmap_copy(&iomap, &task->arch.iomap, task->arch.iomap.bits); |
/* |
* It is safe to set the trailing eight bits because of the extra |
* convenience byte in TSS_IOMAP_SIZE. |
* It is safe to set the trailing eight bits because of the |
* extra convenience byte in TSS_IOMAP_SIZE. |
*/ |
bitmap_set_range(&iomap, ALIGN_UP(TASK->arch.iomap.bits, 8), 8); |
} |
/trunk/kernel/arch/ia32/src/proc/scheduler.c |
---|
58,7 → 58,8 |
*/ |
void before_thread_runs_arch(void) |
{ |
CPU->arch.tss->esp0 = (uintptr_t) &THREAD->kstack[THREAD_STACK_SIZE-SP_DELTA]; |
CPU->arch.tss->esp0 = (uintptr_t) &THREAD->kstack[THREAD_STACK_SIZE - |
SP_DELTA]; |
CPU->arch.tss->ss0 = selector(KDATA_DES); |
/* Set up TLS in GS register */ |
69,7 → 70,7 |
if (CPU->id < BKPOINTS_MAX) { |
the_t *the = THE; |
breakpoint_add(&((the_t *) the->thread->kstack)->as, |
BKPOINT_WRITE | BKPOINT_CHECK_ZERO, the->cpu->id); |
BKPOINT_WRITE | BKPOINT_CHECK_ZERO, the->cpu->id); |
} |
#endif |
} |