libpayload: Expand doxygen definitions
Expand libpayload.h to include a main page and add individual groups for the API functions - this adds the Modules tab to the doxygen output. Specify the INPUT list rather then the EXCLUDE list of directories to omit random .c files that we don't want. Add clean targets to the makefile to clean doxygen files only. Signed-off-by: Jordan Crouse <jordan.crouse@amd.com> Acked-by: Stefan Reinauer <stepan@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3545 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
parent
9368e4c991
commit
3a48bdcd36
|
@ -534,7 +534,7 @@ WARN_LOGFILE =
|
||||||
# directories like "/usr/src/myproject". Separate the files or directories
|
# directories like "/usr/src/myproject". Separate the files or directories
|
||||||
# with spaces.
|
# with spaces.
|
||||||
|
|
||||||
INPUT =
|
INPUT = crypto curses drivers i386 include libc
|
||||||
|
|
||||||
# This tag can be used to specify the character encoding of the source files
|
# This tag can be used to specify the character encoding of the source files
|
||||||
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
|
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
|
||||||
|
@ -551,7 +551,7 @@ INPUT_ENCODING = UTF-8
|
||||||
# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
|
# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
|
||||||
# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
|
# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
|
||||||
|
|
||||||
FILE_PATTERNS =
|
FILE_PATTERNS = *.c *.h
|
||||||
|
|
||||||
# The RECURSIVE tag can be used to turn specify whether or not subdirectories
|
# The RECURSIVE tag can be used to turn specify whether or not subdirectories
|
||||||
# should be searched for input files as well. Possible values are YES and NO.
|
# should be searched for input files as well. Possible values are YES and NO.
|
||||||
|
@ -563,7 +563,7 @@ RECURSIVE = YES
|
||||||
# excluded from the INPUT source files. This way you can easily exclude a
|
# excluded from the INPUT source files. This way you can easily exclude a
|
||||||
# subdirectory from a directory tree whose root is specified with the INPUT tag.
|
# subdirectory from a directory tree whose root is specified with the INPUT tag.
|
||||||
|
|
||||||
EXCLUDE = util
|
EXCLUDE =
|
||||||
|
|
||||||
# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
|
# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
|
||||||
# directories that are symbolic links (a Unix filesystem feature) are excluded
|
# directories that are symbolic links (a Unix filesystem feature) are excluded
|
||||||
|
@ -591,7 +591,7 @@ EXCLUDE_SYMBOLS =
|
||||||
# directories that contain example code fragments that are included (see
|
# directories that contain example code fragments that are included (see
|
||||||
# the \include command).
|
# the \include command).
|
||||||
|
|
||||||
EXAMPLE_PATH =
|
EXAMPLE_PATH = sample
|
||||||
|
|
||||||
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
|
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
|
||||||
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
|
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
|
||||||
|
|
|
@ -144,11 +144,14 @@ doxy: doxygen
|
||||||
doxygen:
|
doxygen:
|
||||||
$(Q)$(DOXYGEN) Doxyfile
|
$(Q)$(DOXYGEN) Doxyfile
|
||||||
|
|
||||||
clean:
|
doxyclean: doxygen-clean
|
||||||
|
doxygen-clean:
|
||||||
|
$(Q)rm -rf $(DOXYGEN_OUTPUT_DIR)
|
||||||
|
|
||||||
|
clean: doxygen-clean
|
||||||
$(Q)rm -rf $(obj)/crypto $(obj)/curses $(obj)/drivers
|
$(Q)rm -rf $(obj)/crypto $(obj)/curses $(obj)/drivers
|
||||||
$(Q)rm -rf $(obj)/i386 $(obj)/lib $(obj)/libc
|
$(Q)rm -rf $(obj)/i386 $(obj)/lib $(obj)/libc
|
||||||
$(Q)rm -rf $(src)/lib/i386 $(src)/lib/libpayload.a
|
$(Q)rm -rf $(src)/lib/i386 $(src)/lib/libpayload.a
|
||||||
$(Q)rm -rf $(DOXYGEN_OUTPUT_DIR)
|
|
||||||
|
|
||||||
distclean: clean
|
distclean: clean
|
||||||
$(Q)rm -rf build
|
$(Q)rm -rf build
|
||||||
|
|
|
@ -27,6 +27,19 @@
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/** @mainpage
|
||||||
|
* @section intro Introduction
|
||||||
|
* libpayload is a small BSD-licensed static library (a lightweight
|
||||||
|
* implementation of common and useful functions) intended to be used
|
||||||
|
* as a basis for coreboot payloads.
|
||||||
|
*
|
||||||
|
* @section example Example
|
||||||
|
* Here is an example of a very simple payload:
|
||||||
|
* @include sample/hello.c
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef _LIBPAYLOAD_H
|
#ifndef _LIBPAYLOAD_H
|
||||||
#define _LIBPAYLOAD_H
|
#define _LIBPAYLOAD_H
|
||||||
|
|
||||||
|
@ -73,6 +86,10 @@ static const char _pstruct(key)[] \
|
||||||
#define NVRAM_RTC_FREQ_SELECT 10
|
#define NVRAM_RTC_FREQ_SELECT 10
|
||||||
#define NVRAM_RTC_UIP 0x80
|
#define NVRAM_RTC_UIP 0x80
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @defgroup nvram NVRAM and RTC functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
struct tm {
|
struct tm {
|
||||||
int tm_sec;
|
int tm_sec;
|
||||||
int tm_min;
|
int tm_min;
|
||||||
|
@ -85,19 +102,33 @@ struct tm {
|
||||||
int tm_isdst;
|
int tm_isdst;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* drivers/nvram.c */
|
|
||||||
u8 nvram_read(u8 addr);
|
u8 nvram_read(u8 addr);
|
||||||
void nvram_write(u8 val, u8 addr);
|
void nvram_write(u8 val, u8 addr);
|
||||||
int nvram_updating(void);
|
int nvram_updating(void);
|
||||||
void rtc_read_clock(struct tm *tm);
|
void rtc_read_clock(struct tm *tm);
|
||||||
|
/** @} */
|
||||||
|
|
||||||
/* drivers/keyboard.c */
|
/**
|
||||||
|
* @defgroup input Device functions
|
||||||
|
* @{ @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @defgroup keyboard Keyboard functions
|
||||||
|
* @ingroup input
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
void keyboard_init(void);
|
void keyboard_init(void);
|
||||||
int keyboard_havechar(void);
|
int keyboard_havechar(void);
|
||||||
unsigned char keyboard_get_scancode(void);
|
unsigned char keyboard_get_scancode(void);
|
||||||
int keyboard_getchar(void);
|
int keyboard_getchar(void);
|
||||||
|
/** @} */
|
||||||
|
|
||||||
/* drivers/serial.c */
|
/**
|
||||||
|
* @defgroup serial Serial functions
|
||||||
|
* @ingroup input
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
void serial_init(void);
|
void serial_init(void);
|
||||||
void serial_putchar(unsigned char c);
|
void serial_putchar(unsigned char c);
|
||||||
int serial_havechar(void);
|
int serial_havechar(void);
|
||||||
|
@ -109,13 +140,23 @@ void serial_end_bold(void);
|
||||||
void serial_start_altcharset(void);
|
void serial_start_altcharset(void);
|
||||||
void serial_end_altcharset(void);
|
void serial_end_altcharset(void);
|
||||||
void serial_set_cursor(int y, int x);
|
void serial_set_cursor(int y, int x);
|
||||||
|
/** @} */
|
||||||
|
|
||||||
/* drivers/speaker.c */
|
/**
|
||||||
|
* @defgroup speaker Speaker functions
|
||||||
|
* @ingroup input
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
void speaker_enable(u16 freq);
|
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);
|
||||||
|
/** @} */
|
||||||
|
|
||||||
/* video/video.c */
|
/**
|
||||||
|
* @defgroup video Video functions
|
||||||
|
* @ingroup input
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
int video_console_init(void);
|
int video_console_init(void);
|
||||||
void video_console_putchar(unsigned int ch);
|
void video_console_putchar(unsigned int ch);
|
||||||
void video_console_putc(u8 row, u8 col, unsigned int ch);
|
void video_console_putc(u8 row, u8 col, unsigned int ch);
|
||||||
|
@ -123,11 +164,15 @@ void video_console_clear(void);
|
||||||
void video_console_cursor_enable(int state);
|
void video_console_cursor_enable(int state);
|
||||||
void video_console_get_cursor(unsigned int *x, unsigned int *y, unsigned int *en);
|
void video_console_get_cursor(unsigned int *x, unsigned int *y, unsigned int *en);
|
||||||
void video_console_set_cursor(unsigned int cursorx, unsigned int cursory);
|
void video_console_set_cursor(unsigned int cursorx, unsigned int cursory);
|
||||||
|
/** @} */
|
||||||
|
|
||||||
/* drivers/option.c */
|
/* drivers/option.c */
|
||||||
int get_option(void *dest, char *name);
|
int get_option(void *dest, char *name);
|
||||||
|
|
||||||
/* libc/console.c */
|
/**
|
||||||
|
* @defgroup console Console functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
void console_init(void);
|
void console_init(void);
|
||||||
int putchar(int c);
|
int putchar(int c);
|
||||||
int puts(const char *s);
|
int puts(const char *s);
|
||||||
|
@ -138,8 +183,12 @@ int getchar_timeout(int *ms);
|
||||||
extern int last_putchar;
|
extern int last_putchar;
|
||||||
|
|
||||||
#define havechar havekey
|
#define havechar havekey
|
||||||
|
/** @} */
|
||||||
|
|
||||||
/* libc/ctype.c */
|
/**
|
||||||
|
* @defgroup ctype Character Type Functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
int isalnum(int c);
|
int isalnum(int c);
|
||||||
int isalpha(int c);
|
int isalpha(int c);
|
||||||
int isascii(int c);
|
int isascii(int c);
|
||||||
|
@ -155,20 +204,36 @@ int isupper(int c);
|
||||||
int isxdigit(int c);
|
int isxdigit(int c);
|
||||||
int tolower(int c);
|
int tolower(int c);
|
||||||
int toupper(int c);
|
int toupper(int c);
|
||||||
|
/** @} */
|
||||||
|
|
||||||
/* libc/ipchecksum.c */
|
/**
|
||||||
|
* @defgroup ipchecksum IP Checksum Functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
unsigned short ipchksum(const void *ptr, unsigned long nbytes);
|
unsigned short ipchksum(const void *ptr, unsigned long nbytes);
|
||||||
|
/** @} */
|
||||||
|
|
||||||
/* libc/malloc.c */
|
/**
|
||||||
|
* @defgroup malloc Memory Allocation Functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
void free(void *ptr);
|
void free(void *ptr);
|
||||||
void *malloc(size_t size);
|
void *malloc(size_t size);
|
||||||
void *calloc(size_t nmemb, size_t size);
|
void *calloc(size_t nmemb, size_t size);
|
||||||
void *realloc(void *ptr, size_t size);
|
void *realloc(void *ptr, size_t size);
|
||||||
|
/** @} */
|
||||||
|
|
||||||
/* libc/exec.c */
|
/**
|
||||||
|
* @defgroup exec Execution Functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
int exec(long addr, int argc, char **argv);
|
int exec(long addr, int argc, char **argv);
|
||||||
|
/** @} */
|
||||||
|
|
||||||
/* libc/lib.c */
|
/**
|
||||||
|
* @defgroup misc Misc Functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
int bcd2dec(int b);
|
int bcd2dec(int b);
|
||||||
int dec2bcd(int d);
|
int dec2bcd(int d);
|
||||||
int abs(int j);
|
int abs(int j);
|
||||||
|
@ -176,27 +241,43 @@ long int labs(long int j);
|
||||||
long long int llabs(long long int j);
|
long long int llabs(long long int j);
|
||||||
u8 bin2hex(u8 b);
|
u8 bin2hex(u8 b);
|
||||||
u8 hex2bin(u8 h);
|
u8 hex2bin(u8 h);
|
||||||
|
/** @} */
|
||||||
|
|
||||||
/* libc/memory.c */
|
/**
|
||||||
|
* @defgroup memory Memory Manipulation Functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
void *memset(void *s, int c, size_t n);
|
void *memset(void *s, int c, size_t n);
|
||||||
void *memcpy(void *dst, const void *src, size_t n);
|
void *memcpy(void *dst, const void *src, size_t n);
|
||||||
void *memmove(void *dst, const void *src, size_t n);
|
void *memmove(void *dst, const void *src, size_t n);
|
||||||
int memcmp(const void *s1, const void *s2, size_t len);
|
int memcmp(const void *s1, const void *s2, size_t len);
|
||||||
|
/** @} */
|
||||||
|
|
||||||
/* libc/printf.c */
|
/**
|
||||||
|
* @defgroup printf Print Functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
int snprintf(char *str, size_t size, const char *fmt, ...);
|
int snprintf(char *str, size_t size, const char *fmt, ...);
|
||||||
int sprintf(char *str, const char *fmt, ...);
|
int sprintf(char *str, const char *fmt, ...);
|
||||||
int vsnprintf(char *str, size_t size, const char *fmt, va_list ap);
|
int vsnprintf(char *str, size_t size, const char *fmt, va_list ap);
|
||||||
int vsprintf(char *str, const char *fmt, va_list ap);
|
int vsprintf(char *str, const char *fmt, va_list ap);
|
||||||
int printf(const char *fmt, ...);
|
int printf(const char *fmt, ...);
|
||||||
int vprintf(const char *fmt, va_list ap);
|
int vprintf(const char *fmt, va_list ap);
|
||||||
|
/** @} */
|
||||||
|
|
||||||
/* libc/rand.c */
|
/**
|
||||||
|
* @defgroup rand Random Number Generator Functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
int rand_r(unsigned int *seed);
|
int rand_r(unsigned int *seed);
|
||||||
int rand(void);
|
int rand(void);
|
||||||
void srand(unsigned int seed);
|
void srand(unsigned int seed);
|
||||||
|
/** @} */
|
||||||
|
|
||||||
/* libc/sha1.c */
|
/**
|
||||||
|
* @defgroup hash Hashing Functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
#define SHA1_BLOCK_LENGTH 64
|
#define SHA1_BLOCK_LENGTH 64
|
||||||
#define SHA1_DIGEST_LENGTH 20
|
#define SHA1_DIGEST_LENGTH 20
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
@ -209,8 +290,12 @@ void SHA1Transform(u32 state[5], const u8 buffer[SHA1_BLOCK_LENGTH]);
|
||||||
void SHA1Update(SHA1_CTX *context, const u8 *data, size_t len);
|
void SHA1Update(SHA1_CTX *context, const u8 *data, size_t len);
|
||||||
void SHA1Final(u8 digest[SHA1_DIGEST_LENGTH], SHA1_CTX *context);
|
void SHA1Final(u8 digest[SHA1_DIGEST_LENGTH], SHA1_CTX *context);
|
||||||
u8 *sha1(const u8 *data, size_t len, u8 *buf);
|
u8 *sha1(const u8 *data, size_t len, u8 *buf);
|
||||||
|
/** @} */
|
||||||
|
|
||||||
/* libc/string.c */
|
/**
|
||||||
|
* @defgroup string String Functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
size_t strnlen(const char *str, size_t maxlen);
|
size_t strnlen(const char *str, size_t maxlen);
|
||||||
size_t strlen(const char *str);
|
size_t strlen(const char *str);
|
||||||
int strcmp(const char *s1, const char *s2);
|
int strcmp(const char *s1, const char *s2);
|
||||||
|
@ -221,18 +306,24 @@ char *strncat(char *d, const char *s, size_t n);
|
||||||
char *strchr(const char *s, int c);
|
char *strchr(const char *s, int c);
|
||||||
char *strdup(const char *s);
|
char *strdup(const char *s);
|
||||||
char *strstr(const char *h, const char *n);
|
char *strstr(const char *h, const char *n);
|
||||||
|
/** @} */
|
||||||
|
|
||||||
/* libc/time.c */
|
/**
|
||||||
|
* @defgroup time Time Functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
struct timeval {
|
struct timeval {
|
||||||
time_t tv_sec;
|
time_t tv_sec;
|
||||||
suseconds_t tv_usec;
|
suseconds_t tv_usec;
|
||||||
};
|
};
|
||||||
|
|
||||||
int gettimeofday(struct timeval *tv, void *tz);
|
int gettimeofday(struct timeval *tv, void *tz);
|
||||||
|
/** @} */
|
||||||
|
|
||||||
/* libc/lar.c */
|
/**
|
||||||
|
* @defgroup lar LAR Functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
struct LAR {
|
struct LAR {
|
||||||
void * start;
|
void * start;
|
||||||
int cindex;
|
int cindex;
|
||||||
|
@ -281,14 +372,16 @@ int lfread(void *ptr, size_t size, size_t nmemb, struct LFILE *stream);
|
||||||
|
|
||||||
int lfseek(struct LFILE *stream, long offset, int whence);
|
int lfseek(struct LFILE *stream, long offset, int whence);
|
||||||
int lfclose(struct LFILE *file);
|
int lfclose(struct LFILE *file);
|
||||||
|
/** @} */
|
||||||
|
|
||||||
/* i386/coreboot.c */
|
/**
|
||||||
|
* @defgroup arch Architecture Specific Functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
int get_coreboot_info(struct sysinfo_t *info);
|
int get_coreboot_info(struct sysinfo_t *info);
|
||||||
|
|
||||||
/* i386/sysinfo.c */
|
|
||||||
void lib_get_sysinfo(void);
|
void lib_get_sysinfo(void);
|
||||||
|
|
||||||
/* i386/timer.c */
|
|
||||||
/* Timer functions - defined by each architecture. */
|
/* Timer functions - defined by each architecture. */
|
||||||
unsigned int get_cpu_speed(void);
|
unsigned int get_cpu_speed(void);
|
||||||
void ndelay(unsigned int n);
|
void ndelay(unsigned int n);
|
||||||
|
@ -296,13 +389,17 @@ void udelay(unsigned int n);
|
||||||
void mdelay(unsigned int n);
|
void mdelay(unsigned int n);
|
||||||
void delay(unsigned int n);
|
void delay(unsigned int n);
|
||||||
|
|
||||||
/* i386/util.S */
|
|
||||||
#define abort() halt()
|
#define abort() halt()
|
||||||
void halt(void) __attribute__ ((noreturn));
|
void halt(void) __attribute__ ((noreturn));
|
||||||
void fatal(const char* msg) __attribute__ ((noreturn));
|
void fatal(const char* msg) __attribute__ ((noreturn));
|
||||||
|
/** @} */
|
||||||
|
|
||||||
/* libc/readline.c */
|
/**
|
||||||
|
* @defgroup readline Readline Functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
char * readline(const char * prompt);
|
char * readline(const char * prompt);
|
||||||
int getline(char *buffer, int len);
|
int getline(char *buffer, int len);
|
||||||
|
/** @} */
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue