X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=payloads%2Flibpayload%2Finclude%2Flibpayload.h;h=8535bd04fa74abfe7564da39abdded9c0439f5e2;hb=506980808d2f525e294cdd364b2b4e08276ab8d9;hp=611f65e43238f1513c54987bf7a60b30a596d936;hpb=be504d1d8dfaf39a626cbb74450d26aa5eb05871;p=coreboot.git diff --git a/payloads/libpayload/include/libpayload.h b/payloads/libpayload/include/libpayload.h index 611f65e43..8535bd04f 100644 --- a/payloads/libpayload/include/libpayload.h +++ b/payloads/libpayload/include/libpayload.h @@ -36,6 +36,7 @@ #include #include #include +#include #define MIN(a,b) ((a) < (b) ? (a) : (b)) #define MAX(a,b) ((a) > (b) ? (a) : (b)) @@ -61,12 +62,29 @@ #define NVRAM_RTC_DAY 7 #define NVRAM_RTC_MONTH 8 #define NVRAM_RTC_YEAR 9 +#define NVRAM_RTC_FREQ_SELECT 10 +#define NVRAM_RTC_UIP 0x80 + +struct tm { + int tm_sec; + int tm_min; + int tm_hour; + int tm_mday; + int tm_mon; + int tm_year; + int tm_wday; + int tm_yday; + int tm_isdst; +}; /* drivers/nvram.c */ u8 nvram_read(u8 addr); void nvram_write(u8 val, u8 addr); +int nvram_updating(void); +void rtc_read_clock(struct tm *tm); /* drivers/keyboard.c */ +void keyboard_init(void); int keyboard_havechar(void); unsigned char keyboard_get_scancode(void); int keyboard_getchar(void); @@ -181,6 +199,65 @@ char *strchr(const char *s, int c); char *strdup(const char *s); char *strstr(const char *h, const char *n); +/* libc/time.c */ + +struct timeval { + time_t tv_sec; + suseconds_t tv_usec; +}; + +int gettimeofday(struct timeval *tv, void *tz); + +/* libc/lar.c */ + +struct LAR { + void * start; + int cindex; + int count; + int alloc; + int eof; + void **headers; +}; + +struct larent { + u8 name[LAR_MAX_PATHLEN]; +}; + +struct larstat { + u32 len; + u32 reallen; + u32 checksum; + u32 compchecksum; + u32 offset; + u32 compression; + u64 entry; + u64 loadaddress; +}; + +struct LFILE { + struct LAR *lar; + struct lar_header *header; + u32 size; + void *start; + u32 offset; +}; + +struct LAR *openlar(void *addr); +int closelar(struct LAR *lar); +struct larent *readlar(struct LAR *lar); +void rewindlar(struct LAR *lar); +int larstat(struct LAR *lar, const char *path, struct larstat *buf); +void *larfptr(struct LAR *lar, const char *filename); +struct LFILE * lfopen(struct LAR *lar, const char *filename); +int lfread(void *ptr, size_t size, size_t nmemb, struct LFILE *stream); + +#define SEEK_SET 0 +#define SEEK_CUR 1 +#define SEEK_END 2 + +int lfseek(struct LFILE *stream, long offset, int whence); +int lfclose(struct LFILE *file); + /* i386/coreboot.c */ int get_coreboot_info(struct sysinfo_t *info);