include/uapi/misc/amd-apml.h

Source file repositories/reference/linux-study-clean/include/uapi/misc/amd-apml.h

File Facts

System
Linux kernel
Corpus path
include/uapi/misc/amd-apml.h
Extension
.h
Size
3608 bytes
Lines
153
Domain
Repository Root And Misc
Bucket
include
Inferred role
Repository Root And Misc: implementation source
Status
source implementation candidate

Why This File Exists

Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.

Dependency Surface

Detected Declarations

Annotated Snippet

struct apml_mbox_msg {
	/*
	 * Mailbox Message ID
	 */
	__u32 cmd;
	/*
	 * [0]...[3] mailbox 32bit input/output data
	 */
	__u32 mb_in_out;
	/*
	 * Error code is returned in case of soft mailbox error
	 */
	__u32 fw_ret_code;
};

struct apml_cpuid_msg {
	/*
	 * CPUID input
	 * [0]...[3] cpuid func,
	 * [4][5] cpuid: thread
	 * [6] cpuid: ext function & read eax/ebx or ecx/edx
	 *	[7:0] -> bits [7:4] -> ext function &
	 *	bit [0] read eax/ebx or ecx/edx
	 * CPUID output
	 */
	__u64 cpu_in_out;
	/*
	 * Status code for CPUID read
	 */
	__u32 fw_ret_code;
	__u32 pad;
};

struct apml_mcamsr_msg {
	/*
	 * MCAMSR input
	 * [0]...[3] mca msr func,
	 * [4][5] thread
	 * MCAMSR output
	 */
	__u64 mcamsr_in_out;
	/*
	 * Status code for MCA/MSR access
	 */
	__u32 fw_ret_code;
	__u32 pad;
};

struct apml_reg_xfer_msg {
	/*
	 * RMI register address offset
	 */
	__u16 reg_addr;
	/*
	 * Register data for read/write
	 */
	__u8 data_in_out;
	/*
	 * Register read or write
	 */
	__u8 rflag;
};

/*
 * AMD sideband interface base IOCTL
 */
#define SB_BASE_IOCTL_NR	0xF9

/**
 * DOC: SBRMI_IOCTL_MBOX_CMD
 *
 * @Parameters
 *
 * @struct apml_mbox_msg
 *	Pointer to the &struct apml_mbox_msg that will contain the protocol
 *	information
 *
 * @Description
 * IOCTL command for APML messages using generic _IOWR
 * The IOCTL provides userspace access to AMD sideband mailbox protocol
 * - Mailbox message read/write(0x0~0xFF)
 * - returning "-EFAULT" if none of the above
 * "-EPROTOTYPE" error is returned to provide additional error details
 */
#define SBRMI_IOCTL_MBOX_CMD		_IOWR(SB_BASE_IOCTL_NR, 0, struct apml_mbox_msg)

/**
 * DOC: SBRMI_IOCTL_CPUID_CMD
 *
 * @Parameters

Annotation

Implementation Notes