Changes in kernel/arch/amd64/src/ddi/ddi.c [63e27ef:a35b458] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/amd64/src/ddi/ddi.c
r63e27ef ra35b458 59 59 /* First, copy the I/O Permission Bitmap. */ 60 60 irq_spinlock_lock(&TASK->lock, false); 61 61 62 62 size_t ver = TASK->arch.iomapver; 63 63 size_t elements = TASK->arch.iomap.elements; 64 64 65 65 if (elements > 0) { 66 66 assert(TASK->arch.iomap.bits); 67 67 68 68 bitmap_t iomap; 69 69 bitmap_initialize(&iomap, TSS_IOMAP_SIZE * 8, 70 70 CPU->arch.tss->iomap); 71 71 bitmap_copy(&iomap, &TASK->arch.iomap, elements); 72 72 73 73 /* 74 74 * Set the trailing bits in the last byte of the map to disable … … 77 77 bitmap_set_range(&iomap, elements, 78 78 ALIGN_UP(elements, 8) - elements); 79 79 80 80 /* 81 81 * It is safe to set the trailing eight bits because of the … … 84 84 bitmap_set_range(&iomap, ALIGN_UP(elements, 8), 8); 85 85 } 86 86 87 87 irq_spinlock_unlock(&TASK->lock, false); 88 88 89 89 /* 90 90 * Second, adjust TSS segment limit. … … 93 93 ptr_16_64_t cpugdtr; 94 94 gdtr_store(&cpugdtr); 95 95 96 96 descriptor_t *gdt_p = (descriptor_t *) cpugdtr.base; 97 97 size_t size = bitmap_size(elements); 98 98 gdt_tss_setlimit(&gdt_p[TSS_DES], TSS_BASIC_SIZE + size); 99 99 gdtr_load(&cpugdtr); 100 100 101 101 /* 102 102 * Before we load new TSS limit, the current TSS descriptor … … 106 106 tss_desc->type = AR_TSS; 107 107 tr_load(GDT_SELECTOR(TSS_DES)); 108 108 109 109 /* 110 110 * Update the generation count so that faults caused by
Note:
See TracChangeset
for help on using the changeset viewer.