VirtualBox

Changeset 14799 in vbox for trunk/include


Ignore:
Timestamp:
Nov 28, 2008 11:59:56 PM (16 years ago)
Author:
vboxsync
Message:

#3202: assembly hacking for weird darwin kernel.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/hwacc_vmx.h

    r14650 r14799  
    12031203 * @param   pVMXOn      Physical address of VMXON structure
    12041204 */
    1205 #if RT_INLINE_ASM_EXTERNAL || HC_ARCH_BITS == 64
     1205#if RT_INLINE_ASM_EXTERNAL || HC_ARCH_BITS == 64 || defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0)
    12061206DECLASM(int) VMXEnable(RTHCPHYS pVMXOn);
    12071207#else
     
    12571257 * Executes VMXOFF
    12581258 */
    1259 #if RT_INLINE_ASM_EXTERNAL || HC_ARCH_BITS == 64
     1259#if RT_INLINE_ASM_EXTERNAL || HC_ARCH_BITS == 64 || defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0)
    12601260DECLASM(void) VMXDisable(void);
    12611261#else
     
    12841284 * @param   pVMCS       Physical address of VM control structure
    12851285 */
    1286 #if RT_INLINE_ASM_EXTERNAL || HC_ARCH_BITS == 64
     1286#if RT_INLINE_ASM_EXTERNAL || HC_ARCH_BITS == 64 || defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0)
    12871287DECLASM(int) VMXClearVMCS(RTHCPHYS pVMCS);
    12881288#else
     
    13321332 * @param   pVMCS       Physical address of VMCS structure
    13331333 */
    1334 #if RT_INLINE_ASM_EXTERNAL || HC_ARCH_BITS == 64
     1334#if RT_INLINE_ASM_EXTERNAL || HC_ARCH_BITS == 64 || defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0)
    13351335DECLASM(int) VMXActivateVMCS(RTHCPHYS pVMCS);
    13361336#else
     
    13871387 * @param   u32Val          32 bits value
    13881388 */
    1389 #if RT_INLINE_ASM_EXTERNAL || HC_ARCH_BITS == 64
     1389#if RT_INLINE_ASM_EXTERNAL || HC_ARCH_BITS == 64 || defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0)
    13901390DECLASM(int) VMXWriteVMCS32(uint32_t idxField, uint32_t u32Val);
    13911391#else
     
    14321432#endif
    14331433
    1434 /** 
    1435  * Executes VMWRITE 
    1436  * 
    1437  * @returns VBox status code 
    1438  * @param   idxField        VMCS index 
    1439  * @param   u64Val          16, 32 or 64 bits value 
    1440  */ 
    1441 #if HC_ARCH_BITS == 64
    1442 DECLASM(int) VMXWriteVMCS64(uint32_t idxField, uint64_t u64Val); 
    1443 #else 
    1444 DECLINLINE(int) VMXWriteVMCS64(uint32_t idxField, uint64_t u64Val) 
    1445 { 
    1446     int rc; 
    1447 
    1448     rc  = VMXWriteVMCS32(idxField, u64Val); 
    1449         rc |= VMXWriteVMCS32(idxField + 1, (uint32_t)(u64Val >> 32ULL)); 
    1450         AssertRC(rc); 
    1451         return rc; 
    1452 } 
    1453 #endif 
     1434/**
     1435 * Executes VMWRITE
     1436 *
     1437 * @returns VBox status code
     1438 * @param   idxField        VMCS index
     1439 * @param   u64Val          16, 32 or 64 bits value
     1440 */
     1441#if HC_ARCH_BITS == 64 || defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0)
     1442DECLASM(int) VMXWriteVMCS64(uint32_t idxField, uint64_t u64Val);
     1443#else
     1444DECLINLINE(int) VMXWriteVMCS64(uint32_t idxField, uint64_t u64Val)
     1445{
     1446    int rc;
     1447
     1448    rc  = VMXWriteVMCS32(idxField, u64Val);
     1449        rc |= VMXWriteVMCS32(idxField + 1, (uint32_t)(u64Val >> 32ULL));
     1450        AssertRC(rc);
     1451        return rc;
     1452}
     1453#endif
    14541454
    14551455#if HC_ARCH_BITS == 64
     
    14831483 * @param   pData           Ptr to store VM field value
    14841484 */
    1485 #if RT_INLINE_ASM_EXTERNAL || HC_ARCH_BITS == 64
     1485#if RT_INLINE_ASM_EXTERNAL || HC_ARCH_BITS == 64 || defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0)
    14861486DECLASM(int) VMXReadVMCS32(uint32_t idxField, uint32_t *pData);
    14871487#else
     
    15311531#endif
    15321532
    1533 #if HC_ARCH_BITS == 64
    1534 /**
    1535  * Executes VMREAD
    1536  *
    1537  * @returns VBox status code
    1538  * @param   idxField        VMCS index
    1539  * @param   pData           Ptr to store VM field value
    1540  */
    1541 DECLASM(int) VMXReadVMCS64(uint32_t idxField, uint64_t *pData); 
    1542 #else 
    1543 DECLINLINE(int) VMXReadVMCS64(uint32_t idxField, uint64_t *pData) 
    1544 { 
    1545     int rc; 
    1546 
    1547     uint32_t val_hi, val; 
    1548     rc  = VMXReadVMCS32(idxField, &val); 
    1549     rc |= VMXReadVMCS32(idxField + 1, &val_hi); 
    1550     AssertRC(rc); 
    1551     *pData = RT_MAKE_U64(val, val_hi); 
    1552     return rc; 
    1553 } 
    1554 #endif 
     1533/**
     1534 * Executes VMREAD
     1535 *
     1536 * @returns VBox status code
     1537 * @param   idxField        VMCS index
     1538 * @param   pData           Ptr to store VM field value
     1539 */
     1540#if HC_ARCH_BITS == 64 || defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0)
     1541DECLASM(int) VMXReadVMCS64(uint32_t idxField, uint64_t *pData);
     1542#else
     1543DECLINLINE(int) VMXReadVMCS64(uint32_t idxField, uint64_t *pData)
     1544{
     1545    int rc;
     1546
     1547    uint32_t val_hi, val;
     1548    rc  = VMXReadVMCS32(idxField, &val);
     1549    rc |= VMXReadVMCS32(idxField + 1, &val_hi);
     1550    AssertRC(rc);
     1551    *pData = RT_MAKE_U64(val, val_hi);
     1552    return rc;
     1553}
     1554#endif
    15551555
    15561556#if HC_ARCH_BITS == 64
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