Author: uwe Date: 2007-11-21 19:25:20 +0100 (Wed, 21 Nov 2007) New Revision: 514
Modified: LinuxBIOSv3/arch/x86/post_code.c LinuxBIOSv3/arch/x86/speaker.c LinuxBIOSv3/include/arch/x86/legacy.h Log: Add comment, small style fixes (trivial).
Signed-off-by: Uwe Hermann uwe@hermann-uwe.de Acked-by: Uwe Hermann uwe@hermann-uwe.de
Modified: LinuxBIOSv3/arch/x86/post_code.c =================================================================== --- LinuxBIOSv3/arch/x86/post_code.c 2007-11-20 19:06:03 UTC (rev 513) +++ LinuxBIOSv3/arch/x86/post_code.c 2007-11-21 18:25:20 UTC (rev 514) @@ -20,9 +20,16 @@ #include <types.h> #include <io.h>
+/** + * Output a POST code (Power-on-self-test code) on port 0x80. + * + * We're hardcoding 0x80 as port where we output the POST code, as pretty + * much all of today's computers use that one. However, in the past (pre-486 + * era or so) other ports were sometimes used, too. + * + * @param value The 8 bit value to output as POST code. + */ void post_code(u8 value) { outb(value, 0x80); } - -
Modified: LinuxBIOSv3/arch/x86/speaker.c =================================================================== --- LinuxBIOSv3/arch/x86/speaker.c 2007-11-20 19:06:03 UTC (rev 513) +++ LinuxBIOSv3/arch/x86/speaker.c 2007-11-21 18:25:20 UTC (rev 514) @@ -47,13 +47,15 @@ */ void speaker_enable(u16 freq) { - /* Select counter 2. Read/write LSB first, then MSB. Use mode 3 - (square wave generator). Use a 16bit binary counter. */ + /* + * Select counter 2. Read/write LSB first, then MSB. Use mode 3 + * (square wave generator). Use a 16bit binary counter. + */ outb(0xb6, I82C54_CONTROL_WORD_REGISTER);
/* Set the desired tone frequency. */ - outb((u8)(freq & 0x00ff), I82C54_COUNTER2); /* LSB. */ - outb((u8)(freq >> 8), I82C54_COUNTER2); /* MSB. */ + outb((u8)(freq & 0x00ff), I82C54_COUNTER2); /* LSB */ + outb((u8)(freq >> 8), I82C54_COUNTER2); /* MSB */
/* Enable the PC speaker (set bits 0 and 1). */ outb(inb(PC_SPEAKER_PORT) | 0x03, PC_SPEAKER_PORT); @@ -105,4 +107,3 @@ speaker_tone(1760, 2000); /* 1760 == note A6. */ #endif } -
Modified: LinuxBIOSv3/include/arch/x86/legacy.h =================================================================== --- LinuxBIOSv3/include/arch/x86/legacy.h 2007-11-20 19:06:03 UTC (rev 513) +++ LinuxBIOSv3/include/arch/x86/legacy.h 2007-11-21 18:25:20 UTC (rev 514) @@ -28,7 +28,7 @@ * - http://en.wikipedia.org/wiki/Intel_8253 */
-#define I82C54_CONTROL_WORD_REGISTER 0x43 /* Write-only. */ +#define I82C54_CONTROL_WORD_REGISTER 0x43 /* Write-only! */ #define I82C54_COUNTER0 0x40 #define I82C54_COUNTER1 0x41 #define I82C54_COUNTER2 0x42