Changeset 9fa16b20 in mainline for arch/amd64
- Timestamp:
- 2006-04-17T15:45:38Z (20 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 73e9b49
- Parents:
- 97a7eff
- Location:
- arch/amd64
- Files:
-
- 4 edited
-
include/pm.h (modified) (2 diffs)
-
include/proc/task.h (modified) (1 diff)
-
src/proc/scheduler.c (modified) (4 diffs)
-
src/proc/task.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
arch/amd64/include/pm.h
r97a7eff r9fa16b20 68 68 69 69 #define TSS_BASIC_SIZE 104 70 #define TSS_IOMAP_SIZE (16*1024+1) /* 16K for bitmap + 1 terminating byte for convenience */ 70 71 71 72 #ifndef __ASM__ … … 145 146 __u16 reserve4; 146 147 __u16 iomap_base; 147 __u8 iomap[ 0x10000 + 1]; /* 64K + 1 terminating byte */148 __u8 iomap[TSS_IOMAP_SIZE]; 148 149 } __attribute__ ((packed)); 149 150 typedef struct tss tss_t; -
arch/amd64/include/proc/task.h
r97a7eff r9fa16b20 32 32 #include <typedefs.h> 33 33 #include <arch/types.h> 34 #include <adt/bitmap.h> 34 35 35 36 typedef struct { 36 count_t iomap_size; 37 __u8 *iomap; 37 bitmap_t iomap; 38 38 } task_arch_t; 39 39 -
arch/amd64/src/proc/scheduler.c
r97a7eff r9fa16b20 37 37 #include <print.h> 38 38 #include <arch/pm.h> 39 #include <adt/bitmap.h> 39 40 40 41 /** Perform amd64 specific tasks needed before the new task is run. … … 44 45 void before_task_runs_arch(void) 45 46 { 46 size_t iomap_size;47 count_t bits; 47 48 ptr_16_64_t cpugdtr; 48 49 descriptor_t *gdt_p; … … 54 55 /* First, copy the I/O Permission Bitmap. */ 55 56 spinlock_lock(&TASK->lock); 56 iomap_size = TASK->arch.iomap_size; 57 if (iomap_size) { 58 ASSERT(TASK->arch.iomap); 59 memcpy(CPU->arch.tss->iomap, TASK->arch.iomap, iomap_size); 60 CPU->arch.tss->iomap[iomap_size] = 0xff; /* terminating byte */ 57 if ((bits = TASK->arch.iomap.bits)) { 58 bitmap_t iomap; 59 60 ASSERT(TASK->arch.iomap.map); 61 bitmap_initialize(&iomap, CPU->arch.tss->iomap, TSS_IOMAP_SIZE * 8); 62 bitmap_copy(&iomap, &TASK->arch.iomap, TASK->arch.iomap.bits); 63 /* 64 * It is safe to set the trailing four bits because of the extra 65 * convenience byte in TSS_IOMAP_SIZE. 66 */ 67 bitmap_set_range(&iomap, TASK->arch.iomap.bits, 4); 61 68 } 62 69 spinlock_unlock(&TASK->lock); … … 65 72 gdtr_store(&cpugdtr); 66 73 gdt_p = (descriptor_t *) cpugdtr.base; 67 gdt_tss_setlimit(&gdt_p[TSS_DES], TSS_BASIC_SIZE + iomap_size- 1);74 gdt_tss_setlimit(&gdt_p[TSS_DES], TSS_BASIC_SIZE + BITS2BYTES(bits) - 1); 68 75 gdtr_load(&cpugdtr); 69 76 } -
arch/amd64/src/proc/task.c
r97a7eff r9fa16b20 36 36 void task_create_arch(task_t *t) 37 37 { 38 t->arch.iomap = NULL; 39 t->arch.iomap_size = 0; 38 bitmap_initialize(&t->arch.iomap, NULL, 0); 40 39 }
Note:
See TracChangeset
for help on using the changeset viewer.
