1. 02 Mar, 2013 3 commits
    • James Hogan's avatar
      metag: move traps.c exports out of metag_ksyms.c · 9fb4aa87
      James Hogan authored
      It's less error prone to have function symbols exported immediately
      after the function rather than in metag_ksyms.c. Move each EXPORT_SYMBOL
      in metag_ksyms.c for symbols defined in traps.c into traps.c
      Signed-off-by: default avatarJames Hogan <james.hogan@imgtec.com>
    • James Hogan's avatar
      metag: move irq enable out of irqflags.h on SMP · fa771d02
      James Hogan authored
      The SMP version of arch_local_irq_enable() uses preempt_disable(), but
      <asm/irqflags.h> doesn't include <linux/preempt.h> causing the following
      errors on SMP when pstore/ftrace is enabled (caught by buildbot smp
      In file included from include/linux/irqflags.h:15,
                       from fs/pstore/ftrace.c:16:
      arch/metag/include/asm/irqflags.h: In function 'arch_local_irq_enable':
      arch/metag/include/asm/irqflags.h:84: error: implicit declaration of function 'preempt_disable'
      arch/metag/include/asm/irqflags.h:86: error: implicit declaration of function 'preempt_enable_no_resched'
      However <linux/preempt.h> cannot be easily included from
      <asm/irqflags.h> as it can cause circular include dependencies in the
      !SMP case, and potentially in the SMP case in the future. Therefore move
      the SMP implementation of arch_local_irq_enable() into traps.c and use
      an inline version of get_trigger_mask() which is also defined in traps.c
      for SMP.
      This adds an extra layer of function call / stack push when
      preempt_disable needs to call other functions, however in the
      non-preemptive SMP case it should be about as fast, as it was already
      calling the get_trigger_mask() function which is now used inline.
      Signed-off-by: default avatarJames Hogan <james.hogan@imgtec.com>
    • James Hogan's avatar
      metag: Traps · ac919f08
      James Hogan authored
      Add trap code for metag. At the lowest level Meta traps (and return from
      interrupt instruction - RTI) simply swap the PC and PCX registers and
      optionally toggle the interrupt status bit (ISTAT). Low level TBX code
      in tbipcx.S handles the core context save, determine the TBX signal
      number based on the core trigger that fired (using the TXSTATI status
      register), and call TBX signal handlers (mostly in traps.c) via a vector
      Signed-off-by: default avatarJames Hogan <james.hogan@imgtec.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>