Author: uwe
Date: 2008-04-11 20:01:50 +0200 (Fri, 11 Apr 2008)
New Revision: 3234
Modified:
trunk/payloads/libpayload/Config.in
trunk/payloads/libpayload/curses/local.h
trunk/payloads/libpayload/drivers/video/font8x16.h
trunk/payloads/libpayload/i386/coreboot.c
trunk/payloads/libpayload/include/arch/io.h
trunk/payloads/libpayload/include/arch/msr.h
trunk/payloads/libpayload/include/arch/rdtsc.h
trunk/payloads/libpayload/include/arch/types.h
trunk/payloads/libpayload/include/coreboot_tables.h
trunk/payloads/libpayload/include/curses.h
trunk/payloads/libpayload/include/curses.priv.h
trunk/payloads/libpayload/include/libpayload.h
trunk/payloads/libpayload/include/pci.h
trunk/payloads/libpayload/include/sysinfo.h
trunk/payloads/libpayload/include/video_console.h
Log:
Various small consistency fixes (trivial):
- Use _FOO_H include guard format everywhere.
- Add missing speaker.c prototypes to libpayload.h.
- Consistently use short form u8/u16/u32 instead of uint8_t et. al.
- kcofig: Use 'depends on' instead of 'depends', which seems deprecated.
Signed-off-by: Uwe Hermann <uwe(a)hermann-uwe.de>
Acked-by: Uwe Hermann <uwe(a)hermann-uwe.de>
Modified: trunk/payloads/libpayload/Config.in
===================================================================
--- trunk/payloads/libpayload/Config.in 2008-04-11 15:48:21 UTC (rev 3233)
+++ trunk/payloads/libpayload/Config.in 2008-04-11 18:01:50 UTC (rev 3234)
@@ -46,17 +46,17 @@
config SERIAL_IOBASE
hex "I/O base for the serial port (default 0x3f8)"
- depends SERIAL_CONSOLE
+ depends on SERIAL_CONSOLE
default 0x3f8
config SERIAL_SET_SPEED
bool "Override the serial console baud rate"
default n
- depends SERIAL_CONSOLE
+ depends on SERIAL_CONSOLE
config SERIAL_BAUD_RATE
int "Serial console baud rate (default 115200)"
- depends SERIAL_SET_SPEED
+ depends on SERIAL_SET_SPEED
default 115200
config VIDEO_CONSOLE
Modified: trunk/payloads/libpayload/curses/local.h
===================================================================
--- trunk/payloads/libpayload/curses/local.h 2008-04-11 15:48:21 UTC (rev 3233)
+++ trunk/payloads/libpayload/curses/local.h 2008-04-11 18:01:50 UTC (rev 3234)
@@ -27,8 +27,8 @@
* SUCH DAMAGE.
*/
-#ifndef TINYCURSES_H
-#define TINYCURSES_H
+#ifndef _CURSES_LOCAL_H
+#define _CURSES_LOCAL_H
/* For curses.priv.h: */
#define USE_RCS_IDS 0
@@ -91,4 +91,4 @@
void speaker_disable(void);
void speaker_tone(u16 freq, unsigned int duration);
-#endif /* TINYCURSES_H */
+#endif
Modified: trunk/payloads/libpayload/drivers/video/font8x16.h
===================================================================
--- trunk/payloads/libpayload/drivers/video/font8x16.h 2008-04-11 15:48:21 UTC (rev 3233)
+++ trunk/payloads/libpayload/drivers/video/font8x16.h 2008-04-11 18:01:50 UTC (rev 3234)
@@ -27,8 +27,8 @@
* SUCH DAMAGE.
*/
-#ifndef FONT_8X16_H_
-#define FONT_8X16_H_
+#ifndef _DRIVERS_VIDEO_FONT8X16_H
+#define _DRIVERS_VIDEO_FONT8X16_H
#ifdef HAVE_CONSOLE_FONT
#error "You have already defined a console font!"
Modified: trunk/payloads/libpayload/i386/coreboot.c
===================================================================
--- trunk/payloads/libpayload/i386/coreboot.c 2008-04-11 15:48:21 UTC (rev 3233)
+++ trunk/payloads/libpayload/i386/coreboot.c 2008-04-11 18:01:50 UTC (rev 3234)
@@ -95,10 +95,10 @@
return 0;
/* Make sure the checksums match. */
- if (ipchksum((uint16_t *) header, sizeof(*header)) != 0)
+ if (ipchksum((u16 *) header, sizeof(*header)) != 0)
return -1;
- if (ipchksum((uint16_t *) (ptr + sizeof(*header)),
+ if (ipchksum((u16 *) (ptr + sizeof(*header)),
header->table_bytes) != header->table_checksum)
return -1;
Modified: trunk/payloads/libpayload/include/arch/io.h
===================================================================
--- trunk/payloads/libpayload/include/arch/io.h 2008-04-11 15:48:21 UTC (rev 3233)
+++ trunk/payloads/libpayload/include/arch/io.h 2008-04-11 18:01:50 UTC (rev 3234)
@@ -27,8 +27,8 @@
* SUCH DAMAGE.
*/
-#ifndef _X86_ARCH_IO_H_
-#define _X86_ARCH_IO_H_
+#ifndef _ARCH_IO_H
+#define _ARCH_IO_H
#define readb(_a) (*(volatile unsigned char *) (_a))
#define readw(_a) (*(volatile unsigned short *) (_a))
Modified: trunk/payloads/libpayload/include/arch/msr.h
===================================================================
--- trunk/payloads/libpayload/include/arch/msr.h 2008-04-11 15:48:21 UTC (rev 3233)
+++ trunk/payloads/libpayload/include/arch/msr.h 2008-04-11 18:01:50 UTC (rev 3234)
@@ -27,8 +27,8 @@
* SUCH DAMAGE.
*/
-#ifndef _ARCH_MSR_H_
-#define _ARCH_MSR_H_
+#ifndef _ARCH_MSR_H
+#define _ARCH_MSR_H
static inline unsigned long long _rdmsr(unsigned int msr)
{
Modified: trunk/payloads/libpayload/include/arch/rdtsc.h
===================================================================
--- trunk/payloads/libpayload/include/arch/rdtsc.h 2008-04-11 15:48:21 UTC (rev 3233)
+++ trunk/payloads/libpayload/include/arch/rdtsc.h 2008-04-11 18:01:50 UTC (rev 3234)
@@ -27,8 +27,8 @@
* SUCH DAMAGE.
*/
-#ifndef _RDTSC_H_
-#define _RDTSC_H_
+#ifndef _ARCH_RDTSC_H
+#define _ARCH_RDTSC_H
static inline unsigned long long rdtsc(void)
{
Modified: trunk/payloads/libpayload/include/arch/types.h
===================================================================
--- trunk/payloads/libpayload/include/arch/types.h 2008-04-11 15:48:21 UTC (rev 3233)
+++ trunk/payloads/libpayload/include/arch/types.h 2008-04-11 18:01:50 UTC (rev 3234)
@@ -27,8 +27,8 @@
* SUCH DAMAGE.
*/
-#ifndef _ARCH_X86_TYPES_H
-#define _ARCH_X86_TYPES_H
+#ifndef _ARCH_TYPES_H
+#define _ARCH_TYPES_H
typedef unsigned char uint8_t;
typedef unsigned char u8;
Modified: trunk/payloads/libpayload/include/coreboot_tables.h
===================================================================
--- trunk/payloads/libpayload/include/coreboot_tables.h 2008-04-11 15:48:21 UTC (rev 3233)
+++ trunk/payloads/libpayload/include/coreboot_tables.h 2008-04-11 18:01:50 UTC (rev 3234)
@@ -27,28 +27,28 @@
* SUCH DAMAGE.
*/
-#ifndef _COREBOOT_TABLES_H_
-#define _COREBOOT_TABLES_H_
+#ifndef _COREBOOT_TABLES_H
+#define _COREBOOT_TABLES_H
#include <arch/types.h>
struct cbuint64 {
- uint32_t lo;
- uint32_t hi;
+ u32 lo;
+ u32 hi;
};
struct cb_header {
- uint8_t signature[4];
- uint32_t header_bytes;
- uint32_t header_checksum;
- uint32_t table_bytes;
- uint32_t table_checksum;
- uint32_t table_entries;
+ u8 signature[4];
+ u32 header_bytes;
+ u32 header_checksum;
+ u32 table_bytes;
+ u32 table_checksum;
+ u32 table_entries;
};
struct cb_record {
- uint32_t tag;
- uint32_t size;
+ u32 tag;
+ u32 size;
};
#define CB_TAG_UNUSED 0x0000
@@ -57,7 +57,7 @@
struct cb_memory_range {
struct cbuint64 start;
struct cbuint64 size;
- uint32_t type;
+ u32 type;
};
#define CB_MEM_RAM 1
@@ -65,27 +65,27 @@
#define CB_MEM_TABLE 16
struct cb_memory {
- uint32_t tag;
- uint32_t size;
+ u32 tag;
+ u32 size;
struct cb_memory_range map[0];
};
#define CB_TAG_HWRPB 0x0002
struct cb_hwrpb {
- uint32_t tag;
- uint32_t size;
- uint64_t hwrpb;
+ u32 tag;
+ u32 size;
+ u64 hwrpb;
};
#define CB_TAG_MAINBOARD 0x0003
struct cb_mainboard {
- uint32_t tag;
- uint32_t size;
- uint8_t vendor_idx;
- uint8_t part_number_idx;
- uint8_t strings[0];
+ u32 tag;
+ u32 size;
+ u8 vendor_idx;
+ u8 part_number_idx;
+ u8 strings[0];
};
#define CB_TAG_VERSION 0x0004
@@ -100,25 +100,25 @@
#define CB_TAG_ASSEMBLER 0x000d
struct cb_string {
- uint32_t tag;
- uint32_t size;
- uint8_t string[0];
+ u32 tag;
+ u32 size;
+ u8 string[0];
};
#define CB_TAG_SERIAL 0x000f
struct cb_serial {
- uint32_t tag;
- uint32_t size;
- uint16_t ioport;
+ u32 tag;
+ u32 size;
+ u16 ioport;
};
#define CB_TAG_CONSOLE 0x00010
struct cb_console {
- uint32_t tag;
- uint32_t size;
- uint16_t type;
+ u32 tag;
+ u32 size;
+ u16 type;
};
#define CB_TAG_CONSOLE_SERIAL8250 0
@@ -136,7 +136,7 @@
(((_rec)->size - sizeof(*(_rec))) / sizeof((_rec)->map[0]))
#define MEM_RANGE_PTR(_rec, _idx) \
- (((uint8_t *) (_rec)) + sizeof(*(_rec)) \
+ (((u8 *) (_rec)) + sizeof(*(_rec)) \
+ (sizeof((_rec)->map[0]) * (_idx)))
#define MB_VENDOR_STRING(_mb) \
@@ -146,6 +146,6 @@
(((unsigned char *) ((_mb)->strings)) + (_mb)->part_number_idx)
#define UNPACK_CB64(_in) \
- ( (((uint64_t) _in.hi) << 32) | _in.lo )
+ ( (((u64) _in.hi) << 32) | _in.lo )
#endif
Modified: trunk/payloads/libpayload/include/curses.h
===================================================================
--- trunk/payloads/libpayload/include/curses.h 2008-04-11 15:48:21 UTC (rev 3233)
+++ trunk/payloads/libpayload/include/curses.h 2008-04-11 18:01:50 UTC (rev 3234)
@@ -34,8 +34,8 @@
/* $Id: curses.h.in,v 1.167 2006/11/26 01:14:54 tom Exp $ */
-#ifndef __NCURSES_H
-#define __NCURSES_H
+#ifndef _CURSES_H
+#define _CURSES_H
#define CURSES 1
#define CURSES_H 1
@@ -1673,4 +1673,4 @@
void curses_enable_vga(int);
void curses_enable_serial(int);
-#endif /* __NCURSES_H */
+#endif /* _CURSES_H */
Modified: trunk/payloads/libpayload/include/curses.priv.h
===================================================================
--- trunk/payloads/libpayload/include/curses.priv.h 2008-04-11 15:48:21 UTC (rev 3233)
+++ trunk/payloads/libpayload/include/curses.priv.h 2008-04-11 18:01:50 UTC (rev 3234)
@@ -43,8 +43,8 @@
*
*/
-#ifndef CURSES_PRIV_H
-#define CURSES_PRIV_H 1
+#ifndef _CURSES_PRIV_H
+#define _CURSES_PRIV_H 1
//// XXX
extern void *memset(void *s, int c, size_t len);
Modified: trunk/payloads/libpayload/include/libpayload.h
===================================================================
--- trunk/payloads/libpayload/include/libpayload.h 2008-04-11 15:48:21 UTC (rev 3233)
+++ trunk/payloads/libpayload/include/libpayload.h 2008-04-11 18:01:50 UTC (rev 3234)
@@ -27,8 +27,8 @@
* SUCH DAMAGE.
*/
-#ifndef LIBPAYLOAD_H
-#define LIBPAYLOAD_H
+#ifndef _LIBPAYLOAD_H
+#define _LIBPAYLOAD_H
#include <autoconf.h>
#include <stddef.h>
@@ -78,6 +78,11 @@
int serial_havechar(void);
int serial_getchar(void);
+/* drivers/speaker.c */
+void speaker_enable(u16 freq);
+void speaker_disable(void);
+void speaker_tone(u16 freq, unsigned int duration);
+
/* video/video.c */
int video_console_init(void);
void video_console_putchar(unsigned int ch);
Modified: trunk/payloads/libpayload/include/pci.h
===================================================================
--- trunk/payloads/libpayload/include/pci.h 2008-04-11 15:48:21 UTC (rev 3233)
+++ trunk/payloads/libpayload/include/pci.h 2008-04-11 18:01:50 UTC (rev 3234)
@@ -27,8 +27,8 @@
* SUCH DAMAGE.
*/
-#ifndef _PCI_H_
-#define _PCI_H_
+#ifndef _PCI_H
+#define _PCI_H
typedef unsigned short pcidev_t;
Modified: trunk/payloads/libpayload/include/sysinfo.h
===================================================================
--- trunk/payloads/libpayload/include/sysinfo.h 2008-04-11 15:48:21 UTC (rev 3233)
+++ trunk/payloads/libpayload/include/sysinfo.h 2008-04-11 18:01:50 UTC (rev 3234)
@@ -27,8 +27,8 @@
* SUCH DAMAGE.
*/
-#ifndef SYSINFO_H
-#define SYSINFO_H
+#ifndef _SYSINFO_H
+#define _SYSINFO_H
/* Allow a maximum of 16 memory range definitions. */
#define SYSINFO_MAX_MEM_RANGES 16
Modified: trunk/payloads/libpayload/include/video_console.h
===================================================================
--- trunk/payloads/libpayload/include/video_console.h 2008-04-11 15:48:21 UTC (rev 3233)
+++ trunk/payloads/libpayload/include/video_console.h 2008-04-11 18:01:50 UTC (rev 3234)
@@ -27,8 +27,8 @@
* SUCH DAMAGE.
*/
-#ifndef VIDEO_CONSOLE_H_
-#define VIDEO_CONSOLE_H_
+#ifndef _VIDEO_CONSOLE_H
+#define _VIDEO_CONSOLE_H
#define VIDEO_ROWS 25
#define VIDEO_COLS 80