board_inspector: add a property to reflect the encoded IRQs in RDT

This patch adds the property `irqs` to the class SmallResourceitemIRQ so
that the list of IRQs encoded in this resource item can be retrieved
easily.

Tracked-On: #6287
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
This commit is contained in:
Junjie Mao 2021-07-02 14:55:43 +08:00 committed by wenlingz
parent 0991f7f03b
commit 127e12a56a
1 changed files with 4 additions and 0 deletions

View File

@ -43,6 +43,10 @@ def SmallResourceItemIRQ_factory(_len):
('_WKC', ctypes.c_uint8, 1), ('_WKC', ctypes.c_uint8, 1),
('reserved', ctypes.c_uint8, 2), ('reserved', ctypes.c_uint8, 2),
] if (_len > 2) else []) ] if (_len > 2) else [])
@property
def irqs(self):
return [i for i in range(0, 16) if ((self._INT & (1 << i)) != 0)]
return SmallResourceItemIRQ return SmallResourceItemIRQ
# 6.4.2.2 DMA Descriptor # 6.4.2.2 DMA Descriptor