drivers/gpu/drm/amd/ras/rascore/ras_cper.h

Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/ras/rascore/ras_cper.h

File Facts

System
Linux kernel
Corpus path
drivers/gpu/drm/amd/ras/rascore/ras_cper.h
Extension
.h
Size
8597 bytes
Lines
305
Domain
Driver Families
Bucket
drivers/gpu
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

struct ras_cper_guid {
	uint8_t b[CPER_UUID_MAX_SIZE];
};

#define CPER_GUID__INIT(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7)			\
	((struct ras_cper_guid)								\
	{{ (a) & 0xff, ((a) >> 8) & 0xff, ((a) >> 16) & 0xff, ((a) >> 24) & 0xff, \
		(b) & 0xff, ((b) >> 8) & 0xff,					\
		(c) & 0xff, ((c) >> 8) & 0xff,					\
		(d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) }})

#define CPER_HDR__REV_1          (0x100)
#define CPER_SEC__MINOR_REV_1    (0x01)
#define CPER_SEC__MAJOR_REV_22   (0x22)
#define CPER_OAM_MAX_COUNT      (8)

#define CPER_CTX_TYPE__CRASH     (1)
#define CPER_CTX_TYPE__BOOT      (9)

#define CPER_CREATOR_ID__AMDGPU	"amdgpu"

#define CPER_NOTIFY__MCE                                               \
	CPER_GUID__INIT(0xE8F56FFE, 0x919C, 0x4cc5, 0xBA, 0x88, 0x65, 0xAB, \
		  0xE1, 0x49, 0x13, 0xBB)
#define CPER_NOTIFY__CMC                                               \
	CPER_GUID__INIT(0x2DCE8BB1, 0xBDD7, 0x450e, 0xB9, 0xAD, 0x9C, 0xF4, \
		  0xEB, 0xD4, 0xF8, 0x90)
#define BOOT__TYPE                                                     \
	CPER_GUID__INIT(0x3D61A466, 0xAB40, 0x409a, 0xA6, 0x98, 0xF3, 0x62, \
		  0xD4, 0x64, 0xB3, 0x8F)

#define GPU__CRASHDUMP                                                 \
	CPER_GUID__INIT(0x32AC0C78, 0x2623, 0x48F6, 0xB0, 0xD0, 0x73, 0x65, \
		  0x72, 0x5F, 0xD6, 0xAE)
#define GPU__NONSTANDARD_ERROR                                     \
	CPER_GUID__INIT(0x32AC0C78, 0x2623, 0x48F6, 0x81, 0xA2, 0xAC, 0x69, \
		  0x17, 0x80, 0x55, 0x1D)
#define PROC_ERR__SECTION_TYPE                                         \
	CPER_GUID__INIT(0xDC3EA0B0, 0xA144, 0x4797, 0xB9, 0x5B, 0x53, 0xFA, \
		  0x24, 0x2B, 0x6E, 0x1D)

enum ras_cper_type {
	RAS_CPER_TYPE_RUNTIME,
	RAS_CPER_TYPE_FATAL,
	RAS_CPER_TYPE_BOOT,
	RAS_CPER_TYPE_RMA,
};

enum ras_cper_severity {
	RAS_CPER_SEV_NON_FATAL_UE   = 0,
	RAS_CPER_SEV_FATAL_UE       = 1,
	RAS_CPER_SEV_NON_FATAL_CE   = 2,
	RAS_CPER_SEV_RMA            = 3,

	RAS_CPER_SEV_UNUSED = 10,
};

enum ras_cper_aca_reg {
	RAS_CPER_ACA_REG_CTL    = 0,
	RAS_CPER_ACA_REG_STATUS = 1,
	RAS_CPER_ACA_REG_ADDR   = 2,
	RAS_CPER_ACA_REG_MISC0  = 3,
	RAS_CPER_ACA_REG_CONFIG = 4,
	RAS_CPER_ACA_REG_IPID   = 5,
	RAS_CPER_ACA_REG_SYND   = 6,
	RAS_CPER_ACA_REG_DESTAT	= 8,
	RAS_CPER_ACA_REG_DEADDR	= 9,
	RAS_CPER_ACA_REG_MASK	= 10,

	RAS_CPER_ACA_REG_COUNT     = 16,
};

#pragma pack(push, 1)

struct ras_cper_timestamp {
	uint8_t seconds;
	uint8_t minutes;
	uint8_t hours;
	uint8_t flag;
	uint8_t day;
	uint8_t month;
	uint8_t year;
	uint8_t century;
};

struct cper_section_hdr {
	char                     signature[4];  /* "CPER"  */
	uint16_t                 revision;
	uint32_t                 signature_end; /* 0xFFFFFFFF */
	uint16_t                 sec_cnt;

Annotation

Implementation Notes