From 95281171a713f4d32f1a044b937563ec7776ccfe Mon Sep 17 00:00:00 2001 From: James Hogan Date: Tue, 5 Nov 2013 14:42:03 +0000 Subject: metag: handle low level kicks directly Kick interrupts trigger the LWK (low level kick) signal, usually handled by the __TBIDoStdLWK() function which is the only handler inherited from the bootloader. The LWK signal is converted either to a SWK (plain software kick) or a SWS (software kick with an attached message). Linux has kick_handler() to handle SWK and call registered kick handlers (IPIs and inter-thread comms), but SWS is as far as I'm aware unused with Linux. Therefore remove that abstraction and have Linux handle LWK directly. This will reduce kick latency slightly, and reduce our dependence on the bootloader, which makes it easier to directly boot a kernel in QEMU (particularly for SMP). Signed-off-by: James Hogan --- arch/metag/kernel/setup.c | 6 +----- arch/metag/kernel/traps.c | 5 ++--- 2 files changed, 3 insertions(+), 8 deletions(-) (limited to 'arch/metag/kernel') diff --git a/arch/metag/kernel/setup.c b/arch/metag/kernel/setup.c index c396cd0..e639bae 100644 --- a/arch/metag/kernel/setup.c +++ b/arch/metag/kernel/setup.c @@ -302,13 +302,9 @@ void __init setup_arch(char **cmdline_p) * rather than the version from the bootloader. This makes call * stacks easier to understand and may allow us to unmap the * bootloader at some point. - * - * We need to keep the LWK handler that TBI installed in order to - * be able to do inter-thread comms. */ for (i = 0; i <= TBID_SIGNUM_MAX; i++) - if (i != TBID_SIGNUM_LWK) - _pTBI->fnSigs[i] = __TBIUnExpXXX; + _pTBI->fnSigs[i] = __TBIUnExpXXX; /* A Meta requirement is that the kernel is loaded (virtually) * at the PAGE_OFFSET. diff --git a/arch/metag/kernel/traps.c b/arch/metag/kernel/traps.c index 25f9d1c..17b2e2e 100644 --- a/arch/metag/kernel/traps.c +++ b/arch/metag/kernel/traps.c @@ -819,8 +819,7 @@ void per_cpu_trap_init(unsigned long cpu) set_trigger_mask(TBI_INTS_INIT(thread) | /* interrupts */ TBI_TRIG_BIT(TBID_SIGNUM_LWK) | /* low level kick */ - TBI_TRIG_BIT(TBID_SIGNUM_SW1) | - TBI_TRIG_BIT(TBID_SIGNUM_SWS)); + TBI_TRIG_BIT(TBID_SIGNUM_SW1)); /* non-priv - use current stack */ int_context.Sig.pCtx = NULL; @@ -842,7 +841,7 @@ void __init trap_init(void) _pTBI->fnSigs[TBID_SIGNUM_SW1] = switch1_handler; _pTBI->fnSigs[TBID_SIGNUM_SW2] = switchx_handler; _pTBI->fnSigs[TBID_SIGNUM_SW3] = switchx_handler; - _pTBI->fnSigs[TBID_SIGNUM_SWK] = kick_handler; + _pTBI->fnSigs[TBID_SIGNUM_LWK] = kick_handler; #ifdef CONFIG_METAG_META21 _pTBI->fnSigs[TBID_SIGNUM_DFR] = __TBIHandleDFR; -- cgit v1.1