|
|
1.1 ! root 1: /* ! 2: * Mach Operating System ! 3: * Copyright (c) 1991,1990,1989 Carnegie Mellon University. ! 4: * Copyright (c) 1994 The University of Utah and ! 5: * the Center for Software Science (CSS). ! 6: * All rights reserved. ! 7: * ! 8: * Permission to use, copy, modify and distribute this software and its ! 9: * documentation is hereby granted, provided that both the copyright ! 10: * notice and this permission notice appear in all copies of the ! 11: * software, derivative works or modified versions, and any portions ! 12: * thereof, and that both notices appear in supporting documentation. ! 13: * ! 14: * CARNEGIE MELLON, THE UNIVERSITY OF UTAH AND CSS ALLOW FREE USE OF ! 15: * THIS SOFTWARE IN ITS "AS IS" CONDITION, AND DISCLAIM ANY LIABILITY ! 16: * OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF ! 17: * THIS SOFTWARE. ! 18: * ! 19: * Carnegie Mellon requests users of this software to return to ! 20: * ! 21: * Software Distribution Coordinator or [email protected] ! 22: * School of Computer Science ! 23: * Carnegie Mellon University ! 24: * Pittsburgh PA 15213-3890 ! 25: * ! 26: * any improvements or extensions that they make and grant Carnegie Mellon ! 27: * the rights to redistribute these changes. ! 28: */ ! 29: #ifndef _I386_MOSS_TRAP_H_ ! 30: #define _I386_MOSS_TRAP_H_ ! 31: ! 32: #ifndef ASSEMBLER ! 33: ! 34: ! 35: /* This structure corresponds to the state of user registers ! 36: as saved upon kernel trap/interrupt entry. ! 37: As always, it is only a default implementation; ! 38: a well-optimized microkernel will probably want to override it ! 39: with something that allows better optimization. */ ! 40: ! 41: struct trap_state { ! 42: ! 43: /* Saved segment registers */ ! 44: unsigned int gs; ! 45: unsigned int fs; ! 46: unsigned int es; ! 47: unsigned int ds; ! 48: ! 49: /* PUSHA register state frame */ ! 50: unsigned int edi; ! 51: unsigned int esi; ! 52: unsigned int ebp; ! 53: unsigned int cr2; /* we save cr2 over esp for page faults */ ! 54: unsigned int ebx; ! 55: unsigned int edx; ! 56: unsigned int ecx; ! 57: unsigned int eax; ! 58: ! 59: unsigned int trapno; ! 60: unsigned int err; ! 61: ! 62: /* Processor state frame */ ! 63: unsigned int eip; ! 64: unsigned int cs; ! 65: unsigned int eflags; ! 66: unsigned int esp; ! 67: unsigned int ss; ! 68: ! 69: /* Virtual 8086 segment registers */ ! 70: unsigned int v86_es; ! 71: unsigned int v86_ds; ! 72: unsigned int v86_fs; ! 73: unsigned int v86_gs; ! 74: }; ! 75: ! 76: /* The actual trap_state frame pushed by the processor ! 77: varies in size depending on where the trap came from. */ ! 78: #define TR_KSIZE ((int)&((struct trap_state*)0)->esp) ! 79: #define TR_USIZE ((int)&((struct trap_state*)0)->v86_es) ! 80: #define TR_V86SIZE sizeof(struct trap_state) ! 81: ! 82: ! 83: #else ASSEMBLER ! 84: ! 85: #include <mach/machine/asm.h> ! 86: ! 87: #define UNEXPECTED_TRAP \ ! 88: movw %ss,%ax ;\ ! 89: movw %ax,%ds ;\ ! 90: movw %ax,%es ;\ ! 91: movl %esp,%eax ;\ ! 92: pushl %eax ;\ ! 93: call EXT(trap_dump_die) ;\ ! 94: ! 95: ! 96: #endif ASSEMBLER ! 97: ! 98: #include <mach/machine/trap.h> ! 99: ! 100: #endif _I386_MOSS_TRAP_H_
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.