libpayload: Expose options_checksum_valid
[coreboot.git] / payloads / libpayload / include / libpayload.h
index 2efb88e3281edd8aa3eb75e12003132eb27a54b9..488ad488f8cfb7b33795a4e1960c1d48a632f331 100644 (file)
@@ -123,6 +123,7 @@ void rtc_read_clock(struct tm *tm);
  * @{
  */
 int usb_initialize(void);
+int usb_exit (void);
 int usbhid_havechar(void);
 int usbhid_getchar(void);
 /** @} */
@@ -153,7 +154,6 @@ int keyboard_set_layout(char *country);
  * @{
  */
 void serial_init(void);
-void serial_hardware_init(int port, int speed, int word_bits, int parity, int stop_bits);
 void serial_putchar(unsigned int c);
 int serial_havechar(void);
 int serial_getchar(void);
@@ -194,7 +194,25 @@ void video_console_set_cursor(unsigned int cursorx, unsigned int cursory);
 /** @} */
 
 /* drivers/option.c */
+struct nvram_accessor {
+       u8 (*read)(u8 reg);
+       void (*write)(u8 val, u8 reg);
+};
+
+extern u8 *mem_accessor_base;
+extern struct nvram_accessor *use_nvram, *use_mem;
+
+struct cb_cmos_option_table *get_system_option_table(void);
+int options_checksum_valid(const struct nvram_accessor *nvram);
+void fix_options_checksum_with(const struct nvram_accessor *nvram);
+void fix_options_checksum(void);
+int get_option_with(const struct nvram_accessor *nvram, struct cb_cmos_option_table *option_table, void *dest, char *name);
+int get_option_from(struct cb_cmos_option_table *option_table, void *dest, char *name);
 int get_option(void *dest, char *name);
+int set_option_with(const struct nvram_accessor *nvram, struct cb_cmos_option_table *option_table, void *value, char *name);
+int set_option(void *value, char *name);
+int get_option_as_string(const struct nvram_accessor *nvram, struct cb_cmos_option_table *option_table, char **dest, char *name);
+int set_option_from_string(const struct nvram_accessor *nvram, struct cb_cmos_option_table *option_table, char *value, char *name);
 
 /**
  * @defgroup console Console functions
@@ -272,6 +290,7 @@ typedef struct {
 void SHA1Init(SHA1_CTX *context);
 void SHA1Transform(u32 state[5], const u8 buffer[SHA1_BLOCK_LENGTH]);
 void SHA1Update(SHA1_CTX *context, const u8 *data, size_t len);
+void SHA1Pad(SHA1_CTX *context);
 void SHA1Final(u8 digest[SHA1_DIGEST_LENGTH], SHA1_CTX *context);
 u8 *sha1(const u8 *data, size_t len, u8 *buf);
 /** @} */
@@ -342,10 +361,6 @@ int lfverify(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 /**< The seek offset is absolute. */
-#define SEEK_CUR 1 /**< The seek offset is against the current position. */
-#define SEEK_END 2 /**< The seek offset is against the end of the file. */
-
 int lfseek(struct LFILE *stream, long offset, int whence);
 int lfclose(struct LFILE *file);
 /** @} */
@@ -369,7 +384,7 @@ int sysinfo_have_multiboot(unsigned long *addr);
 int get_coreboot_info(struct sysinfo_t *info);
 int get_multiboot_info(struct sysinfo_t *info);
 
-void lib_get_sysinfo(void);
+int lib_get_sysinfo(void);
 
 /* Timer functions - defined by each architecture. */
 unsigned int get_cpu_speed(void);