6.2.4. _DMA(直接内存访问)
此可选对象返回一个字节流,其格式与 _CRS 对象相同。_DMA 仅定义在表示总线的设备下。它指定总线控制器(桥)在其接口子端译码的范围。(这类似于 _CRS 对象,后者描述总线控制器在其接口父端译码的资源。)在 _DMA 对象资源中描述的任何范围,都可以由子设备用于 DMA 或总线主控事务。
仅当也定义了 _CRS 对象时,_DMA 对象才有效。OSPM 必须在执行 _SRS 对象之后重新求值 _DMA 对象,因为 _DMA 范围资源可能会根据桥的配置方式而变化。
如果总线设备不存在 _DMA 对象,则 OS 假定子设备放置到总线上的任何地址都将由总线上的某个设备或总线本身译码,(换句话说,所有地址范围都可用于 DMA)。
例如,如果某个平台实现了一个无法访问全部物理内存的 PCI 总线,则它会在该 PCI 总线下提供一个 _DMA 对象,以描述该总线上的设备可以访问的物理内存范围。
_DMA 对象并非用于描述为每次 DMA 事务设置的任何“映射寄存器”硬件。它仅用于描述一种总线的 DMA 属性,而这种属性若不重新求值 _SRS 方法就无法改变。
参数:
无
返回值:
包含资源描述符字节流的 Buffer
_DMA 示例 ASL:
Device(BUS0)
{
//
// The _DMA method returns a resource template describing the
// addresses that are decoded on the child side of this
// bridge. The contained resource descriptors thus indicate
// the address ranges that bus masters living below this
// bridge can use to send accesses through the bridge toward a
// destination elsewhere in the system (e.g. main memory).
//
// In our case, any bus master addresses need to fall between
// 0 and 0x80000000 and will have 0x200000000 added as they
// cross the bridge. Furthermore, any child-side accesses
// falling into the range claimed in our _CRS will be
// interpreted as a peer-to-peer traffic and will not be
// forwarded upstream by the bridge.
//
// Our upstream address decoder will only claim one range from
// 0x20000000 to 0x5fffffff in the _CRS. Therefore _DMA
// should return two QWORDMemory descriptors, one describing
// the range below and one describing the range above this
// "peer-to-peer" address range.
//
Method(_DMA, ResourceTemplate()
{
QWORDMemory(
ResourceConsumer,
PosDecode, // _DEC
MinFixed, // _MIF
MaxFixed, // _MAF
Prefetchable, // _MEM
ReadWrite, // _RW
0, // _GRA
0, // _MIN
0x1fffffff, // _MAX
0x200000000, // _TRA
0x20000000, // _LEN
,
,
,
)
QWORDMemory(
ResourceConsumer,
PosDecode, // _DEC
MinFixed, // _MIF
MaxFixed, // _MAF
Prefetchable, // _MEM
ReadWrite, // _RW
0, // _GRA
0x60000000, // _MIN
0x7fffffff, // _MAX
0x200000000, // _TRA
0x20000000, // _LEN
,
,
,
)
})
}