Esempio n. 1
0
class LargeResourceItemExtendedAddressSpace(cdata.Struct):
    _pack_ = 1
    _fields_ = LargeResourceDataTag._fields_ + [
        ('_TYP', ctypes.c_uint8),
        ('ignored', ctypes.c_uint8, 1),
        ('_DEC', ctypes.c_uint8, 1),
        ('_MIF', ctypes.c_uint8, 1),
        ('_MAF', ctypes.c_uint8, 1),
        ('reserved1', ctypes.c_uint8, 4),
        ('flags', ctypes.c_uint8),
        ('revision', ctypes.c_uint8),
        ('reserved2', ctypes.c_uint8),
        ('_GRA', ctypes.c_uint64),
        ('_MIN', ctypes.c_uint64),
        ('_MAX', ctypes.c_uint64),
        ('_TRA', ctypes.c_uint64),
        ('_LEN', ctypes.c_uint64),
        ('_ATT', ctypes.c_uint64),
    ]
    _formats = {
        '_TYP': unpack.format_table("{}", resource_type),
        '_DEC': unpack.format_table("{}", decode_type),
        '_MIF': unpack.format_table("{}", min_address_fixed),
        '_MAF': unpack.format_table("{}", max_address_fixed),
    }
Esempio n. 2
0
    class LargeResourceItemWordAddressSpace(cdata.Struct):
        _pack_ = 1
        _fields_ = LargeResourceDataTag._fields_ + [
            ('_TYP', ctypes.c_uint8),
            ('ignored', ctypes.c_uint8, 1),
            ('_DEC', ctypes.c_uint8, 1),
            ('_MIF', ctypes.c_uint8, 1),
            ('_MAF', ctypes.c_uint8, 1),
            ('reserved1', ctypes.c_uint8, 4),
            ('flags', ctypes.c_uint8),
            ('_GRA', ctypes.c_uint16),
            ('_MIN', ctypes.c_uint16),
            ('_MAX', ctypes.c_uint16),
            ('_TRA', ctypes.c_uint16),
            ('_LEN', ctypes.c_uint16),
        ] + ([('reserved2', ctypes.c_uint8)] if
             (_len > 13) else []) + ([('resource_source_opt', ctypes.c_char *
                                       (_len - 14))] if (_len > 14) else [])
        _formats = {
            '_TYP': unpack.format_table("{}", resource_type),
            '_DEC': unpack.format_table("{}", decode_type),
            '_MIF': unpack.format_table("{}", min_address_fixed),
            '_MAF': unpack.format_table("{}", max_address_fixed),
        }

        @property
        def resource_source(self):
            return getattr(self, "resource_source_opt", None)
Esempio n. 3
0
class APICSubtable_int_flags_bits(cdata.Struct):
    _pack_ = 1
    _fields_ = [
        ('polarity', ctypes.c_uint16, 2),
        ('trigger_mode', ctypes.c_uint16, 2),
    ]
    _formats = {
        'polarity': unpack.format_table("{}", mps_inti_polarity),
        'trigger_mode': unpack.format_table("{}", mps_inti_trigger_mode),
    }
Esempio n. 4
0
class APICSubtableLocalGIC_flags_bits(cdata.Struct):
    _pack_ = 1
    _fields_ = [
        ('enabled', ctypes.c_uint32, 1),
        ('performance_interrupt_mode', ctypes.c_uint32, 1),
    ]
    _formats = {
        'performance_interrupt_mode':
        unpack.format_table("{}", mps_inti_polarity),
    }
Esempio n. 5
0
class SmallResourceItemIOPort(cdata.Struct):
    _pack_ = 1
    _fields_ = SmallResourceDataTag._fields_ + [
        ('_DEC', ctypes.c_uint8, 1),
        ('reserved', ctypes.c_uint8, 7),
        ('_MIN', ctypes.c_uint16),
        ('_MAX', ctypes.c_uint16),
        ('_ALN', ctypes.c_uint8),
        ('_LEN', ctypes.c_uint8),
    ]
    _formats = {'_DEC': unpack.format_table("{}", io_port_decoding)}
Esempio n. 6
0
class GAS(cdata.Struct):
    _pack_ = 1
    _fields_ = [
        ('address_space_id', ctypes.c_uint8),
        ('register_bit_width', ctypes.c_uint8),
        ('register_bit_offset', ctypes.c_uint8),
        ('access_size', ctypes.c_uint8),
        ('address', ctypes.c_uint64),
    ]

    _formats = {
        'address_space_id': unpack.format_function("{:#x}", _asid_str),
        'access_size': unpack.format_table("{}", _access_sizes),
    }
