Add qemu 2.4.0
[kvmfornfv.git] / qemu / roms / SLOF / include / romfs.h
1 /******************************************************************************
2  * Copyright (c) 2004, 2008 IBM Corporation
3  * All rights reserved.
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
8  *
9  * Contributors:
10  *     IBM Corporation - initial implementation
11  *****************************************************************************/
12 #ifndef ROMFS_H
13 #define ROMFS_H
14
15 #define RFS_T_SIZE      0x00
16 #define RFS_T_FLAGS     0x08
17 #define RFS_T_FILEADDR  0x10
18 #define RFS_T_NEXT      0x18
19 #define RFS_T_NAME      0x20
20 #define RFS_T_DATA      0x28
21
22 #define RFS_H_NEXT      0x00
23 #define RFS_H_SIZE      0x08
24 #define RFS_H_FLAGS     0x10
25 #define RFS_H_DATA      0x18
26 #define RFS_H_NAME      0x20
27
28 #define ROMFS_HDR_NEXT (0 * 8)
29 #define ROMFS_HDR_LEN  (1 * 8)
30 #define ROMFS_HDR_FLAG (2 * 8)
31 #define ROMFS_HDR_DPTR (3 * 8)
32 #define ROMFS_HDR_NAME (4 * 8)
33
34 #ifndef  __ASSEMBLER__
35 /* no not change except if you change romfs.S */
36 struct romfs_t {
37         unsigned long   size;
38         unsigned long   flags;
39         unsigned long   fileaddr;
40         unsigned long   nexfile;
41         unsigned char   *namep;
42         unsigned char   *datap;
43 };
44
45 struct romfs_lookup_t {
46         unsigned long   addr_header;
47         unsigned long   addr_data;
48         unsigned long   size_data;
49         unsigned long   flags;
50 };
51
52 int romfs_stat(char *filename, struct romfs_t *hnd);
53
54 int romfs_stat_file(char *filename, struct romfs_t *hnd);
55
56 int c_romfs_lookup(char *filename, unsigned long rombase,
57                 struct romfs_lookup_t *ret);
58
59 #endif          /*  __ASSEMBLER__ */
60 #endif          /* ROMFS_H */