~ubuntu-branches/ubuntu/vivid/qemu/vivid

« back to all changes in this revision

Viewing changes to include/exec/memory-internal.h

  • Committer: Package Import Robot
  • Author(s): Serge Hallyn
  • Date: 2014-02-25 22:31:43 UTC
  • mfrom: (1.8.5)
  • Revision ID: package-import@ubuntu.com-20140225223143-odhqxfc60wxrjl15
Tags: 2.0.0~rc1+dfsg-0ubuntu1
* Merge 2.0.0-rc1
* debian/rules: consolidate ppc filter entries.
* Move qemu-system-arch64 into qemu-system-arm
* debian/patches/define-trusty-machine-type.patch: define a trusty machine
  type, currently the same as pc-i440fx-2.0, to put is in a better position
  to enable live migrations from trusty onward.  (LP: #1294823)
* debian/control: build-dep on libfdt >= 1.4.0  (LP: #1295072)
* Merge latest upstream git to commit dc9528f
* Debian/rules:
  - remove -enable-uname-release=2.6.32
  - don't make the aarch64 target Ubuntu-specific.
* Remove patches which are now upstream:
  - fix-smb-security-share.patch
  - slirp-smb-redirect-port-445-too.patch 
  - linux-user-Implement-sendmmsg-syscall.patch (better version is upstream)
  - signal-added-a-wrapper-for-sigprocmask-function.patch
  - ubuntu/signal-sigsegv-protection-on-do_sigprocmask.patch
  - ubuntu/Don-t-block-SIGSEGV-at-more-places.patch
  - ubuntu/ppc-force-cpu-threads-count-to-be-power-of-2.patch
* add link for /usr/share/qemu/bios-256k.bin
* Remove all linaro patches.
* Remove all arm64/ patches.  Many but not all are upstream.
* Remove CVE-2013-4377.patch which is upstream.
* debian/control-in: don't make qemu-system-aarch64 ubuntu-specific

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
#define MEMORY_INTERNAL_H
21
21
 
22
22
#ifndef CONFIG_USER_ONLY
23
 
#include "hw/xen/xen.h"
24
 
 
25
 
 
26
23
typedef struct AddressSpaceDispatch AddressSpaceDispatch;
27
24
 
28
25
void address_space_init_dispatch(AddressSpace *as);
33
30
bool memory_region_access_valid(MemoryRegion *mr, hwaddr addr,
34
31
                                unsigned size, bool is_write);
35
32
 
36
 
ram_addr_t qemu_ram_alloc_from_ptr(ram_addr_t size, void *host,
37
 
                                   MemoryRegion *mr);
38
 
ram_addr_t qemu_ram_alloc(ram_addr_t size, MemoryRegion *mr);
39
 
void *qemu_get_ram_ptr(ram_addr_t addr);
40
 
void qemu_ram_free(ram_addr_t addr);
41
 
void qemu_ram_free_from_ptr(ram_addr_t addr);
42
 
 
43
 
#define VGA_DIRTY_FLAG       0x01
44
 
#define CODE_DIRTY_FLAG      0x02
45
 
#define MIGRATION_DIRTY_FLAG 0x08
46
 
 
47
 
static inline int cpu_physical_memory_get_dirty_flags(ram_addr_t addr)
48
 
{
49
 
    return ram_list.phys_dirty[addr >> TARGET_PAGE_BITS];
50
 
}
51
 
 
52
 
/* read dirty bit (return 0 or 1) */
53
 
static inline int cpu_physical_memory_is_dirty(ram_addr_t addr)
54
 
{
55
 
    return cpu_physical_memory_get_dirty_flags(addr) == 0xff;
56
 
}
57
 
 
58
 
static inline int cpu_physical_memory_get_dirty(ram_addr_t start,
59
 
                                                ram_addr_t length,
60
 
                                                int dirty_flags)
61
 
{
62
 
    int ret = 0;
63
 
    ram_addr_t addr, end;
64
 
 
65
 
    end = TARGET_PAGE_ALIGN(start + length);
66
 
    start &= TARGET_PAGE_MASK;
67
 
    for (addr = start; addr < end; addr += TARGET_PAGE_SIZE) {
68
 
        ret |= cpu_physical_memory_get_dirty_flags(addr) & dirty_flags;
69
 
    }
70
 
    return ret;
71
 
}
72
 
 
73
 
static inline int cpu_physical_memory_set_dirty_flags(ram_addr_t addr,
74
 
                                                      int dirty_flags)
75
 
{
76
 
    return ram_list.phys_dirty[addr >> TARGET_PAGE_BITS] |= dirty_flags;
77
 
}
78
 
 
79
 
static inline void cpu_physical_memory_set_dirty(ram_addr_t addr)
80
 
{
81
 
    cpu_physical_memory_set_dirty_flags(addr, 0xff);
82
 
}
83
 
 
84
 
static inline int cpu_physical_memory_clear_dirty_flags(ram_addr_t addr,
85
 
                                                        int dirty_flags)
86
 
{
87
 
    int mask = ~dirty_flags;
88
 
 
89
 
    return ram_list.phys_dirty[addr >> TARGET_PAGE_BITS] &= mask;
90
 
}
91
 
 
92
 
static inline void cpu_physical_memory_set_dirty_range(ram_addr_t start,
93
 
                                                       ram_addr_t length,
94
 
                                                       int dirty_flags)
95
 
{
96
 
    ram_addr_t addr, end;
97
 
 
98
 
    end = TARGET_PAGE_ALIGN(start + length);
99
 
    start &= TARGET_PAGE_MASK;
100
 
    for (addr = start; addr < end; addr += TARGET_PAGE_SIZE) {
101
 
        cpu_physical_memory_set_dirty_flags(addr, dirty_flags);
102
 
    }
103
 
    xen_modified_memory(addr, length);
104
 
}
105
 
 
106
 
static inline void cpu_physical_memory_mask_dirty_range(ram_addr_t start,
107
 
                                                        ram_addr_t length,
108
 
                                                        int dirty_flags)
109
 
{
110
 
    ram_addr_t addr, end;
111
 
 
112
 
    end = TARGET_PAGE_ALIGN(start + length);
113
 
    start &= TARGET_PAGE_MASK;
114
 
    for (addr = start; addr < end; addr += TARGET_PAGE_SIZE) {
115
 
        cpu_physical_memory_clear_dirty_flags(addr, dirty_flags);
116
 
    }
117
 
}
118
 
 
119
 
void cpu_physical_memory_reset_dirty(ram_addr_t start, ram_addr_t end,
120
 
                                     int dirty_flags);
121
 
 
122
33
#endif
123
 
 
124
34
#endif