Changeset 445 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Initialization


Ignore:
Timestamp:
Aug 29, 2012, 12:59:23 PM (12 years ago)
Author:
krille_n_@…
google:author:
krille_n_@hotmail.com
Message:

Changes:

  • A speed optimization to the eSHL_IM macro for 386 and higher. This change breaks emulation in the sense that the macro will fail when given a memory operand as the first parameter.
  • Memory_SumCXbytesFromESSItoAL now returns with the zero flag set/cleared according to the result.
  • Unrolled all the 8 bit READ transfer loops to do 16 bytes per iteration. Added a new macro (UNROLL_SECTORS_IN_CX_TO_OWORDS) as part of it. Size wise this is expensive but I think it should be worth the ROM space. The WRITE transfer loops were left as is since writes are rare anyway (<10% of all disk I/O IIRC).
  • Minor optimizations and fixes here and there.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/AtaID.asm

    r442 r445  
    44
    55;
    6 ; XTIDE Universal BIOS and Associated Tools 
     6; XTIDE Universal BIOS and Associated Tools
    77; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
    88;
     
    1111; the Free Software Foundation; either version 2 of the License, or
    1212; (at your option) any later version.
    13 ; 
     13;
    1414; This program is distributed in the hope that it will be useful,
    1515; but WITHOUT ANY WARRANTY; without even the implied warranty of
    1616; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    17 ; GNU General Public License for more details.     
     17; GNU General Public License for more details.
    1818; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
    19 ;       
     19;
    2020
    2121; Section containing code
     
    2828;   Returns:
    2929;       CF:     Set if failed to verify ATA-ID
    30 ;               Cleared if ATA-ID verified succesfully
     30;               Cleared if ATA-ID verified successfully
    3131;   Corrupts registers:
    3232;       AX, BX, CX
     
    4444    call    .CompareCHorSfromOffsetBXtoMaxValueInCX
    4545
    46     add     bx, BYTE ATA1.wHeadCnt - ATA1.wCylCnt
     46    mov     bl, ATA1.wHeadCnt & 0FFh
    4747    mov     cx, MAX_VALID_PCHS_HEADS
    4848    call    .CompareCHorSfromOffsetBXtoMaxValueInCX
    4949
    50     add     bx, BYTE ATA1.wSPT - ATA1.wHeadCnt
     50    mov     bl, ATA1.wSPT & 0FFh
    5151    mov     cl, MAX_VALID_PCHS_SECTORS_PER_TRACK
    5252    call    .CompareCHorSfromOffsetBXtoMaxValueInCX
     
    6969    ; Check checksum byte
    7070    mov     cx, ATA6_size
    71     call    Memory_SumCXbytesFromESSItoAL
    72     test    al, al
     71    call    Memory_SumCXbytesFromESSItoAL       ; Returns with ZF set according to result
    7372    jnz     SHORT .FailedToVerifyAtaID
    7473
     
    119118    mov     bx, [es:si+ATA1.bPioMode]
    120119    mov     ax, bx                  ; AH = 0, AL = PIO mode 0, 1 or 2
    121     shl     bx, 1                   ; Shift for WORD lookup
     120    eSHL_IM bx, 1                   ; Shift for WORD lookup
    122121    mov     cx, [cs:bx+.rgwPio0to2CycleTimeInNanosecs]
    123122
     
    187186;--------------------------------------------------------------------
    188187AtaID_GetActiveTimeToAXfromPioModeInBX:
    189     shl     bx, 1
    190     mov     ax, [cs:bx+.rgwPioModeToActiveTimeNs]
    191     shr     bx, 1
    192     ret
    193 
    194 .rgwPioModeToActiveTimeNs:
    195     dw      PIO_0_MIN_ACTIVE_TIME_NS
    196     dw      PIO_1_MIN_ACTIVE_TIME_NS
    197     dw      PIO_2_MIN_ACTIVE_TIME_NS
    198     dw      PIO_3_MIN_ACTIVE_TIME_NS
    199     dw      PIO_4_MIN_ACTIVE_TIME_NS
    200     dw      PIO_5_MIN_ACTIVE_TIME_NS
    201     dw      PIO_6_MIN_ACTIVE_TIME_NS
     188    eMOVZX  ax, [cs:bx+.rgbPioModeToActiveTimeNs]
     189    ret
     190
     191.rgbPioModeToActiveTimeNs:
     192    db      PIO_0_MIN_ACTIVE_TIME_NS
     193    db      PIO_1_MIN_ACTIVE_TIME_NS
     194    db      PIO_2_MIN_ACTIVE_TIME_NS
     195    db      PIO_3_MIN_ACTIVE_TIME_NS
     196    db      PIO_4_MIN_ACTIVE_TIME_NS
     197    db      PIO_5_MIN_ACTIVE_TIME_NS
     198    db      PIO_6_MIN_ACTIVE_TIME_NS
    202199
    203200%endif ; MODULE_ADVANCED_ATA
Note: See TracChangeset for help on using the changeset viewer.