linux/arch/arc/include/asm
Vineet Gupta 359105bdb0 ARC: pt_regs update #4: r25 saved/restored unconditionally
(This is a VERY IMP change for low level interrupt/exception handling)

-----------------------------------------------------------------------
WHAT
-----------------------------------------------------------------------
* User 25 now saved in pt_regs->user_r25 (vs. tsk->thread_info.user_r25)

* This allows Low level interrupt code to unconditionally save r25
  (vs. the prev version which would only do it for U->K transition).
  Ofcourse for nested interrupts, only the pt_regs->user_r25 of
  bottom-most frame is useful.

* simplifies the interrupt prologue/epilogue

* Needed for ARCv2 ISA code and done here to keep design similar with
  ARCompact event handling

-----------------------------------------------------------------------
WHY
-------------------------------------------------------------------------
With CONFIG_ARC_CURR_IN_REG, r25 is used to cache "current" task pointer
in kernel mode. So when entering kernel mode from User Mode
- user r25 is specially safe-kept (it being a callee reg is NOT part of
  pt_regs which are saved by default on each interrupt/trap/exception)
- r25 loaded with current task pointer.

Further, if interrupt was taken in kernel mode, this is skipped since we
know that r25 already has valid "current" pointer.

With 2 level of interrupts in ARCompact ISA, detecting this is difficult
but still possible, since we could be in kernel mode but r25 not already saved
(in fact the stack itself might not have been switched).

A. User mode
B. L1 IRQ taken
C. L2 IRQ taken (while on 1st line of L1 ISR)

So in #C, although in kernel mode, r25 not saved (infact SP not
switched at all)

Given that ARcompact has manual stack switching, we could use a bit of
trickey - The low level code would make sure that SP is only set to kernel
mode value at the very end (after saving r25). So a non kernel mode SP,
even if in kernel mode, meant r25 was NOT saved.

