|
|
1.1 ! root 1: /* ! 2: * Copyright (c) 1995-1994 The University of Utah and ! 3: * the Computer Systems Laboratory at the University of Utah (CSL). ! 4: * All rights reserved. ! 5: * ! 6: * Permission to use, copy, modify and distribute this software is hereby ! 7: * granted provided that (1) source code retains these copyright, permission, ! 8: * and disclaimer notices, and (2) redistributions including binaries ! 9: * reproduce the notices in supporting documentation, and (3) all advertising ! 10: * materials mentioning features or use of this software display the following ! 11: * acknowledgement: ``This product includes software developed by the ! 12: * Computer Systems Laboratory at the University of Utah.'' ! 13: * ! 14: * THE UNIVERSITY OF UTAH AND CSL ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS ! 15: * IS" CONDITION. THE UNIVERSITY OF UTAH AND CSL DISCLAIM ANY LIABILITY OF ! 16: * ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. ! 17: * ! 18: * CSL requests users of this software to return to [email protected] any ! 19: * improvements that they make and grant CSL redistribution rights. ! 20: * ! 21: * Author: Bryan Ford, University of Utah CSL ! 22: */ ! 23: ! 24: #include <mach/machine/tss.h> ! 25: #include <mach/machine/proc_reg.h> ! 26: ! 27: #include "cpu.h" ! 28: #include "real_tss.h" ! 29: #include "vm_param.h" ! 30: #include "config.h" ! 31: ! 32: #ifdef ENABLE_REAL_TSS ! 33: ! 34: static void real_tss_init() ! 35: { ! 36: /* Only initialize once. */ ! 37: if (!real_tss.ss0) ! 38: { ! 39: /* Initialize the real-mode TSS. */ ! 40: real_tss.ss0 = KERNEL_DS; ! 41: real_tss.esp0 = get_esp(); ! 42: real_tss.io_bit_map_offset = sizeof(real_tss); ! 43: ! 44: /* Set the last byte in the I/O bitmap to all 1's. */ ! 45: ((unsigned char*)&real_tss)[REAL_TSS_SIZE] = 0xff; ! 46: } ! 47: } ! 48: ! 49: void ! 50: cpu_gdt_init_REAL_TSS(struct cpu *cpu) ! 51: { ! 52: real_tss_init(); ! 53: ! 54: fill_gdt_descriptor(cpu, REAL_TSS, ! 55: kvtolin(&real_tss), REAL_TSS_SIZE-1, ! 56: ACC_PL_K|ACC_TSS, 0); ! 57: } ! 58: ! 59: #endif ENABLE_REAL_TSS
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.