linux-stable-rt/include/asm-powerpc
David Howells 7d12e780e0 IRQ: Maintain regs pointer globally rather than passing to IRQ handlers
Maintain a per-CPU global "struct pt_regs *" variable which can be used instead
of passing regs around manually through all ~1800 interrupt handlers in the
Linux kernel.

The regs pointer is used in few places, but it potentially costs both stack
space and code to pass it around.  On the FRV arch, removing the regs parameter
from all the genirq function results in a 20% speed up of the IRQ exit path
(ie: from leaving timer_interrupt() to leaving do_IRQ()).

Where appropriate, an arch may override the generic storage facility and do
something different with the variable.  On FRV, for instance, the address is
maintained in GR28 at all times inside the kernel as part of general exception
handling.

Having looked over the code, it appears that the parameter may be handed down
through up to twenty or so layers of functions.  Consider a USB character
device attached to a USB hub, attached to a USB controller that posts its
interrupts through a cascaded auxiliary interrupt controller.  A character
device driver may want to pass regs to the sysrq handler through the input
layer which adds another few layers of parameter passing.

I've build this code with allyesconfig for x86_64 and i386.  I've runtested the
main part of the code on FRV and i386, though I can't test most of the drivers.
I've also done partial conversion for powerpc and MIPS - these at least compile
with minimal configurations.

This will affect all archs.  Mostly the changes should be relatively easy.
Take do_IRQ(), store the regs pointer at the beginning, saving the old one:

	struct pt_regs *old_regs = set_irq_regs(regs);

And put the old one back at the end:

	set_irq_regs(old_regs);

Don't pass regs through to generic_handle_irq() or __do_IRQ().

In timer_interrupt(), this sort of change will be necessary:

	-	update_process_times(user_mode(regs));
	-	profile_tick(CPU_PROFILING, regs);
	+	update_process_times(user_mode(get_irq_regs()));
	+	profile_tick(CPU_PROFILING);

I'd like to move update_process_times()'s use of get_irq_regs() into itself,
except that i386, alone of the archs, uses something other than user_mode().

Some notes on the interrupt handling in the drivers:

 (*) input_dev() is now gone entirely.  The regs pointer is no longer stored in
     the input_dev struct.

 (*) finish_unlinks() in drivers/usb/host/ohci-q.c needs checking.  It does
     something different depending on whether it's been supplied with a regs
     pointer or not.

 (*) Various IRQ handler function pointers have been moved to type
     irq_handler_t.

