📄 ata.lst
字号:
343 0238 1000B3AF sw $19,16($sp) 344 345 .loc 1 56 0 346 023c 2A183402 slt $3,$17,$20 347 .loc 1 58 0 348 0240 21904202 addu $18,$18,$2 59:/mnt/hgfs/boot/booter/source/ata.c **** buf += SECTOR_SIZE / 2; 349 .loc 1 59 0 350 .loc 1 56 0 351 0244 F6FF6014 bne $3,$0,$L34 352 0248 00021026 addiu $16,$16,512 353 354 $L36: 60:/mnt/hgfs/boot/booter/source/ata.c **** } 61:/mnt/hgfs/boot/booter/source/ata.c **** 62:/mnt/hgfs/boot/booter/source/ata.c **** return bytes_read; 63:/mnt/hgfs/boot/booter/source/ata.c **** } 355 .loc 1 63 0 356 024c 21104002 move $2,$18 357 0250 3400BF8F lw $31,52($sp) 358 0254 3000B68F lw $22,48($sp) 359 0258 2C00B58F lw $21,44($sp) 360 025c 2800B48F lw $20,40($sp) 361 0260 2400B38F lw $19,36($sp) 362 0264 2000B28F lw $18,32($sp) 363 0268 1C00B18F lw $17,28($sp) 364 026c 1800B08F lw $16,24($sp) 365 0270 0800E003 j $31 366 0274 3800BD27 addiu $sp,$sp,56 367 368 .set macro 369 .set reorder 370 $LFE5: 371 .end ata_read_sectors 372 .align 2 373 .globl ata_write_sectors 374 .ent ata_write_sectors 375 .type ata_write_sectors, @function 376 ata_write_sectors: 377 $LFB6: 64:/mnt/hgfs/boot/booter/source/ata.c **** 65:/mnt/hgfs/boot/booter/source/ata.c **** int ata_write_sectors(void* base, int sect, int n, short *buf, int reg_size) 66:/mnt/hgfs/boot/booter/source/ata.c **** { 378 .loc 1 66 0 379 .frame $sp,0,$31 # vars= 0, regs= 0/0, args= 0, gp= 0 380 .mask 0x00000000,0 381 .fmask 0x00000000,0 382 .set noreorder 383 .set nomacro 384 GAS LISTING /tmp/ccpN3UVf.s page 9 385 .loc 1 66 0 386 0278 1000AC8F lw $12,16($sp) 387 027c 21588000 move $11,$4 388 0280 2170A000 move $14,$5 389 $LBB12: 390 .loc 1 5 0 391 0284 C0680C00 sll $13,$12,3 392 0288 2310AC01 subu $2,$13,$12 393 $LBE12: 394 .loc 1 66 0 395 028c 2178C000 move $15,$6 396 0290 21C0E000 move $24,$7 397 $LBB13: 398 .loc 1 5 0 399 0294 21184400 addu $3,$2,$4 400 $L38: 401 $LBB14: 402 .loc 1 6 0 403 0298 00006290 lbu $2,0($3) 404 029c 00160200 sll $2,$2,24 405 02a0 03160200 sra $2,$2,24 67:/mnt/hgfs/boot/booter/source/ata.c **** volatile uint8* regs = (volatile uint8*) base; 68:/mnt/hgfs/boot/booter/source/ata.c **** 69:/mnt/hgfs/boot/booter/source/ata.c **** ata_wait_busy(®s[reg_size*ATA_REG_STATUS]); 70:/mnt/hgfs/boot/booter/source/ata.c **** 71:/mnt/hgfs/boot/booter/source/ata.c **** regs[reg_size*ATA_REG_SECTOR_COUNT] = 1; 406 .loc 1 71 0 407 .loc 1 6 0 408 02a4 FCFF4004 bltz $2,$L38 409 02a8 40280C00 sll $5,$12,1 410 411 $LBE14: 412 $LBE13: 72:/mnt/hgfs/boot/booter/source/ata.c **** regs[reg_size*ATA_REG_SECTOR_NUMBER] = sect & 0xff; 73:/mnt/hgfs/boot/booter/source/ata.c **** regs[reg_size*ATA_REG_CYLINDER_LOW] = (sect >> 8) & 0xff; 74:/mnt/hgfs/boot/booter/source/ata.c **** regs[reg_size*ATA_REG_CYLINDER_HIGH] = (sect >> 16) & 0xff; 75:/mnt/hgfs/boot/booter/source/ata.c **** regs[reg_size*ATA_REG_DEVICE_HEAD] = (sect >> 24) & 0x0f | 0xe0; 413 .loc 1 75 0 414 02ac 031E0E00 sra $3,$14,24 415 .loc 1 72 0 416 02b0 2130AC00 addu $6,$5,$12 417 .loc 1 73 0 418 02b4 80200C00 sll $4,$12,2 419 .loc 1 75 0 420 02b8 E0FF0224 li $2,-32 421 02bc 0F006330 andi $3,$3,0xf 422 .loc 1 74 0 423 02c0 21388C00 addu $7,$4,$12 424 .loc 1 75 0 425 02c4 40400600 sll $8,$6,1 426 02c8 25186200 or $3,$3,$2 427 .loc 1 71 0 428 02cc 2128AB00 addu $5,$5,$11 429 02d0 01000224 li $2,1 430 02d4 0000A2A0 sb $2,0($5) 431 .loc 1 74 0 432 02d8 2138EB00 addu $7,$7,$11GAS LISTING /tmp/ccpN3UVf.s page 10 433 .loc 1 75 0 434 02dc 21400B01 addu $8,$8,$11 435 .loc 1 72 0 436 02e0 2130CB00 addu $6,$6,$11 437 .loc 1 73 0 438 02e4 21208B00 addu $4,$4,$11 439 02e8 034A0E00 sra $9,$14,8 440 .loc 1 74 0 441 02ec 03540E00 sra $10,$14,16 76:/mnt/hgfs/boot/booter/source/ata.c **** 77:/mnt/hgfs/boot/booter/source/ata.c **** if (n == 1) 442 .loc 1 77 0 443 02f0 01000224 li $2,1 # 0x1 444 .loc 1 72 0 445 02f4 0000CEA0 sb $14,0($6) 446 .loc 1 73 0 447 02f8 000089A0 sb $9,0($4) 448 .loc 1 74 0 449 02fc 0000EAA0 sb $10,0($7) 450 .loc 1 75 0 451 0300 000003A1 sb $3,0($8) 78:/mnt/hgfs/boot/booter/source/ata.c **** regs[reg_size*ATA_REG_COMMAND] = 0x31; 452 .loc 1 78 0 453 .loc 1 77 0 454 0304 2900E211 beq $15,$2,$L54 455 0308 2310AC01 subu $2,$13,$12 456 79:/mnt/hgfs/boot/booter/source/ata.c **** else 80:/mnt/hgfs/boot/booter/source/ata.c **** regs[reg_size*ATA_REG_COMMAND] = 0xc5; 457 .loc 1 80 0 458 030c 21104B00 addu $2,$2,$11 459 0310 C5FF0324 li $3,-59 460 $L53: 461 0314 000043A0 sb $3,0($2) 462 $LBB15: 463 .loc 1 5 0 464 0318 2310AC01 subu $2,$13,$12 465 031c 21184B00 addu $3,$2,$11 466 $L43: 467 $LBB16: 468 .loc 1 6 0 469 0320 00006290 lbu $2,0($3) 470 0324 00160200 sll $2,$2,24 471 0328 03160200 sra $2,$2,24 472 032c FCFF4004 bltz $2,$L43 473 0330 2320AC01 subu $4,$13,$12 474 475 $LBE16: 476 $LBE15: 477 0334 21188B00 addu $3,$4,$11 478 0338 00006290 lbu $2,0($3) 479 033c 08004230 andi $2,$2,0x8 81:/mnt/hgfs/boot/booter/source/ata.c **** 82:/mnt/hgfs/boot/booter/source/ata.c **** ata_wait_busy(®s[reg_size*ATA_REG_STATUS]); 83:/mnt/hgfs/boot/booter/source/ata.c **** 84:/mnt/hgfs/boot/booter/source/ata.c **** int i = 0; 480 .loc 1 84 0GAS LISTING /tmp/ccpN3UVf.s page 11 481 .loc 1 6 0 482 0340 18004010 beq $2,$0,$L47 483 0344 21400000 move $8,$0 484 485 0348 00320F00 sll $6,$15,8 486 034c 1500C018 blez $6,$L47 487 0350 00000000 nop 488 489 0354 FEFF0727 addiu $7,$24,-2 490 0358 21188000 move $3,$4 491 $L51: 85:/mnt/hgfs/boot/booter/source/ata.c **** while((regs[reg_size*ATA_REG_STATUS] & ATA_STATUS_DRQ ) && i < ((SECTOR_SIZE/2)*n)) // while DRQ 86:/mnt/hgfs/boot/booter/source/ata.c **** { 87:/mnt/hgfs/boot/booter/source/ata.c **** *((uint16*) ®s[reg_size*ATA_REG_DATA]) = buf[i++]; 492 .loc 1 87 0 493 035c 0200E724 addiu $7,$7,2 494 0360 0000E294 lhu $2,0($7) 495 0364 01000825 addiu $8,$8,1 496 $LBB17: 497 .loc 1 5 0 498 0368 21186B00 addu $3,$3,$11 499 $LBE17: 500 .loc 1 87 0 501 036c 000062A5 sh $2,0($11) 502 $L48: 503 $LBB18: 504 $LBB19: 505 .loc 1 6 0 506 0370 00006290 lbu $2,0($3) 507 0374 00160200 sll $2,$2,24 508 0378 03160200 sra $2,$2,24 509 037c FCFF4004 bltz $2,$L48 510 0380 00000000 nop 511 512 $LBE19: 513 $LBE18: 514 0384 21188B00 addu $3,$4,$11 515 0388 00006290 lbu $2,0($3) 516 038c 08004230 andi $2,$2,0x8 517 0390 04004010 beq $2,$0,$L47 518 0394 21188000 move $3,$4 519 520 0398 2A100601 slt $2,$8,$6 521 039c EFFF4014 bne $2,$0,$L51 522 03a0 00000000 nop 523 524 $L47: 88:/mnt/hgfs/boot/booter/source/ata.c **** ata_wait_busy(®s[reg_size*ATA_REG_STATUS]); 89:/mnt/hgfs/boot/booter/source/ata.c **** } 90:/mnt/hgfs/boot/booter/source/ata.c **** 91:/mnt/hgfs/boot/booter/source/ata.c **** return i*2; 92:/mnt/hgfs/boot/booter/source/ata.c **** } 525 .loc 1 92 0 526 03a4 0800E003 j $31 527 03a8 40100800 sll $2,$8,1 528 529 $L54:GAS LISTING /tmp/ccpN3UVf.s page 12 530 .loc 1 78 0 531 03ac 21104B00 addu $2,$2,$11 532 03b0 C5000008 j $L53 533 03b4 31000324 li $3,49 534 535 .set macro 536 .set reorder 537 $LFE6: 538 .end ata_write_sectors 539 .section .debug_frame,"",@progbits 540 $Lframe0: 541 0000 0C000000 .4byte $LECIE0-$LSCIE0 542 $LSCIE0: 543 0004 FFFFFFFF .4byte 0xffffffff 544 0008 01 .byte 0x1 545 0009 00 .ascii "\000" 546 000a 01 .uleb128 0x1 547 000b 04 .sleb128 4 548 000c 1F .byte 0x1f 549 000d 0C .byte 0xc 550 000e 1D .uleb128 0x1d 551 000f 00 .uleb128 0x0 552 .align 2 553 $LECIE0: 554 $LSFDE0: 555 0010 0C000000 .4byte $LEFDE0-$LASFDE0 556 $LASFDE0: 557 0014 00000000 .4byte $Lframe0 558 0018 00000000 .4byte $LFB2 559 001c 1C000000 .4byte $LFE2-$LFB2 560 .align 2 561 $LEFDE0: 562 $LSFDE2: 563 0020 24000000 .4byte $LEFDE2-$LASFDE2 564 $LASFDE2: 565 0024 00000000 .4byte $Lframe0 566 0028 1C000000 .4byte $LFB3 567 002c 7C000000 .4byte $LFE3-$LFB3 568 0030 44 .byte 0x4 569 .4byte $LCFI0-$LFB3 570 0031 0E .byte 0xe 571 0032 28 .uleb128 0x28 572 0033 58 .byte 0x4 573 .4byte $LCFI6-$LCFI0 574 0034 11 .byte 0x11 575 0035 10 .uleb128 0x10 576 0036 7A .sleb128 -6 577 0037 11 .byte 0x11 578 0038 12 .uleb128 0x12 579 0039 7C .sleb128 -4 580 003a 11 .byte 0x11 581 003b 1F .uleb128 0x1f 582 003c 7F .sleb128 -1 583 003d 11 .byte 0x11 584 003e 11 .uleb128 0x11 585 003f 7B .sleb128 -5 586 0040 11 .byte 0x11GAS LISTING /tmp/ccpN3UVf.s page 13 587 0041 13 .uleb128 0x13 588 0042 7D .sleb128 -3 589 0043 11 .byte 0x11 590 0044 14 .uleb128 0x14 591 0045 7E .sleb128 -2 592 0046 0000 .align 2 593 $LEFDE2: 594 $LSFDE4: 595 0048 0C000000 .4byte $LEFDE4-$LASFDE4 596 $LASFDE4: 597 004c 00000000 .4byte $Lframe0 598 0050 98000000 .4byte $LFB4 599 0054 44010000 .4byte $LFE4-$LFB4 600 .align 2 601 $LEFDE4: 602 $LSFDE6: 603 0058 28000000 .4byte $LEFDE6-$LASFDE6 604 $LASFDE6: 605 005c 00000000 .4byte $Lframe0 606 0060 DC010000 .4byte $LFB5 607 0064 9C000000 .4byte $LFE5-$LFB5 608 0068 44 .byte 0x4 609 .4byte $LCFI7-$LFB5 610 0069 0E .byte 0xe 611 006a 38 .uleb128 0x38 612 006b 60 .byte 0x4 613 .4byte $LCFI15-$LCFI7 614 006c 11 .byte 0x11 615 006d 1F .uleb128 0x1f 616 006e 7F .sleb128 -1 617 006f 11 .byte 0x11 618 0070 10 .uleb128 0x10 619 0071 78 .sleb128 -8 620 0072 11 .byte 0x11 621 0073 11 .uleb128 0x11 622 0074 79 .sleb128 -7 623 0075 11 .byte 0x11 624 0076 12 .uleb128 0x12 625 0077 7A .sleb128 -6 626 0078 11 .byte 0x11 627 0079 13 .uleb128 0x13 628 007a 7B .sleb128 -5 629 007b 11 .byte 0x11 630 007c 14 .uleb128 0x14 631 007d 7C .sleb128 -4 632 007e 11 .byte 0x11 633 007f 15 .uleb128 0x15 634 0080 7D .sleb128 -3 635 0081 11 .byte 0x11 636 0082 16 .uleb128 0x16 637 0083 7E .sleb128 -2 638 .align 2 639 $LEFDE6: 640 $LSFDE8: 641 0084 0C000000 .4byte $LEFDE8-$LASFDE8 642 $LASFDE8: 643 0088 00000000 .4byte $Lframe0GAS LISTING /tmp/ccpN3UVf.s page 14 644 008c 78020000 .4byte $LFB6 645 0090 40010000 .4byte $LFE6-$LFB6 646 .align 2 647 $LEFDE8: 648 .align 0 649 .file 2 "/mnt/hgfs/boot/booter/include/example.h" 650 .file 3 "/mnt/hgfs/boot/booter/platforms/DB1200/platform.h" 651 .text 652 $Letext0: 653 03b8 00000000 .section .debug_info 653 00000000 654 0000 23030000 .4byte 0x323 655 0004 0200 .2byte 0x2 656 0006 00000000 .4byte $Ldebug_abbrev0 657 000a 04 .byte 0x4 658 000b 01 .uleb128 0x1 659 000c 00000000 .4byte $Ldebug_line0 660 0010 B8030000 .4byte $Letext0 661 0014 00000000 .4byte $Ltext0 662 0018 D3000000 .4byte $LASF19 663 001c 01 .byte 0x1 664 001d 7C000000 .4byte $LASF20 665 0021 02 .uleb128 0x2 666 0022 0D010000 .4byte $LASF0 667 0026 01 .byte 0x1 668 0027 06 .byte 0x6 669 0028 02 .uleb128 0x2 670 0029 E2000000 .4byte $LASF1 671 002d 02 .byte 0x2 672 002e 05 .byte 0x5 673 002f 03 .uleb128 0x3 674 0030 696E7400 .ascii "int\000" 675 0034 04 .byte 0x4 676 0035 05 .byte 0x5 677 0036 04 .uleb128 0x4 678 0037 2C010000 .4byte $LASF21 679 003b 02 .byte 0x2 680 003c 35 .byte 0x35 681 003d 41000000 .4byte 0x41 682 0041 02 .uleb128 0x2 683 0042 F1000000 .4byte $LASF2 684 0046 01 .byte 0x1 685 0047 08 .byte 0x8 686 0048 02 .uleb128 0x2 687 0049 19010000 .4byte $LASF3 688 004d 02 .byte 0x2 689 004e 07 .byte 0x7 690 004f 02 .uleb128 0x2 691 0050 1F000000 .4byte $LASF4 692 0054 04 .byte 0x4 693 0055 07 .byte 0x7 694 0056 02 .uleb128 0x2 695 0057 55000000 .4byte $LASF5 696 005b 08 .byte 0x8 697 005c 07 .byte 0x7 698 005d 02 .uleb128 0x2 699 005e 1F000000 .4byte $LASF4GAS LISTING /tmp/ccpN3UVf.s page 15 700 0062 04 .byte 0x4 701 0063 07 .byte 0x7 702 0064 05 .uleb128 0x5 703 0065 04 .byte 0x4 704 0066 02 .uleb128 0x2 705 0067 C1000000 .4byte $LASF6 706 006b 04 .byte 0x4 707 006c 07 .byte 0x7 708 006d 06 .uleb128 0x6 709 006e 87000000 .4byte 0x87 710 0072 01 .byte 0x1 711 0073 FF000000 .4byte $LASF7 712 0077 01 .byte 0x1 713 0078 05 .byte 0x5 714 0079 01 .byte 0x1 715 007a 03 .byte 0x3 716 007b 07 .uleb128 0x7
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -