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
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

View File

@ -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_enable(u16 freq);
void speaker_disable(void);
void speaker_tone(u16 freq, unsigned int duration);
#endif /* TINYCURSES_H */
#endif

View File

@ -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!"

View File

@ -95,10 +95,10 @@ static int cb_parse_header(void *addr, int len, struct sysinfo_t *info)
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;

View File

@ -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))

View File

@ -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)
{

View File

@ -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)
{

View File

@ -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;

View File

@ -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_record {
struct cb_memory_range {
struct cbuint64 start;
struct cbuint64 size;
uint32_t type;
u32 type;
};
#define CB_MEM_RAM 1
@ -65,27 +65,27 @@ struct cb_memory_range {
#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 @@ struct cb_mainboard {
#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 @@ struct cb_console {
(((_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 @@ struct cb_console {
(((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

View File

@ -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 @@ extern NCURSES_EXPORT(const char *) _nc_visbuf (const char *);
void curses_enable_vga(int);
void curses_enable_serial(int);
#endif /* __NCURSES_H */
#endif /* _CURSES_H */

View File

@ -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);

View File

@ -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 @@ void serial_putchar(unsigned char c);
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);

View File

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

View File

@ -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

View File

@ -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