linux-kernel-test/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 V4L/DVB (3599b): Whitespace cleanups under drivers/media 2006-03-25 09:29:23 -03:00
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
adv7170.c V4L/DVB (3599b): Whitespace cleanups under drivers/media 2006-03-25 09:29:23 -03:00
adv7175.c V4L/DVB (3599b): Whitespace cleanups under drivers/media 2006-03-25 09:29:23 -03:00
arv.c IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
bt819.c V4L/DVB (3599b): Whitespace cleanups under drivers/media 2006-03-25 09:29:23 -03:00
bt856.c V4L/DVB (3599b): Whitespace cleanups under drivers/media 2006-03-25 09:29:23 -03:00
bt866.c V4L/DVB (4508): Fix an array overflow on bt866 2006-09-26 12:30:32 -03:00
btcx-risc.c V4L/DVB (3355): removed uneeded init on structs like static int foo=0 2006-01-13 14:10:19 -02:00
btcx-risc.h [PATCH] v4l: common part Updates and tuner additions 2005-09-09 13:57:49 -07:00
bw-qcam.c V4L/DVB (4118): Whitespace cleanups 2006-06-25 02:05:10 -03:00
bw-qcam.h V4L/DVB (3318b): sem2mutex: drivers/media/, #2 2006-02-07 06:49:14 -02:00
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_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
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
cs53l32a.c V4L/DVB (3599): Implement new routing commands for wm8775 and cs53l32a. 2006-03-24 16:27:00 -03:00
cs8420.h V4L/DVB (3599b): Whitespace cleanups under drivers/media 2006-03-25 09:29:23 -03:00
cx2341x.c V4L/DVB (4548): Better temporal filter handling. 2006-09-26 12:30:34 -03:00
dabfirmware.h V4L/DVB (3599a): Move drivers/usb/media to drivers/media/video 2006-03-25 09:29:04 -03:00
dabusb.c IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
dabusb.h V4L/DVB (3599b): Whitespace cleanups under drivers/media 2006-03-25 09:29:23 -03:00
dpc7146.c V4L/DVB (3537a): Whitespace cleanup 2006-03-21 08:53:57 -08:00
font.h V4L/DVB (3518): Creates a virtual video device driver 2006-03-24 16:26:49 -03:00
hexium_gemini.c V4L/DVB (3537a): Whitespace cleanup 2006-03-21 08:53:57 -08:00
hexium_orion.c V4L/DVB (3537a): Whitespace cleanup 2006-03-21 08:53:57 -08:00
ibmmpeg2.h
indycam.c V4L/DVB (3344a): Conversions from kmalloc+memset to k(z|c)alloc 2006-01-11 19:40:56 -02:00
indycam.h VINO driver version 0.0.5. 2005-11-07 18:05:41 +00:00
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
Kconfig Merge git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial 2006-10-03 16:35:11 -07: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
Makefile V4L/DVB (4568): Added missing KS0197 Kconfig item 2006-09-26 12:30:34 -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 V4L/DVB (3384): Separate tv & radio freqs, fix cb/freq transmit order for tuners that need this. 2006-01-15 21:25:32 -02:00
mxb.c V4L/DVB (3584): Implement V4L2_TUNER_MODE_LANG1_LANG2 audio mode 2006-03-24 16:26:58 -03:00
mxb.h V4L/DVB (3537a): Whitespace cleanup 2006-03-21 08:53:57 -08:00
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 V4L/DVB (3599b): Whitespace cleanups under drivers/media 2006-03-25 09:29:23 -03:00
pms.c V4L/DVB (4118): Whitespace cleanups 2006-06-25 02:05:10 -03:00
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
saa711x.c [PATCH] I2C: Drop unneeded i2c-dev.h includes 2006-03-23 14:21:55 -08: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 V4L/DVB (3546): Fix Compilation after moving bttv code 2006-03-24 16:26:51 -03:00
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 V4L/DVB (3599b): Whitespace cleanups under drivers/media 2006-03-25 09:29:23 -03:00
saa7114.c V4L/DVB (3599b): Whitespace cleanups under drivers/media 2006-03-25 09:29:23 -03:00
saa7115.c V4L/DVB (4626): On saa7111/7113, LUMA_CTRL need a different value 2006-09-26 12:30:36 -03:00
saa7121.h V4L/DVB (3599b): Whitespace cleanups under drivers/media 2006-03-25 09:29:23 -03:00
saa7127.c V4L/DVB (4110): Small bug in saa7127.c 2006-06-25 02:05:09 -03:00
saa7146.h V4L/DVB (3599b): Whitespace cleanups under drivers/media 2006-03-25 09:29:23 -03:00
saa7146reg.h V4L/DVB (3599b): Whitespace cleanups under drivers/media 2006-03-25 09:29:23 -03:00
saa7185.c V4L/DVB (3599b): Whitespace cleanups under drivers/media 2006-03-25 09:29:23 -03:00
saa7191.c V4L/DVB (3344a): Conversions from kmalloc+memset to k(z|c)alloc 2006-01-11 19:40:56 -02:00
saa7191.h VINO driver version 0.0.5. 2005-11-07 18:05:41 +00:00
saa7196.h V4L/DVB (3599b): Whitespace cleanups under drivers/media 2006-03-25 09:29:23 -03:00
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 V4L/DVB (3599b): Whitespace cleanups under drivers/media 2006-03-25 09:29:23 -03:00
tda7432.c V4L/DVB (3577): Cleanup audio input handling 2006-03-24 16:26:56 -03:00
tda8290.c V4L/DVB (3378): Restore power on defaults of tda9887 after tda8290 probe 2006-03-03 14:18:07 -03:00
tda9840.c V4L/DVB (3599b): Whitespace cleanups under drivers/media 2006-03-25 09:29:23 -03:00
tda9840.h V4L/DVB (3548): Renamed I2C_foo addresses to I2C_ADDR_foo 2006-03-24 16:26:51 -03:00
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 V4L/DVB (3599b): Whitespace cleanups under drivers/media 2006-03-25 09:29:23 -03:00
tea6415c.h
tea6420.c V4L/DVB (3599b): Whitespace cleanups under drivers/media 2006-03-25 09:29:23 -03:00
tea6420.h V4L/DVB (3548): Renamed I2C_foo addresses to I2C_ADDR_foo 2006-03-24 16:26:51 -03:00
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_reg.h V4L/DVB (3408): Included new sliced VBI types to videodev2.h and tvp5150 2006-01-23 17:11:05 -02:00
tvp5150.c V4L/DVB (4506): TVP5150 routing logic were broken. 2006-09-26 12:30:32 -03:00
upd64031a.c V4L/DVB (3666): Remove trailing newlines 2006-04-02 04:55:52 -03:00
upd64083.c V4L/DVB (3665): Add new NEC uPD64031A and uPD64083 i2c drivers 2006-04-02 04:55:51 -03:00
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 [PATCH] Indycam / VINO drivers 2005-09-07 16:58:01 -07:00
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_decoder.h V4L/DVB (3599b): Whitespace cleanups under drivers/media 2006-03-25 09:29:23 -03:00
w9968cf_vpp.h V4L/DVB (3599b): Whitespace cleanups under drivers/media 2006-03-25 09:29:23 -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
wm8739.c V4L/DVB (3661): Add wm8739 stereo audio ADC i2c driver 2006-04-02 04:55:45 -03:00
wm8775.c V4L/DVB (3599): Implement new routing commands for wm8775 and cs53l32a. 2006-03-24 16:27:00 -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 V4L/DVB (3599b): Whitespace cleanups under drivers/media 2006-03-25 09:29:23 -03:00
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 V4L/DVB (3599b): Whitespace cleanups under drivers/media 2006-03-25 09:29:23 -03:00
zoran.h V4L/DVB (4605): Fixes an issue with V4L1 and make headers-install 2006-09-10 13:45:55 -03:00
zr36016.c V4L/DVB (3599b): Whitespace cleanups under drivers/media 2006-03-25 09:29:23 -03:00
zr36016.h
zr36050.c V4L/DVB (3599b): Whitespace cleanups under drivers/media 2006-03-25 09:29:23 -03:00
zr36050.h
zr36057.h V4L/DVB (3599b): Whitespace cleanups under drivers/media 2006-03-25 09:29:23 -03:00
zr36060.c V4L/DVB (3599b): Whitespace cleanups under drivers/media 2006-03-25 09:29:23 -03:00
zr36060.h
zr36120_i2c.c V4L/DVB (3413): Typos grab bag of the month 2006-03-08 12:30:19 -03:00
zr36120_mem.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
zr36120_mem.h
zr36120.c IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
zr36120.h V4L/DVB (3599b): Whitespace cleanups under drivers/media 2006-03-25 09:29:23 -03:00