Skip to content

Commit

Permalink
Support for "irq" and "irq -u" on the S390 and S390X architectures
Browse files Browse the repository at this point in the history
if they are running Linux 3.12 and later kernels.  Older kernels
without GENERIC_HARDIRQ support will fail with the error message
"irq: cannot determine number of IRQs".
([email protected])
  • Loading branch information
Dave Anderson committed Nov 17, 2014
1 parent 8cccbed commit f15a488
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 32 deletions.
6 changes: 0 additions & 6 deletions kernel.c
Original file line number Diff line number Diff line change
Expand Up @@ -5575,9 +5575,6 @@ cmd_irq(void)
return;

case 'u':
if (machine_type("S390") || machine_type("S390X"))
command_not_supported();

pc->curcmd_flags |= IRQ_IN_USE;
if (kernel_symbol_exists("no_irq_chip"))
pc->curcmd_private = (ulonglong)symbol_value("no_irq_chip");
Expand Down Expand Up @@ -5633,9 +5630,6 @@ cmd_irq(void)
if (argerrs)
cmd_usage(pc->curcmd, SYNOPSIS);

if (machine_type("S390") || machine_type("S390X"))
command_not_supported();

if ((nr_irqs = machdep->nr_irqs) == 0)
error(FATAL, "cannot determine number of IRQs\n");

Expand Down
24 changes: 11 additions & 13 deletions s390.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ static int s390_translate_pte(ulong, void *, ulonglong);
static ulong s390_processor_speed(void);
static int s390_eframe_search(struct bt_info *);
static void s390_back_trace_cmd(struct bt_info *);
static void s390_dump_irq(int);
static void s390_get_stack_frame(struct bt_info *, ulong *, ulong *);
static int s390_dis_filter(ulong, char *, unsigned int);
static void s390_cmd_mach(void);
Expand Down Expand Up @@ -146,9 +145,17 @@ s390_init(int when)
break;

case POST_GDB:
machdep->nr_irqs = 0; /* TBD */
if (symbol_exists("irq_desc"))
ARRAY_LENGTH_INIT(machdep->nr_irqs, irq_desc,
"irq_desc", NULL, 0);
else if (kernel_symbol_exists("nr_irqs"))
get_symbol_data("nr_irqs", sizeof(unsigned int),
&machdep->nr_irqs);
else
machdep->nr_irqs = 0;

machdep->vmalloc_start = s390_vmalloc_start;
machdep->dump_irq = s390_dump_irq;
machdep->dump_irq = generic_dump_irq;
if (!machdep->hz)
machdep->hz = HZ;
machdep->section_size_bits = _SECTION_SIZE_BITS;
Expand Down Expand Up @@ -194,7 +201,7 @@ s390_dump_machdep_table(ulong arg)
fprintf(fp, " uvtop: s390_uvtop()\n");
fprintf(fp, " kvtop: s390_kvtop()\n");
fprintf(fp, " get_task_pgd: s390_get_task_pgd()\n");
fprintf(fp, " dump_irq: s390_dump_irq()\n");
fprintf(fp, " dump_irq: generic_dump_irq()\n");
fprintf(fp, " get_stack_frame: s390_get_stack_frame()\n");
fprintf(fp, " get_stackbase: generic_get_stackbase()\n");
fprintf(fp, " get_stacktop: generic_get_stacktop()\n");
Expand Down Expand Up @@ -953,15 +960,6 @@ s390_get_stack_frame(struct bt_info *bt, ulong *eip, ulong *esp)
}
}

/*
* cmd_irq() is not implemented for s390.
*/
static void
s390_dump_irq(int irq)
{
error(FATAL, "s390_dump_irq: TBD\n");
}

/*
* Filter disassembly output if the output radix is not gdb's default 10
*/
Expand Down
24 changes: 11 additions & 13 deletions s390x.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ static int s390x_translate_pte(ulong, void *, ulonglong);
static ulong s390x_processor_speed(void);
static int s390x_eframe_search(struct bt_info *);
static void s390x_back_trace_cmd(struct bt_info *);
static void s390x_dump_irq(int);
static void s390x_get_stack_frame(struct bt_info *, ulong *, ulong *);
static int s390x_dis_filter(ulong, char *, unsigned int);
static void s390x_cmd_mach(void);
Expand Down Expand Up @@ -412,9 +411,17 @@ s390x_init(int when)
break;

case POST_GDB:
machdep->nr_irqs = 0; /* TBD */
if (symbol_exists("irq_desc"))
ARRAY_LENGTH_INIT(machdep->nr_irqs, irq_desc,
"irq_desc", NULL, 0);
else if (kernel_symbol_exists("nr_irqs"))
get_symbol_data("nr_irqs", sizeof(unsigned int),
&machdep->nr_irqs);
else
machdep->nr_irqs = 0;

machdep->vmalloc_start = s390x_vmalloc_start;
machdep->dump_irq = s390x_dump_irq;
machdep->dump_irq = generic_dump_irq;
if (!machdep->hz)
machdep->hz = HZ;
machdep->section_size_bits = _SECTION_SIZE_BITS;
Expand Down Expand Up @@ -462,7 +469,7 @@ s390x_dump_machdep_table(ulong arg)
fprintf(fp, " uvtop: s390x_uvtop()\n");
fprintf(fp, " kvtop: s390x_kvtop()\n");
fprintf(fp, " get_task_pgd: s390x_get_task_pgd()\n");
fprintf(fp, " dump_irq: s390x_dump_irq()\n");
fprintf(fp, " dump_irq: generic_dump_irq()\n");
fprintf(fp, " get_stack_frame: s390x_get_stack_frame()\n");
fprintf(fp, " get_stackbase: generic_get_stackbase()\n");
fprintf(fp, " get_stacktop: generic_get_stacktop()\n");
Expand Down Expand Up @@ -1412,15 +1419,6 @@ s390x_get_stack_frame(struct bt_info *bt, ulong *eip, ulong *esp)
}
}

/*
* cmd_irq() is not implemented for s390x.
*/
static void
s390x_dump_irq(int irq)
{
error(FATAL, "s390x_dump_irq: TBD\n");
}

/*
* Filter disassembly output if the output radix is not gdb's default 10
*/
Expand Down

0 comments on commit f15a488

Please sign in to comment.