linux/drivers/media/video
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
..
bt8xx IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
cpia2 IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
cx88 IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
cx25840 V4L/DVB (4519): Fixes Helper module dependencies against V4L APIs 2006-09-26 12:30:34 -03:00
em28xx IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
et61x251 IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
ovcamchip
pvrusb2 IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
pwc IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
saa7134 IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
sn9c102 IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
usbvideo IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
zc0301 IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
Kconfig Merge git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial 2006-10-03 16:35:11 -07:00
Makefile V4L/DVB (4568): Added missing KS0197 Kconfig item 2006-09-26 12:30:34 -03:00
adv7170.c
adv7175.c
arv.c IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
bt819.c
bt856.c
bt866.c V4L/DVB (4508): Fix an array overflow on bt866 2006-09-26 12:30:32 -03:00
btcx-risc.c
btcx-risc.h
bw-qcam.c V4L/DVB (4118): Whitespace cleanups 2006-06-25 02:05:10 -03:00
bw-qcam.h
c-qcam.c V4L/DVB (4068): Removed all references to kernel stuff from videodev.h and videodev2.h 2006-06-25 02:05:05 -03:00
compat_ioctl32.c V4L/DVB (4475): Fix most Compat32 stuff on V4L2 2006-09-26 11:53:51 -03:00
cpia.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
cpia.h V4L/DVB (4068): Removed all references to kernel stuff from videodev.h and videodev2.h 2006-06-25 02:05:05 -03:00
cpia_pp.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
cpia_usb.c IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
cs53l32a.c
cs8420.h
cx2341x.c V4L/DVB (4548): Better temporal filter handling. 2006-09-26 12:30:34 -03:00
dabfirmware.h
dabusb.c IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
dabusb.h
dpc7146.c
font.h
hexium_gemini.c
hexium_orion.c
ibmmpeg2.h
indycam.c
indycam.h
ir-kbd-i2c.c V4L/DVB (4670): Allow RC5 codes 64 - 127 in ir-kbd-i2c.c 2006-10-03 15:14:04 -03:00
ks0127.c V4L/DVB (4512): Ks0127: wire up i2c_add_driver() return value 2006-09-26 12:30:32 -03:00
ks0127.h V4L/DVB (3916): AverMedia 6 Eyes AVS6EYES support 2006-06-25 01:59:28 -03:00
meye.c IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
meye.h Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
msp3400-driver.c V4L/DVB (4688): Fix msp343xG handling (regression from 2.6.16) 2006-10-03 15:14:55 -03:00
msp3400-driver.h V4L/DVB (4688): Fix msp343xG handling (regression from 2.6.16) 2006-10-03 15:14:55 -03:00
msp3400-kthreads.c V4L/DVB (4688): Fix msp343xG handling (regression from 2.6.16) 2006-10-03 15:14:55 -03:00
mt20xx.c
mxb.c
mxb.h
ov511.c IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
ov511.h V4L/DVB (4068): Removed all references to kernel stuff from videodev.h and videodev2.h 2006-06-25 02:05:05 -03:00
planb.c IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
planb.h
pms.c V4L/DVB (4118): Whitespace cleanups 2006-06-25 02:05:10 -03:00
saa711x.c
saa711x_regs.h V4L/DVB (4551): Added register aliases for saa711x registers, instead of using reg numbers 2006-09-26 12:30:34 -03:00
saa5246a.c V4L/DVB (4421): V4L2 Conversion: saa5246a, saa5249, vino, hexium_orion, hexium_gemini 2006-09-26 11:53:36 -03:00
saa5246a.h
saa5249.c V4L/DVB (4421): V4L2 Conversion: saa5246a, saa5249, vino, hexium_orion, hexium_gemini 2006-09-26 11:53:36 -03:00
saa6588.c
saa7110.c V4L/DVB (4068): Removed all references to kernel stuff from videodev.h and videodev2.h 2006-06-25 02:05:05 -03:00
saa7111.c
saa7114.c
saa7115.c V4L/DVB (4626): On saa7111/7113, LUMA_CTRL need a different value 2006-09-26 12:30:36 -03:00
saa7121.h
saa7127.c V4L/DVB (4110): Small bug in saa7127.c 2006-06-25 02:05:09 -03:00
saa7146.h
saa7146reg.h
saa7185.c
saa7191.c
saa7191.h
saa7196.h
se401.c IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
se401.h V4L/DVB (4068): Removed all references to kernel stuff from videodev.h and videodev2.h 2006-06-25 02:05:05 -03:00
stradis.c IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
stv680.c IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
stv680.h
tda7432.c
tda8290.c
tda9840.c
tda9840.h
tda9875.c V4L/DVB (4118): Whitespace cleanups 2006-06-25 02:05:10 -03:00
tda9887.c V4L/DVB (4533): Tda9887: add configuration setting for L standard PLL gating 2006-09-26 12:30:34 -03:00
tea5767.c V4L/DVB (3715): Change all emails to the currently used one. 2006-06-25 01:57:39 -03:00
tea6415c.c
tea6415c.h
tea6420.c
tea6420.h
tlv320aic23b.c V4L/DVB (4048): Add support for the Texas Instruments TLV320AIC23B audio codec 2006-06-25 02:05:00 -03:00
tuner-3036.c V4L/DVB (4068): Removed all references to kernel stuff from videodev.h and videodev2.h 2006-06-25 02:05:05 -03:00
tuner-core.c V4L/DVB (4343): Fix for compilation without V4L1 or V4L1_COMPAT 2006-07-29 17:22:30 -03:00
tuner-simple.c V4L/DVB (4533): Tda9887: add configuration setting for L standard PLL gating 2006-09-26 12:30:34 -03:00
tuner-types.c V4L/DVB (4533): Tda9887: add configuration setting for L standard PLL gating 2006-09-26 12:30:34 -03:00
tvaudio.c V4L/DVB (4624): Tvaudio: Replaced kernel_thread() with kthread_run() 2006-09-26 12:30:36 -03:00
tveeprom.c V4L/DVB (4708): Add tveeprom support for Philips FM1236/FM1216ME MK5 2006-10-04 08:06:55 -03:00
tvmixer.c V4L/DVB (3968a): Remove compatibility check for I2C_PEC 2006-06-25 01:59:57 -03:00
tvp5150.c V4L/DVB (4506): TVP5150 routing logic were broken. 2006-09-26 12:30:32 -03:00
tvp5150_reg.h
upd64031a.c
upd64083.c
v4l1-compat.c V4L/DVB (4474): On some cases, depth were not returned. 2006-09-26 11:53:49 -03:00
v4l2-common.c V4L/DVB (4546): Add u32 argument to VIDIOC_INT_RESET. 2006-09-26 12:30:34 -03:00
video-buf-dvb.c V4L/DVB (4391): Refactor dvb_detach calls into a single dvb_frontend_detach function. 2006-09-26 11:53:29 -03:00
video-buf.c V4L/DVB (4685): Fix compiler warning in drivers/media/video/video-buf.c 2006-10-03 15:14:48 -03:00
videocodec.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
videocodec.h V4L/DVB (4269): Subject: videocodec: make 1-bit fields unsigned 2006-06-30 15:59:30 -03:00
videodev.c V4L/DVB (4637): Add a default method for VIDIOC_G_PARM 2006-09-26 12:30:36 -03:00
vino.c IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
vino.h
vivi.c V4L/DVB (4627): Vivi crashes with mplayer 2006-09-26 12:30:36 -03:00
vpx3220.c V4L/DVB (4515): Fixed module name, since it is, in fact, a decoder. 2006-09-26 12:30:32 -03:00
w9966.c V4L/DVB (4068): Removed all references to kernel stuff from videodev.h and videodev2.h 2006-06-25 02:05:05 -03:00
w9968cf.c IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
w9968cf.h Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
w9968cf_decoder.h
w9968cf_vpp.h
wm8739.c
wm8775.c
zoran.h V4L/DVB (4605): Fixes an issue with V4L1 and make headers-install 2006-09-10 13:45:55 -03:00
zoran_card.c V4L/DVB (4707): 4linux: complete conversion to hotplug safe PCI API 2006-10-04 08:06:50 -03:00
zoran_card.h
zoran_device.c IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
zoran_device.h IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
zoran_driver.c V4L/DVB (4632): Zoran: Implement pcipci failure check 2006-09-26 12:30:36 -03:00
zoran_procfs.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
zoran_procfs.h
zr36016.c
zr36016.h
zr36050.c
zr36050.h
zr36057.h
zr36060.c
zr36060.h
zr36120.c IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
zr36120.h
zr36120_i2c.c
zr36120_mem.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
zr36120_mem.h