Esempio n. 7
0
 class LargeResourceItemDWordAddressSpace(cdata.Struct):
     _pack_ = 1
     _fields_ = LargeResourceDataTag._fields_ + [
         ('_TYP', ctypes.c_uint8),
         ('ignored', ctypes.c_uint8, 1),
         ('_DEC', ctypes.c_uint8, 1),
         ('_MIF', ctypes.c_uint8, 1),
         ('_MAF', ctypes.c_uint8, 1),
         ('reserved1', ctypes.c_uint8, 4),
         ('flags', ctypes.c_uint8),
         ('_GRA', ctypes.c_uint32),
         ('_MIN', ctypes.c_uint32),
         ('_MAX', ctypes.c_uint32),
         ('_TRA', ctypes.c_uint32),
         ('_LEN', ctypes.c_uint32),
     ] + ([('reserved2', ctypes.c_uint8)] if
          (_len > 23) else []) + ([('source', ctypes.c_char *
                                    (_len - 24))] if (_len > 24) else [])
     _formats = {
         '_TYP': unpack.format_table("{}", resource_type),
         '_DEC': unpack.format_table("{}", decode_type),
         '_MIF': unpack.format_table("{}", min_address_fixed),
         '_MAF': unpack.format_table("{}", max_address_fixed),
     }
Esempio n. 8
0
class FACP_v5(cdata.Struct):
    _pack_ = 1
    _fields_ = [
        ('header', TableHeader),
        ('firmware_ctrl', ctypes.c_uint32),
        ('dsdt', ctypes.c_uint32),
        ('reserved0', ctypes.c_uint8),
        ('preferred_pm_profile', ctypes.c_uint8),
        ('sci_int', ctypes.c_uint16),
        ('smi_cmd', ctypes.c_uint32),
        ('acpi_enable', ctypes.c_uint8),
        ('acpi_disable', ctypes.c_uint8),
        ('s4bios_req', ctypes.c_uint8),
        ('pstate_cnt', ctypes.c_uint8),
        ('pm1a_evt_blk', ctypes.c_uint32),
        ('pm1b_evt_blk', ctypes.c_uint32),
        ('pm1a_cnt_blk', ctypes.c_uint32),
        ('pm1b_cnt_blk', ctypes.c_uint32),
        ('pm2_cnt_blk', ctypes.c_uint32),
        ('pm_tmr_blk', ctypes.c_uint32),
        ('gpe0_blk', ctypes.c_uint32),
        ('gpe1_blk', ctypes.c_uint32),
        ('pm1_evt_len', ctypes.c_uint8),
        ('pm1_cnt_len', ctypes.c_uint8),
        ('pm2_cnt_len', ctypes.c_uint8),
        ('pm_tmr_len', ctypes.c_uint8),
        ('gpe0_blk_len', ctypes.c_uint8),
        ('gpe1_blk_len', ctypes.c_uint8),
        ('gpe1_base', ctypes.c_uint8),
        ('cst_cnt', ctypes.c_uint8),
        ('p_lvl2_lat', ctypes.c_uint16),
        ('p_lvl3_lat', ctypes.c_uint16),
        ('flush_size', ctypes.c_uint16),
        ('flush_stride', ctypes.c_uint16),
        ('duty_offset', ctypes.c_uint8),
        ('duty_width', ctypes.c_uint8),
        ('day_alrm', ctypes.c_uint8),
        ('mon_alrm', ctypes.c_uint8),
        ('century', ctypes.c_uint8),
        ('iapc_boot_arch', facp_iapc_arch_v5),
        ('reserved1', ctypes.c_uint8),
        ('flags', facp_flags_v5),
        ('reset_reg', GAS),
        ('reset_value', ctypes.c_uint8),
        ('reserved2', ctypes.c_uint8 * 3),
        ('x_firmware_ctrl', ctypes.c_uint64),
        ('x_dsdt', ctypes.c_uint64),
        ('x_pm1a_evt_blk', GAS),
        ('x_pm1b_evt_blk', GAS),
        ('x_pm1a_cnt_blk', GAS),
        ('x_pm1b_cnt_blk', GAS),
        ('x_pm2_cnt_blk', GAS),
        ('x_pm_tmr_blk', GAS),
        ('x_gpe0_blk', GAS),
        ('x_gpe1_blk', GAS),
        ('sleep_control_reg', GAS),
        ('sleep_status_reg', GAS),
    ]

    _formats = {
        'preferred_pm_profile': unpack.format_table("{}",
                                                    _preferred_pm_profile),
    }