From 5cced7fd10f6adfed1df26a73c40c39551702704 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 10 Nov 2007 21:36:24 +0000 Subject: [PATCH] 2007-11-10 Robert Millan * commands/i386/pc/play.c (beep_off): Switch order of arguments in grub_outb() calls. (beep_on): Likewise. --- ChangeLog | 6 ++++++ commands/i386/pc/play.c | 13 ++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index f1ce9682e..859cf7a06 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-11-10 Robert Millan + + * commands/i386/pc/play.c (beep_off): Switch order of arguments + in grub_outb() calls. + (beep_on): Likewise. + 2007-11-10 Christian Franke * normal/menu.c (run_menu): Check for empty menu to avoid crash. diff --git a/commands/i386/pc/play.c b/commands/i386/pc/play.c index 450470689..4fbae0830 100644 --- a/commands/i386/pc/play.c +++ b/commands/i386/pc/play.c @@ -116,7 +116,7 @@ beep_off (void) unsigned char status; status = grub_inb (SPEAKER); - grub_outb (SPEAKER, status & ~(SPEAKER_TMR2 | SPEAKER_DATA)); + grub_outb (status & ~(SPEAKER_TMR2 | SPEAKER_DATA), SPEAKER); } static void @@ -133,15 +133,14 @@ beep_on (short pitch) counter = PIT_FREQUENCY / pitch; /* Program timer 2. */ - grub_outb (PIT_CTRL, PIT_CTRL_SELECT_2 | PIT_CTRL_READLOAD_WORD - | PIT_CTRL_SQUAREWAVE_GEN | PIT_CTRL_COUNT_BINARY); - grub_outb (PIT_COUNTER_2, counter & 0xff); /* LSB */ - grub_outb (PIT_COUNTER_2, (counter >> 8) & 0xff); /* MSB */ + grub_outb (PIT_CTRL_SELECT_2 | PIT_CTRL_READLOAD_WORD + | PIT_CTRL_SQUAREWAVE_GEN | PIT_CTRL_COUNT_BINARY, PIT_CTRL); + grub_outb (counter & 0xff, PIT_COUNTER_2); /* LSB */ + grub_outb ((counter >> 8) & 0xff, PIT_COUNTER_2); /* MSB */ /* Start speaker. */ status = grub_inb (SPEAKER); - grub_outb (SPEAKER, status | SPEAKER_TMR2 | SPEAKER_DATA); - + grub_outb (status | SPEAKER_TMR2 | SPEAKER_DATA, SPEAKER); } static grub_err_t