enabling LKM for custom beeper
Subsystems (2)
PATCH 1/1 enabling LKM for custom beeper
Hi Linus, Alan,
this patch has proven to be stable an useable. It hasn't changed since 2.2.13.
The patch affects kd_mksound and kd_nosound which are responsible for generating sound.
The default behaviour won't be changed but it's now possible for a LKM to hook into these calls and change the way the system bell rings.
Changes in struct timer_list made a separate patch for 2.4.0 necessary.
Please incorporante into next release of 2.{2,4} if appropriate; TIA,
cu.
:
Christianchar/vt.c renamed from char/vt.c.orig +5 -3
@@ -92,18 +92,20 @@ || (defined(__mips__) && !defined(CONFIG_SGI))static void -kd_nosound (unsigned long ignored) +_kd_nosound (unsigned long ignored) {/* disable counter 2 */ outb (inb_p (0x61 )&0xFC ,0x61 );return ; } -void +void (*kd_nosound)(unsigned long ignored) = _kd_nosound; + +static void _kd_mksound (unsigned int hz,unsigned int ticks) {static struct timer_list sound_timer = {NULL ,NULL ,0 ,0 , - kd_nosound }; + _kd_nosound };unsigned int count =0 ;
ksyms.c renamed from ksyms.c.orig +5 -0
@@ -62,6 +62,9 @@extern void free_dma (unsigned int dmanr);extern spinlock_t dma_spin_lock; +extern void (*kd_nosound)(unsigned long ignored); +extern void (*kd_mksound)(unsigned int count,unsigned int ticks); +#ifdef CONFIG_MODVERSIONS const struct module_symbol __export_Using_Versions __attribute__((section("__ksymtab"))) = {
@@ -341,6 +344,8 @@EXPORT_SYMBOL (register_reboot_notifier);EXPORT_SYMBOL (unregister_reboot_notifier);EXPORT_SYMBOL (_ctype); +EXPORT_SYMBOL (kd_nosound); +EXPORT_SYMBOL (kd_mksound);EXPORT_SYMBOL (secure_tcp_sequence_number);EXPORT_SYMBOL (get_random_bytes);EXPORT_SYMBOL (securebits);
linux/vt_kern.h renamed from linux/vt_kern.h.orig +1 -1
@@ -30,7 +30,7 @@struct wait_queue *paste_wait; } *vt_cons[MAX_NR_CONSOLES ]; -void (*kd_mksound)(unsigned int hz,unsigned int ticks); +extern void (*kd_mksound)(unsigned int hz,unsigned int ticks);/* console.c */
drivers/char/vt.c +5 -3
@@ -98,17 +98,19 @@ || (defined(__arm__) && defined(CONFIG_HOST_FOOTBRIDGE))static void -kd_nosound (unsigned long ignored) +_kd_nosound (unsigned long ignored) {/* disable counter 2 */ outb (inb_p (0x61 )&0xFC ,0x61 );return ; } -void +void (*kd_nosound)(unsigned long ignored) = _kd_nosound; + +static void _kd_mksound (unsigned int hz,unsigned int ticks) { -static struct timer_list sound_timer = { function: kd_nosound }; +static struct timer_list sound_timer = { function: _kd_nosound };unsigned int count =0 ;unsigned long flags;
include/linux/vt_kern.h +1 -1
@@ -30,7 +30,7 @@wait_queue_head_t paste_wait; } *vt_cons[MAX_NR_CONSOLES ]; -void (*kd_mksound)(unsigned int hz,unsigned int ticks); +extern void (*kd_mksound)(unsigned int hz,unsigned int ticks);/* console.c */
kernel/ksyms.c +5 -0
@@ -62,6 +62,9 @@extern void free_dma (unsigned int dmanr);extern spinlock_t dma_spin_lock; +extern void (*kd_nosound)(unsigned long ignored); +extern void (*kd_mksound)(unsigned int count,unsigned int ticks); +#ifdef CONFIG_MODVERSIONS const struct module_symbol __export_Using_Versions __attribute__((section("__ksymtab"))) = {
@@ -455,6 +458,8 @@EXPORT_SYMBOL (machine_halt);EXPORT_SYMBOL (machine_power_off);EXPORT_SYMBOL (_ctype); +EXPORT_SYMBOL (kd_nosound); +EXPORT_SYMBOL (kd_mksound);EXPORT_SYMBOL (secure_tcp_sequence_number);EXPORT_SYMBOL (get_random_bytes);EXPORT_SYMBOL (securebits);