summaryrefslogtreecommitdiff
path: root/i386/i386/i386asm.sym
blob: 6c1f68a4a4395899f6d2ef005661d94ca86616af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
/*
 * Mach Operating System
 * Copyright (c) 1991,1990 Carnegie Mellon University
 * Copyright (c) 1991 IBM Corporation
 * All Rights Reserved.
 *
 * Permission to use, copy, modify and distribute this software and its
 * documentation is hereby granted, provided that both the copyright
 * notice and this permission notice appear in all copies of the
 * software, derivative works or modified versions, and any portions
 * thereof, and that both notices appear in supporting documentation,
 * and that the name IBM not be used in advertising or publicity
 * pertaining to distribution of the software without specific, written
 * prior permission.
 *
 * CARNEGIE MELLON AND IBM ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS IS"
 * CONDITION.  CARNEGIE MELLON AND IBM DISCLAIM ANY LIABILITY OF ANY KIND FOR
 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
 *
 * Carnegie Mellon requests users of this software to return to
 *
 *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
 *  School of Computer Science
 *  Carnegie Mellon University
 *  Pittsburgh PA 15213-3890
 *
 * any improvements or extensions that they make and grant Carnegie Mellon
 * the rights to redistribute these changes.
 */

#include <cpus.h>
#include <mach_kdb.h>
#include <stat_time.h>

/*
 * Pass field offsets to assembly code.
 */
#include <sys/reboot.h>

#include <kern/thread.h>
#include <kern/task.h>
#include <kern/syscall_emulation.h>
#include <i386/thread.h>
#include <i386/pmap.h>
#include "vm_param.h"
#include "gdt.h"
#include "ldt.h"
#include "mp_desc.h"

#include <oskit/x86/seg.h>
#include <oskit/x86/tss.h>
#include <oskit/x86/base_idt.h>


offset	thread			th	pcb
offset	thread			th	task
offset	thread			th	recover
offset	thread			th	kernel_stack
offset	thread			th	swap_func

offset	task			task	eml_dispatch	TASK_EMUL

offset	eml_dispatch		eml	disp_min	DISP_MIN
offset	eml_dispatch		eml	disp_count	DISP_COUNT
offset	eml_dispatch		eml	disp_vector	DISP_VECTOR

expr	&STACK_IKS(0)->k_ebx				KSS_EBX
expr	&STACK_IKS(0)->k_esp				KSS_ESP
expr	&STACK_IKS(0)->k_ebp				KSS_EBP
expr	&STACK_IKS(0)->k_esi				KSS_ESI
expr	&STACK_IKS(0)->k_edi				KSS_EDI
expr	&STACK_IKS(0)->k_eip				KSS_EIP
size	i386_kernel_state	iks

size	i386_exception_link	iel

offset	trap_state		r	cs
offset	trap_state		r	esp
offset	trap_state		r	eax
offset	trap_state		r	trapno
offset	trap_state		r	err
offset	trap_state		r	eflags		R_EFLAGS
offset	trap_state		r	eip
offset	trap_state		r	cr2

offset	i386_interrupt_state	i	eip
offset	i386_interrupt_state	i	cs
offset	i386_interrupt_state	i	efl

offset	x86_tss			tss	esp0
offset	x86_tss			tss	ss0

expr	I386_PGBYTES					NBPG
expr	VM_MIN_ADDRESS
expr	VM_MAX_ADDRESS
expr	VM_MIN_KERNEL_ADDRESS				KERNELBASE
expr	KERNEL_STACK_SIZE

expr	PDESHIFT
expr	PTESHIFT
expr	PTEMASK

expr	INTEL_PTE_PFN					PTE_PFN
expr	INTEL_PTE_VALID					PTE_V
expr	INTEL_PTE_WRITE					PTE_W
expr	~INTEL_PTE_VALID				PTE_INVALID
expr	NPTES						PTES_PER_PAGE
expr	INTEL_PTE_VALID|INTEL_PTE_WRITE			INTEL_PTE_KERNEL

expr	IDTSZ
expr	GDTSZ
expr	LDTSZ

expr	KERNEL_CS
expr	KERNEL_DS
/*expr	KERNEL_GS*/
expr	KERNEL_TSS
expr	KERNEL_LDT

expr	(VM_MIN_KERNEL_ADDRESS>>PDESHIFT)*sizeof(pt_entry_t)	KERNELBASEPDE

#if	NCPUS > 1
offset	mp_desc_table		mp	gdt
offset	mp_desc_table		mp	idt
#endif	/* NCPUS > 1 */
expr	INTSTACK_SIZE

#if	!STAT_TIME
offset	timer			tm	low_bits	LOW_BITS
offset	timer			tm	high_bits	HIGH_BITS
offset	timer			tm	high_bits_check	HIGH_BITS_CHECK
expr	TIMER_HIGH_UNIT
offset	thread			th	system_timer
offset	thread			th	user_timer
#endif