Changeset a35b458 in mainline for kernel/arch/ia32/src/ddi/ddi.c
- Timestamp:
- 2018-03-02T20:10:49Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f1380b7
- Parents:
- 3061bc1
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:38:31)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:10:49)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ia32/src/ddi/ddi.c
r3061bc1 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_32_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_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 … … 105 105 gdt_p[TSS_DES].access = AR_PRESENT | AR_TSS | DPL_KERNEL; 106 106 tr_load(GDT_SELECTOR(TSS_DES)); 107 107 108 108 /* 109 109 * Update the generation count so that faults caused by
Note:
See TracChangeset
for help on using the changeset viewer.