VirtualBox

Changeset 71214 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Mar 5, 2018 8:31:03 PM (7 years ago)
Author:
vboxsync
Message:

DevDMA: Handle I/O port access from ring-0 and raw-mode since we handle port 0x80 here. Port 0x80 is used both the our BIOS and the linux kernel for I/O delay / debugging, there is no need to go to ring-3 each time it is accessed. [build fix]

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/PC/DevDMA.cpp

    r71212 r71214  
    191191
    192192/* Convert DMA channel number (0-7) to controller number (0-1). */
    193 #define DMACH2C(c)      (c < 4 ? 0 : 1)
     193#define DMACH2C(c)          (c < 4 ? 0 : 1)
    194194
    195195#ifdef LOG_ENABLED
    196 static int const dmaChannelMap[8] = {-1, 2, 3, 1, -1, -1, -1, 0};
     196static int const g_aiDmaChannelMap[8] = {-1, 2, 3, 1, -1, -1, -1, 0};
    197197/* Map a DMA page register offset (0-7) to channel index (0-3). */
    198 #define DMAPG2CX(c)     (dmaChannelMap[c])
     198# define DMAPG2CX(c)        (g_aiDmaChannelMap[c])
    199199#endif
    200200
    201 static int const dmaMapChannel[4] = {7, 3, 1, 2};
     201#ifdef IN_RING3
     202static int const g_aiDmaMapChannel[4] = {7, 3, 1, 2};
    202203/* Map a channel index (0-3) to DMA page register offset (0-7). */
    203 #define DMACX2PG(c)     (dmaMapChannel[c])
     204# define DMACX2PG(c)        (g_aiDmaMapChannel[c])
    204205/* Map a channel number (0-7) to DMA page register offset (0-7). */
    205 #define DMACH2PG(c)     (dmaMapChannel[c & 3])
     206# define DMACH2PG(c)        (g_aiDmaMapChannel[c & 3])
     207#endif
    206208
    207209/* Test the decrement bit of mode register. */
    208 #define IS_MODE_DEC(c)  ((c) & 0x20)
     210#define IS_MODE_DEC(c)      ((c) & 0x20)
    209211/* Test the auto-init bit of mode register. */
    210 #define IS_MODE_AI(c)   ((c) & 0x10)
     212#define IS_MODE_AI(c)       ((c) & 0x10)
    211213/* Extract the transfer type bits of mode register. */
    212 #define GET_MODE_XTYP(c)(((c) & 0x0c) >> 2)
     214#define GET_MODE_XTYP(c)    (((c) & 0x0c) >> 2)
    213215
    214216
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