Changeset 88 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Common/HStatus.asm
- Timestamp:
- Jan 27, 2011, 8:14:13 AM (14 years ago)
- google:author:
- aitotat
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Common/HStatus.asm
r34 r88 1 ; File name : HStatus.asm 2 ; Project name : IDE BIOS 3 ; Created date : 15.12.2009 4 ; Last update : 23.8.2010 5 ; Author : Tomi Tilli 1 ; Project name : XTIDE Universal BIOS 6 2 ; Description : IDE Status Register polling functions. 7 3 … … 176 172 ALIGN JUMP_ALIGN 177 173 HStatus_PollBsyAndFlg: 178 call SoftDelay_InitTimeout; Initialize timeout counter174 call InitializeTimeoutWithTicksInCL ; Initialize timeout counter 179 175 in al, dx ; Discard contents for first read 180 176 ; (should read Alternate Status Register) … … 188 184 ALIGN JUMP_ALIGN 189 185 .UpdateTimeout: 190 call S oftDelay_UpdTimeout ; Update timeout counter186 call SetCFifTimeout 191 187 jnc SHORT .PollLoop ; Loop if time left (sets CF on timeout) 192 188 jmp HError_ProcessTimeoutAfterPollingBSYandSomeOtherStatusBit … … 210 206 ALIGN JUMP_ALIGN 211 207 HStatus_PollBsy: 212 call SoftDelay_InitTimeout; Initialize timeout counter208 call InitializeTimeoutWithTicksInCL ; Initialize timeout counter 213 209 in al, dx ; Discard contents for first read 214 210 ; (should read Alternate Status Register) … … 218 214 test al, FLG_IDE_ST_BSY ; Controller busy? 219 215 jz SHORT GetErrorCodeFromPollingToAH ; If not, jump to check errors 220 call S oftDelay_UpdTimeout; Update timeout counter216 call SetCFifTimeout ; Update timeout counter 221 217 jnc SHORT .PollLoop ; Loop if time left (sets CF on timeout) 222 218 ALIGN JUMP_ALIGN 223 219 GetErrorCodeFromPollingToAH: 224 220 jmp HError_ProcessErrorsAfterPollingBSY 221 222 223 ;-------------------------------------------------------------------- 224 ; InitializeTimeoutWithTicksInCL 225 ; Parameters: 226 ; CL: Timeout value in system timer ticks 227 ; DS: Segment to RAMVARS 228 ; Returns: 229 ; Nothing 230 ; Corrupts registers: 231 ; CX 232 ;-------------------------------------------------------------------- 233 ALIGN JUMP_ALIGN 234 InitializeTimeoutWithTicksInCL: 235 push bx 236 xchg cx, ax 237 238 xor ah, ah ; Timeout ticks now in AX 239 mov bx, RAMVARS.wTimeoutCounter 240 call TimerTicks_InitializeTimeoutFromAX 241 242 xchg ax, cx ; Restore AX 243 pop bx 244 ret 245 246 ;-------------------------------------------------------------------- 247 ; SetCFifTimeout 248 ; Parameters: 249 ; DS: Segment to RAMVARS 250 ; Returns: 251 ; Nothing 252 ; Corrupts registers: 253 ; CX 254 ;-------------------------------------------------------------------- 255 ALIGN JUMP_ALIGN 256 SetCFifTimeout: 257 push bx 258 xchg cx, ax 259 260 mov bx, RAMVARS.wTimeoutCounter 261 call TimerTicks_GetTimeoutTicksLeftToAXfromDSBX 262 263 xchg ax, cx ; Restore AX 264 pop bx 265 ret
Note:
See TracChangeset
for help on using the changeset viewer.