Changeset 24bd23a in mainline
- Timestamp:
- 2005-09-07T08:34:16Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 909c6e3
- Parents:
- 7248e31
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/ia32/src/asm.S
r7248e31 r24bd23a 55 55 # 56 56 paging_on: 57 pushl %eax 58 movl %cr0,%eax 59 orl $(1<<31),%eax # paging on 60 andl $~((1<<30)|(1<<29)),%eax # clear Cache Disable and not Write Though 61 movl %eax,%cr0 57 movl %cr0,%edx 58 orl $(1<<31),%edx # paging on 59 andl $~((1<<30)|(1<<29)),%edx # clear Cache Disable and not Write Though 60 movl %edx,%cr0 62 61 jmp 0f 63 62 0: 64 popl %eax65 63 ret 66 64 … … 71 69 # 72 70 enable_l_apic_in_msr: 73 push a74 71 push %eax 72 75 73 movl $0x1b, %ecx 76 74 rdmsr … … 78 76 orl $(0xfee00000),%eax 79 77 wrmsr 80 81 pop a78 79 pop %eax 82 80 ret 83 81 … … 116 114 117 115 # CLNT 118 pushfl; 119 pop %eax ;120 and $0xFFFFBFFF,%eax ;121 push %eax ;122 popfl ;116 pushfl 117 pop %eax 118 and $0xFFFFBFFF,%eax 119 push %eax 120 popfl 123 121 124 122 125 123 126 124 # Test if this is interrupt with error word or not 127 mov $\i,%cl ;128 movl $1,%eax ;129 test $0xe0,%cl ;130 jnz 0f ;131 and $0x1f,%cl ;132 shl %cl,%eax ;133 and $ERROR_WORD_INTERRUPT_LIST,%eax ;134 jz 0f ;125 mov $\i,%cl 126 movl $1,%eax 127 test $0xe0,%cl 128 jnz 0f 129 and $0x1f,%cl 130 shl %cl,%eax 131 and $ERROR_WORD_INTERRUPT_LIST,%eax 132 jz 0f 135 133 136 134 137 135 # Return with error word 138 popa ;139 pop %ebp ;140 add $4,%esp ;# Skip error word141 iret ;136 popa 137 pop %ebp 138 add $4,%esp # Skip error word 139 iret 142 140 143 141 0: … … 168 166 # 169 167 inb: 170 push %edx171 168 xorl %eax,%eax 169 movl 4(%esp),%edx 170 inb %dx,%al 171 ret 172 173 174 ## I/O input (word) 175 # 176 # Get a word from I/O port and store it AX. 177 # 178 inw: 179 xorl %eax,%eax 180 movl 4(%esp),%edx 181 inw %dx,%ax 182 ret 183 184 185 ## I/O input (dword) 186 # 187 # Get a dword from I/O port and store it EAX. 188 # 189 inl: 190 xorl %eax,%eax 191 movl 4(%esp),%edx 192 inl %dx,%eax 193 ret 194 195 196 ## I/O output (byte) 197 # 198 # Send a byte to I/O port. 199 # 200 outb: 201 push %eax 202 172 203 movl 8(%esp),%edx 173 inb %dx,%al 174 pop %edx 175 ret 176 177 178 ## I/O input (word) 179 # 180 # Get a word from I/O port and store it AX. 181 # 182 inw: 183 push %edx 184 xorl %eax,%eax 204 movl 12(%esp),%eax 205 outb %al,%dx 206 207 pop %eax 208 ret 209 210 211 ## I/O output (word) 212 # 213 # Send a word to I/O port. 214 # 215 outw: 216 push %eax 217 185 218 movl 8(%esp),%edx 186 inw %dx,%ax 187 pop %edx 188 ret 189 190 191 ## I/O input (dword) 192 # 193 # Get a dword from I/O port and store it EAX. 194 # 195 inl: 196 push %edx 197 xorl %eax,%eax 219 movl 12(%esp),%eax 220 outw %ax,%dx 221 222 pop %eax 223 ret 224 225 226 ## I/O output (dword) 227 # 228 # Send a dword to I/O port. 229 # 230 outl: 231 push %eax 232 198 233 movl 8(%esp),%edx 199 inl %dx,%eax 200 pop %edx 201 ret 202 203 204 ## I/O output (byte) 205 # 206 # Send a byte to I/O port. 207 # 208 outb: 209 push %ebp 210 movl %esp,%ebp 211 pusha 212 213 movl 8(%ebp),%edx 214 movl 12(%ebp),%eax 215 outb %al,%dx 216 217 popa 218 pop %ebp 219 ret 220 221 222 ## I/O output (word) 223 # 224 # Send a word to I/O port. 225 # 226 outw: 227 push %ebp 228 movl %esp,%ebp 229 pusha 230 231 movl 8(%ebp),%edx 232 movl 12(%ebp),%eax 233 outw %ax,%dx 234 235 popa 236 pop %ebp 237 ret 238 239 240 ## I/O output (dword) 241 # 242 # Send a dword to I/O port. 243 # 244 outl: 245 push %ebp 246 movl %esp,%ebp 247 pusha 248 249 movl 8(%ebp),%edx 250 movl 12(%ebp),%eax 234 movl 12(%esp),%eax 251 235 outl %eax,%dx 252 236 253 popa 254 pop %ebp 237 pop %eax 255 238 ret 256 239 … … 263 246 # The memory areas cannot overlap. 264 247 # 265 SRC=1 2266 DST= 8267 CNT= 16248 SRC=16 249 DST=12 250 CNT=20 268 251 memcpy: 269 push %ebp 270 movl %esp,%ebp 271 pusha 272 273 cld 274 movl CNT(%ebp),%ecx 275 movl DST(%ebp),%edi 276 movl SRC(%ebp),%esi 252 push %esi 253 push %edi 254 255 movl CNT(%esp),%ecx 256 movl DST(%esp),%edi 257 movl SRC(%esp),%esi 277 258 278 259 rep movsb %ds:(%esi),%es:(%edi) 279 260 280 pop a281 pop %e bp261 pop %edi 262 pop %esi 282 263 ret 283 264 … … 289 270 # byte value defined by 3rd argument. 290 271 # 291 DST= 8292 CNT=1 2293 X= 16272 DST=12 273 CNT=16 274 X=20 294 275 memsetb: 295 push %ebp 296 movl %esp,%ebp 297 pusha 298 299 cld 300 movl CNT(%ebp),%ecx 301 movl DST(%ebp),%edi 302 movl X(%ebp),%eax 276 push %eax 277 push %edi 278 279 movl CNT(%esp),%ecx 280 movl DST(%esp),%edi 281 movl X(%esp),%eax 303 282 304 283 rep stosb %al,%es:(%edi) 305 284 306 pop a307 pop %e bp285 pop %edi 286 pop %eax 308 287 ret 309 288 … … 315 294 # word value defined by 3rd argument. 316 295 # 317 DST= 8318 CNT=1 2319 X= 16296 DST=12 297 CNT=16 298 X=20 320 299 memsetw: 321 push %ebp 322 movl %esp,%ebp 323 pusha 324 325 cld 326 movl CNT(%ebp),%ecx 327 movl DST(%ebp),%edi 328 movl X(%ebp),%eax 300 push %eax 301 push %edi 302 303 movl CNT(%esp),%ecx 304 movl DST(%esp),%edi 305 movl X(%esp),%eax 329 306 330 307 rep stosw %ax,%es:(%edi) 331 308 332 popa 333 pop %ebp 309 pop %edi 310 pop %eax 311 334 312 ret 335 313 … … 346 324 CNT=20 347 325 memcmp: 348 push %ebp 349 subl $4,%esp 350 movl %esp,%ebp 351 352 pusha 353 354 cld 355 movl CNT(%ebp),%ecx 356 movl DST(%ebp),%edi 357 movl SRC(%ebp),%esi 326 push %esi 327 push %edi 328 329 movl CNT(%esp),%ecx 330 movl DST(%esp),%edi 331 movl SRC(%esp),%esi 358 332 359 333 repe cmpsb %es:(%edi),%ds:(%esi) 360 movl %ecx,(%ebp) 361 362 popa 363 364 movl (%ebp),%eax # return value => %eax (zero on success) 365 addl $4,%esp 366 pop %ebp 334 movl %ecx,%eax # %ecx contains the return value (zero on success) 335 336 pop %edi 337 pop %esi 367 338 368 339 ret … … 372 343 .global utext 373 344 utext: 374 xor %ax,%ax ;375 mov %ax,%ds ;376 mov %ax,%es ;377 mov %ax,%fs ;378 mov %ax,%gs ;345 xor %ax,%ax 346 mov %ax,%ds 347 mov %ax,%es 348 mov %ax,%fs 349 mov %ax,%gs 379 350 0: 380 351 int $48
Note:
See TracChangeset
for help on using the changeset viewer.