Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1dad093b authored by Thomas Huth's avatar Thomas Huth Committed by Martin Schwidefsky
Browse files

s390/irq: Use defines for external interruption codes



Use the new defines for external interruption codes to get rid
of "magic" numbers in the s390 source code. And while we're at it,
also rename the (un-)register_external_interrupt function to
something shorter so that this patch does not exceed the 80
columns all over the place.

Signed-off-by: default avatarThomas Huth <thuth@linux.vnet.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 072c2790
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@
#define EXT_IRQ_TIMING_ALERT	0x1406
#define EXT_IRQ_MEASURE_ALERT	0x1407
#define EXT_IRQ_SERVICE_SIG	0x2401
#define EXT_IRQ_CP_SERVICE	0x2603
#define EXT_IRQ_IUCV		0x4000

#ifndef __ASSEMBLY__
@@ -89,8 +90,8 @@ struct ext_code {

typedef void (*ext_int_handler_t)(struct ext_code, unsigned int, unsigned long);

int register_external_interrupt(u16 code, ext_int_handler_t handler);
int unregister_external_interrupt(u16 code, ext_int_handler_t handler);
int register_external_irq(u16 code, ext_int_handler_t handler);
int unregister_external_irq(u16 code, ext_int_handler_t handler);

enum irq_subclass {
	IRQ_SUBCLASS_MEASUREMENT_ALERT = 5,
+5 −5
Original line number Diff line number Diff line
@@ -205,7 +205,7 @@ static inline int ext_hash(u16 code)
	return (code + (code >> 9)) & (ARRAY_SIZE(ext_int_hash) - 1);
}

int register_external_interrupt(u16 code, ext_int_handler_t handler)
int register_external_irq(u16 code, ext_int_handler_t handler)
{
	struct ext_int_info *p;
	unsigned long flags;
@@ -223,9 +223,9 @@ int register_external_interrupt(u16 code, ext_int_handler_t handler)
	spin_unlock_irqrestore(&ext_int_hash_lock, flags);
	return 0;
}
EXPORT_SYMBOL(register_external_interrupt);
EXPORT_SYMBOL(register_external_irq);

int unregister_external_interrupt(u16 code, ext_int_handler_t handler)
int unregister_external_irq(u16 code, ext_int_handler_t handler)
{
	struct ext_int_info *p;
	unsigned long flags;
@@ -241,7 +241,7 @@ int unregister_external_interrupt(u16 code, ext_int_handler_t handler)
	spin_unlock_irqrestore(&ext_int_hash_lock, flags);
	return 0;
}
EXPORT_SYMBOL(unregister_external_interrupt);
EXPORT_SYMBOL(unregister_external_irq);

static irqreturn_t do_ext_interrupt(int irq, void *dummy)
{
@@ -251,7 +251,7 @@ static irqreturn_t do_ext_interrupt(int irq, void *dummy)
	int index;

	ext_code = *(struct ext_code *) &regs->int_code;
	if (ext_code.code != 0x1004)
	if (ext_code.code != EXT_IRQ_CLK_COMP)
		__get_cpu_var(s390_idle).nohz_delay = 1;

	index = ext_hash(ext_code.code);
+4 −2
Original line number Diff line number Diff line
@@ -673,7 +673,8 @@ static int __init cpumf_pmu_init(void)
	ctl_clear_bit(0, 48);

	/* register handler for measurement-alert interruptions */
	rc = register_external_interrupt(0x1407, cpumf_measurement_alert);
	rc = register_external_irq(EXT_IRQ_MEASURE_ALERT,
				   cpumf_measurement_alert);
	if (rc) {
		pr_err("Registering for CPU-measurement alerts "
		       "failed with rc=%i\n", rc);
@@ -684,7 +685,8 @@ static int __init cpumf_pmu_init(void)
	rc = perf_pmu_register(&cpumf_pmu, "cpum_cf", PERF_TYPE_RAW);
	if (rc) {
		pr_err("Registering the cpum_cf PMU failed with rc=%i\n", rc);
		unregister_external_interrupt(0x1407, cpumf_measurement_alert);
		unregister_external_irq(EXT_IRQ_MEASURE_ALERT,
					cpumf_measurement_alert);
		goto out;
	}
	perf_cpu_notifier(cpumf_pmu_notifier);
+4 −2
Original line number Diff line number Diff line
@@ -1621,7 +1621,8 @@ static int __init init_cpum_sampling_pmu(void)
		pr_err("Registering for s390dbf failed\n");
	debug_register_view(sfdbg, &debug_sprintf_view);

	err = register_external_interrupt(0x1407, cpumf_measurement_alert);
	err = register_external_irq(EXT_IRQ_MEASURE_ALERT,
				    cpumf_measurement_alert);
	if (err) {
		pr_cpumsf_err(RS_INIT_FAILURE_ALRT);
		goto out;
@@ -1630,7 +1631,8 @@ static int __init init_cpum_sampling_pmu(void)
	err = perf_pmu_register(&cpumf_sampling, "cpum_sf", PERF_TYPE_RAW);
	if (err) {
		pr_cpumsf_err(RS_INIT_FAILURE_PERF);
		unregister_external_interrupt(0x1407, cpumf_measurement_alert);
		unregister_external_irq(EXT_IRQ_MEASURE_ALERT,
					cpumf_measurement_alert);
		goto out;
	}
	perf_cpu_notifier(cpumf_pmu_notifier);
+2 −1
Original line number Diff line number Diff line
@@ -138,7 +138,8 @@ static int __init runtime_instr_init(void)
		return 0;

	irq_subclass_register(IRQ_SUBCLASS_MEASUREMENT_ALERT);
	rc = register_external_interrupt(0x1407, runtime_instr_int_handler);
	rc = register_external_irq(EXT_IRQ_MEASURE_ALERT,
				   runtime_instr_int_handler);
	if (rc)
		irq_subclass_unregister(IRQ_SUBCLASS_MEASUREMENT_ALERT);
	else
Loading