summaryrefslogtreecommitdiff
path: root/payloads/libpayload/include
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2008-04-11 18:01:50 +0000
committerUwe Hermann <uwe@hermann-uwe.de>2008-04-11 18:01:50 +0000
commitfad8c2bd7ca3605fdae3548b8a932aa309871931 (patch)
tree26cbef49876963512753dd271f9fafcff77baf26 /payloads/libpayload/include
parent54315533cc8f162d5251458c6b9fa9f38c3f47f0 (diff)
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
Diffstat (limited to 'payloads/libpayload/include')
-rw-r--r--payloads/libpayload/include/arch/io.h4
-rw-r--r--payloads/libpayload/include/arch/msr.h4
-rw-r--r--payloads/libpayload/include/arch/rdtsc.h4
-rw-r--r--payloads/libpayload/include/arch/types.h4
-rw-r--r--payloads/libpayload/include/coreboot_tables.h68
-rw-r--r--payloads/libpayload/include/curses.h6
-rw-r--r--payloads/libpayload/include/curses.priv.h4
-rw-r--r--payloads/libpayload/include/libpayload.h9
-rw-r--r--payloads/libpayload/include/pci.h4
-rw-r--r--payloads/libpayload/include/sysinfo.h4
-rw-r--r--payloads/libpayload/include/video_console.h4
11 files changed, 60 insertions, 55 deletions
diff --git a/payloads/libpayload/include/arch/io.h b/payloads/libpayload/include/arch/io.h
index dcf5bd97ea..538b296a11 100644
--- a/payloads/libpayload/include/arch/io.h
+++ b/payloads/libpayload/include/arch/io.h
@@ -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))
diff --git a/payloads/libpayload/include/arch/msr.h b/payloads/libpayload/include/arch/msr.h
index 5985ab81d8..c28b56cde1 100644
--- a/payloads/libpayload/include/arch/msr.h
+++ b/payloads/libpayload/include/arch/msr.h
@@ -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)
{
diff --git a/payloads/libpayload/include/arch/rdtsc.h b/payloads/libpayload/include/arch/rdtsc.h
index 1addedafc8..da7949d808 100644
--- a/payloads/libpayload/include/arch/rdtsc.h
+++ b/payloads/libpayload/include/arch/rdtsc.h
@@ -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)
{
diff --git a/payloads/libpayload/include/arch/types.h b/payloads/libpayload/include/arch/types.h
index d1f3acda5b..641fb0aef8 100644
--- a/payloads/libpayload/include/arch/types.h
+++ b/payloads/libpayload/include/arch/types.h
@@ -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;
diff --git a/payloads/libpayload/include/coreboot_tables.h b/payloads/libpayload/include/coreboot_tables.h
index f156383862..88dc251cd8 100644
--- a/payloads/libpayload/include/coreboot_tables.h
+++ b/payloads/libpayload/include/coreboot_tables.h
@@ -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
diff --git a/payloads/libpayload/include/curses.h b/payloads/libpayload/include/curses.h
index dc64ad36af..993bb3c962 100644
--- a/payloads/libpayload/include/curses.h
+++ b/payloads/libpayload/include/curses.h
@@ -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 */
diff --git a/payloads/libpayload/include/curses.priv.h b/payloads/libpayload/include/curses.priv.h
index 72d9e82db1..720e678922 100644
--- a/payloads/libpayload/include/curses.priv.h
+++ b/payloads/libpayload/include/curses.priv.h
@@ -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);
diff --git a/payloads/libpayload/include/libpayload.h b/payloads/libpayload/include/libpayload.h
index 32deabf2b3..e197e430fd 100644
--- a/payloads/libpayload/include/libpayload.h
+++ b/payloads/libpayload/include/libpayload.h
@@ -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);
diff --git a/payloads/libpayload/include/pci.h b/payloads/libpayload/include/pci.h
index 32ad3fb96d..df88e098ab 100644
--- a/payloads/libpayload/include/pci.h
+++ b/payloads/libpayload/include/pci.h
@@ -27,8 +27,8 @@
* SUCH DAMAGE.
*/
-#ifndef _PCI_H_
-#define _PCI_H_
+#ifndef _PCI_H
+#define _PCI_H
typedef unsigned short pcidev_t;
diff --git a/payloads/libpayload/include/sysinfo.h b/payloads/libpayload/include/sysinfo.h
index 50d331a043..aebbff6481 100644
--- a/payloads/libpayload/include/sysinfo.h
+++ b/payloads/libpayload/include/sysinfo.h
@@ -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
diff --git a/payloads/libpayload/include/video_console.h b/payloads/libpayload/include/video_console.h
index 55deedf65f..1646ec6056 100644
--- a/payloads/libpayload/include/video_console.h
+++ b/payloads/libpayload/include/video_console.h
@@ -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