Signed-Off-By: David Howells <dhowells@redhat.com>
(cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)
2006-10-05 15:10:12 +01:00
..
iseries [POWERPC] Merge iSeries i/o operations with the rest 2006-09-22 15:19:58 +10:00
8253pit.h
Kbuild [HEADERS] One line per header in Kbuild files to reduce conflicts 2006-09-19 12:43:58 +01:00
a.out.h
abs_addr.h
agp.h
asm-compat.h
atomic.h
auxvec.h
backlight.h
bitops.h
bootx.h
btext.h
bug.h [PATCH] Let WARN_ON/WARN_ON_ONCE return the condition 2006-09-29 09:18:06 -07:00
bugs.h
byteorder.h
cache.h
cacheflush.h
checksum.h
compat.h
cputable.h [POWERPC] powerpc: PA6T cputable entry, PVR value 2006-09-13 18:39:52 +10:00
cputime.h
current.h
dbdma.h
delay.h
div64.h
dma-mapping.h
dma.h
eeh.h [POWERPC] Fix MMIO ops to provide expected barrier behaviour 2006-09-13 22:08:26 +10:00
eeh_event.h
elf.h
emergency-restart.h
errno.h
fcntl.h
firmware.h [POWERPC] implement BEGIN/END_FW_FTR_SECTION 2006-10-03 16:50:21 +10:00
floppy.h
fs_pd.h POWERPC: Get rid of remapping the whole immr 2006-09-21 22:37:58 +04:00
futex.h [POWERPC] Implement PowerPC futex_atomic_cmpxchg_inatomic(). 2006-09-13 18:28:41 +10:00
grackle.h
hardirq.h
heathrow.h
hvcall.h [POWERPC] powerpc: Instrument Hypervisor Calls 2006-09-13 18:39:53 +10:00
hvconsole.h
hvcserver.h
hw_irq.h
i8259.h
ibmebus.h
ide.h [POWERPC] clean up ide io accessors 2006-09-20 14:06:18 +10:00
immap_86xx.h
immap_qe.h [POWERPC] Add QUICC Engine (QE) infrastructure 2006-10-04 15:24:27 +10:00
io.h [PATCH] restore parport_pc probing on powermac 2006-10-03 08:03:41 -07:00
ioctl.h
ioctls.h
iommu.h
ipc.h
ipcbuf.h
ipic.h fix file specification in comments 2006-10-03 23:01:26 +02:00
irq.h IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
irq_regs.h IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
irqflags.h
kdebug.h
kdump.h [POWERPC] kdump: Support kernels having 64k page size. 2006-09-13 18:30:04 +10:00
kexec.h [POWERPC] Make crash.c work on 32-bit and 64-bit 2006-08-17 16:41:10 +10:00
keylargo.h
kmap_types.h
kprobes.h [PATCH] kprobes: handle symbol resolution when <module:.symbol> is specified 2006-10-02 07:57:16 -07:00
linkage.h
lmb.h
local.h
lppaca.h [POWERPC] Update lppaca offset comments 2006-08-08 17:08:58 +10:00
machdep.h
macio.h
mc146818rtc.h
mediabay.h
mman.h
mmu.h
mmu_context.h
mmzone.h
module.h
mpc85xx.h POWERPC: Add support for the mpc8560 eval board 2006-09-21 22:31:26 +04:00
mpc86xx.h [POWERPC] Use mpc8641hpcn PIC base address from dev tree. 2006-08-25 14:32:13 +10:00
mpic.h [POWERPC] Support for "weird" MPICs and fixup mpc7448_hpc2 2006-08-30 14:29:42 +10:00
msgbuf.h
mutex.h
namei.h
nvram.h
of_device.h
ohare.h
oprofile_impl.h
pSeries_reconfig.h
paca.h Merge branch 'linux-2.6' 2006-09-14 07:07:18 +10:00
page.h [POWERPC] Remove DISCONTIGMEM cruft from page.h 2006-09-22 15:19:58 +10:00
page_32.h
page_64.h
param.h
parport.h
pci-bridge.h Remove all inclusions of <linux/config.h> 2006-10-04 03:38:54 -04:00
pci.h
percpu.h
pgalloc.h [POWERPC] hugepage BUG fix 2006-08-24 10:07:23 +10:00
pgtable-4k.h [PATCH] Standardize pxx_page macros 2006-09-26 08:48:51 -07:00
pgtable-64k.h
pgtable.h [PATCH] Standardize pxx_page macros 2006-09-26 08:48:51 -07:00
pmac_feature.h
pmac_low_i2c.h
pmac_pfunc.h
pmc.h
poll.h
posix_types.h
ppc-pci.h [POWERPC] EEH: enable MMIO/DMA on frozen slot 2006-09-21 22:59:14 +10:00
ppc_asm.h
processor.h
prom.h [POWERPC] Define of_read_ulong helper 2006-09-20 15:09:48 +10:00
ptrace.h [PATCH] Add regs_return_value() helper 2006-10-02 07:57:16 -07:00
qe.h [POWERPC] Add QUICC Engine (QE) infrastructure 2006-10-04 15:24:27 +10:00
qe_ic.h [POWERPC] Add QUICC Engine (QE) infrastructure 2006-10-04 15:24:27 +10:00
reg.h [POWERPC] powerpc: PA6T cputable entry, PVR value 2006-09-13 18:39:52 +10:00
reg_8xx.h
resource.h
rtas.h [POWERPC] Add a helper for calculating RTAS "config_addr" parameters 2006-08-25 13:27:35 +10:00
rtc.h
rwsem.h
scatterlist.h
seccomp.h
sections.h
semaphore.h
sembuf.h
serial.h
setup.h
shmbuf.h
shmparam.h
sigcontext.h
siginfo.h
signal.h
smp.h IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
smu.h
socket.h
sockios.h
sparsemem.h
spinlock.h [PATCH] Directed yield: direct yield of spinlocks for powerpc 2006-10-01 00:39:22 -07:00
spinlock_types.h
spu.h [POWERPC] spufs: add infrastructure for finding elf objects 2006-10-05 09:21:02 +10:00
spu_csa.h
spu_priv1.h
sstep.h
stat.h
statfs.h
string.h
synch.h
syscalls.h
systbl.h
system.h [POWERPC] Cleanup include/asm-powerpc/xmon.h 2006-10-04 14:52:17 +10:00
tce.h
termbits.h
termios.h
thread_info.h
time.h [POWERPC] Add powerpc get/set_rtc_time interface to new generic rtc class 2006-10-02 17:48:47 +10:00
timex.h
tlb.h
tlbflush.h
todc.h
topology.h [PATCH] sched: introduce child field in sched_domain 2006-10-03 08:04:06 -07:00
tsi108.h [POWERPC] Update mpc7448hpc2 board irq support using device tree 2006-08-23 15:51:18 +10:00
tsi108_irq.h [POWERPC] Update mpc7448hpc2 board irq support using device tree 2006-08-23 15:51:18 +10:00
types.h
uaccess.h
ucc.h [POWERPC] Add QUICC Engine (QE) infrastructure 2006-10-04 15:24:27 +10:00
ucc_fast.h [POWERPC] Add QUICC Engine (QE) infrastructure 2006-10-04 15:24:27 +10:00
ucc_slow.h [POWERPC] Add QUICC Engine (QE) infrastructure 2006-10-04 15:24:27 +10:00
ucontext.h
udbg.h
unaligned.h
uninorth.h
unistd.h [PATCH] rename the provided execve functions to kernel_execve 2006-10-02 07:57:23 -07:00
user.h
vdso.h
vdso_datapage.h
vga.h
vio.h
xmon.h [POWERPC] Fix xmon=off and cleanup xmon initialisation 2006-10-04 14:52:22 +10:00
xor.h