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@hermann-uwe.de>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>



git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3234 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
Uwe Hermann
2008-04-11 18:01:50 +00:00
parent 54315533cc
commit fad8c2bd7c
15 changed files with 70 additions and 65 deletions

View File

@ -46,17 +46,17 @@ config SERIAL_CONSOLE
config SERIAL_IOBASE config SERIAL_IOBASE
hex "I/O base for the serial port (default 0x3f8)" hex "I/O base for the serial port (default 0x3f8)"
depends SERIAL_CONSOLE depends on SERIAL_CONSOLE
default 0x3f8 default 0x3f8
config SERIAL_SET_SPEED config SERIAL_SET_SPEED
bool "Override the serial console baud rate" bool "Override the serial console baud rate"
default n default n
depends SERIAL_CONSOLE depends on SERIAL_CONSOLE
config SERIAL_BAUD_RATE config SERIAL_BAUD_RATE
int "Serial console baud rate (default 115200)" int "Serial console baud rate (default 115200)"
depends SERIAL_SET_SPEED depends on SERIAL_SET_SPEED
default 115200 default 115200
config VIDEO_CONSOLE config VIDEO_CONSOLE

View File

@ -27,8 +27,8 @@
* SUCH DAMAGE. * SUCH DAMAGE.
*/ */
#ifndef TINYCURSES_H #ifndef _CURSES_LOCAL_H
#define TINYCURSES_H #define _CURSES_LOCAL_H
/* For curses.priv.h: */ /* For curses.priv.h: */
#define USE_RCS_IDS 0 #define USE_RCS_IDS 0
@ -91,4 +91,4 @@ void speaker_enable(u16 freq);
void speaker_disable(void); void speaker_disable(void);
void speaker_tone(u16 freq, unsigned int duration); void speaker_tone(u16 freq, unsigned int duration);
#endif /* TINYCURSES_H */ #endif

View File

@ -27,8 +27,8 @@
* SUCH DAMAGE. * SUCH DAMAGE.
*/ */
#ifndef FONT_8X16_H_ #ifndef _DRIVERS_VIDEO_FONT8X16_H
#define FONT_8X16_H_ #define _DRIVERS_VIDEO_FONT8X16_H
#ifdef HAVE_CONSOLE_FONT #ifdef HAVE_CONSOLE_FONT
#error "You have already defined a console font!" #error "You have already defined a console font!"

View File

@ -95,10 +95,10 @@ static int cb_parse_header(void *addr, int len, struct sysinfo_t *info)
return 0; return 0;
/* Make sure the checksums match. */ /* Make sure the checksums match. */
if (ipchksum((uint16_t *) header, sizeof(*header)) != 0) if (ipchksum((u16 *) header, sizeof(*header)) != 0)
return -1; return -1;
if (ipchksum((uint16_t *) (ptr + sizeof(*header)), if (ipchksum((u16 *) (ptr + sizeof(*header)),
header->table_bytes) != header->table_checksum) header->table_bytes) != header->table_checksum)
return -1; return -1;

View File

@ -27,8 +27,8 @@
* SUCH DAMAGE. * SUCH DAMAGE.
*/ */
#ifndef _X86_ARCH_IO_H_ #ifndef _ARCH_IO_H
#define _X86_ARCH_IO_H_ #define _ARCH_IO_H
#define readb(_a) (*(volatile unsigned char *) (_a)) #define readb(_a) (*(volatile unsigned char *) (_a))
#define readw(_a) (*(volatile unsigned short *) (_a)) #define readw(_a) (*(volatile unsigned short *) (_a))

View File

