📄 ep931xide.cod
字号:
; 107 : //
; 108 : // PIO Mode 0 - Delay for 70ns.
; 109 : // PIO Mode 1 - Delay for 50ns.
; 110 : // PIO Mode 2 - Delay for 30ns.
; 111 : // PIO Mode 3 - Delay for 30ns.
; 112 : // PIO Mode 4 - Delay for 25ns.
; 113 : //
; 114 : // For a write to a APB register with HCLK at 100Mhz is 130ns.
; 115 : // No extra delay is needed.
; 116 : //
; 117 : *IDE_CTRL = ulControl &= ~IDE_CTRL_DIOR;
; 118 :
; 119 : //
; 120 : // See Section 10.2.2 of the ATA/ATAPI Specification Version 5 for Delay
; 121 : // Information.
; 122 : //
; 123 : // PIO Mode 0 - Delay for 290ns.
; 124 : // PIO Mode 1 - Delay for 290s.
; 125 : // PIO Mode 2 - Delay for 290s.
; 126 : // PIO Mode 3 - Delay for 80ns.
; 127 : // PIO Mode 4 - Delay for 70ns.
; 128 : //
; 129 : // For a write to a APB register with HCLK at 100Mhz is 130ns.
; 130 : // No extra delay is needed.
; 131 : //
; 132 :
; 133 : *IDE_CTRL = ulControl |= IDE_CTRL_DIOR;
; 134 :
; 135 : uiValue = *IDE_DATAIN;
00014 e59f1030 ldr r1, [pc, #0x30]
00018 e3c33020 bic r3, r3, #0x20
0001c e3832020 orr r2, r3, #0x20
00020 e58e3000 str r3, [lr]
; 136 :
; 137 : if(ulRegister == CSDA_DATA_REG)
00024 e3500002 cmp r0, #2
00028 e58e2000 str r2, [lr]
0002c e5912000 ldr r2, [r1]
; 138 : {
; 139 : return(uiValue & 0xFFFF);
00030 03a03cff moveq r3, #0xFF, 24
00034 038330ff orreq r3, r3, #0xFF
00038 00020003 andeq r0, r2, r3
; 144 : }
; 145 : }
0003c 049de004 ldreq lr, [sp], #4
; 140 : }
; 141 : else
; 142 : {
; 143 : return(uiValue & 0xFF);
00040 120200ff andne r0, r2, #0xFF
; 144 : }
; 145 : }
00044 149de004 ldrne lr, [sp], #4
00048 e12fff1e bx lr
0004c |$L33778|
0004c b00a0014 DCD 0xb00a0014
00050 |$M33774|
ENDP ; |?ATAReadRegister@@YAKK@Z|, ATAReadRegister
EXPORT |?ATAWriteRegister@@YAXKI@Z| ; ATAWriteRegister
00000 AREA |.text| { |?ATAWriteRegister@@YAXKI@Z| }, CODE, ARM, SELECTION=2 ; comdat any
00000 AREA |.pdata$$?ATAWriteRegister@@YAXKI@Z|, PDATA, SELECTION=5, ASSOC=|.text| { |?ATAWriteRegister@@YAXKI@Z| } ; comdat associative
|$T33788| DCD |$L33787|
DCD 0x40000e01
; Function compile flags: /Ogsy
00000 AREA |.text| { |?ATAWriteRegister@@YAXKI@Z| }, CODE, ARM, SELECTION=2 ; comdat any
00000 |?ATAWriteRegister@@YAXKI@Z| PROC ; ATAWriteRegister
; 155 : {
00000 |$L33787|
00000 e52de004 str lr, [sp, #-4]!
00004 |$M33785|
; 156 : register ULONG ulControl;
; 157 :
; 158 :
; 159 : //
; 160 : // Setup the control register for a write.
; 161 : //
; 162 : *IDE_CTRL = ulControl = IDE_CTRL_DIOR | IDE_CTRL_DIOW | ulRegister;
00004 e3a0e20b mov lr, #0xB, 4
00008 e38ee80a orr lr, lr, #0xA, 16
0000c e3803060 orr r3, r0, #0x60
; 163 : *IDE_DATAOUT = uiData;
00010 e59f001c ldr r0, [pc, #0x1C]
00014 e58e3000 str r3, [lr]
; 164 :
; 165 : //
; 166 : // See Section 10.2.2 of the ATA/ATAPI Specification Version 5 for Delay
; 167 : // Information.
; 168 : //
; 169 : // PIO Mode 0 - Delay for 70ns.
; 170 : // PIO Mode 1 - Delay for 50ns.
; 171 : // PIO Mode 2 - Delay for 30ns.
; 172 : // PIO Mode 3 - Delay for 30ns.
; 173 : // PIO Mode 4 - Delay for 25ns.
; 174 : //
; 175 : // For a write to a APB register with HCLK at 100Mhz is 130ns.
; 176 : // No extra delay is needed.
; 177 : //
; 178 : *IDE_CTRL = ulControl &= ~IDE_CTRL_DIOW;
00018 e3c33040 bic r3, r3, #0x40
; 179 :
; 180 : //
; 181 : // See Section 10.2.2 of the ATA/ATAPI Specification Version 5 for Delay
; 182 : // Information.
; 183 : //
; 184 : // PIO Mode 0 - Delay for 290ns.
; 185 : // PIO Mode 1 - Delay for 290s.
; 186 : // PIO Mode 2 - Delay for 290s.
; 187 : // PIO Mode 3 - Delay for 80ns.
; 188 : // PIO Mode 4 - Delay for 70ns.
; 189 : //
; 190 : // For a write to a APB register with HCLK at 100Mhz is 130ns.
; 191 : // No extra delay is needed.
; 192 : //
; 193 : *IDE_CTRL = ulControl |= IDE_CTRL_DIOW;
0001c e3832040 orr r2, r3, #0x40
00020 e5801000 str r1, [r0]
00024 e58e3000 str r3, [lr]
00028 e58e2000 str r2, [lr]
; 194 :
; 195 : //
; 196 : // See Section 10.2.2 of the ATA/ATAPI Specification Version 5 for Delay
; 197 : // Information. There are also delays from all the returns and
; 198 : // function calls so I am not putting the full delay in.
; 199 : //
; 200 : // PIO Mode 0 - N/A
; 201 : // PIO Mode 1 - N/A
; 202 : // PIO Mode 2 - N/A
; 203 : // PIO Mode 3 - Delay for 70ns.
; 204 : // PIO Mode 4 - Delay for 25ns.
; 205 : //
; 206 : // This 25ns easily gets eaten up by the function call return call and the few
; 207 : // necessary instructions in the functions were it is used.
; 208 : // DELAY_10NS
; 209 : // DELAY_10NS
; 210 : // DELAY_10NS
; 211 : }
0002c e49de004 ldr lr, [sp], #4
00030 e12fff1e bx lr
00034 |$L33790|
00034 b00a0010 DCD 0xb00a0010
00038 |$M33786|
ENDP ; |?ATAWriteRegister@@YAXKI@Z|, ATAWriteRegister
EXPORT |?Init@CEP931xPort@@QAAHXZ| ; CEP931xPort::Init
EXPORT |??_C@_1GM@ENNICEOF@?$AAC?$AAE?$AAP?$AA9?$AA3?$AA1?$AAx?$AAD?$AAi?$AAs?$AAk?$AA?3?$AA?3?$AAI?$AAn?$AAi?$AAt?$AA?5?$AAF?$AAa@| [ DATA ] ; `string'
EXPORT |??_C@_1HC@FCKPCMNB@?$AAC?$AAE?$AAP?$AA9?$AA3?$AA1?$AAx?$AAD?$AAi?$AAs?$AAk?$AA?3?$AA?3?$AAI?$AAn?$AAi?$AAt?$AA?5?$AAF?$AAa@| [ DATA ] ; `string'
IMPORT |CreateEventW|
IMPORT |NKDbgPrintfW|
IMPORT |AllocPhysMem|
IMPORT |InterruptInitialize|
00000 AREA |.text| { |?Init@CEP931xPort@@QAAHXZ| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 AREA |.pdata$$?Init@CEP931xPort@@QAAHXZ|, PDATA, SELECTION=5, ASSOC=|.text| { |?Init@CEP931xPort@@QAAHXZ| } ; comdat associative
|$T33812| DCD |$L33811|
DCD 0x40004602
00000 AREA |.rdata| { |??_C@_1HC@FCKPCMNB@?$AAC?$AAE?$AAP?$AA9?$AA3?$AA1?$AAx?$AAD?$AAi?$AAs?$AAk?$AA?3?$AA?3?$AAI?$AAn?$AAi?$AAt?$AA?5?$AAF?$AAa@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_1HC@FCKPCMNB@?$AAC?$AAE?$AAP?$AA9?$AA3?$AA1?$AAx?$AAD?$AAi?$AAs?$AAk?$AA?3?$AA?3?$AAI?$AAn?$AAi?$AAt?$AA?5?$AAF?$AAa@| DCB "C"
DCB 0x0, "E", 0x0, "P", 0x0, "9", 0x0, "3", 0x0, "1", 0x0, "x"
DCB 0x0, "D", 0x0, "i", 0x0, "s", 0x0, "k", 0x0, ":", 0x0, ":"
DCB 0x0, "I", 0x0, "n", 0x0, "i", 0x0, "t", 0x0, " ", 0x0, "F"
DCB 0x0, "a", 0x0, "i", 0x0, "l", 0x0, "e", 0x0, "d", 0x0, " "
DCB 0x0, "t", 0x0, "o", 0x0, " ", 0x0, "C", 0x0, "r", 0x0, "e"
DCB 0x0, "a", 0x0, "t", 0x0, "e", 0x0, " ", 0x0, "I", 0x0, "n"
DCB 0x0, "i", 0x0, "t", 0x0, "i", 0x0, "a", 0x0, "l", 0x0, "i"
DCB 0x0, "z", 0x0, "e", 0x0, "I", 0x0, "n", 0x0, "t", 0x0, "e"
DCB 0x0, "r", 0x0, "r", 0x0, "u", 0x0, "p", 0x0, "t", 0x0, 0xd
DCB 0x0, 0xa, 0x0, 0x0, 0x0 ; `string'
00000 AREA |.rdata| { |??_C@_1GM@ENNICEOF@?$AAC?$AAE?$AAP?$AA9?$AA3?$AA1?$AAx?$AAD?$AAi?$AAs?$AAk?$AA?3?$AA?3?$AAI?$AAn?$AAi?$AAt?$AA?5?$AAF?$AAa@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_1GM@ENNICEOF@?$AAC?$AAE?$AAP?$AA9?$AA3?$AA1?$AAx?$AAD?$AAi?$AAs?$AAk?$AA?3?$AA?3?$AAI?$AAn?$AAi?$AAt?$AA?5?$AAF?$AAa@| DCB "C"
DCB 0x0, "E", 0x0, "P", 0x0, "9", 0x0, "3", 0x0, "1", 0x0, "x"
DCB 0x0, "D", 0x0, "i", 0x0, "s", 0x0, "k", 0x0, ":", 0x0, ":"
DCB 0x0, "I", 0x0, "n", 0x0, "i", 0x0, "t", 0x0, " ", 0x0, "F"
DCB 0x0, "a", 0x0, "i", 0x0, "l", 0x0, "e", 0x0, "d", 0x0, " "
DCB 0x0, "t", 0x0, "o", 0x0, " ", 0x0, "C", 0x0, "r", 0x0, "e"
DCB 0x0, "a", 0x0, "t", 0x0, "e", 0x0, " ", 0x0, "I", 0x0, "n"
DCB 0x0, "t", 0x0, "e", 0x0, "r", 0x0, "r", 0x0, "u", 0x0, "p"
DCB 0x0, "t", 0x0, " ", 0x0, "E", 0x0, "v", 0x0, "e", 0x0, "n"
DCB 0x0, "t", 0x0, ".", 0x0, 0xd, 0x0, 0xa, 0x0, 0x0, 0x0 ; `string'
; Function compile flags: /Ogsy
00000 AREA |.text| { |?Init@CEP931xPort@@QAAHXZ| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 |?Init@CEP931xPort@@QAAHXZ| PROC ; CEP931xPort::Init
; 224 : {
00000 |$L33811|
00000 e92d4070 stmdb sp!, {r4 - r6, lr}
00004 e24dd004 sub sp, sp, #4
00008 |$M33809|
00008 e1a05000 mov r5, r0
; 225 : BOOL bResult = TRUE;
; 226 : ULONG ulShifted;
; 227 : int ThreadPriority;
; 228 :
; 229 : //
; 230 : // Find out the shift factor for the page size.
; 231 : //
; 232 : m_ulPageShift = 0;
; 233 : ulShifted = UserKInfo[KINX_PAGESIZE];
0000c e3a03004 mov r3, #4
00010 e3a06000 mov r6, #0
00014 e2433c35 sub r3, r3, #0x35, 24
00018 e5856050 str r6, [r5, #0x50]
0001c e5933000 ldr r3, [r3]
; 234 : while(ulShifted != 1)
00020 e3530001 cmp r3, #1
00024 0a000005 beq |$L32973|
00028 e3a02000 mov r2, #0
0002c |$L32972|
; 235 : {
; 236 : m_ulPageShift++;
; 237 : ulShifted= ulShifted>>1;
0002c e1a030a3 mov r3, r3, lsr #1
00030 e3530001 cmp r3, #1
00034 e2822001 add r2, r2, #1
00038 1afffffb bne |$L32972|
; 234 : while(ulShifted != 1)
0003c e5852050 str r2, [r5, #0x50]
00040 |$L32973|
; 238 : }
; 239 :
; 240 :
; 241 : //
; 242 : // Create an event and a thread, and then associate them.
; 243 : //
; 244 : m_hIdeIntEvent = CreateEvent( NULL, FALSE, FALSE, NULL);
00040 e3a03000 mov r3, #0
00044 e3a02000 mov r2, #0
00048 e3a01000 mov r1, #0
0004c e3a00000 mov r0, #0
00050 eb000000 bl CreateEventW
00054 e3500000 cmp r0, #0
00058 e5850000 str r0, [r5]
; 245 : if(!m_hIdeIntEvent)
0005c 1a000003 bne |$L33802|
; 246 : {
; 247 : DEBUGMSG( ZONE_INIT, (TEXT("CEP931xDisk::Init Failed to Create Interrupt Event.\r\n")));
; 248 : RETAILMSG(1,(TEXT("CEP931xDisk::Init Failed to Create Interrupt Event.\r\n")));
00060 e59f00ac ldr r0, [pc, #0xAC]
00064 eb000000 bl NKDbgPrintfW
00068 |$L33797|
; 249 : bResult = FALSE;
00068 e3a04000 mov r4, #0
; 250 : }
; 251 :
; 252 : //
; 253 : // Get the event handle, register the interrupt, and then
; 254 : // associate it with the event.
; 255 : //
; 256 : if(bResult)
0006c ea000020 b |$L32983|
00070 |$L33802|
; 257 : {
; 258 : bResult = InterruptInitialize(SYSINTR_IDE, m_hIdeIntEvent, NULL, 0) ;
00070 e1a01000 mov r1, r0
00074 e3a00029 mov r0, #0x29
00078 e3a03000 mov r3, #0
0007c e3a02000 mov r2, #0
00080 eb000000 bl InterruptInitialize
00084 e1b04000 movs r4, r0
; 259 : if(!bResult)
00088 1a000002 bne |$L33801|
; 260 : {
; 261 : DEBUGMSG( ZONE_INIT, (TEXT("CEP931xDisk::Init Failed to InitializeInterrupt.\r\n")));
; 262 : RETAILMSG(1,(TEXT("CEP931xDisk::Init Failed to Create InitializeInterrupt\r\n")));
0008c e59f007c ldr r0, [pc, #0x7C]
00090 eb000000 bl NKDbgPrintfW
; 263 : }
; 264 : }
; 265 :
; 266 : //
; 267 : // Allocate a DMA buffer if the buffer is unaligned. This is used if the
; 268 : // buffer is unaligned. HalAllocateCommonBuffer
; 269 : //
; 270 : if(bResult)
00094 ea000016 b |$L32983|
00098 |$L33801|
; 271 : {
; 272 : m_pucStaticBuffer = (PUCHAR) AllocPhysMem
; 273 : (
; 274 : 131072,
; 275 : PAGE_READWRITE | PAGE_NOCACHE,
; 276 : 0,
; 277 : 0,
; 278 : &m_ulStaticPhysBuff
; 279 : );
00098 e285302c add r3, r5, #0x2C
0009c e58d3000 str r3, [sp]
000a0 e3a03000 mov r3, #0
000a4 e3a02000 mov r2, #0
000a8 e3a01f81 mov r1, #0x81, 30
000ac e3a00802 mov r0, #2, 16
000b0 eb000000 bl AllocPhysMem
000b4 e3500000 cmp r0, #0
000b8 e5850028 str r0, [r5, #0x28]
; 280 : bResult = m_pucStaticBuffer ?TRUE:FALSE;
000bc 0affffe9 beq |$L33797|
; 281 : }
; 282 :
; 283 :
; 284 : if(bResult)
; 285 : {
; 286 : //
; 287 : // Initialize the IDE interface to PIO mode 4.
; 288 : //
; 289 : *IDE_CFG = IDE_CFG_IDEEN | IDE_CFG_PIOEN | IDE_CFG_PIO4 | (1 <<IDE_CFG_WST_SHIFT);
000c0 e59f2044 ldr r2, [pc, #0x44]
000c4 e3a03d05 mov r3, #5, 26
000c8 e3833003 orr r3, r3, #3
; 290 :
; 291 : *IDE_CTRL = IDE_CTRL_DIOR | IDE_CTRL_DIOW | CSDA_DATA_REG;
; 292 :
; 293 :
; 294 : //
; 295 : // Make sure that MDMA and UDMA are disabled.
; 296 : //
; 297 : *IDE_MDMAOP = 0;
000cc e59f0034 ldr r0, [pc, #0x34]
000d0 e3a0120b mov r1, #0xB, 4
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -