arch/powerpc/platforms/pseries/firmware.c

Source file repositories/reference/linux-study-clean/arch/powerpc/platforms/pseries/firmware.c

File Facts

System
Linux kernel
Corpus path
arch/powerpc/platforms/pseries/firmware.c
Extension
.c
Size
5222 bytes
Lines
192
Domain
Architecture Layer
Bucket
arch/powerpc
Inferred role
Architecture Layer: implementation source
Status
source implementation candidate

Why This File Exists

CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.

Dependency Surface

Detected Declarations

Annotated Snippet

struct hypertas_fw_feature {
    unsigned long val;
    char * name;
};

/*
 * The names in this table match names in rtas/ibm,hypertas-functions.  If the
 * entry ends in a '*', only upto the '*' is matched.  Otherwise the entire
 * string must match.
 */
static __initdata struct hypertas_fw_feature
hypertas_fw_features_table[] = {
	{FW_FEATURE_PFT,		"hcall-pft"},
	{FW_FEATURE_TCE,		"hcall-tce"},
	{FW_FEATURE_SPRG0,		"hcall-sprg0"},
	{FW_FEATURE_DABR,		"hcall-dabr"},
	{FW_FEATURE_COPY,		"hcall-copy"},
	{FW_FEATURE_ASR,		"hcall-asr"},
	{FW_FEATURE_DEBUG,		"hcall-debug"},
	{FW_FEATURE_PERF,		"hcall-perf"},
	{FW_FEATURE_DUMP,		"hcall-dump"},
	{FW_FEATURE_INTERRUPT,		"hcall-interrupt"},
	{FW_FEATURE_MIGRATE,		"hcall-migrate"},
	{FW_FEATURE_PERFMON,		"hcall-perfmon"},
	{FW_FEATURE_CRQ,		"hcall-crq"},
	{FW_FEATURE_VIO,		"hcall-vio"},
	{FW_FEATURE_RDMA,		"hcall-rdma"},
	{FW_FEATURE_LLAN,		"hcall-lLAN"},
	{FW_FEATURE_BULK_REMOVE,	"hcall-bulk"},
	{FW_FEATURE_XDABR,		"hcall-xdabr"},
	{FW_FEATURE_PUT_TCE_IND | FW_FEATURE_STUFF_TCE,
					"hcall-multi-tce"},
	{FW_FEATURE_SPLPAR,		"hcall-splpar"},
	{FW_FEATURE_VPHN,		"hcall-vphn"},
	{FW_FEATURE_SET_MODE,		"hcall-set-mode"},
	{FW_FEATURE_BEST_ENERGY,	"hcall-best-energy-1*"},
	{FW_FEATURE_HPT_RESIZE,		"hcall-hpt-resize"},
	{FW_FEATURE_BLOCK_REMOVE,	"hcall-block-remove"},
	{FW_FEATURE_PAPR_SCM,		"hcall-scm"},
	{FW_FEATURE_RPT_INVALIDATE,	"hcall-rpt-invalidate"},
	{FW_FEATURE_ENERGY_SCALE_INFO,	"hcall-energy-scale-info"},
	{FW_FEATURE_WATCHDOG,		"hcall-watchdog"},
	{FW_FEATURE_PLPKS,		"hcall-pks"},
};

/* Build up the firmware features bitmask using the contents of
 * device-tree/ibm,hypertas-functions.  Ultimately this functionality may
 * be moved into prom.c prom_init().
 */
static void __init fw_hypertas_feature_init(const char *hypertas,
					    unsigned long len)
{
	const char *s;
	int i;

	pr_debug(" -> fw_hypertas_feature_init()\n");

	for (s = hypertas; s < hypertas + len; s += strlen(s) + 1) {
		for (i = 0; i < ARRAY_SIZE(hypertas_fw_features_table); i++) {
			const char *name = hypertas_fw_features_table[i].name;
			size_t size;

			/*
			 * If there is a '*' at the end of name, only check
			 * upto there
			 */
			size = strlen(name);
			if (size && name[size - 1] == '*') {
				if (strncmp(name, s, size - 1))
					continue;
			} else if (strcmp(name, s))
				continue;

			/* we have a match */
			powerpc_firmware_features |=
				hypertas_fw_features_table[i].val;
			break;
		}
	}

	if (is_secure_guest() &&
	    (powerpc_firmware_features & FW_FEATURE_PUT_TCE_IND)) {
		powerpc_firmware_features &= ~FW_FEATURE_PUT_TCE_IND;
		pr_debug("SVM: disabling PUT_TCE_IND firmware feature\n");
	}

	pr_debug(" <- fw_hypertas_feature_init()\n");
}

struct vec5_fw_feature {

Annotation

Implementation Notes