root / vl.h @ a412ac57
History | View | Annotate | Download (2 kB)
1 | fc01f7e7 | bellard | /*
|
---|---|---|---|
2 | fc01f7e7 | bellard | * QEMU System Emulator header
|
3 | fc01f7e7 | bellard | *
|
4 | fc01f7e7 | bellard | * Copyright (c) 2003 Fabrice Bellard
|
5 | fc01f7e7 | bellard | *
|
6 | fc01f7e7 | bellard | * Permission is hereby granted, free of charge, to any person obtaining a copy
|
7 | fc01f7e7 | bellard | * of this software and associated documentation files (the "Software"), to deal
|
8 | fc01f7e7 | bellard | * in the Software without restriction, including without limitation the rights
|
9 | fc01f7e7 | bellard | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10 | fc01f7e7 | bellard | * copies of the Software, and to permit persons to whom the Software is
|
11 | fc01f7e7 | bellard | * furnished to do so, subject to the following conditions:
|
12 | fc01f7e7 | bellard | *
|
13 | fc01f7e7 | bellard | * The above copyright notice and this permission notice shall be included in
|
14 | fc01f7e7 | bellard | * all copies or substantial portions of the Software.
|
15 | fc01f7e7 | bellard | *
|
16 | fc01f7e7 | bellard | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17 | fc01f7e7 | bellard | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18 | fc01f7e7 | bellard | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
19 | fc01f7e7 | bellard | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20 | fc01f7e7 | bellard | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21 | fc01f7e7 | bellard | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22 | fc01f7e7 | bellard | * THE SOFTWARE.
|
23 | fc01f7e7 | bellard | */
|
24 | fc01f7e7 | bellard | #ifndef VL_H
|
25 | fc01f7e7 | bellard | #define VL_H
|
26 | fc01f7e7 | bellard | |
27 | 33e3963e | bellard | /* vl.c */
|
28 | 33e3963e | bellard | void *get_mmap_addr(unsigned long size); |
29 | 33e3963e | bellard | |
30 | fc01f7e7 | bellard | /* block.c */
|
31 | fc01f7e7 | bellard | typedef struct BlockDriverState BlockDriverState; |
32 | fc01f7e7 | bellard | |
33 | 33e3963e | bellard | BlockDriverState *bdrv_open(const char *filename, int snapshot); |
34 | fc01f7e7 | bellard | void bdrv_close(BlockDriverState *bs);
|
35 | fc01f7e7 | bellard | int bdrv_read(BlockDriverState *bs, int64_t sector_num,
|
36 | fc01f7e7 | bellard | uint8_t *buf, int nb_sectors);
|
37 | fc01f7e7 | bellard | int bdrv_write(BlockDriverState *bs, int64_t sector_num,
|
38 | fc01f7e7 | bellard | const uint8_t *buf, int nb_sectors); |
39 | fc01f7e7 | bellard | void bdrv_get_geometry(BlockDriverState *bs, int64_t *nb_sectors_ptr);
|
40 | 33e3963e | bellard | int bdrv_commit(BlockDriverState *bs);
|
41 | 33e3963e | bellard | |
42 | 33e3963e | bellard | /* user mode linux compatible COW file */
|
43 | 33e3963e | bellard | #define COW_MAGIC 0x4f4f4f4d /* MOOO */ |
44 | 33e3963e | bellard | #define COW_VERSION 2 |
45 | fc01f7e7 | bellard | |
46 | 33e3963e | bellard | struct cow_header_v2 {
|
47 | 33e3963e | bellard | uint32_t magic; |
48 | 33e3963e | bellard | uint32_t long version;
|
49 | 33e3963e | bellard | char backing_file[1024]; |
50 | 33e3963e | bellard | int32_t mtime; |
51 | 33e3963e | bellard | uint64_t size; |
52 | 33e3963e | bellard | uint32_t sectorsize; |
53 | 33e3963e | bellard | }; |
54 | fc01f7e7 | bellard | |
55 | fc01f7e7 | bellard | #endif /* VL_H */ |