@ -27,8 +27,8 @@
* SUCH DAMAGE. * SUCH DAMAGE.
*/ */
#ifndef _ARCH_MSR_H_ #ifndef _ARCH_MSR_H
#define _ARCH_MSR_H_ #define _ARCH_MSR_H
static inline unsigned long long _rdmsr(unsigned int msr) static inline unsigned long long _rdmsr(unsigned int msr)
{ {

View File

@ -27,8 +27,8 @@
* SUCH DAMAGE. * SUCH DAMAGE.
*/ */
#ifndef _RDTSC_H_ #ifndef _ARCH_RDTSC_H
#define _RDTSC_H_ #define _ARCH_RDTSC_H
static inline unsigned long long rdtsc(void) static inline unsigned long long rdtsc(void)
{ {

View File

@ -27,8 +27,8 @@
* SUCH DAMAGE. * SUCH DAMAGE.
*/ */
#ifndef _ARCH_X86_TYPES_H #ifndef _ARCH_TYPES_H
#define _ARCH_X86_TYPES_H #define _ARCH_TYPES_H
typedef unsigned char uint8_t; typedef unsigned char uint8_t;
typedef unsigned char u8; typedef unsigned char u8;

View File

@ -27,28 +27,28 @@
* SUCH DAMAGE. * SUCH DAMAGE.
*/ */
#ifndef _COREBOOT_TABLES_H_ #ifndef _COREBOOT_TABLES_H
#define _COREBOOT_TABLES_H_ #define _COREBOOT_TABLES_H
#include <arch/types.h> #include <arch/types.h>
struct cbuint64 { struct cbuint64 {
uint32_t lo; u32 lo;
uint32_t hi; u32 hi;
}; };
struct cb_header { struct cb_header {
uint8_t signature[4]; u8 signature[4];
uint32_t header_bytes; u32 header_bytes;
uint32_t header_checksum; u32 header_checksum;
uint32_t table_bytes; u32 table_bytes;
uint32_t table_checksum; u32 table_checksum;
uint32_t table_entries; u32 table_entries;
}; };
struct cb_record { struct cb_record {
uint32_t tag; u32 tag;
uint32_t size; u32 size;
}; };
#define CB_TAG_UNUSED 0x0000 #define CB_TAG_UNUSED 0x0000
@ -57,7 +57,7 @@ struct cb_record {
struct cb_memory_range { struct cb_memory_range {
struct cbuint64 start; struct cbuint64 start;
struct cbuint64 size; struct cbuint64 size;
uint32_t type; u32 type;
}; };
#define CB_MEM_RAM 1 #define CB_MEM_RAM 1
@ -65,27 +65,27 @@ struct cb_memory_range {
#define CB_MEM_TABLE 16 #define CB_MEM_TABLE 16
struct cb_memory { struct cb_memory {
uint32_t tag; u32 tag;
uint32_t size; u32 size;
struct cb_memory_range map[0]; struct cb_memory_range map[0];
}; };
#define CB_TAG_HWRPB 0x0002 #define CB_TAG_HWRPB 0x0002
struct cb_hwrpb { struct cb_hwrpb {
uint32_t tag; u32 tag;
uint32_t size; u32 size;
uint64_t hwrpb; u64 hwrpb;
}; };
#define CB_TAG_MAINBOARD 0x0003 #define CB_TAG_MAINBOARD 0x0003
struct cb_mainboard { struct cb_mainboard {
uint32_t tag; u32 tag;
uint32_t size; u32 size;
uint8_t vendor_idx; u8 vendor_idx;
uint8_t part_number_idx; u8 part_number_idx;
uint8_t strings[0]; u8 strings[0];
}; };
#define CB_TAG_VERSION 0x0004 #define CB_TAG_VERSION 0x0004
@ -100,25 +100,25 @@ struct cb_mainboard {
#define CB_TAG_ASSEMBLER 0x000d #define CB_TAG_ASSEMBLER 0x000d
struct cb_string { struct cb_string {
uint32_t tag; u32 tag;
uint32_t size; u32 size;
uint8_t string[0]; u8 string[0];
}; };
#define CB_TAG_SERIAL 0x000f #define CB_TAG_SERIAL 0x000f
struct cb_serial { struct cb_serial {
uint32_t tag; u32 tag;
uint32_t size; u32 size;
uint16_t ioport; u16 ioport;
}; };
#define CB_TAG_CONSOLE 0x00010 #define CB_TAG_CONSOLE 0x00010
struct cb_console { struct cb_console {
uint32_t tag; u32 tag;
uint32_t size; u32 size;
uint16_t type; u16 type;
}; };
#define CB_TAG_CONSOLE_SERIAL8250 0 #define CB_TAG_CONSOLE_SERIAL8250 0
@ -136,7 +136,7 @@ struct cb_console {
(((_rec)->size - sizeof(*(_rec))) / sizeof((_rec)->map[0])) (((_rec)->size - sizeof(*(_rec))) / sizeof((_rec)->map[0]))
#define MEM_RANGE_PTR(_rec, _idx) \ #define MEM_RANGE_PTR(_rec, _idx) \
(((uint8_t *) (_rec)) + sizeof(*(_rec)) \ (((u8 *) (_rec)) + sizeof(*(_rec)) \
+ (sizeof((_rec)->map[0]) * (_idx))) + (sizeof((_rec)->map[0]) * (_idx)))
#define MB_VENDOR_STRING(_mb) \ #define MB_VENDOR_STRING(_mb) \
@ -146,6 +146,6 @@ struct cb_console {
(((unsigned char *) ((_mb)->strings)) + (_mb)->part_number_idx) (((unsigned char *) ((_mb)->strings)) + (_mb)->part_number_idx)
#define UNPACK_CB64(_in) \ #define UNPACK_CB64(_in) \
( (((uint64_t) _in.hi) << 32) | _in.lo ) ( (((u64) _in.hi) << 32) | _in.lo )
#endif #endif

View File

@ -34,8 +34,8 @@
/* $Id: curses.h.in,v 1.167 2006/11/26 01:14:54 tom Exp $ */ /* $Id: curses.h.in,v 1.167 2006/11/26 01:14:54 tom Exp $ */
#ifndef __NCURSES_H #ifndef _CURSES_H
#define __NCURSES_H #define _CURSES_H
#define CURSES 1 #define CURSES 1
#define CURSES_H 1 #define CURSES_H 1
@ -1673,4 +1673,4 @@ extern NCURSES_EXPORT(const char *) _nc_visbuf (const char *);
void curses_enable_vga(int); void curses_enable_vga(int);
void curses_enable_serial(int); void curses_enable_serial(int);
#endif /* __NCURSES_H */ #endif /* _CURSES_H */

View File

@ -43,8 +43,8 @@
* *
*/ */
#ifndef CURSES_PRIV_H #ifndef _CURSES_PRIV_H
#define CURSES_PRIV_H 1 #define _CURSES_PRIV_H 1
//// XXX //// XXX
extern void *memset(void *s, int c, size_t len); extern void *memset(void *s, int c, size_t len);

View File

@ -27,8 +27,8 @@
* SUCH DAMAGE. * SUCH DAMAGE.
*/ */
#ifndef LIBPAYLOAD_H #ifndef _LIBPAYLOAD_H
#define LIBPAYLOAD_H #define _LIBPAYLOAD_H
#include <autoconf.h> #include <autoconf.h>
#include <stddef.h> #include <stddef.h>
@ -78,6 +78,11 @@ void serial_putchar(unsigned char c);
int serial_havechar(void); int serial_havechar(void);
int serial_getchar(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 */ /* video/video.c */
int video_console_init(void); int video_console_init(void);
void video_console_putchar(unsigned int ch); void video_console_putchar(unsigned int ch);

View File

@ -27,8 +27,8 @@
* SUCH DAMAGE. * SUCH DAMAGE.
*/ */
#ifndef _PCI_H_ #ifndef _PCI_H
#define _PCI_H_ #define _PCI_H
typedef unsigned short pcidev_t; typedef unsigned short pcidev_t;

View File

@ -27,8 +27,8 @@
* SUCH DAMAGE. * SUCH DAMAGE.
*/ */
#ifndef SYSINFO_H #ifndef _SYSINFO_H
#define SYSINFO_H #define _SYSINFO_H
/* Allow a maximum of 16 memory range definitions. */ /* Allow a maximum of 16 memory range definitions. */
#define SYSINFO_MAX_MEM_RANGES 16 #define SYSINFO_MAX_MEM_RANGES 16

View File

@ -27,8 +27,8 @@
* SUCH DAMAGE. * SUCH DAMAGE.
*/ */
#ifndef VIDEO_CONSOLE_H_ #ifndef _VIDEO_CONSOLE_H
#define VIDEO_CONSOLE_H_ #define _VIDEO_CONSOLE_H
#define VIDEO_ROWS 25 #define VIDEO_ROWS 25
#define VIDEO_COLS 80 #define VIDEO_COLS 80