VirtualBox

Ignore:
Timestamp:
Mar 26, 2024 8:20:34 PM (10 months ago)
Author:
vboxsync
Message:

ValKit/bootsectors: Added Bs3TestQueryCfgU16 and made it and the existing Bs3TestQueryCfgU8/Bool/U32 variants take a default value and return it when the query fails. bugref:9898

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-TestQueryCfgU8.asm

    r98103 r104071  
    4242
    4343;;
    44 ; @cproto   BS3_DECL(uint8_t) Bs3TestQueryCfgU8(uint16_t uCfg);
    45 ; @cproto   BS3_DECL(bool)    Bs3TestQueryCfgBool(uint16_t uCfg);
     44; @cproto   BS3_DECL(uint8_t) Bs3TestQueryCfgU8(uint16_t uCfg, uint8_t bDefault);
     45; @cproto   BS3_DECL(bool)    Bs3TestQueryCfgBool(uint16_t uCfg, bool fDefault);
    4646;
    4747BS3_GLOBAL_NAME_EX BS3_CMN_NM(Bs3TestQueryCfgBool), function, 3
    4848BS3_PROC_BEGIN_CMN Bs3TestQueryCfgU8, BS3_PBC_HYBRID
    49         BS3_CALL_CONV_PROLOG 1
     49        BS3_CALL_CONV_PROLOG 2
    5050        push    xBP
    5151        mov     xBP, xSP
    5252        push    xDX
     53        push    xCX
    5354
    54         xor     al, al
    5555        cmp     byte [BS3_DATA16_WRT(g_fbBs3VMMDevTesting)], 0
    5656        je      .no_vmmdev
     
    7373        ; Read back the result.
    7474        in      al, dx
     75%if TMPL_BITS == 16
     76        mov     cl, al
     77        in      ax, dx                      ; check the 'okay'
     78        cmp     ax, VMMDEV_TESTING_QUERY_CFG_OKAY_TAIL & 0xffff
     79        mov     al, cl
     80        mov     ah, 0
     81%else
     82        movzx   ecx, al
     83        in      eax, dx                     ; check the 'okay'
     84        cmp     eax, VMMDEV_TESTING_QUERY_CFG_OKAY_TAIL
     85        mov     eax, ecx
     86%endif
     87        jne     .no_vmmdev
     88
     89.return:
     90        pop     xCX
     91        pop     xDX
     92        pop     xBP
     93        BS3_CALL_CONV_EPILOG 2
     94        BS3_HYBRID_RET
    7595
    7696.no_vmmdev:
    77         pop     xDX
    78         pop     xBP
    79         BS3_CALL_CONV_EPILOG 1
    80         BS3_HYBRID_RET
     97%if TMPL_BITS == 16
     98        mov     al, [xBP + xCB + cbCurRetAddr + xCB]
     99%else
     100        movzx   eax, byte [xBP + xCB + cbCurRetAddr + xCB]
     101%endif
     102        jmp     .return
    81103BS3_PROC_END_CMN   Bs3TestQueryCfgU8
    82104
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette