Skip to content

Commit fde15c3

Browse files
heicarstMartin Schwidefsky
authored andcommitted
[S390] irq: external interrupt code passing
The external interrupt handlers have a parameter called ext_int_code. Besides the name this paramter does not only contain the ext_int_code but in addition also the "cpu address" (POP) which caused the external interrupt. To make the code a bit more obvious pass a struct instead so the called function can easily distinguish between external interrupt code and cpu address. The cpu address field however is named "subcode" since some external interrupt sources do not pass a cpu address but a different parameter (or none at all). Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
1 parent 2215011 commit fde15c3

12 files changed

Lines changed: 32 additions & 30 deletions

File tree

‎arch/s390/include/asm/irq.h‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,12 @@ enum interruption_class {
3434
NR_IRQS,
3535
};
3636

37-
typedef void (*ext_int_handler_t)(unsigned int, unsigned int, unsigned long);
37+
struct ext_code {
38+
unsigned short subcode;
39+
unsigned short code;
40+
};
41+
42+
typedef void (*ext_int_handler_t)(struct ext_code, unsigned int, unsigned long);
3843

3944
int register_external_interrupt(u16 code, ext_int_handler_t handler);
4045
int unregister_external_interrupt(u16 code, ext_int_handler_t handler);

‎arch/s390/kernel/entry.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ int handle_signal32(unsigned long sig, struct k_sigaction *ka,
3535
siginfo_t *info, sigset_t *oldset, struct pt_regs *regs);
3636
void do_notify_resume(struct pt_regs *regs);
3737

38-
void do_extint(struct pt_regs *regs, unsigned int, unsigned int, unsigned long);
38+
struct ext_code;
39+
void do_extint(struct pt_regs *regs, struct ext_code, unsigned int, unsigned long);
3940
void do_restart(void);
4041
void __init startup_init(void);
4142
void die(struct pt_regs *regs, const char *str);

‎arch/s390/kernel/irq.c‎

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -209,29 +209,27 @@ int unregister_external_interrupt(u16 code, ext_int_handler_t handler)
209209
}
210210
EXPORT_SYMBOL(unregister_external_interrupt);
211211

