📄 atapiio.cod
字号:
00000 AREA |.text| { |?SetTransferMode@CDisk@@QAAHE@Z| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 |?SetTransferMode@CDisk@@QAAHE@Z| PROC ; CDisk::SetTransferMode
; 380 : {
00000 |$L33376|
00000 e92d4030 stmdb sp!, {r4, r5, lr}
00004 |$M33374|
00004 e1a04001 mov r4, r1
00008 e1a05000 mov r5, r0
; 381 : BYTE bError, bStatus;
; 382 :
; 383 : //* * * CAMSDB040504 - Try forceing the IDE/ATA mode to
; 384 : //* * * a UDMA mode. (START)
; 385 : //bMode = 0x41;
; 386 : //DEBUGMSG( 1, (TEXT("ATAPI:SetTransferMode(...) FORCING mode to Mode=%02X\r\n"), bMode));
; 387 : //* * * CAMSDB040504 - Try forceing the IDE/ATA mode to
; 388 : //* * * a UDMA mode. (START)
; 389 :
; 390 : SelectDevice();
0000c e595364c ldr r3, [r5, #0x64C]
00010 e59f0154 ldr r0, [pc, #0x154]
00014 e3530000 cmp r3, #0
00018 03a030a0 moveq r3, #0xA0
0001c 13a030b0 movne r3, #0xB0
00020 e20310ff and r1, r3, #0xFF
00024 eb000000 bl WRITE_PORT_UCHAR
; 391 :
; 392 : WaitForDisc(WAIT_TYPE_NOT_BUSY, 100);
00028 e3a03000 mov r3, #0
0002c e3a02064 mov r2, #0x64
00030 e3a01002 mov r1, #2
00034 e1a00005 mov r0, r5
00038 eb000000 bl |?WaitForDisc@CDisk@@QAAHEKK@Z|
; 393 : WaitForDisc(WAIT_TYPE_READY, 1000);
0003c e3a03000 mov r3, #0
00040 e3a02ffa mov r2, #0xFA, 30
00044 e3a01003 mov r1, #3
00048 e1a00005 mov r0, r5
0004c eb000000 bl |?WaitForDisc@CDisk@@QAAHEKK@Z|
; 394 : WaitOnBusy(TRUE);
00050 e3a01001 mov r1, #1
00054 e1a00005 mov r0, r5
00058 eb000000 bl |?WaitOnBusy@CDisk@@QAAEH@Z|
; 395 :
; 396 : SelectDevice();
0005c e595364c ldr r3, [r5, #0x64C]
00060 e59f0104 ldr r0, [pc, #0x104]
00064 e3530000 cmp r3, #0
00068 03a030a0 moveq r3, #0xA0
0006c 13a030b0 movne r3, #0xB0
00070 e20310ff and r1, r3, #0xFF
00074 eb000000 bl WRITE_PORT_UCHAR
; 397 :
; 398 : WriteFeature(ATA_SET_TRANSFER_MODE);
00078 e3a00183 mov r0, #0x83, 2
0007c e2400696 sub r0, r0, #0x96, 12
00080 e3a01003 mov r1, #3
00084 eb000000 bl WRITE_PORT_UCHAR
; 399 : WriteSectorCount( bMode);
00088 e59f00ec ldr r0, [pc, #0xEC]
0008c e1a01004 mov r1, r4
00090 eb000000 bl WRITE_PORT_UCHAR
; 400 : WriteSectorNumber(0);
00094 e59f00dc ldr r0, [pc, #0xDC]
00098 e3a01000 mov r1, #0
0009c eb000000 bl WRITE_PORT_UCHAR
; 401 : WriteLowCount(0);
000a0 e59f00cc ldr r0, [pc, #0xCC]
000a4 e3a01000 mov r1, #0
000a8 eb000000 bl WRITE_PORT_UCHAR
; 402 : WriteHighCount(0);
000ac e59f00bc ldr r0, [pc, #0xBC]
000b0 e3a01000 mov r1, #0
000b4 eb000000 bl WRITE_PORT_UCHAR
; 403 : WriteCommand( IDE_COMMAND_SET_FEATURE);
000b8 e59f00a8 ldr r0, [pc, #0xA8]
000bc e3a010ef mov r1, #0xEF
000c0 eb000000 bl WRITE_PORT_UCHAR
; 404 :
; 405 : SelectDevice();
000c4 e595364c ldr r3, [r5, #0x64C]
000c8 e59f009c ldr r0, [pc, #0x9C]
000cc e3530000 cmp r3, #0
000d0 03a030a0 moveq r3, #0xA0
000d4 13a030b0 movne r3, #0xB0
000d8 e20310ff and r1, r3, #0xFF
000dc eb000000 bl WRITE_PORT_UCHAR
; 406 : WaitOnBusy(TRUE);
000e0 e3a01001 mov r1, #1
000e4 e1a00005 mov r0, r5
000e8 eb000000 bl |?WaitOnBusy@CDisk@@QAAEH@Z|
; 407 : //
; 408 : // Set Default PIO mode
; 409 : //
; 410 : SelectDevice();
000ec e595364c ldr r3, [r5, #0x64C]
000f0 e59f0074 ldr r0, [pc, #0x74]
000f4 e3530000 cmp r3, #0
000f8 03a030a0 moveq r3, #0xA0
000fc 13a030b0 movne r3, #0xB0
00100 e20310ff and r1, r3, #0xFF
00104 eb000000 bl WRITE_PORT_UCHAR
; 411 : WaitForDisc(WAIT_TYPE_NOT_BUSY, 200);
00108 e3a03000 mov r3, #0
0010c e3a020c8 mov r2, #0xC8
00110 e3a01002 mov r1, #2
00114 e1a00005 mov r0, r5
00118 eb000000 bl |?WaitForDisc@CDisk@@QAAHEKK@Z|
; 412 :
; 413 : bStatus = GetBaseStatus();
0011c e59f0044 ldr r0, [pc, #0x44]
00120 eb000000 bl READ_PORT_UCHAR
00124 e1a04000 mov r4, r0
; 414 : bError = GetError();
00128 e3a00183 mov r0, #0x83, 2
0012c e2400696 sub r0, r0, #0x96, 12
00130 eb000000 bl READ_PORT_UCHAR
; 415 : DEBUGMSG( 1, (TEXT("ATAPI:SetTransferMode Mode=%02X Status=%02X Error=%02X\r\n"), bMode, bStatus, bError));
; 416 : if ((bStatus & 0x1) && (bError & 0x4)) {
00134 e3140001 tst r4, #1
00138 0a000007 beq |$L32959|
0013c e3100004 tst r0, #4
00140 0a000005 beq |$L32959|
; 417 : ResetController(FALSE);
00144 e3a01000 mov r1, #0
00148 e1a00005 mov r0, r5
0014c eb000000 bl |?ResetController@CDisk@@QAAHH@Z|
; 418 : return FALSE;
00150 e3a00000 mov r0, #0
; 428 : }
00154 e8bd4030 ldmia sp!, {r4, r5, lr}
00158 e12fff1e bx lr
0015c |$L32959|
; 419 : }
; 420 :
; 421 : //* * * CAMSDB04/05/04 - Re-print capabilities after forced mode above (START)
; 422 : //DEBUGMSG( 1, (TEXT("* * * ATAPI:Doing AnalyzeDeviceCapabilities() again START.\r\n")));
; 423 : //AnalyzeDeviceCapabilities();
; 424 : //DEBUGMSG( 1, (TEXT("* * * ATAPI:Doing AnalyzeDeviceCapabilities() again END.\r\n")));
; 425 : //* * * CAMSDB04/05/04 - Re-print capabilities after forced mode above (END)
; 426 :
; 427 : return TRUE;
0015c e3a00001 mov r0, #1
; 428 : }
00160 e8bd4030 ldmia sp!, {r4, r5, lr}
00164 e12fff1e bx lr
00168 |$L33379|
00168 b6a000e0 DCD 0xb6a000e0
0016c b6a000c0 DCD 0xb6a000c0
00170 b6a000a0 DCD 0xb6a000a0
00174 b6a00080 DCD 0xb6a00080
00178 b6a00060 DCD 0xb6a00060
0017c b6a00040 DCD 0xb6a00040
00180 |$M33375|
ENDP ; |?SetTransferMode@CDisk@@QAAHE@Z|, CDisk::SetTransferMode
EXPORT |?SendIOCommand@CDisk@@QAAHKKE@Z| ; CDisk::SendIOCommand
IMPORT |__imp___rt_udiv|
; File d:\wince500\platform\bvdmain\drivers\atapi\diskmain.h
00000 AREA |.text| { |?SendIOCommand@CDisk@@QAAHKKE@Z| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 AREA |.pdata$$?SendIOCommand@CDisk@@QAAHKKE@Z|, PDATA, SELECTION=5, ASSOC=|.text| { |?SendIOCommand@CDisk@@QAAHKKE@Z| } ; comdat associative
|$T33444| DCD |$L33443|
DCD 0x40006601
; Function compile flags: /Ogsy
; File d:\wince500\platform\bvdmain\drivers\atapi\atapiio.cpp
00000 AREA |.text| { |?SendIOCommand@CDisk@@QAAHKKE@Z| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 |?SendIOCommand@CDisk@@QAAHKKE@Z| PROC ; CDisk::SendIOCommand
; 14 : {
00000 |$L33443|
00000 e92d43f0 stmdb sp!, {r4 - r9, lr}
00004 |$M33441|
00004 e1a07003 mov r7, r3
00008 e1a04002 mov r4, r2
0000c e1a06001 mov r6, r1
00010 e1a05000 mov r5, r0
; 15 : volatile ULONG ulIdeCtrl;
; 16 :
; 17 : //DEBUGMSG( ZONE_IO, (TEXT("ATAPI:SendIOCommand - Sector %d SectorsLeft %x Command %x\r\n"), dwStartSector,dwNumberOfSectors,bCmd));
; 18 :
; 19 : //* * * CAMSDB - Changed the zone (START)
; 20 : DEBUGMSG( ZONE_WARNING, (TEXT("ATAPI:SendIOCommand - Sector %d SectorsLeft %x Command %x\r\n"), dwStartSector,dwNumberOfSectors,bCmd));
; 21 : //* * * CAMSDB - Changed the zone (END)
; 22 :
; 23 : SelectDevice();
00014 e595e64c ldr lr, [r5, #0x64C]
00018 e59f0160 ldr r0, [pc, #0x160]
0001c e35e0000 cmp lr, #0
00020 03a020a0 moveq r2, #0xA0
00024 13a020b0 movne r2, #0xB0
00028 e20210ff and r1, r2, #0xFF
0002c eb000000 bl WRITE_PORT_UCHAR
; 24 :
; 25 : if (WaitOnBusy(FALSE))
00030 e3a01000 mov r1, #0
00034 e1a00005 mov r0, r5
00038 eb000000 bl |?WaitOnBusy@CDisk@@QAAEH@Z|
0003c e3500000 cmp r0, #0
; 26 : {
; 27 : //* * * CAMSDB - Changed the zone (START)
; 28 : //DEBUGMSG( ZONE_IO, (TEXT("ATAPI:SendIOCommand - Can't send a command!!! Status:%x Error:%x \r\n"), GetAltStatus(),GetError()));
; 29 : DEBUGMSG( ZONE_WARNING, (TEXT("ATAPI:SendIOCommand - Can't send a command!!! Status:%x Error:%x \r\n"), GetAltStatus(),GetError()));
; 30 : //* * * CAMSDB - Changed the zone (END)
; 31 :
; 32 : //* * * CAMSDB - Changed the zone (START)
; 33 : DEBUGMSG( ZONE_WARNING, (TEXT("ATAPI:SendIOCommand BAD EXIT\r\n")));
; 34 : //* * * CAMSDB - Changed the zone (END)
; 35 :
; 36 : return (FALSE);
00040 13a00000 movne r0, #0
; 87 : }
00044 18bd43f0 ldmneia sp!, {r4 - r9, lr}
00048 112fff1e bxne lr
; 37 : }
; 38 :
; 39 : //RETAILMSG(1,(TEXT("Test-------------------\r\n")));
; 40 :
; 41 : GetBaseStatus();
0004c e59f0128 ldr r0, [pc, #0x128]
00050 eb000000 bl READ_PORT_UCHAR
; 42 :
; 43 : //ulIdeCtrl = *IDE_CTRL;
; 44 :
; 45 : //
; 46 : // To transfer 256 Sectors set Sector Count Register to 0.
; 47 : //
; 48 : if(dwNumberOfSectors == MAX_SECT_PER_COMMAND)
00054 e3540c01 cmp r4, #1, 24
; 49 : dwNumberOfSectors = 0;
00058 03a04000 moveq r4, #0
; 50 :
; 51 :
; 52 : WriteSectorCount((BYTE)dwNumberOfSectors);
0005c e59f0130 ldr r0, [pc, #0x130]
00060 e20410ff and r1, r4, #0xFF
00064 eb000000 bl WRITE_PORT_UCHAR
; 53 :
; 54 : if (m_fLBAMode == TRUE)
00068 e5953678 ldr r3, [r5, #0x678]
0006c e3530001 cmp r3, #1
00070 1a000011 bne |$L32788|
; 55 : {
; 56 : //RETAILMSG(1,(TEXT("Test-2222222222------------------\r\n")));
; 57 : WriteSectorNumber( (BYTE)dwStartSector);
00074 e59f0114 ldr r0, [pc, #0x114]
00078 e20610ff and r1, r6, #0xFF
0007c eb000000 bl WRITE_PORT_UCHAR
; 58 : WriteLowCount((BYTE)(dwStartSector >> 8));
00080 e59f0104 ldr r0, [pc, #0x104]
00084 e1a03426 mov r3, r6, lsr #8
00088 e20310ff and r1, r3, #0xFF
0008c eb000000 bl WRITE_PORT_UCHAR
; 59 : WriteHighCount((BYTE)(dwStartSector >> 16));
00090 e59f00f0 ldr r0, [pc, #0xF0]
00094 e1a03826 mov r3, r6, lsr #16
00098 e20310ff and r1, r3, #0xFF
0009c eb000000 bl WRITE_PORT_UCHAR
; 60 : WriteDriveHeadReg((BYTE)((dwStartSector >> 24) | ATA_HEAD_LBA_MODE) | ((m_dwDevice == 0 ) ? ATA_HEAD_DRIVE_1 : ATA_HEAD_DRIVE_2));
000a0 e595364c ldr r3, [r5, #0x64C]
000a4 e3530000 cmp r3, #0
000a8 03a030a0 moveq r3, #0xA0
000ac 13a030b0 movne r3, #0xB0
000b0 e1833c26 orr r3, r3, r6, lsr #24
000b4 e38330e0 orr r3, r3, #0xE0
; 61 :
; 62 : } else { // translate LBA to CHS format
000b8 ea000026 b |$L33440|
000bc |$L32788|
; 63 :
; 64 : DWORD dwSectors = m_DiskInfo.di_sectors;
; 65 : DWORD dwHeads = m_DiskInfo.di_heads;
; 66 :
; 67 : WriteSectorNumber((BYTE)((dwStartSector % dwSectors) + 1));
000bc e59f30c0 ldr r3, [pc, #0xC0]
000c0 e5954670 ldr r4, [r5, #0x670]
000c4 e595866c ldr r8, [r5, #0x66C]
000c8 e5933000 ldr r3, [r3]
000cc e1a00004 mov r0, r4
000d0 e1a01006 mov r1, r6
000d4 e1a0e00f mov lr, pc
000d8 e12fff13 bx r3
000dc e1a09000 mov r9, r0
000e0 e59f00a8 ldr r0, [pc, #0xA8]
000e4 e2813001 add r3, r1, #1
000e8 e20310ff and r1, r3, #0xFF
000ec eb000000 bl WRITE_PORT_UCHAR
; 68 : WriteLowCount((BYTE) (dwStartSector /(dwSectors*dwHeads)));
000f0 e59f308c ldr r3, [pc, #0x8C]
000f4 e1a01006 mov r1, r6
000f8 e0000498 mul r0, r8, r4
000fc e5933000 ldr r3, [r3]
00100 e1a0e00f mov lr, pc
00104 e12fff13 bx r3
00108 e1a04000 mov r4, r0
0010c e59f0078 ldr r0, [pc, #0x78]
00110 e20410ff and r1, r4, #0xFF
00114 eb000000 bl WRITE_PORT_UCHAR
; 69 : WriteHighCount((BYTE)((dwStartSector /(dwSectors*dwHeads)) >> 8));
00118 e59f0068 ldr r0, [pc, #0x68]
0011c e1a03424 mov r3, r4, lsr #8
00120 e20310ff and r1, r3, #0xFF
00124 eb000000 bl WRITE_PORT_UCHAR
; 70 : WriteDriveHeadReg((BYTE)(((dwStartSector/dwSectors)% dwHeads) | ((m_dwDevice == 0 ) ? ATA_HEAD_DRIVE_1 : ATA_HEAD_DRIVE_2)));
00128 e595364c ldr r3, [r5, #0x64C]
0012c e1a00008 mov r0, r8
00130 e1a01009 mov r1, r9
00134 e3530000 cmp r3, #0
00138 e59f3044 ldr r3, [pc, #0x44]
0013c 03a040a0 moveq r4, #0xA0
00140 13a040b0 movne r4, #0xB0
00144 e5933000 ldr r3, [r3]
00148 e1a0e00f mov lr, pc
0014c e12fff13 bx r3
00150 e1843001 orr r3, r4, r1
00154 e1a02000 mov r2, r0
00158 |$L33440|
00158 e59f0020 ldr r0, [pc, #0x20]
0015c e20310ff and r1, r3, #0xFF
00160 eb000000 bl WRITE_PORT_UCHAR
; 71 : }
; 72 :
; 73 :
; 74 : //RETAILMSG(1,(TEXT("Test555555555555-------------------\r\n")));
; 75 :
; 76 : //* * * CAMSDB - Took this out for test, put it back 04/20/04 (START)
; 77 : WriteCommand(bCmd);
00164 e59f0010 ldr r0, [pc, #0x10]
00168 e1a01007 mov r1, r7
0016c eb000000 bl WRITE_PORT_UCHAR
; 78 : //* * * CAMSDB - Took this out for test, put it back 04/20/04 (END)
; 79 :
; 80 : //* * * CAMSDB - Changed the zone (START)
; 81 : DEBUGMSG( ZONE_WARNING, (TEXT("ATAPI:SendIOCommand GOOD EXIT\r\n")));
; 82 : //* * * CAMSDB - Changed the zone (END)
; 83 :
; 84 : //RETAILMSG(1,(TEXT("Test444444444444444-------------------\r\n")));
; 85 :
; 86 : return (TRUE);
00170 e3a00001 mov r0, #1
; 87 : }
00174 e8bd43f0 ldmia sp!, {r4 - r9, lr}
00178 e12fff1e bx lr
0017c |$L33446|
0017c b6a000e0 DCD 0xb6a000e0
00180 b6a000c0 DCD 0xb6a000c0
00184 00000000 DCD |__imp___rt_udiv|
00188 b6a000a0 DCD 0xb6a000a0
0018c b6a00080 DCD 0xb6a00080
00190 b6a00060 DCD 0xb6a00060
00194 b6a00040 DCD 0xb6a00040
00198 |$M33442|
ENDP ; |?SendIOCommand@CDisk@@QAAHKKE@Z|, CDisk::SendIOCommand
END
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -