def _inject_processor_error(apicid=None): # Constructor creates a structure with all zero init error_type = acpi.error_type_flags() yield error_type if apicid is not None: # Constructor creates a structure with all zero init flags = acpi.set_error_type_with_addr_flags() flags.processor_apic_valid = 1 _set_error_type_with_addr_op_cpu(error_type, flags, apicid) else: set_error_type_op(error_type)
def _inject_pcie_error(segment=None, bus=None, device=None, function=None): # Constructor creates a structure with all zero init error_type = acpi.error_type_flags() yield error_type if all(x is not None for x in (segment, bus, device, function)): # Constructor creates a structure with all zero init flags = acpi.set_error_type_with_addr_flags() flags.pcie_sbdf_valid = 1 _set_error_type_with_addr_op_pcie(error_type, flags, segment, bus, device, function) else: set_error_type_op(error_type)
def _inject_memory_error(address=None, mask=None): # Constructor creates a structure with all zero init error_type = acpi.error_type_flags() yield error_type if (address is not None) and (mask is not None): # Constructor creates a structure with all zero init flags = acpi.set_error_type_with_addr_flags() flags.memory_addr_and_mask_valid = 1 _set_error_type_with_addr_op_mem(error_type, flags, address, mask) else: set_error_type_op(error_type)
def _inject_platform_error(): # Constructor creates a structure with all zero init error_type = acpi.error_type_flags() yield error_type set_error_type_op(error_type)