[U-Boot] [PATCH 03/15] Add command to enable/disable interrupts

Kumar Gala
2008-08-18T23:18:09Z

On Aug 18, 2008, at 5:59 PM, Wolfgang Denk wrote:

> Dear Kumar Gala,
>
> In message <1218806685-3615-3-git-send-email-
> galak at kernel.crashing.org> you wrote:
>> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
>> ---
>> common/Makefile | 1 +
>> common/cmd_irq.c | 50 ++++++++++++++++++++++++++++++++++++++++++++
>> ++++++
>> 2 files changed, 51 insertions(+), 0 deletions(-)
>> create mode 100644 common/cmd_irq.c
> ...
>> +U_BOOT_CMD(
>> + interrupts, 5, 0, do_interrupts,
>> + "interrupts - enable or disable interrupts\n",
>> + "[on, off]\n"
>> + " - enable or disable interrupts\n"
>
> I suggest to also support this command without argument, in which case
> it would print the current setting.

The current arch interfaces don't have a "clean" way to do this right
now.

I can hack it in via:

iflag = disable_interrupts()
if (iflag) {
enable_interrupts()
printf("interrupts are enabled\n");
} else {
printf("interrupts are disabled\n");
}

If this isn't ok, I'd request you take this patch and I'll look at
adding an get_irqflags() to all the arches and add support to print
the interrupt state based on that.

- k