212-
void __irq_entry do_extint(struct pt_regs *regs, unsigned int ext_int_code,
212+
void __irq_entry do_extint(struct pt_regs *regs, struct ext_code ext_code,
213213
unsigned int param32, unsigned long param64)
214214
{
215215
struct pt_regs *old_regs;
216-
unsigned short code;
217216
struct ext_int_info *p;
218217
int index;
219218

220-
code = (unsigned short) ext_int_code;
221219
old_regs = set_irq_regs(regs);
222220
irq_enter();
223221
if (S390_lowcore.int_clock >= S390_lowcore.clock_comparator)
224222
/* Serve timer interrupts first. */
225223
clock_comparator_work();
226224
kstat_cpu(smp_processor_id()).irqs[EXTERNAL_INTERRUPT]++;
227-
if (code != 0x1004)
225+
if (ext_code.code != 0x1004)
228226
__get_cpu_var(s390_idle).nohz_delay = 1;
229227

230-
index = ext_hash(code);
228+
index = ext_hash(ext_code.code);
231229
rcu_read_lock();
232230
list_for_each_entry_rcu(p, &ext_int_hash[index], entry)
233-
if (likely(p->code == code))
234-
p->handler(ext_int_code, param32, param64);
231+
if (likely(p->code == ext_code.code))
232+
p->handler(ext_code, param32, param64);
235233
rcu_read_unlock();
236234
irq_exit();
237235
set_irq_regs(old_regs);

‎arch/s390/kernel/smp.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -434,14 +434,14 @@ void smp_stop_cpu(void)
434434
* This is the main routine where commands issued by other
435435
* cpus are handled.
436436
*/
437-
static void do_ext_call_interrupt(unsigned int ext_int_code,
437+
static void do_ext_call_interrupt(struct ext_code ext_code,
438438
unsigned int param32, unsigned long param64)
439439
{
440440
unsigned long bits;
441441
int cpu;
442442

443443
cpu = smp_processor_id();
444-
if ((ext_int_code & 0xffff) == 0x1202)
444+
if (ext_code.code == 0x1202)
445445
kstat_cpu(cpu).irqs[EXTINT_EXC]++;
446446
else
447447
kstat_cpu(cpu).irqs[EXTINT_EMS]++;

‎arch/s390/kernel/time.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ void init_cpu_timer(void)
165165
__ctl_set_bit(0, 4);
166166
}
167167

168-
static void clock_comparator_interrupt(unsigned int ext_int_code,
168+
static void clock_comparator_interrupt(struct ext_code ext_code,
169169
unsigned int param32,
170170
unsigned long param64)
171171
{
@@ -177,7 +177,7 @@ static void clock_comparator_interrupt(unsigned int ext_int_code,
177177
static void etr_timing_alert(struct etr_irq_parm *);
178178
static void stp_timing_alert(struct stp_irq_parm *);
179179

180-
static void timing_alert_interrupt(unsigned int ext_int_code,
180+
static void timing_alert_interrupt(struct ext_code ext_code,
181181
unsigned int param32, unsigned long param64)
182182
{
183183
kstat_cpu(smp_processor_id()).irqs[EXTINT_TLA]++;

‎arch/s390/kernel/vtime.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ static void do_callbacks(struct list_head *cb_list)
220220
/*
221221
* Handler for the virtual CPU timer.
222222
*/
223-
static void do_cpu_timer_interrupt(unsigned int ext_int_code,
223+
static void do_cpu_timer_interrupt(struct ext_code ext_code,
224224
unsigned int param32, unsigned long param64)
225225
{
226226
struct vtimer_queue *vq;

‎arch/s390/mm/fault.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ void pfault_fini(void)
532532
static DEFINE_SPINLOCK(pfault_lock);
533533
static LIST_HEAD(pfault_list);
534534

535-
static void pfault_interrupt(unsigned int ext_int_code,
535+
static void pfault_interrupt(struct ext_code ext_code,
536536
unsigned int param32, unsigned long param64)
537537
{
538538
struct task_struct *tsk;
@@ -545,7 +545,7 @@ static void pfault_interrupt(unsigned int ext_int_code,
545545
* in the 'cpu address' field associated with the
546546
* external interrupt.
547547
*/
548-
subcode = ext_int_code >> 16;
548+
subcode = ext_code.subcode;
549549
if ((subcode & 0xff00) != __SUBCODE_MASK)
550550
return;
551551
kstat_cpu(smp_processor_id()).irqs[EXTINT_PFL]++;

‎arch/s390/oprofile/hwsampler.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,8 @@ static inline unsigned long *trailer_entry_ptr(unsigned long v)
233233
}
234234

235235
/* prototypes for external interrupt handler and worker */
236-
static void hws_ext_handler(unsigned int ext_int_code,
237-
unsigned int param32, unsigned long param64);
236+
static void hws_ext_handler(struct ext_code ext_code,
237+
unsigned int param32, unsigned long param64);
238238

239239
static void worker(struct work_struct *work);
240240

@@ -673,7 +673,7 @@ int hwsampler_activate(unsigned int cpu)
673673
return rc;
674674
}
675675

676-
static void hws_ext_handler(unsigned int ext_int_code,
676+
static void hws_ext_handler(struct ext_code ext_code,
677677
unsigned int param32, unsigned long param64)
678678
{
679679
struct hws_cpu_buffer *cb;

‎drivers/s390/block/dasd_diag.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ dasd_diag_term_IO(struct dasd_ccw_req * cqr)
229229
}
230230

231231
/* Handle external interruption. */
232-
static void dasd_ext_handler(unsigned int ext_int_code,
232+
static void dasd_ext_handler(struct ext_code ext_code,
233233
unsigned int param32, unsigned long param64)
234234
{
235235
struct dasd_ccw_req *cqr, *next;
@@ -239,7 +239,7 @@ static void dasd_ext_handler(unsigned int ext_int_code,
239239
addr_t ip;
240240
int rc;
241241

242-
switch (ext_int_code >> 24) {
242+
switch (ext_code.subcode >> 8) {
243243
case DASD_DIAG_CODE_31BIT:
244244
ip = (addr_t) param32;
245245
break;
@@ -280,7 +280,7 @@ static void dasd_ext_handler(unsigned int ext_int_code,
280280
cqr->stopclk = get_clock();
281281

282282
expires = 0;
283-
if ((ext_int_code & 0xff0000) == 0) {
283+
if ((ext_code.subcode & 0xff) == 0) {
284284
cqr->status = DASD_CQR_SUCCESS;
285285
/* Start first request on queue if possible -> fast_io. */
286286
if (!list_empty(&device->ccw_queue)) {
@@ -296,7 +296,7 @@ static void dasd_ext_handler(unsigned int ext_int_code,
296296
cqr->status = DASD_CQR_QUEUED;
297297
DBF_DEV_EVENT(DBF_DEBUG, device, "interrupt status for "
298298
"request %p was %d (%d retries left)", cqr,
299-
(ext_int_code >> 16) & 0xff, cqr->retries);
299+
ext_code.subcode & 0xff, cqr->retries);
300300
dasd_diag_erp(device);
301301
}
302302

‎drivers/s390/char/sclp.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ __sclp_find_req(u32 sccb)
393393
/* Handler for external interruption. Perform request post-processing.
394394
* Prepare read event data request if necessary. Start processing of next
395395
* request on queue. */
396-
static void sclp_interrupt_handler(unsigned int ext_int_code,
396+
static void sclp_interrupt_handler(struct ext_code ext_code,
397397
unsigned int param32, unsigned long param64)
398398
{
399399
struct sclp_req *req;
@@ -818,7 +818,7 @@ EXPORT_SYMBOL(sclp_reactivate);
818818

819819
/* Handler for external interruption used during initialization. Modify
820820
* request state to done. */
821-
static void sclp_check_handler(unsigned int ext_int_code,
821+
static void sclp_check_handler(struct ext_code ext_code,
822822
unsigned int param32, unsigned long param64)
823823
{
824824
u32 finished_sccb;

0 commit comments

Comments
 (0)