The same paradigm won't work in ARCv2 ISA since SP is auto-switched so
it's setting can't be delayed/constrained.

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
2013-06-22 19:23:25 +05:30
..
Kbuild ARC: [mm] Aliasing VIPT dcache support 4/4 2013-05-09 22:00:57 +05:30
arcregs.h ARC: Entry Handler tweaks: Avoid hardcoded LIMMS for ECR values 2013-06-22 19:23:23 +05:30
asm-offsets.h ARC: Generic Headers 2013-01-28 12:34:21 +05:30
atomic.h ARC: Atomic/bitops/cmpxchg/barriers 2013-02-11 20:00:30 +05:30
barrier.h ARC: Atomic/bitops/cmpxchg/barriers 2013-02-11 20:00:30 +05:30
bitops.h ARC: Atomic/bitops/cmpxchg/barriers 2013-02-11 20:00:30 +05:30
bug.h ARC: Fundamental ARCH data-types/defines 2013-02-11 20:00:34 +05:30
cache.h ARC: cache detection code bitrot 2013-06-22 13:46:43 +05:30
cacheflush.h ARC: [mm] Assume pagecache page dirty by default 2013-06-22 19:23:19 +05:30
checksum.h ARC: Checksum/byteorder/swab routines 2013-02-11 20:00:34 +05:30
clk.h ARC: [DeviceTree] Convert some Kconfig items to runtime values 2013-02-15 23:15:56 +05:30
cmpxchg.h ARC: Atomic/bitops/cmpxchg/barriers 2013-02-11 20:00:30 +05:30
current.h ARC: [optim] Cache "current" in Register r25 2013-02-15 23:15:58 +05:30
delay.h ARC: Timers/counters/delay management 2013-02-11 20:00:39 +05:30
disasm.h ARC: disassembly (needed by kprobes/kgdb/unaligned-access-emul) 2013-02-15 23:16:04 +05:30
dma-mapping.h arc: fix dma_address assignment during dma_map_sg() 2013-03-19 15:34:53 +05:30
dma.h ARC: I/O and DMA Mappings 2013-02-15 23:15:54 +05:30
elf.h ARC: Remove SET_PERSONALITY (tracks cross-arch change) 2013-03-18 14:37:05 +05:30
entry.h ARC: pt_regs update #4: r25 saved/restored unconditionally 2013-06-22 19:23:25 +05:30
exec.h ARC: Fundamental ARCH data-types/defines 2013-02-11 20:00:34 +05:30
futex.h ARC: Futex support 2013-02-15 23:16:00 +05:30
io.h ARC: Add support for ioremap_prot API 2013-02-15 23:16:11 +05:30
irq.h ARC: Prepare interrupt code for external controllers 2013-05-07 13:43:58 +05:30
irqflags.h ARC: Disintegrate arcregs.h 2013-06-22 13:46:42 +05:30
kdebug.h ARC: Fundamental ARCH data-types/defines 2013-02-11 20:00:34 +05:30
kgdb.h ARC: make allyesconfig build breakages 2013-03-11 19:01:09 +05:30
kprobes.h ARC: kprobes support 2013-02-15 23:16:05 +05:30
linkage.h ARC: Support for single cycle Close Coupled Mem (CCM) 2013-02-15 23:16:10 +05:30
mach_desc.h ARC: make a copy of flat DT 2013-02-26 14:25:18 +05:30
mmu.h ARC: Disintegrate arcregs.h 2013-06-22 13:46:42 +05:30
mmu_context.h ARC: SMP support 2013-02-15 23:16:02 +05:30
module.h ARC: DWARF2 .debug_frame based stack unwinder 2013-02-15 23:16:03 +05:30
mutex.h ARC: SMP support 2013-02-15 23:16:02 +05:30
page.h ARC: [mm] Make stack/heap Non-executable by default 2013-06-22 19:23:20 +05:30
perf_event.h ARC: perf support (software counters only) 2013-02-15 23:16:09 +05:30
pgalloc.h ARC: Page Table Management 2013-02-15 23:15:51 +05:30
pgtable.h ARC: Disintegrate arcregs.h 2013-06-22 13:46:42 +05:30
processor.h ARC: pt_regs update #4: r25 saved/restored unconditionally 2013-06-22 19:23:25 +05:30
prom.h ARC: [Review] Multi-platform image #2: Board callback Infrastructure 2013-02-15 23:16:13 +05:30
ptrace.h ARC: pt_regs update #4: r25 saved/restored unconditionally 2013-06-22 19:23:25 +05:30
sections.h ARC: [DeviceTree] Basic support 2013-02-15 23:15:55 +05:30
segment.h ARC: uaccess friends 2013-02-11 20:00:31 +05:30
serial.h ARC: [TB10x] Add support for TB10x platform 2013-05-07 13:43:59 +05:30
setup.h ARC: UAPI Disintegrate arch/arc/include/asm 2013-02-15 23:16:11 +05:30
shmparam.h ARC: [mm] Aliasing VIPT dcache support 4/4 2013-05-09 22:00:57 +05:30
smp.h ARC: [Review] Multi-platform image #7: SMP common code to use callbacks 2013-02-15 23:16:16 +05:30
spinlock.h ARC: Spinlock/rwlock/mutex primitives 2013-02-11 20:00:35 +05:30
spinlock_types.h ARC: Spinlock/rwlock/mutex primitives 2013-02-11 20:00:35 +05:30
string.h ARC: String library 2013-02-11 20:00:35 +05:30
switch_to.h ARC: Process-creation/scheduling/idle-loop 2013-02-11 20:00:38 +05:30
syscall.h ARC: Syscall support (no-legacy-syscall ABI) 2013-02-11 20:00:38 +05:30
syscalls.h ARC: ABIv3: fork/vfork wrappers not needed in "no-legacy-syscall" ABI 2013-03-11 19:01:10 +05:30
thread_info.h ARC: Fundamental ARCH data-types/defines 2013-02-11 20:00:34 +05:30
timex.h ARC: Timers/counters/delay management 2013-02-11 20:00:39 +05:30
tlb-mmu1.h ARC: Disintegrate arcregs.h 2013-06-22 13:46:42 +05:30
tlb.h ARC: Disintegrate arcregs.h 2013-06-22 13:46:42 +05:30
tlbflush.h ARC: TLB flush Handling 2013-02-15 23:15:53 +05:30
uaccess.h ARC: [optim] uaccess __{get,put}_user() optimised 2013-02-11 20:00:32 +05:30
unaligned.h ARC: Unaligned access emulation 2013-02-15 23:16:06 +05:30
unwind.h ARC: DWARF2 .debug_frame based stack unwinder 2013-02-15 23:16:03 +05:30