1 /******************************************************************************
2 * Copyright (c) 2004, 2008 IBM Corporation
4 * This program and the accompanying materials
5 * are made available under the terms of the BSD License
6 * which accompanies this distribution, and is available at
7 * http://www.opensource.org/licenses/bsd-license.php
10 * IBM Corporation - initial implementation
11 *****************************************************************************/
18 #if __BYTE_ORDER == __BIG_ENDIAN
19 #define cpu_to_be64(x) (x)
21 #define cpu_to_be64(x) bswap_64(x)
26 unsigned int romfs_size;
27 struct ffs_header_t *first;
30 #define FLAG_LLFW 1 /* low level firmware at fix offs in romfs */
32 #define needs_fix_offset(hdr) ((hdr)->flags & FLAG_LLFW)
35 unsigned long long flags;
36 unsigned long long romaddr;
40 struct ffs_header_t *linked_to;
41 struct ffs_header_t *next;
42 unsigned long long save_data;
43 unsigned long long save_data_len;
46 unsigned long long addr; /* tmp */
47 int hdrsize; /* tmp */
48 int tokensize; /* tmp */
52 void dump_fs_contents(struct ffs_chain_t *chain);
53 void find_duplicates(struct ffs_chain_t *chain);
54 void free_chain_memory(struct ffs_chain_t *chain);
56 int read_config(int conf_file, struct ffs_chain_t *ffs_chain);
57 int reorder_ffs_chain(struct ffs_chain_t *fs);
58 int build_ffs(struct ffs_chain_t *fs, const char *outfile, int notime);