diff options
author | Sven Schnelle <svens@stackframe.org> | 2011-06-12 14:35:11 +0200 |
---|---|---|
committer | Sven Schnelle <svens@stackframe.org> | 2011-06-15 08:51:18 +0200 |
commit | 4297a9a101f342ed9699848c8d55f26f78b3816c (patch) | |
tree | 4886f6f35e25238a418699d7f5bf4ee5786ccb54 /src/lib/cbfs.c | |
parent | d29e5bb9335a7d185480a8a780b619d3a3151f11 (diff) |
X60: trigger save cmos on volume/brightness change
Change-Id: I020e06bc311c4e4327c9d3cf2c379dc8fe070a7a
Signed-off-by: Sven Schnelle <svens@stackframe.org>
Reviewed-on: http://review.coreboot.org/25
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/lib/cbfs.c')
-rw-r--r-- | src/lib/cbfs.c | 59 |
1 files changed, 30 insertions, 29 deletions
diff --git a/src/lib/cbfs.c b/src/lib/cbfs.c index 690033e6b0..7cfa3e2a40 100644 --- a/src/lib/cbfs.c +++ b/src/lib/cbfs.c @@ -25,34 +25,6 @@ #include <arch/byteorder.h> -/** - * Decompression wrapper for CBFS - * @param algo - * @param src - * @param dst - * @param len - * @return 0 on success, -1 on failure - */ -static int cbfs_decompress(int algo, void *src, void *dst, int len) -{ - switch(algo) { - case CBFS_COMPRESS_NONE: - memcpy(dst, src, len); - return 0; - - case CBFS_COMPRESS_LZMA: - if (!ulzma(src, dst)) { - printk(BIOS_ERR, "CBFS: LZMA decompression failed!\n"); - return -1; - } - return 0; - - default: - printk(BIOS_INFO, "CBFS: Unknown compression type %d\n", algo); - return -1; - } -} - static int cbfs_check_magic(struct cbfs_file *file) { return !strcmp(file->magic, CBFS_FILE_MAGIC) ? 1 : 0; @@ -132,6 +104,7 @@ void *cbfs_find_file(const char *name, int type) return (void *) CBFS_SUBHEADER(file); } +#ifndef __SMM__ static inline int tohex4(unsigned int c) { return (c<=9)?(c+'0'):(c-10+'a'); @@ -145,6 +118,34 @@ static void tohex16(unsigned int val, char* dest) dest[3]=tohex4(val & 0xf); } +/** + * Decompression wrapper for CBFS + * @param algo + * @param src + * @param dst + * @param len + * @return 0 on success, -1 on failure + */ +static int cbfs_decompress(int algo, void *src, void *dst, int len) +{ + switch(algo) { + case CBFS_COMPRESS_NONE: + memcpy(dst, src, len); + return 0; + + case CBFS_COMPRESS_LZMA: + if (!ulzma(src, dst)) { + printk(BIOS_ERR, "CBFS: LZMA decompression failed!\n"); + return -1; + } + return 0; + default: + printk(BIOS_INFO, "CBFS: Unknown compression type %d\n", algo); + return -1; + } +} + + void *cbfs_load_optionrom(u16 vendor, u16 device, void * dest) { char name[17]="pciXXXX,XXXX.rom"; @@ -246,4 +247,4 @@ int run_address(void *f) v = f; return v(); } - +#endif |