Share via


OEMDeviceTable (Compact 7)

3/12/2014

This structure defines virtual-to-physical address mappings for devices on the x86 and ARM platforms.

Syntax

struct _DeviceTableEntry {
    DWORD VirtualAddress;
    DWORD ShiftedPhysicalAddress;
    DWORD Size;
    DWORD Attributes;
}
typedef struct _DeviceTableEntry DeviceTableEntry, *PDeviceTableEntry;
typedef const DeviceTableEntry  *PCDeviceTableEntry;
PCDeviceTableEntry g_pOEMDeviceTable;

Members

Member Description

VirtualAddress

The virtual address to be statically mapped; must be page-aligned.

ShiftedPhysicalAddress

The target physical address for the mapping, right-shifted 8 bits.

Size

Amount of memory to be mapped, in MB; must be a multiple of the platform's native page size.

Attributes

Settings for the specified address range, such as whether the memory is cached or uncached. These settings are CPU architecture-dependent; see the reference manual for your CPU architecture for specific details.

Setting this value to 0 (zero) configures the memory range to allow read/write access by the kernel, no access from user space, and caches the memory.

Remarks

For each entry in this table, a mapping is created to a device with the exact cache attributes (cached or uncached) specified in the entry. This differs from the format in earlier versions in which both a cached and uncached version were created.

OEMDeviceTable is not required (except on CPUs with ARMv7 architecture where it is required for mapping uncached devices), unless you want to provide additional kernel virtual address space.

All uncached address mappings must be listed in OEMDeviceTable.

Note

Address cache bits must not be directly manipulated in the OAL when you use OEMDeviceTable.

You can use any name for the table; two names that developers commonly use are OEMDeviceTable and g_pOEMDeviceTable. The last entry of this table must be 0 (zero) to indicate the end of the table.

To use OEMDeviceTable, the first entry in the OEMAddressTable must point to OEMDeviceTable, using the following syntax:

CE_NEW_MAPPING_TABLE, <OEMDeviceTable>, 0

<OEMDeviceTable> must be a pointer to OEMDeviceTable.

Example

The following example code shows how to use OEMDeviceTable for an ARM device.

;------------------------------------------------------------------------------
;  CE7 Device Table format: Virtual Address, Physical Address >> 8, Size in MB, Section Attributes
;   set attributes to 0 to restrict device table register access to kernel drivers only

g_oalCE7DeviceTable

        DCD     0xA1000000, 0x4A0000,   0x400000,  0x00000     
        DCD     0xA1400000, 0x480000,   0x400000,  0x00000     
        DCD     0xA1800000, 0x400000,   0x200000,  0x00000     
        DCD     0xA1A00000, 0x490000,   0x100000,  0x00000     
        DCD     0xA1B00000, 0x4C0000,   0x100000,  0x00000     
        DCD     0xA1C00000, 0x4D0000,   0x100000,  0x00000     
        DCD     0xA1D00000, 0x4E0000,   0x100000,  0x00000     
        DCD     0xA1E00000, 0x500000,   0x100000,  0x00000     
        DCD     0xA1F00000, 0x580000,   0x100000,  0x00000     
        DCD     0xA2000000, 0x403000,   0x100000,  0x00000     
        DCD     0xA2100000, 0x520000,   0x100000,  0x00000     
        DCD     0xA2200000, 0x550000,   0x100000,  0x00000     
        DCD     0xA2300000, 0x560000,   0x100000,  0x00000     
        DCD     0xA2400000, 0x541000,   0x100000,  0x00000     
        DCD     0xA2500000, 0x440000,   0x100000,  0x00000     
        DCD     0xA2600000, 0x448000,   0x100000,  0x00000     
        DCD     0xA2700000, 0x450000,   0x100000,  0x00000     
        DCD     0xA2800000, 0x5C0000,   0x100000,  0x00000     
        DCD     0x00000000, 0x000000,   0x000000,  0x00000     ; end of table
;------------------------------------------------------------------------------ 

See Also

Reference

OAL Memory Mapping Structures
OEMAddressTable
OAL Structures