third_party/virtualbox/src/VBox/Devices/Network/DevE1000.cpp
/**
 * Handle 4 byte aligned and sized read operation.
 *
 * Looks up and calls appropriate handler.
 *
 * @returns VBox status code.
 *
 * @param   pThis       The device state structure.
 * @param   offReg      Register offset in memory-mapped frame.
 * @param   pu32        Where to store the result.
 * @thread  EMT
 */
Handle 4 byte aligned and sized read operation.
Looks up and calls appropriate handler.

@returns VBox status code.

@param   pThis       The device state structure.
@param   offReg      Register offset in memory-mapped frame.
@param   pu32        Where to store the result.
@thread  EMT
Handle 4 byte aligned and sized read operation . Looks up and calls appropriate handler . @returns VBox status code . @param pThis The device state structure . @param offReg Register offset in memory - mapped frame . @param pu32 Where to store the result . @thread EMT
static int e1kRegReadAlignedU32(PE1KSTATE pThis, uint32_t offReg, uint32_t *pu32)
{
    Assert(!(offReg & 3));
    int rc     = VINF_SUCCESS;
    int idxReg = e1kRegLookup(offReg);
    if (RT_LIKELY(idxReg != -1))
    {
        RT_UNTRUSTED_VALIDATED_FENCE(); 
        if (RT_UNLIKELY(g_aE1kRegMap[idxReg].readable))
        {
            rc = g_aE1kRegMap[idxReg].pfnRead(pThis, offReg & 0xFFFFFFFC, idxReg, pu32);
            Log6(("%s At %08X read  %08X          from %s (%s)\n",
                  pThis->szPrf, offReg, *pu32, g_aE1kRegMap[idxReg].abbrev, g_aE1kRegMap[idxReg].name));
            if (IOM_SUCCESS(rc))
                STAM_COUNTER_INC(&pThis->aStatRegReads[idxReg]);
        }
        else
            E1kLog(("%s At %08X read attempt from non-readable register %s (%s)\n",
                    pThis->szPrf, offReg, g_aE1kRegMap[idxReg].abbrev, g_aE1kRegMap[idxReg].name));
    }
    else
        E1kLog(("%s At %08X read attempt from non-existing register\n", pThis->szPrf, offReg));
    return rc;
}
static int e1kRegReadAlignedU32 ( PE1KSTATE pThis , uint32_t offReg , uint32_t * pu32 ) { Assert ( ! ( offReg & 3 ) ) ; int rc = VINF_SUCCESS ; int idxReg = e1kRegLookup ( offReg ) ; if ( RT_LIKELY ( idxReg != -1 ) ) { RT_UNTRUSTED_VALIDATED_FENCE ( ) ; if ( RT_UNLIKELY ( g_aE1kRegMap [ idxReg ] . readable ) ) { rc = g_aE1kRegMap [ idxReg ] . pfnRead ( pThis , offReg & 0xFFFFFFFC , idxReg , pu32 ) ; Log6 ( ( " \n " , pThis -> szPrf , offReg , * pu32 , g_aE1kRegMap [ idxReg ] . abbrev , g_aE1kRegMap [ idxReg ] . name ) ) ; if ( IOM_SUCCESS ( rc ) ) STAM_COUNTER_INC ( & pThis -> aStatRegReads [ idxReg ] ) ; } else E1kLog ( ( " \n " , pThis -> szPrf , offReg , g_aE1kRegMap [ idxReg ] . abbrev , g_aE1kRegMap [ idxReg ] . name ) ) ; } else E1kLog ( ( " \n " , pThis -> szPrf , offReg ) ) ; return rc ; }
Handle 4 byte aligned and sized read operation.
Handle 4 byte aligned and sized read operation .
/*
     * Lookup the register and check that it's readable.
     */ /* paranoia because of port I/O. */ /*
             * Read it. Pass the mask so the handler knows what has to be read.
             * Mask out irrelevant bits.
             */ //rc = e1kCsEnter(pThis, VERR_SEM_BUSY, RT_SRC_POS); //if (RT_UNLIKELY(rc != VINF_SUCCESS)) //    return rc; //pThis->fDelayInts = false; //pThis->iStatIntLost += pThis->iStatIntLostOne; //pThis->iStatIntLostOne = 0; //e1kCsLeave(pThis);