Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- beep.c 2008-07-31 03:10:54.000000000 +0800
- +++ beep.new2.c 2012-05-09 21:04:19.674211872 +0800
- @@ -24,7 +24,7 @@
- #include <linux/miscdevice.h>
- #include <asm/uaccess.h>
- #if defined(CONFIG_MIPS) || defined(CONFIG_X86)
- -#include <asm/i8253.h>
- +#include <linux/i8253.h>
- #else
- #include <asm/8253pit.h>
- static DEFINE_SPINLOCK(i8253_lock);
- @@ -165,22 +165,22 @@
- if (value > 20 && value < 32767)
- count = PIT_TICK_RATE / value;
- - spin_lock_irqsave(&i8253_lock, flags);
- + raw_spin_lock_irqsave(&i8253_lock, flags);
- if (count) {
- - /* enable counter 2 */
- - outb_p(inb_p(0x61) | 3, 0x61);
- /* set command for counter 2, 2 byte write */
- outb_p(0xB6, 0x43);
- /* select desired HZ */
- outb_p(count & 0xff, 0x42);
- outb((count >> 8) & 0xff, 0x42);
- + /* enable counter 2 */
- + outb_p(inb_p(0x61) | 3, 0x61);
- } else {
- /* disable counter 2 */
- - outb(inb_p(0x61) & 0xFC, 0x61);
- + outb(inb_p(0x61) & 0xFC, 0x61);
- }
- - spin_unlock_irqrestore(&i8253_lock, flags);
- + raw_spin_unlock_irqrestore(&i8253_lock, flags);
- }
- if (value) {
- what_beep=1;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement