aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mn10300
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mn10300')
-rw-r--r--arch/mn10300/Kconfig74
-rw-r--r--arch/mn10300/include/asm/irqflags.h8
2 files changed, 76 insertions, 6 deletions
diff --git a/arch/mn10300/Kconfig b/arch/mn10300/Kconfig
index a1f334ce0a36..a0a16e6e4a4e 100644
--- a/arch/mn10300/Kconfig
+++ b/arch/mn10300/Kconfig
@@ -351,6 +351,80 @@ config MN10300_TTYSM2_CTS
351 351
352endmenu 352endmenu
353 353
354menu "Interrupt request priority options"
355
356comment "[!] NOTE: A lower number/level indicates a higher priority (0 is highest, 6 is lowest)"
357
358comment "____Non-maskable interrupt levels____"
359comment "The following must be set to a higher priority than local_irq_disable() and on-chip serial"
360
361config GDBSTUB_IRQ_LEVEL
362 int "GDBSTUB interrupt priority"
363 depends on GDBSTUB
364 range 0 1 if LINUX_CLI_LEVEL = 2
365 range 0 2 if LINUX_CLI_LEVEL = 3
366 range 0 3 if LINUX_CLI_LEVEL = 4
367 range 0 4 if LINUX_CLI_LEVEL = 5
368 range 0 5 if LINUX_CLI_LEVEL = 6
369 default 0
370
371comment "The following must be set to a higher priority than local_irq_disable()"
372
373config MN10300_SERIAL_IRQ_LEVEL
374 int "MN10300 on-chip serial interrupt priority"
375 depends on MN10300_TTYSM
376 range 1 1 if LINUX_CLI_LEVEL = 2
377 range 1 2 if LINUX_CLI_LEVEL = 3
378 range 1 3 if LINUX_CLI_LEVEL = 4
379 range 1 4 if LINUX_CLI_LEVEL = 5
380 range 1 5 if LINUX_CLI_LEVEL = 6
381 default 1
382
383comment "-"
384comment "____Maskable interrupt levels____"
385
386config LINUX_CLI_LEVEL
387 int "The highest interrupt priority excluded by local_irq_disable() (2-6)"
388 range 2 6
389 default 2
390 help
391 local_irq_disable() doesn't actually disable maskable interrupts -
392 what it does is restrict the levels of interrupt which are permitted
393 (a lower level indicates a higher priority) by lowering the value in
394 EPSW.IM from 7. Any interrupt is permitted for which the level is
395 lower than EPSW.IM.
396
397 Certain interrupts, such as GDBSTUB and virtual MN10300 on-chip
398 serial DMA interrupts are allowed to interrupt normal disabled
399 sections.
400
401comment "The following must be set to a equal to or lower priority than LINUX_CLI_LEVEL"
402
403config TIMER_IRQ_LEVEL
404 int "Kernel timer interrupt priority"
405 range LINUX_CLI_LEVEL 6
406 default 4
407
408config PCI_IRQ_LEVEL
409 int "PCI interrupt priority"
410 depends on PCI
411 range LINUX_CLI_LEVEL 6
412 default 5
413
414config ETHERNET_IRQ_LEVEL
415 int "Ethernet interrupt priority"
416 depends on SMC91X || SMC911X || SMSC911X
417 range LINUX_CLI_LEVEL 6
418 default 6
419
420config EXT_SERIAL_IRQ_LEVEL
421 int "External serial port interrupt priority"
422 depends on SERIAL_8250
423 range LINUX_CLI_LEVEL 6
424 default 6
425
426endmenu
427
354source "mm/Kconfig" 428source "mm/Kconfig"
355 429
356menu "Power management options" 430menu "Power management options"
diff --git a/arch/mn10300/include/asm/irqflags.h b/arch/mn10300/include/asm/irqflags.h
index f1b64b256060..b3ab2071354d 100644
--- a/arch/mn10300/include/asm/irqflags.h
+++ b/arch/mn10300/include/asm/irqflags.h
@@ -23,11 +23,7 @@
23 * - level 6 - timer interrupt 23 * - level 6 - timer interrupt
24 * - "enabled": run in IM7 24 * - "enabled": run in IM7
25 */ 25 */
26#ifdef CONFIG_MN10300_TTYSM 26#define MN10300_CLI_LEVEL (CONFIG_LINUX_CLI_LEVEL << EPSW_IM_SHIFT)
27#define MN10300_CLI_LEVEL EPSW_IM_2
28#else
29#define MN10300_CLI_LEVEL EPSW_IM_1
30#endif
31 27
32#ifndef __ASSEMBLY__ 28#ifndef __ASSEMBLY__
33 29
@@ -94,7 +90,7 @@ static inline void arch_local_irq_restore(unsigned long flags)
94 90
95static inline bool arch_irqs_disabled_flags(unsigned long flags) 91static inline bool arch_irqs_disabled_flags(unsigned long flags)
96{ 92{
97 return (flags & EPSW_IM) <= MN10300_CLI_LEVEL; 93 return (flags & (EPSW_IE | EPSW_IM)) != (EPSW_IE | EPSW_IM_7);
98} 94}
99 95
100static inline bool arch_irqs_disabled(void) 96static inline bool arch_irqs_disabled(void)