diff options
author | 2015-08-28 09:58:54 +0800 | |
---|---|---|
committer | 2015-09-01 12:44:00 +0800 | |
commit | e44e3482bdb4d0ebde2d8b41830ac2cdb07948fb (patch) | |
tree | 66b09f592c55df2878107a468a91d21506104d3f /qemu/roms/SLOF/romfs/tools/cfgparse.h | |
parent | 9ca8dbcc65cfc63d6f5ef3312a33184e1d726e00 (diff) |
Add qemu 2.4.0
Change-Id: Ic99cbad4b61f8b127b7dc74d04576c0bcbaaf4f5
Signed-off-by: Yang Zhang <yang.z.zhang@intel.com>
Diffstat (limited to 'qemu/roms/SLOF/romfs/tools/cfgparse.h')
-rw-r--r-- | qemu/roms/SLOF/romfs/tools/cfgparse.h | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/qemu/roms/SLOF/romfs/tools/cfgparse.h b/qemu/roms/SLOF/romfs/tools/cfgparse.h new file mode 100644 index 000000000..ed5c8856d --- /dev/null +++ b/qemu/roms/SLOF/romfs/tools/cfgparse.h @@ -0,0 +1,59 @@ +/****************************************************************************** + * Copyright (c) 2004, 2008 IBM Corporation + * All rights reserved. + * This program and the accompanying materials + * are made available under the terms of the BSD License + * which accompanies this distribution, and is available at + * http://www.opensource.org/licenses/bsd-license.php + * + * Contributors: + * IBM Corporation - initial implementation + *****************************************************************************/ +#ifndef CFGPARSE_H +#define CFGPARSE_H + +#include <byteswap.h> +#include <endian.h> + +#if __BYTE_ORDER == __BIG_ENDIAN +#define cpu_to_be64(x) (x) +#else +#define cpu_to_be64(x) bswap_64(x) +#endif + +struct ffs_chain_t { + int count; + unsigned int romfs_size; + struct ffs_header_t *first; +}; + +#define FLAG_LLFW 1 /* low level firmware at fix offs in romfs */ + +#define needs_fix_offset(hdr) ((hdr)->flags & FLAG_LLFW) + +struct ffs_header_t { + unsigned long long flags; + unsigned long long romaddr; + char *token; + char *imagefile; + int imagefile_length; + struct ffs_header_t *linked_to; + struct ffs_header_t *next; + unsigned long long save_data; + unsigned long long save_data_len; + int save_data_valid; + + unsigned long long addr; /* tmp */ + int hdrsize; /* tmp */ + int tokensize; /* tmp */ + int ffsize; /* tmp */ +}; + +void dump_fs_contents(struct ffs_chain_t *chain); +void find_duplicates(struct ffs_chain_t *chain); +void free_chain_memory(struct ffs_chain_t *chain); + +int read_config(int conf_file, struct ffs_chain_t *ffs_chain); +int reorder_ffs_chain(struct ffs_chain_t *fs); +int build_ffs(struct ffs_chain_t *fs, const char *outfile, int notime); +#endif |