qemu-options.hx: Fix minor issues in icount documentation
[qemu/ar7.git] / contrib / elf2dmp / addrspace.h
blobd87f6a18c6842b0ddf9e39729b0e86cdc1834331
1 /*
2 * Copyright (c) 2018 Virtuozzo International GmbH
4 * This work is licensed under the terms of the GNU GPL, version 2 or later.
6 */
8 #ifndef ADDRSPACE_H
9 #define ADDRSPACE_H
11 #include "qemu_elf.h"
13 #define PAGE_BITS 12
14 #define PAGE_SIZE (1ULL << PAGE_BITS)
15 #define PFN_MASK (~(PAGE_SIZE - 1))
17 #define INVALID_PA UINT64_MAX
19 struct pa_block {
20 uint8_t *addr;
21 uint64_t paddr;
22 uint64_t size;
25 struct pa_space {
26 size_t block_nr;
27 struct pa_block *block;
30 struct va_space {
31 uint64_t dtb;
32 struct pa_space *ps;
35 int pa_space_create(struct pa_space *ps, QEMU_Elf *qemu_elf);
36 void pa_space_destroy(struct pa_space *ps);
38 void va_space_create(struct va_space *vs, struct pa_space *ps, uint64_t dtb);
39 void va_space_set_dtb(struct va_space *vs, uint64_t dtb);
40 void *va_space_resolve(struct va_space *vs, uint64_t va);
41 int va_space_rw(struct va_space *vs, uint64_t addr,
42 void *buf, size_t size, int is_write);
44 #endif /* ADDRSPACE_H */