Rev 472 | Rev 513 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
425 | victor | 1 | $Revision: 479 $ |
431 | serge | 2 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
3 | ;; ;; |
||
4 | ;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; |
||
5 | ;; Distributed under terms of the GNU General Public License ;; |
||
6 | ;; ;; |
||
7 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
||
164 | serge | 8 | |
9 | drw0 equ 10010010b ; data read/write dpl0 |
||
10 | drw3 equ 11110010b ; data read/write dpl3 |
||
11 | cpl0 equ 10011010b ; code read dpl0 |
||
12 | cpl3 equ 11111010b ; code read dpl3 |
||
13 | |||
14 | D32 equ 01000000b ; 32bit segment |
||
465 | serge | 15 | G32 equ 10000000b ; page gran |
164 | serge | 16 | |
17 | |||
18 | ;;;;;;;;;;;;cpu_caps flags;;;;;;;;;;;;;;;; |
||
19 | |||
20 | CPU_386 equ 3 |
||
21 | CPU_486 equ 4 |
||
22 | CPU_PENTIUM equ 5 |
||
23 | CPU_P6 equ 6 |
||
24 | CPU_PENTIUM4 equ 0x0F |
||
25 | |||
26 | CAPS_FPU equ 00 ;on-chip x87 floating point unit |
||
27 | CAPS_VME equ 01 ;virtual-mode enhancements |
||
28 | CAPS_DE equ 02 ;debugging extensions |
||
29 | CAPS_PSE equ 03 ;page-size extensions |
||
30 | CAPS_TSC equ 04 ;time stamp counter |
||
31 | CAPS_MSR equ 05 ;model-specific registers |
||
32 | CAPS_PAE equ 06 ;physical-address extensions |
||
33 | CAPS_MCE equ 07 ;machine check exception |
||
34 | CAPS_CX8 equ 08 ;CMPXCHG8B instruction |
||
35 | CAPS_APIC equ 09 ;on-chip advanced programmable |
||
36 | ; interrupt controller |
||
37 | ; 10 ;unused |
||
38 | CAPS_SEP equ 11 ;SYSENTER and SYSEXIT instructions |
||
39 | CAPS_MTRR equ 12 ;memory-type range registers |
||
40 | CAPS_PGE equ 13 ;page global extension |
||
41 | CAPS_MCA equ 14 ;machine check architecture |
||
42 | CAPS_CMOV equ 15 ;conditional move instructions |
||
43 | CAPS_PAT equ 16 ;page attribute table |
||
44 | |||
45 | CAPS_PSE36 equ 17 ;page-size extensions |
||
46 | CAPS_PSN equ 18 ;processor serial number |
||
47 | CAPS_CLFLUSH equ 19 ;CLFUSH instruction |
||
48 | |||
49 | CAPS_DS equ 21 ;debug store |
||
50 | CAPS_ACPI equ 22 ;thermal monitor and software |
||
51 | ;controlled clock supported |
||
52 | CAPS_MMX equ 23 ;MMX instructions |
||
53 | CAPS_FXSR equ 24 ;FXSAVE and FXRSTOR instructions |
||
54 | CAPS_SSE equ 25 ;SSE instructions |
||
55 | CAPS_SSE2 equ 26 ;SSE2 instructions |
||
56 | CAPS_SS equ 27 ;self-snoop |
||
57 | CAPS_HTT equ 28 ;hyper-threading technology |
||
58 | CAPS_TM equ 29 ;thermal monitor supported |
||
59 | CAPS_IA64 equ 30 ;IA64 capabilities |
||
60 | CAPS_PBE equ 31 ;pending break enable |
||
61 | |||
62 | ;ecx |
||
63 | CAPS_SSE3 equ 32 ;SSE3 instructions |
||
64 | ; 33 |
||
65 | ; 34 |
||
66 | CAPS_MONITOR equ 35 ;MONITOR/MWAIT instructions |
||
67 | CAPS_DS_CPL equ 36 ; |
||
68 | CAPS_VMX equ 37 ;virtual mode extensions |
||
69 | ; 38 ; |
||
70 | CAPS_EST equ 39 ;enhansed speed step |
||
71 | CAPS_TM2 equ 40 ;thermal monitor2 supported |
||
72 | ; 41 |
||
73 | CAPS_CID equ 42 ; |
||
74 | ; 43 |
||
75 | ; 44 |
||
76 | CAPS_CX16 equ 45 ;CMPXCHG16B instruction |
||
77 | CAPS_xTPR equ 46 ; |
||
78 | ; |
||
79 | ;reserved |
||
80 | ; |
||
81 | ;ext edx /ecx |
||
82 | CAPS_SYSCAL equ 64 ; |
||
83 | CAPS_XD equ 65 ;execution disable |
||
84 | CAPS_FFXSR equ 66 ; |
||
85 | CAPS_RDTSCP equ 67 ; |
||
86 | CAPS_X64 equ 68 ; |
||
87 | CAPS_3DNOW equ 69 ; |
||
88 | CAPS_3DNOWEXT equ 70 ; |
||
89 | CAPS_LAHF equ 71 ; |
||
90 | CAPS_CMP_LEG equ 72 ; |
||
91 | CAPS_SVM equ 73 ;secure virual machine |
||
92 | CAPS_ALTMOVCR8 equ 74 ; |
||
93 | |||
378 | serge | 94 | ; CPU MSR names |
375 | Ghost | 95 | MSR_SYSENTER_CS equ 0x174 |
96 | MSR_SYSENTER_ESP equ 0x175 |
||
97 | MSR_SYSENTER_EIP equ 0x176 |
||
98 | MSR_AMD_EFER equ 0xC0000080 ; Extended Feature Enable Register |
||
99 | MSR_AMD_STAR equ 0xC0000081 ; SYSCALL/SYSRET Target Address Register |
||
164 | serge | 100 | |
168 | serge | 101 | CR0_PE equ 0x00000001 ;protected mode |
102 | CR0_MP equ 0x00000002 ;monitor fpu |
||
103 | CR0_EM equ 0x00000004 ;fpu emulation |
||
104 | CR0_TS equ 0x00000008 ;task switch |
||
105 | CR0_ET equ 0x00000010 ;extension type hardcoded to 1 |
||
106 | CR0_NE equ 0x00000020 ;numeric error |
||
107 | CR0_WP equ 0x00010000 ;write protect |
||
108 | CR0_AM equ 0x00040000 ;alignment check |
||
109 | CR0_NW equ 0x20000000 ;not write-through |
||
110 | CR0_CD equ 0x40000000 ;cache disable |
||
111 | CR0_PG equ 0x80000000 ;paging |
||
112 | |||
113 | |||
164 | serge | 114 | CR4_VME equ 0x0001 |
115 | CR4_PVI equ 0x0002 |
||
116 | CR4_TSD equ 0x0004 |
||
117 | CR4_DE equ 0x0008 |
||
118 | CR4_PSE equ 0x0010 |
||
119 | CR4_PAE equ 0x0020 |
||
120 | CR4_MCE equ 0x0040 |
||
121 | CR4_PGE equ 0x0080 |
||
122 | CR4_PCE equ 0x0100 |
||
123 | CR4_OSFXSR equ 0x0200 |
||
124 | CR4_OSXMMEXPT equ 0x0400 |
||
125 | |||
168 | serge | 126 | SSE_IE equ 0x0001 |
127 | SSE_DE equ 0x0002 |
||
128 | SSE_ZE equ 0x0004 |
||
129 | SSE_OE equ 0x0008 |
||
130 | SSE_UE equ 0x0010 |
||
131 | SSE_PE equ 0x0020 |
||
132 | SSE_DAZ equ 0x0040 |
||
133 | SSE_IM equ 0x0080 |
||
134 | SSE_DM equ 0x0100 |
||
135 | SSE_ZM equ 0x0200 |
||
136 | SSE_OM equ 0x0400 |
||
137 | SSE_UM equ 0x0800 |
||
138 | SSE_PM equ 0x1000 |
||
139 | SSE_FZ equ 0x8000 |
||
164 | serge | 140 | |
168 | serge | 141 | SSE_INIT equ (SSE_IM+SSE_DM+SSE_ZM+SSE_OM+SSE_UM+SSE_PM) |
164 | serge | 142 | |
143 | |||
465 | serge | 144 | struc TSS |
145 | { |
||
146 | ._back rw 2 |
||
147 | ._esp0 rd 1 |
||
148 | ._ss0 rw 2 |
||
149 | ._esp1 rd 1 |
||
150 | ._ss1 rw 2 |
||
151 | ._esp2 rd 1 |
||
152 | ._ss2 rw 2 |
||
153 | ._cr3 rd 1 |
||
154 | ._eip rd 1 |
||
155 | ._eflags rd 1 |
||
156 | ._eax rd 1 |
||
157 | ._ecx rd 1 |
||
158 | ._edx rd 1 |
||
159 | ._ebx rd 1 |
||
160 | ._esp rd 1 |
||
161 | ._ebp rd 1 |
||
162 | ._esi rd 1 |
||
163 | ._edi rd 1 |
||
164 | ._es rw 2 |
||
165 | ._cs rw 2 |
||
166 | ._ss rw 2 |
||
167 | ._ds rw 2 |
||
168 | ._fs rw 2 |
||
169 | ._gs rw 2 |
||
170 | ._ldt rw 2 |
||
171 | ._trap rw 1 |
||
172 | ._io rw 1 |
||
173 | rb 24 |
||
174 | ._io_map_0 rb 4096 |
||
175 | ._io_map_1 rb 4096 |
||
176 | } |
||
164 | serge | 177 | |
465 | serge | 178 | virtual at 0 |
179 | TSS TSS |
||
180 | end virtual |
||
181 | |||
182 | TSS_SIZE equ (128+8192) |
||
183 | |||
184 | OS_BASE equ 0x80000000 |
||
185 | |||
186 | window_data equ OS_BASE |
||
187 | |||
380 | serge | 188 | CURRENT_TASK equ (OS_BASE+0x0003000) |
189 | TASK_COUNT equ (OS_BASE+0x0003004) |
||
190 | TASK_BASE equ (OS_BASE+0x0003010) |
||
191 | TASK_DATA equ (OS_BASE+0x0003020) |
||
192 | TASK_EVENT equ (OS_BASE+0x0003020) |
||
164 | serge | 193 | |
380 | serge | 194 | mouseunder equ (OS_BASE+0x0006900) |
195 | FLOPPY_BUFF equ (OS_BASE+0x0008000) |
||
381 | serge | 196 | ACTIVE_PROC_STACK equ (OS_BASE+0x000A400) ;unused |
380 | serge | 197 | idts equ (OS_BASE+0x000B100) |
198 | WIN_STACK equ (OS_BASE+0x000C000) |
||
199 | WIN_POS equ (OS_BASE+0x000C400) |
||
200 | FDD_BUFF equ (OS_BASE+0x000D000) |
||
164 | serge | 201 | |
381 | serge | 202 | ;unused ? only one reference |
380 | serge | 203 | ENABLE_TASKSWITCH equ (OS_BASE+0x000E000) |
381 | serge | 204 | |
380 | serge | 205 | PUTPIXEL equ (OS_BASE+0x000E020) |
206 | GETPIXEL equ (OS_BASE+0x000E024) |
||
381 | serge | 207 | |
208 | ;unused ? only one reference |
||
380 | serge | 209 | BANK_SWITCH equ (OS_BASE+0x000E030) |
164 | serge | 210 | |
381 | serge | 211 | ;unused ? store mousepointer |
380 | serge | 212 | MOUSE_PICTURE equ (OS_BASE+0x000F200) |
381 | serge | 213 | |
380 | serge | 214 | MOUSE_VISIBLE equ (OS_BASE+0x000F204) |
381 | serge | 215 | WIN_TEMP_XY equ (OS_BASE+0x000F300) |
380 | serge | 216 | KEY_COUNT equ (OS_BASE+0x000F400) |
217 | KEY_BUFF equ (OS_BASE+0x000F401) |
||
164 | serge | 218 | |
380 | serge | 219 | BTN_COUNT equ (OS_BASE+0x000F500) |
220 | BTN_BUFF equ (OS_BASE+0x000F501) |
||
164 | serge | 221 | |
380 | serge | 222 | CPU_FREQ equ (OS_BASE+0x000F600) |
381 | serge | 223 | |
224 | ;unused ? no active references |
||
380 | serge | 225 | MOUSE_PORT equ (OS_BASE+0x000F604) |
164 | serge | 226 | |
381 | serge | 227 | ;unused |
380 | serge | 228 | PS2_CHUNK equ (OS_BASE+0x000FB00) |
381 | serge | 229 | |