19.6.7. BankField(声明 Bank/Data 字段)
语法 :
BankField (RegionName, BankName, BankValue, AccessType, LockRule,
UpdateRule) {FieldUnitList}
参数
RegionName 按 Namestring 进行求值,并且是宿主 Operation Region 的名称。
BankName 按 Namestring 进行求值,并且是 Bank 选择寄存器的名称。
BankValue 是 Bank 选择 ID(Integer),在访问 FieldUnitList 之前会将其写入 BankName 寄存器。
AccessType, LockRule, UpdateRule 和 FieldUnitList 的格式与 Field 运算符相同。
说明
对一个分银行字段数据对象内容的访问将通过正确的 Bank 设置自动进行;如果 LockRule 指定了,还会在包含 BankName 数据变量的操作区域上以及 Global Lock 上进行同步。
此运算符创建数据字段对象。所创建对象的内容通过对 Bank 选择寄存器的引用来获得。
该编码用于定义命名的数据字段对象,这些对象的数据值是通过 Bank 选择寄存器选定的较大对象中的字段。
示例
以下是一个使用 BankField 的 ASL 示例代码块:
在系统 I/O 空间中创建一个 4 位的 Bank 选择寄存器。
在同一系统 I/O 空间中创建通过该 Bank 寄存器选择的重叠字段。
//
// Define a 256-byte operational region in SystemIO space
// and name it GIO0
OperationRegion (GIO0, SystemIO, 0x125, 0x100)
// Create some fields in GIO including a 4-bit bank select register
Field (GIO0, ByteAcc, NoLock, Preserve) {
GLB1, 1,
GLB2, 1,
Offset (1), // Move to offset for byte 1
BNK1, 4
}
// Create FET0 & FET1 in bank 0 at byte offset 0x30
BankField (GIO0, BNK1, 0, ByteAcc, NoLock, Preserve) {
Offset (0x30),
FET0, 1,
FET1, 1
}
// Create BLVL & BAC in bank 1 at the same offset
BankField (GIO0, BNK1, 1, ByteAcc, NoLock, Preserve) {
Offset (0x30),
BLVL, 7,
BAC, 1
}