By making this (logical, and needed) feature unconditional, your patch's
size and complexity is reduced by 80%. (see the attached
pc_speaker.patch2)

        Ingo

diff -u --recursive linux-2.4.5/drivers/char/vt.c linux-2.4.5-nc/drivers/char/vt.c
--- linux-2.4.5/drivers/char/vt.c       Fri Feb  9 20:30:22 2001
+++ linux-2.4.5-nc/drivers/char/vt.c    Wed May  9 23:47:36 2001
@@ -40,6 +41,7 @@
 #include <asm/vc_ioctl.h>
 #endif /* CONFIG_FB_COMPAT_XPMAC */
 
+extern int pcspeaker_enabled;
 char vt_dont_switch;
 extern struct tty_driver console_driver;
 
@@ -112,6 +117,9 @@
        unsigned int count = 0;
        unsigned long flags;
 
+       /* is the pcspeaker enabled or disabled ? 0=disabled,1=enabled */
+       if (!pcspeaker_enabled)
+               return;
        if (hz > 20 && hz < 32767)
                count = 1193180 / hz;
        
diff -u --recursive linux-2.4.5/include/linux/sysctl.h 
linux-2.4.5-nc/include/linux/sysctl.h
--- linux-2.4.5/include/linux/sysctl.h  Tue May 29 17:56:29 2001
+++ linux-2.4.5-nc/include/linux/sysctl.h       Mon May 28 19:24:08 2001
@@ -118,7 +118,8 @@
        KERN_SHMPATH=48,        /* string: path to shm fs */
        KERN_HOTPLUG=49,        /* string: path to hotplug policy agent */
        KERN_IEEE_EMULATION_WARNINGS=50, /* int: unimplemented ieee instructions */
-       KERN_S390_USER_DEBUG_LOGGING=51  /* int: dumps of user faults */
+       KERN_S390_USER_DEBUG_LOGGING=51,  /* int: dumps of user faults */
+       KERN_DISABLE_PC_SPEAKER=52 /* int: speaker on or off */
 };
 
 
diff -u --recursive linux-2.4.5/kernel/sysctl.c linux-2.4.5-nc/kernel/sysctl.c
--- linux-2.4.5/kernel/sysctl.c Tue May 29 17:55:59 2001
+++ linux-2.4.5-nc/kernel/sysctl.c      Wed May  9 23:44:30 2001
@@ -48,6 +49,7 @@
 extern int nr_queued_signals, max_queued_signals;
 extern int sysrq_enabled;
 
+int pcspeaker_enabled;
 /* this is needed for the proc_dointvec_minmax for [fs_]overflow UID and GID */
 static int maxolduid = 65535;
 static int minolduid;
@@ -212,6 +217,8 @@
         0444, NULL, &proc_dointvec},
        {KERN_RTSIGMAX, "rtsig-max", &max_queued_signals, sizeof(int),
         0644, NULL, &proc_dointvec},
+       {KERN_DISABLE_PC_SPEAKER, "pcspeaker", &pcspeaker_enabled, sizeof(int),
+        0644, NULL, &proc_dointvec},
 #ifdef CONFIG_SYSVIPC
        {KERN_SHMMAX, "shmmax", &shm_ctlmax, sizeof (size_t),
         0644, NULL, &proc_doulongvec_minmax},

Reply via email to