Revision a8170e5e

b/HACKING
32 32

  
33 33
Don't use Linux kernel internal types like u32, __u32 or __le32.
34 34

  
35
Use target_phys_addr_t for guest physical addresses except pcibus_t
35
Use hwaddr for guest physical addresses except pcibus_t
36 36
for PCI addresses.  In addition, ram_addr_t is a QEMU internal address
37 37
space that maps guest RAM physical addresses into an intermediate
38 38
address space that can map to host virtual address spaces.  Generally
b/cpu-all.h
474 474
/* Return the physical page corresponding to a virtual one. Use it
475 475
   only for debugging because no protection checks are done. Return -1
476 476
   if no page found. */
477
target_phys_addr_t cpu_get_phys_page_debug(CPUArchState *env, target_ulong addr);
477
hwaddr cpu_get_phys_page_debug(CPUArchState *env, target_ulong addr);
478 478

  
479 479
/* memory API */
480 480

  
b/cpu-common.h
3 3

  
4 4
/* CPU interfaces that are target independent.  */
5 5

  
6
#include "targphys.h"
6
#include "hwaddr.h"
7 7

  
8 8
#ifndef NEED_CPU_H
9 9
#include "poison.h"
......
33 33

  
34 34
/* memory API */
35 35

  
36
typedef void CPUWriteMemoryFunc(void *opaque, target_phys_addr_t addr, uint32_t value);
37
typedef uint32_t CPUReadMemoryFunc(void *opaque, target_phys_addr_t addr);
36
typedef void CPUWriteMemoryFunc(void *opaque, hwaddr addr, uint32_t value);
37
typedef uint32_t CPUReadMemoryFunc(void *opaque, hwaddr addr);
38 38

  
39 39
void qemu_ram_remap(ram_addr_t addr, ram_addr_t length);
40 40
/* This should only be used for ram local to a device.  */
......
49 49
ram_addr_t qemu_ram_addr_from_host_nofail(void *ptr);
50 50
void qemu_ram_set_idstr(ram_addr_t addr, const char *name, DeviceState *dev);
51 51

  
52
void cpu_physical_memory_rw(target_phys_addr_t addr, uint8_t *buf,
52
void cpu_physical_memory_rw(hwaddr addr, uint8_t *buf,
53 53
                            int len, int is_write);
54
static inline void cpu_physical_memory_read(target_phys_addr_t addr,
54
static inline void cpu_physical_memory_read(hwaddr addr,
55 55
                                            void *buf, int len)
56 56
{
57 57
    cpu_physical_memory_rw(addr, buf, len, 0);
58 58
}
59
static inline void cpu_physical_memory_write(target_phys_addr_t addr,
59
static inline void cpu_physical_memory_write(hwaddr addr,
60 60
                                             const void *buf, int len)
61 61
{
62 62
    cpu_physical_memory_rw(addr, (void *)buf, len, 1);
63 63
}
64
void *cpu_physical_memory_map(target_phys_addr_t addr,
65
                              target_phys_addr_t *plen,
64
void *cpu_physical_memory_map(hwaddr addr,
65
                              hwaddr *plen,
66 66
                              int is_write);
67
void cpu_physical_memory_unmap(void *buffer, target_phys_addr_t len,
68
                               int is_write, target_phys_addr_t access_len);
67
void cpu_physical_memory_unmap(void *buffer, hwaddr len,
68
                               int is_write, hwaddr access_len);
69 69
void *cpu_register_map_client(void *opaque, void (*callback)(void *opaque));
70 70
void cpu_unregister_map_client(void *cookie);
71 71

  
72
bool cpu_physical_memory_is_io(target_phys_addr_t phys_addr);
72
bool cpu_physical_memory_is_io(hwaddr phys_addr);
73 73

  
74 74
/* Coalesced MMIO regions are areas where write operations can be reordered.
75 75
 * This usually implies that write operations are side-effect free.  This allows
......
78 78
 */
79 79
void qemu_flush_coalesced_mmio_buffer(void);
80 80

  
81
uint32_t ldub_phys(target_phys_addr_t addr);
82
uint32_t lduw_le_phys(target_phys_addr_t addr);
83
uint32_t lduw_be_phys(target_phys_addr_t addr);
84
uint32_t ldl_le_phys(target_phys_addr_t addr);
85
uint32_t ldl_be_phys(target_phys_addr_t addr);
86
uint64_t ldq_le_phys(target_phys_addr_t addr);
87
uint64_t ldq_be_phys(target_phys_addr_t addr);
88
void stb_phys(target_phys_addr_t addr, uint32_t val);
89
void stw_le_phys(target_phys_addr_t addr, uint32_t val);
90
void stw_be_phys(target_phys_addr_t addr, uint32_t val);
91
void stl_le_phys(target_phys_addr_t addr, uint32_t val);
92
void stl_be_phys(target_phys_addr_t addr, uint32_t val);
93
void stq_le_phys(target_phys_addr_t addr, uint64_t val);
94
void stq_be_phys(target_phys_addr_t addr, uint64_t val);
81
uint32_t ldub_phys(hwaddr addr);
82
uint32_t lduw_le_phys(hwaddr addr);
83
uint32_t lduw_be_phys(hwaddr addr);
84
uint32_t ldl_le_phys(hwaddr addr);
85
uint32_t ldl_be_phys(hwaddr addr);
86
uint64_t ldq_le_phys(hwaddr addr);
87
uint64_t ldq_be_phys(hwaddr addr);
88
void stb_phys(hwaddr addr, uint32_t val);
89
void stw_le_phys(hwaddr addr, uint32_t val);
90
void stw_be_phys(hwaddr addr, uint32_t val);
91
void stl_le_phys(hwaddr addr, uint32_t val);
92
void stl_be_phys(hwaddr addr, uint32_t val);
93
void stq_le_phys(hwaddr addr, uint64_t val);
94
void stq_be_phys(hwaddr addr, uint64_t val);
95 95

  
96 96
#ifdef NEED_CPU_H
97
uint32_t lduw_phys(target_phys_addr_t addr);
98
uint32_t ldl_phys(target_phys_addr_t addr);
99
uint64_t ldq_phys(target_phys_addr_t addr);
100
void stl_phys_notdirty(target_phys_addr_t addr, uint32_t val);
101
void stq_phys_notdirty(target_phys_addr_t addr, uint64_t val);
102
void stw_phys(target_phys_addr_t addr, uint32_t val);
103
void stl_phys(target_phys_addr_t addr, uint32_t val);
104
void stq_phys(target_phys_addr_t addr, uint64_t val);
97
uint32_t lduw_phys(hwaddr addr);
98
uint32_t ldl_phys(hwaddr addr);
99
uint64_t ldq_phys(hwaddr addr);
100
void stl_phys_notdirty(hwaddr addr, uint32_t val);
101
void stq_phys_notdirty(hwaddr addr, uint64_t val);
102
void stw_phys(hwaddr addr, uint32_t val);
103
void stl_phys(hwaddr addr, uint32_t val);
104
void stq_phys(hwaddr addr, uint64_t val);
105 105
#endif
106 106

  
107
void cpu_physical_memory_write_rom(target_phys_addr_t addr,
107
void cpu_physical_memory_write_rom(hwaddr addr,
108 108
                                   const uint8_t *buf, int len);
109 109

  
110 110
extern struct MemoryRegion io_mem_ram;
b/cpu-defs.h
29 29
#include <signal.h>
30 30
#include "osdep.h"
31 31
#include "qemu-queue.h"
32
#include "targphys.h"
32
#include "hwaddr.h"
33 33

  
34 34
#ifndef TARGET_LONG_BITS
35 35
#error TARGET_LONG_BITS must be defined before including this header
......
111 111
#define CPU_COMMON_TLB \
112 112
    /* The meaning of the MMU modes is defined in the target code. */   \
113 113
    CPUTLBEntry tlb_table[NB_MMU_MODES][CPU_TLB_SIZE];                  \
114
    target_phys_addr_t iotlb[NB_MMU_MODES][CPU_TLB_SIZE];               \
114
    hwaddr iotlb[NB_MMU_MODES][CPU_TLB_SIZE];               \
115 115
    target_ulong tlb_flush_addr;                                        \
116 116
    target_ulong tlb_flush_mask;
117 117

  
b/cputlb.c
237 237
   is permitted. Only a single TARGET_PAGE_SIZE region is mapped, the
238 238
   supplied size is only used by tlb_flush_page.  */
239 239
void tlb_set_page(CPUArchState *env, target_ulong vaddr,
240
                  target_phys_addr_t paddr, int prot,
240
                  hwaddr paddr, int prot,
241 241
                  int mmu_idx, target_ulong size)
242 242
{
243 243
    MemoryRegionSection *section;
......
246 246
    target_ulong code_address;
247 247
    uintptr_t addend;
248 248
    CPUTLBEntry *te;
249
    target_phys_addr_t iotlb;
249
    hwaddr iotlb;
250 250

  
251 251
    assert(size >= TARGET_PAGE_SIZE);
252 252
    if (size != TARGET_PAGE_SIZE) {
b/cputlb.h
27 27
void tlb_reset_dirty_range(CPUTLBEntry *tlb_entry, uintptr_t start,
28 28
                           uintptr_t length);
29 29
MemoryRegionSection *phys_page_find(struct AddressSpaceDispatch *d,
30
                                    target_phys_addr_t index);
30
                                    hwaddr index);
31 31
void cpu_tlb_reset_dirty_all(ram_addr_t start1, ram_addr_t length);
32 32
void tlb_set_dirty(CPUArchState *env, target_ulong vaddr);
33 33
extern int tlb_flush_count;
34 34

  
35 35
/* exec.c */
36 36
void tb_flush_jmp_cache(CPUArchState *env, target_ulong addr);
37
target_phys_addr_t memory_region_section_get_iotlb(CPUArchState *env,
37
hwaddr memory_region_section_get_iotlb(CPUArchState *env,
38 38
                                                   MemoryRegionSection *section,
39 39
                                                   target_ulong vaddr,
40
                                                   target_phys_addr_t paddr,
40
                                                   hwaddr paddr,
41 41
                                                   int prot,
42 42
                                                   target_ulong *address);
43 43
bool memory_region_is_unassigned(MemoryRegion *mr);
b/disas.h
22 22
#if defined(CONFIG_USER_ONLY)
23 23
typedef const char *(*lookup_symbol_t)(struct syminfo *s, target_ulong orig_addr);
24 24
#else
25
typedef const char *(*lookup_symbol_t)(struct syminfo *s, target_phys_addr_t orig_addr);
25
typedef const char *(*lookup_symbol_t)(struct syminfo *s, hwaddr orig_addr);
26 26
#endif
27 27

  
28 28
struct syminfo {
b/dma-helpers.c
281 281
bool iommu_dma_memory_valid(DMAContext *dma, dma_addr_t addr, dma_addr_t len,
282 282
                            DMADirection dir)
283 283
{
284
    target_phys_addr_t paddr, plen;
284
    hwaddr paddr, plen;
285 285

  
286 286
#ifdef DEBUG_IOMMU
287 287
    fprintf(stderr, "dma_memory_check context=%p addr=0x" DMA_ADDR_FMT
......
308 308
int iommu_dma_memory_rw(DMAContext *dma, dma_addr_t addr,
309 309
                        void *buf, dma_addr_t len, DMADirection dir)
310 310
{
311
    target_phys_addr_t paddr, plen;
311
    hwaddr paddr, plen;
312 312
    int err;
313 313

  
314 314
#ifdef DEBUG_IOMMU
......
346 346
int iommu_dma_memory_set(DMAContext *dma, dma_addr_t addr, uint8_t c,
347 347
                         dma_addr_t len)
348 348
{
349
    target_phys_addr_t paddr, plen;
349
    hwaddr paddr, plen;
350 350
    int err;
351 351

  
352 352
#ifdef DEBUG_IOMMU
......
392 392
                           DMADirection dir)
393 393
{
394 394
    int err;
395
    target_phys_addr_t paddr, plen;
395
    hwaddr paddr, plen;
396 396
    void *buf;
397 397

  
398 398
    if (dma->map) {
b/dma.h
48 48

  
49 49
typedef int DMATranslateFunc(DMAContext *dma,
50 50
                             dma_addr_t addr,
51
                             target_phys_addr_t *paddr,
52
                             target_phys_addr_t *len,
51
                             hwaddr *paddr,
52
                             hwaddr *len,
53 53
                             DMADirection dir);
54 54
typedef void* DMAMapFunc(DMAContext *dma,
55 55
                         dma_addr_t addr,
......
177 177
                                   DMADirection dir)
178 178
{
179 179
    if (!dma_has_iommu(dma)) {
180
        target_phys_addr_t xlen = *len;
180
        hwaddr xlen = *len;
181 181
        void *p;
182 182

  
183 183
        p = address_space_map(dma->as, addr, &xlen, dir == DMA_DIRECTION_FROM_DEVICE);
......
196 196
                                    DMADirection dir, dma_addr_t access_len)
197 197
{
198 198
    if (!dma_has_iommu(dma)) {
199
        address_space_unmap(dma->as, buffer, (target_phys_addr_t)len,
199
        address_space_unmap(dma->as, buffer, (hwaddr)len,
200 200
                            dir == DMA_DIRECTION_FROM_DEVICE, access_len);
201 201
    } else {
202 202
        iommu_dma_memory_unmap(dma, buffer, len, dir, access_len);
b/dump.c
15 15
#include "elf.h"
16 16
#include "cpu.h"
17 17
#include "cpu-all.h"
18
#include "targphys.h"
18
#include "hwaddr.h"
19 19
#include "monitor.h"
20 20
#include "kvm.h"
21 21
#include "dump.h"
......
66 66
    bool have_section;
67 67
    bool resume;
68 68
    size_t note_size;
69
    target_phys_addr_t memory_offset;
69
    hwaddr memory_offset;
70 70
    int fd;
71 71

  
72 72
    RAMBlock *block;
......
187 187
}
188 188

  
189 189
static int write_elf64_load(DumpState *s, MemoryMapping *memory_mapping,
190
                            int phdr_index, target_phys_addr_t offset)
190
                            int phdr_index, hwaddr offset)
191 191
{
192 192
    Elf64_Phdr phdr;
193 193
    int ret;
......
216 216
}
217 217

  
218 218
static int write_elf32_load(DumpState *s, MemoryMapping *memory_mapping,
219
                            int phdr_index, target_phys_addr_t offset)
219
                            int phdr_index, hwaddr offset)
220 220
{
221 221
    Elf32_Phdr phdr;
222 222
    int ret;
......
248 248
{
249 249
    Elf64_Phdr phdr;
250 250
    int endian = s->dump_info.d_endian;
251
    target_phys_addr_t begin = s->memory_offset - s->note_size;
251
    hwaddr begin = s->memory_offset - s->note_size;
252 252
    int ret;
253 253

  
254 254
    memset(&phdr, 0, sizeof(Elf64_Phdr));
......
296 296

  
297 297
static int write_elf32_note(DumpState *s)
298 298
{
299
    target_phys_addr_t begin = s->memory_offset - s->note_size;
299
    hwaddr begin = s->memory_offset - s->note_size;
300 300
    Elf32_Phdr phdr;
301 301
    int endian = s->dump_info.d_endian;
302 302
    int ret;
......
414 414
}
415 415

  
416 416
/* get the memory's offset in the vmcore */
417
static target_phys_addr_t get_offset(target_phys_addr_t phys_addr,
417
static hwaddr get_offset(hwaddr phys_addr,
418 418
                                     DumpState *s)
419 419
{
420 420
    RAMBlock *block;
421
    target_phys_addr_t offset = s->memory_offset;
421
    hwaddr offset = s->memory_offset;
422 422
    int64_t size_in_block, start;
423 423

  
424 424
    if (s->has_filter) {
......
463 463

  
464 464
static int write_elf_loads(DumpState *s)
465 465
{
466
    target_phys_addr_t offset;
466
    hwaddr offset;
467 467
    MemoryMapping *memory_mapping;
468 468
    uint32_t phdr_index = 1;
469 469
    int ret;
b/exec-all.h
103 103
void tlb_flush_page(CPUArchState *env, target_ulong addr);
104 104
void tlb_flush(CPUArchState *env, int flush_global);
105 105
void tlb_set_page(CPUArchState *env, target_ulong vaddr,
106
                  target_phys_addr_t paddr, int prot,
106
                  hwaddr paddr, int prot,
107 107
                  int mmu_idx, target_ulong size);
108
void tb_invalidate_phys_addr(target_phys_addr_t addr);
108
void tb_invalidate_phys_addr(hwaddr addr);
109 109
#else
110 110
static inline void tlb_flush_page(CPUArchState *env, target_ulong addr)
111 111
{
......
312 312

  
313 313
#if !defined(CONFIG_USER_ONLY)
314 314

  
315
struct MemoryRegion *iotlb_to_region(target_phys_addr_t index);
316
uint64_t io_mem_read(struct MemoryRegion *mr, target_phys_addr_t addr,
315
struct MemoryRegion *iotlb_to_region(hwaddr index);
316
uint64_t io_mem_read(struct MemoryRegion *mr, hwaddr addr,
317 317
                     unsigned size);
318
void io_mem_write(struct MemoryRegion *mr, target_phys_addr_t addr,
318
void io_mem_write(struct MemoryRegion *mr, hwaddr addr,
319 319
                  uint64_t value, unsigned size);
320 320

  
321 321
void tlb_fill(CPUArchState *env1, target_ulong addr, int is_write, int mmu_idx,
b/exec.c
398 398
}
399 399

  
400 400

  
401
static void phys_page_set_level(PhysPageEntry *lp, target_phys_addr_t *index,
402
                                target_phys_addr_t *nb, uint16_t leaf,
401
static void phys_page_set_level(PhysPageEntry *lp, hwaddr *index,
402
                                hwaddr *nb, uint16_t leaf,
403 403
                                int level)
404 404
{
405 405
    PhysPageEntry *p;
406 406
    int i;
407
    target_phys_addr_t step = (target_phys_addr_t)1 << (level * L2_BITS);
407
    hwaddr step = (hwaddr)1 << (level * L2_BITS);
408 408

  
409 409
    if (!lp->is_leaf && lp->ptr == PHYS_MAP_NODE_NIL) {
410 410
        lp->ptr = phys_map_node_alloc();
......
434 434
}
435 435

  
436 436
static void phys_page_set(AddressSpaceDispatch *d,
437
                          target_phys_addr_t index, target_phys_addr_t nb,
437
                          hwaddr index, hwaddr nb,
438 438
                          uint16_t leaf)
439 439
{
440 440
    /* Wildly overreserve - it doesn't matter much. */
......
443 443
    phys_page_set_level(&d->phys_map, &index, &nb, leaf, P_L2_LEVELS - 1);
444 444
}
445 445

  
446
MemoryRegionSection *phys_page_find(AddressSpaceDispatch *d, target_phys_addr_t index)
446
MemoryRegionSection *phys_page_find(AddressSpaceDispatch *d, hwaddr index)
447 447
{
448 448
    PhysPageEntry lp = d->phys_map;
449 449
    PhysPageEntry *p;
......
1473 1473
    tb_invalidate_phys_page_range(pc, pc + 1, 0);
1474 1474
}
1475 1475
#else
1476
void tb_invalidate_phys_addr(target_phys_addr_t addr)
1476
void tb_invalidate_phys_addr(hwaddr addr)
1477 1477
{
1478 1478
    ram_addr_t ram_addr;
1479 1479
    MemoryRegionSection *section;
......
1866 1866
    return ret;
1867 1867
}
1868 1868

  
1869
target_phys_addr_t memory_region_section_get_iotlb(CPUArchState *env,
1869
hwaddr memory_region_section_get_iotlb(CPUArchState *env,
1870 1870
                                                   MemoryRegionSection *section,
1871 1871
                                                   target_ulong vaddr,
1872
                                                   target_phys_addr_t paddr,
1872
                                                   hwaddr paddr,
1873 1873
                                                   int prot,
1874 1874
                                                   target_ulong *address)
1875 1875
{
1876
    target_phys_addr_t iotlb;
1876
    hwaddr iotlb;
1877 1877
    CPUWatchpoint *wp;
1878 1878

  
1879 1879
    if (memory_region_is_ram(section->mr)) {
......
2176 2176
#define SUBPAGE_IDX(addr) ((addr) & ~TARGET_PAGE_MASK)
2177 2177
typedef struct subpage_t {
2178 2178
    MemoryRegion iomem;
2179
    target_phys_addr_t base;
2179
    hwaddr base;
2180 2180
    uint16_t sub_section[TARGET_PAGE_SIZE];
2181 2181
} subpage_t;
2182 2182

  
2183 2183
static int subpage_register (subpage_t *mmio, uint32_t start, uint32_t end,
2184 2184
                             uint16_t section);
2185
static subpage_t *subpage_init(target_phys_addr_t base);
2185
static subpage_t *subpage_init(hwaddr base);
2186 2186
static void destroy_page_desc(uint16_t section_index)
2187 2187
{
2188 2188
    MemoryRegionSection *section = &phys_sections[section_index];
......
2241 2241
static void register_subpage(AddressSpaceDispatch *d, MemoryRegionSection *section)
2242 2242
{
2243 2243
    subpage_t *subpage;
2244
    target_phys_addr_t base = section->offset_within_address_space
2244
    hwaddr base = section->offset_within_address_space
2245 2245
        & TARGET_PAGE_MASK;
2246 2246
    MemoryRegionSection *existing = phys_page_find(d, base >> TARGET_PAGE_BITS);
2247 2247
    MemoryRegionSection subsection = {
2248 2248
        .offset_within_address_space = base,
2249 2249
        .size = TARGET_PAGE_SIZE,
2250 2250
    };
2251
    target_phys_addr_t start, end;
2251
    hwaddr start, end;
2252 2252

  
2253 2253
    assert(existing->mr->subpage || existing->mr == &io_mem_unassigned);
2254 2254

  
......
2268 2268

  
2269 2269
static void register_multipage(AddressSpaceDispatch *d, MemoryRegionSection *section)
2270 2270
{
2271
    target_phys_addr_t start_addr = section->offset_within_address_space;
2271
    hwaddr start_addr = section->offset_within_address_space;
2272 2272
    ram_addr_t size = section->size;
2273
    target_phys_addr_t addr;
2273
    hwaddr addr;
2274 2274
    uint16_t section_index = phys_section_add(section);
2275 2275

  
2276 2276
    assert(size);
......
2836 2836
    return ram_addr;
2837 2837
}
2838 2838

  
2839
static uint64_t unassigned_mem_read(void *opaque, target_phys_addr_t addr,
2839
static uint64_t unassigned_mem_read(void *opaque, hwaddr addr,
2840 2840
                                    unsigned size)
2841 2841
{
2842 2842
#ifdef DEBUG_UNASSIGNED
......
2848 2848
    return 0;
2849 2849
}
2850 2850

  
2851
static void unassigned_mem_write(void *opaque, target_phys_addr_t addr,
2851
static void unassigned_mem_write(void *opaque, hwaddr addr,
2852 2852
                                 uint64_t val, unsigned size)
2853 2853
{
2854 2854
#ifdef DEBUG_UNASSIGNED
......
2865 2865
    .endianness = DEVICE_NATIVE_ENDIAN,
2866 2866
};
2867 2867

  
2868
static uint64_t error_mem_read(void *opaque, target_phys_addr_t addr,
2868
static uint64_t error_mem_read(void *opaque, hwaddr addr,
2869 2869
                               unsigned size)
2870 2870
{
2871 2871
    abort();
2872 2872
}
2873 2873

  
2874
static void error_mem_write(void *opaque, target_phys_addr_t addr,
2874
static void error_mem_write(void *opaque, hwaddr addr,
2875 2875
                            uint64_t value, unsigned size)
2876 2876
{
2877 2877
    abort();
......
2889 2889
    .endianness = DEVICE_NATIVE_ENDIAN,
2890 2890
};
2891 2891

  
2892
static void notdirty_mem_write(void *opaque, target_phys_addr_t ram_addr,
2892
static void notdirty_mem_write(void *opaque, hwaddr ram_addr,
2893 2893
                               uint64_t val, unsigned size)
2894 2894
{
2895 2895
    int dirty_flags;
......
2976 2976
/* Watchpoint access routines.  Watchpoints are inserted using TLB tricks,
2977 2977
   so these check for a hit then pass through to the normal out-of-line
2978 2978
   phys routines.  */
2979
static uint64_t watch_mem_read(void *opaque, target_phys_addr_t addr,
2979
static uint64_t watch_mem_read(void *opaque, hwaddr addr,
2980 2980
                               unsigned size)
2981 2981
{
2982 2982
    check_watchpoint(addr & ~TARGET_PAGE_MASK, ~(size - 1), BP_MEM_READ);
......
2988 2988
    }
2989 2989
}
2990 2990

  
2991
static void watch_mem_write(void *opaque, target_phys_addr_t addr,
2991
static void watch_mem_write(void *opaque, hwaddr addr,
2992 2992
                            uint64_t val, unsigned size)
2993 2993
{
2994 2994
    check_watchpoint(addr & ~TARGET_PAGE_MASK, ~(size - 1), BP_MEM_WRITE);
......
3012 3012
    .endianness = DEVICE_NATIVE_ENDIAN,
3013 3013
};
3014 3014

  
3015
static uint64_t subpage_read(void *opaque, target_phys_addr_t addr,
3015
static uint64_t subpage_read(void *opaque, hwaddr addr,
3016 3016
                             unsigned len)
3017 3017
{
3018 3018
    subpage_t *mmio = opaque;
......
3030 3030
    return io_mem_read(section->mr, addr, len);
3031 3031
}
3032 3032

  
3033
static void subpage_write(void *opaque, target_phys_addr_t addr,
3033
static void subpage_write(void *opaque, hwaddr addr,
3034 3034
                          uint64_t value, unsigned len)
3035 3035
{
3036 3036
    subpage_t *mmio = opaque;
......
3055 3055
    .endianness = DEVICE_NATIVE_ENDIAN,
3056 3056
};
3057 3057

  
3058
static uint64_t subpage_ram_read(void *opaque, target_phys_addr_t addr,
3058
static uint64_t subpage_ram_read(void *opaque, hwaddr addr,
3059 3059
                                 unsigned size)
3060 3060
{
3061 3061
    ram_addr_t raddr = addr;
......
3068 3068
    }
3069 3069
}
3070 3070

  
3071
static void subpage_ram_write(void *opaque, target_phys_addr_t addr,
3071
static void subpage_ram_write(void *opaque, hwaddr addr,
3072 3072
                              uint64_t value, unsigned size)
3073 3073
{
3074 3074
    ram_addr_t raddr = addr;
......
3112 3112
    return 0;
3113 3113
}
3114 3114

  
3115
static subpage_t *subpage_init(target_phys_addr_t base)
3115
static subpage_t *subpage_init(hwaddr base)
3116 3116
{
3117 3117
    subpage_t *mmio;
3118 3118

  
......
3143 3143
    return phys_section_add(&section);
3144 3144
}
3145 3145

  
3146
MemoryRegion *iotlb_to_region(target_phys_addr_t index)
3146
MemoryRegion *iotlb_to_region(hwaddr index)
3147 3147
{
3148 3148
    return phys_sections[index & ~TARGET_PAGE_MASK].mr;
3149 3149
}
......
3333 3333

  
3334 3334
#else
3335 3335

  
3336
static void invalidate_and_set_dirty(target_phys_addr_t addr,
3337
                                     target_phys_addr_t length)
3336
static void invalidate_and_set_dirty(hwaddr addr,
3337
                                     hwaddr length)
3338 3338
{
3339 3339
    if (!cpu_physical_memory_is_dirty(addr)) {
3340 3340
        /* invalidate code */
......
3345 3345
    xen_modified_memory(addr, length);
3346 3346
}
3347 3347

  
3348
void address_space_rw(AddressSpace *as, target_phys_addr_t addr, uint8_t *buf,
3348
void address_space_rw(AddressSpace *as, hwaddr addr, uint8_t *buf,
3349 3349
                      int len, bool is_write)
3350 3350
{
3351 3351
    AddressSpaceDispatch *d = as->dispatch;
3352 3352
    int l;
3353 3353
    uint8_t *ptr;
3354 3354
    uint32_t val;
3355
    target_phys_addr_t page;
3355
    hwaddr page;
3356 3356
    MemoryRegionSection *section;
3357 3357

  
3358 3358
    while (len > 0) {
......
3364 3364

  
3365 3365
        if (is_write) {
3366 3366
            if (!memory_region_is_ram(section->mr)) {
3367
                target_phys_addr_t addr1;
3367
                hwaddr addr1;
3368 3368
                addr1 = memory_region_section_addr(section, addr);
3369 3369
                /* XXX: could force cpu_single_env to NULL to avoid
3370 3370
                   potential bugs */
......
3397 3397
        } else {
3398 3398
            if (!(memory_region_is_ram(section->mr) ||
3399 3399
                  memory_region_is_romd(section->mr))) {
3400
                target_phys_addr_t addr1;
3400
                hwaddr addr1;
3401 3401
                /* I/O case */
3402 3402
                addr1 = memory_region_section_addr(section, addr);
3403 3403
                if (l >= 4 && ((addr1 & 3) == 0)) {
......
3431 3431
    }
3432 3432
}
3433 3433

  
3434
void address_space_write(AddressSpace *as, target_phys_addr_t addr,
3434
void address_space_write(AddressSpace *as, hwaddr addr,
3435 3435
                         const uint8_t *buf, int len)
3436 3436
{
3437 3437
    address_space_rw(as, addr, (uint8_t *)buf, len, true);
......
3444 3444
 * @addr: address within that address space
3445 3445
 * @buf: buffer with the data transferred
3446 3446
 */
3447
void address_space_read(AddressSpace *as, target_phys_addr_t addr, uint8_t *buf, int len)
3447
void address_space_read(AddressSpace *as, hwaddr addr, uint8_t *buf, int len)
3448 3448
{
3449 3449
    address_space_rw(as, addr, buf, len, false);
3450 3450
}
3451 3451

  
3452 3452

  
3453
void cpu_physical_memory_rw(target_phys_addr_t addr, uint8_t *buf,
3453
void cpu_physical_memory_rw(hwaddr addr, uint8_t *buf,
3454 3454
                            int len, int is_write)
3455 3455
{
3456 3456
    return address_space_rw(&address_space_memory, addr, buf, len, is_write);
3457 3457
}
3458 3458

  
3459 3459
/* used for ROM loading : can write in RAM and ROM */
3460
void cpu_physical_memory_write_rom(target_phys_addr_t addr,
3460
void cpu_physical_memory_write_rom(hwaddr addr,
3461 3461
                                   const uint8_t *buf, int len)
3462 3462
{
3463 3463
    AddressSpaceDispatch *d = address_space_memory.dispatch;
3464 3464
    int l;
3465 3465
    uint8_t *ptr;
3466
    target_phys_addr_t page;
3466
    hwaddr page;
3467 3467
    MemoryRegionSection *section;
3468 3468

  
3469 3469
    while (len > 0) {
......
3494 3494

  
3495 3495
typedef struct {
3496 3496
    void *buffer;
3497
    target_phys_addr_t addr;
3498
    target_phys_addr_t len;
3497
    hwaddr addr;
3498
    hwaddr len;
3499 3499
} BounceBuffer;
3500 3500

  
3501 3501
static BounceBuffer bounce;
......
3546 3546
 * likely to succeed.
3547 3547
 */
3548 3548
void *address_space_map(AddressSpace *as,
3549
                        target_phys_addr_t addr,
3550
                        target_phys_addr_t *plen,
3549
                        hwaddr addr,
3550
                        hwaddr *plen,
3551 3551
                        bool is_write)
3552 3552
{
3553 3553
    AddressSpaceDispatch *d = as->dispatch;
3554
    target_phys_addr_t len = *plen;
3555
    target_phys_addr_t todo = 0;
3554
    hwaddr len = *plen;
3555
    hwaddr todo = 0;
3556 3556
    int l;
3557
    target_phys_addr_t page;
3557
    hwaddr page;
3558 3558
    MemoryRegionSection *section;
3559 3559
    ram_addr_t raddr = RAM_ADDR_MAX;
3560 3560
    ram_addr_t rlen;
......
3600 3600
 * Will also mark the memory as dirty if is_write == 1.  access_len gives
3601 3601
 * the amount of memory that was actually read or written by the caller.
3602 3602
 */
3603
void address_space_unmap(AddressSpace *as, void *buffer, target_phys_addr_t len,
3604
                         int is_write, target_phys_addr_t access_len)
3603
void address_space_unmap(AddressSpace *as, void *buffer, hwaddr len,
3604
                         int is_write, hwaddr access_len)
3605 3605
{
3606 3606
    if (buffer != bounce.buffer) {
3607 3607
        if (is_write) {
......
3629 3629
    cpu_notify_map_clients();
3630 3630
}
3631 3631

  
3632
void *cpu_physical_memory_map(target_phys_addr_t addr,
3633
                              target_phys_addr_t *plen,
3632
void *cpu_physical_memory_map(hwaddr addr,
3633
                              hwaddr *plen,
3634 3634
                              int is_write)
3635 3635
{
3636 3636
    return address_space_map(&address_space_memory, addr, plen, is_write);
3637 3637
}
3638 3638

  
3639
void cpu_physical_memory_unmap(void *buffer, target_phys_addr_t len,
3640
                               int is_write, target_phys_addr_t access_len)
3639
void cpu_physical_memory_unmap(void *buffer, hwaddr len,
3640
                               int is_write, hwaddr access_len)
3641 3641
{
3642 3642
    return address_space_unmap(&address_space_memory, buffer, len, is_write, access_len);
3643 3643
}
3644 3644

  
3645 3645
/* warning: addr must be aligned */
3646
static inline uint32_t ldl_phys_internal(target_phys_addr_t addr,
3646
static inline uint32_t ldl_phys_internal(hwaddr addr,
3647 3647
                                         enum device_endian endian)
3648 3648
{
3649 3649
    uint8_t *ptr;
......
3686 3686
    return val;
3687 3687
}
3688 3688

  
3689
uint32_t ldl_phys(target_phys_addr_t addr)
3689
uint32_t ldl_phys(hwaddr addr)
3690 3690
{
3691 3691
    return ldl_phys_internal(addr, DEVICE_NATIVE_ENDIAN);
3692 3692
}
3693 3693

  
3694
uint32_t ldl_le_phys(target_phys_addr_t addr)
3694
uint32_t ldl_le_phys(hwaddr addr)
3695 3695
{
3696 3696
    return ldl_phys_internal(addr, DEVICE_LITTLE_ENDIAN);
3697 3697
}
3698 3698

  
3699
uint32_t ldl_be_phys(target_phys_addr_t addr)
3699
uint32_t ldl_be_phys(hwaddr addr)
3700 3700
{
3701 3701
    return ldl_phys_internal(addr, DEVICE_BIG_ENDIAN);
3702 3702
}
3703 3703

  
3704 3704
/* warning: addr must be aligned */
3705
static inline uint64_t ldq_phys_internal(target_phys_addr_t addr,
3705
static inline uint64_t ldq_phys_internal(hwaddr addr,
3706 3706
                                         enum device_endian endian)
3707 3707
{
3708 3708
    uint8_t *ptr;
......
3745 3745
    return val;
3746 3746
}
3747 3747

  
3748
uint64_t ldq_phys(target_phys_addr_t addr)
3748
uint64_t ldq_phys(hwaddr addr)
3749 3749
{
3750 3750
    return ldq_phys_internal(addr, DEVICE_NATIVE_ENDIAN);
3751 3751
}
3752 3752

  
3753
uint64_t ldq_le_phys(target_phys_addr_t addr)
3753
uint64_t ldq_le_phys(hwaddr addr)
3754 3754
{
3755 3755
    return ldq_phys_internal(addr, DEVICE_LITTLE_ENDIAN);
3756 3756
}
3757 3757

  
3758
uint64_t ldq_be_phys(target_phys_addr_t addr)
3758
uint64_t ldq_be_phys(hwaddr addr)
3759 3759
{
3760 3760
    return ldq_phys_internal(addr, DEVICE_BIG_ENDIAN);
3761 3761
}
3762 3762

  
3763 3763
/* XXX: optimize */
3764
uint32_t ldub_phys(target_phys_addr_t addr)
3764
uint32_t ldub_phys(hwaddr addr)
3765 3765
{
3766 3766
    uint8_t val;
3767 3767
    cpu_physical_memory_read(addr, &val, 1);
......
3769 3769
}
3770 3770

  
3771 3771
/* warning: addr must be aligned */
3772
static inline uint32_t lduw_phys_internal(target_phys_addr_t addr,
3772
static inline uint32_t lduw_phys_internal(hwaddr addr,
3773 3773
                                          enum device_endian endian)
3774 3774
{
3775 3775
    uint8_t *ptr;
......
3812 3812
    return val;
3813 3813
}
3814 3814

  
3815
uint32_t lduw_phys(target_phys_addr_t addr)
3815
uint32_t lduw_phys(hwaddr addr)
3816 3816
{
3817 3817
    return lduw_phys_internal(addr, DEVICE_NATIVE_ENDIAN);
3818 3818
}
3819 3819

  
3820
uint32_t lduw_le_phys(target_phys_addr_t addr)
3820
uint32_t lduw_le_phys(hwaddr addr)
3821 3821
{
3822 3822
    return lduw_phys_internal(addr, DEVICE_LITTLE_ENDIAN);
3823 3823
}
3824 3824

  
3825
uint32_t lduw_be_phys(target_phys_addr_t addr)
3825
uint32_t lduw_be_phys(hwaddr addr)
3826 3826
{
3827 3827
    return lduw_phys_internal(addr, DEVICE_BIG_ENDIAN);
3828 3828
}
......
3830 3830
/* warning: addr must be aligned. The ram page is not masked as dirty
3831 3831
   and the code inside is not invalidated. It is useful if the dirty
3832 3832
   bits are used to track modified PTEs */
3833
void stl_phys_notdirty(target_phys_addr_t addr, uint32_t val)
3833
void stl_phys_notdirty(hwaddr addr, uint32_t val)
3834 3834
{
3835 3835
    uint8_t *ptr;
3836 3836
    MemoryRegionSection *section;
......
3862 3862
    }
3863 3863
}
3864 3864

  
3865
void stq_phys_notdirty(target_phys_addr_t addr, uint64_t val)
3865
void stq_phys_notdirty(hwaddr addr, uint64_t val)
3866 3866
{
3867 3867
    uint8_t *ptr;
3868 3868
    MemoryRegionSection *section;
......
3890 3890
}
3891 3891

  
3892 3892
/* warning: addr must be aligned */
3893
static inline void stl_phys_internal(target_phys_addr_t addr, uint32_t val,
3893
static inline void stl_phys_internal(hwaddr addr, uint32_t val,
3894 3894
                                     enum device_endian endian)
3895 3895
{
3896 3896
    uint8_t *ptr;
......
3934 3934
    }
3935 3935
}
3936 3936

  
3937
void stl_phys(target_phys_addr_t addr, uint32_t val)
3937
void stl_phys(hwaddr addr, uint32_t val)
3938 3938
{
3939 3939
    stl_phys_internal(addr, val, DEVICE_NATIVE_ENDIAN);
3940 3940
}
3941 3941

  
3942
void stl_le_phys(target_phys_addr_t addr, uint32_t val)
3942
void stl_le_phys(hwaddr addr, uint32_t val)
3943 3943
{
3944 3944
    stl_phys_internal(addr, val, DEVICE_LITTLE_ENDIAN);
3945 3945
}
3946 3946

  
3947
void stl_be_phys(target_phys_addr_t addr, uint32_t val)
3947
void stl_be_phys(hwaddr addr, uint32_t val)
3948 3948
{
3949 3949
    stl_phys_internal(addr, val, DEVICE_BIG_ENDIAN);
3950 3950
}
3951 3951

  
3952 3952
/* XXX: optimize */
3953
void stb_phys(target_phys_addr_t addr, uint32_t val)
3953
void stb_phys(hwaddr addr, uint32_t val)
3954 3954
{
3955 3955
    uint8_t v = val;
3956 3956
    cpu_physical_memory_write(addr, &v, 1);
3957 3957
}
3958 3958

  
3959 3959
/* warning: addr must be aligned */
3960
static inline void stw_phys_internal(target_phys_addr_t addr, uint32_t val,
3960
static inline void stw_phys_internal(hwaddr addr, uint32_t val,
3961 3961
                                     enum device_endian endian)
3962 3962
{
3963 3963
    uint8_t *ptr;
......
4001 4001
    }
4002 4002
}
4003 4003

  
4004
void stw_phys(target_phys_addr_t addr, uint32_t val)
4004
void stw_phys(hwaddr addr, uint32_t val)
4005 4005
{
4006 4006
    stw_phys_internal(addr, val, DEVICE_NATIVE_ENDIAN);
4007 4007
}
4008 4008

  
4009
void stw_le_phys(target_phys_addr_t addr, uint32_t val)
4009
void stw_le_phys(hwaddr addr, uint32_t val)
4010 4010
{
4011 4011
    stw_phys_internal(addr, val, DEVICE_LITTLE_ENDIAN);
4012 4012
}
4013 4013

  
4014
void stw_be_phys(target_phys_addr_t addr, uint32_t val)
4014
void stw_be_phys(hwaddr addr, uint32_t val)
4015 4015
{
4016 4016
    stw_phys_internal(addr, val, DEVICE_BIG_ENDIAN);
4017 4017
}
4018 4018

  
4019 4019
/* XXX: optimize */
4020
void stq_phys(target_phys_addr_t addr, uint64_t val)
4020
void stq_phys(hwaddr addr, uint64_t val)
4021 4021
{
4022 4022
    val = tswap64(val);
4023 4023
    cpu_physical_memory_write(addr, &val, 8);
4024 4024
}
4025 4025

  
4026
void stq_le_phys(target_phys_addr_t addr, uint64_t val)
4026
void stq_le_phys(hwaddr addr, uint64_t val)
4027 4027
{
4028 4028
    val = cpu_to_le64(val);
4029 4029
    cpu_physical_memory_write(addr, &val, 8);
4030 4030
}
4031 4031

  
4032
void stq_be_phys(target_phys_addr_t addr, uint64_t val)
4032
void stq_be_phys(hwaddr addr, uint64_t val)
4033 4033
{
4034 4034
    val = cpu_to_be64(val);
4035 4035
    cpu_physical_memory_write(addr, &val, 8);
......
4040 4040
                        uint8_t *buf, int len, int is_write)
4041 4041
{
4042 4042
    int l;
4043
    target_phys_addr_t phys_addr;
4043
    hwaddr phys_addr;
4044 4044
    target_ulong page;
4045 4045

  
4046 4046
    while (len > 0) {
......
4195 4195
#endif
4196 4196

  
4197 4197
#ifndef CONFIG_USER_ONLY
4198
bool cpu_physical_memory_is_io(target_phys_addr_t phys_addr)
4198
bool cpu_physical_memory_is_io(hwaddr phys_addr)
4199 4199
{
4200 4200
    MemoryRegionSection *section;
4201 4201

  
b/hw/a9mpcore.c
26 26
    uint32_t num_irq;
27 27
} a9mp_priv_state;
28 28

  
29
static uint64_t a9_scu_read(void *opaque, target_phys_addr_t offset,
29
static uint64_t a9_scu_read(void *opaque, hwaddr offset,
30 30
                            unsigned size)
31 31
{
32 32
    a9mp_priv_state *s = (a9mp_priv_state *)opaque;
......
57 57
    }
58 58
}
59 59

  
60
static void a9_scu_write(void *opaque, target_phys_addr_t offset,
60
static void a9_scu_write(void *opaque, hwaddr offset,
61 61
                         uint64_t value, unsigned size)
62 62
{
63 63
    a9mp_priv_state *s = (a9mp_priv_state *)opaque;
b/hw/alpha_pci.c
15 15
/* PCI IO reads/writes, to byte-word addressable memory.  */
16 16
/* ??? Doesn't handle multiple PCI busses.  */
17 17

  
18
static uint64_t bw_io_read(void *opaque, target_phys_addr_t addr, unsigned size)
18
static uint64_t bw_io_read(void *opaque, hwaddr addr, unsigned size)
19 19
{
20 20
    switch (size) {
21 21
    case 1:
......
28 28
    abort();
29 29
}
30 30

  
31
static void bw_io_write(void *opaque, target_phys_addr_t addr,
31
static void bw_io_write(void *opaque, hwaddr addr,
32 32
                        uint64_t val, unsigned size)
33 33
{
34 34
    switch (size) {
......
57 57
};
58 58

  
59 59
/* PCI config space reads/writes, to byte-word addressable memory.  */
60
static uint64_t bw_conf1_read(void *opaque, target_phys_addr_t addr,
60
static uint64_t bw_conf1_read(void *opaque, hwaddr addr,
61 61
                              unsigned size)
62 62
{
63 63
    PCIBus *b = opaque;
64 64
    return pci_data_read(b, addr, size);
65 65
}
66 66

  
67
static void bw_conf1_write(void *opaque, target_phys_addr_t addr,
67
static void bw_conf1_write(void *opaque, hwaddr addr,
68 68
                           uint64_t val, unsigned size)
69 69
{
70 70
    PCIBus *b = opaque;
......
83 83

  
84 84
/* PCI/EISA Interrupt Acknowledge Cycle.  */
85 85

  
86
static uint64_t iack_read(void *opaque, target_phys_addr_t addr, unsigned size)
86
static uint64_t iack_read(void *opaque, hwaddr addr, unsigned size)
87 87
{
88 88
    return pic_read_irq(isa_pic);
89 89
}
90 90

  
91
static void special_write(void *opaque, target_phys_addr_t addr,
91
static void special_write(void *opaque, hwaddr addr,
92 92
                          uint64_t val, unsigned size)
93 93
{
94 94
    qemu_log("pci: special write cycle");
b/hw/alpha_typhoon.c
70 70
    }
71 71
}
72 72

  
73
static uint64_t cchip_read(void *opaque, target_phys_addr_t addr, unsigned size)
73
static uint64_t cchip_read(void *opaque, hwaddr addr, unsigned size)
74 74
{
75 75
    CPUAlphaState *env = cpu_single_env;
76 76
    TyphoonState *s = opaque;
......
203 203
    return ret;
204 204
}
205 205

  
206
static uint64_t dchip_read(void *opaque, target_phys_addr_t addr, unsigned size)
206
static uint64_t dchip_read(void *opaque, hwaddr addr, unsigned size)
207 207
{
208 208
    /* Skip this.  It's all related to DRAM timing and setup.  */
209 209
    return 0;
210 210
}
211 211

  
212
static uint64_t pchip_read(void *opaque, target_phys_addr_t addr, unsigned size)
212
static uint64_t pchip_read(void *opaque, hwaddr addr, unsigned size)
213 213
{
214 214
    TyphoonState *s = opaque;
215 215
    uint64_t ret = 0;
......
306 306
    return ret;
307 307
}
308 308

  
309
static void cchip_write(void *opaque, target_phys_addr_t addr,
309
static void cchip_write(void *opaque, hwaddr addr,
310 310
                        uint64_t v32, unsigned size)
311 311
{
312 312
    TyphoonState *s = opaque;
......
463 463
    }
464 464
}
465 465

  
466
static void dchip_write(void *opaque, target_phys_addr_t addr,
466
static void dchip_write(void *opaque, hwaddr addr,
467 467
                        uint64_t val, unsigned size)
468 468
{
469 469
    /* Skip this.  It's all related to DRAM timing and setup.  */
470 470
}
471 471

  
472
static void pchip_write(void *opaque, target_phys_addr_t addr,
472
static void pchip_write(void *opaque, hwaddr addr,
473 473
                        uint64_t v32, unsigned size)
474 474
{
475 475
    TyphoonState *s = opaque;
b/hw/an5206.c
27 27
    CPUM68KState *env;
28 28
    int kernel_size;
29 29
    uint64_t elf_entry;
30
    target_phys_addr_t entry;
30
    hwaddr entry;
31 31
    MemoryRegion *address_space_mem = get_system_memory();
32 32
    MemoryRegion *ram = g_new(MemoryRegion, 1);
33 33
    MemoryRegion *sram = g_new(MemoryRegion, 1);
b/hw/apb_pci.c
87 87

  
88 88
static void pci_apb_set_irq(void *opaque, int irq_num, int level);
89 89

  
90
static void apb_config_writel (void *opaque, target_phys_addr_t addr,
90
static void apb_config_writel (void *opaque, hwaddr addr,
91 91
                               uint64_t val, unsigned size)
92 92
{
93 93
    APBState *s = opaque;
......
152 152
}
153 153

  
154 154
static uint64_t apb_config_readl (void *opaque,
155
                                  target_phys_addr_t addr, unsigned size)
155
                                  hwaddr addr, unsigned size)
156 156
{
157 157
    APBState *s = opaque;
158 158
    uint32_t val;
......
212 212
    .endianness = DEVICE_NATIVE_ENDIAN,
213 213
};
214 214

  
215
static void apb_pci_config_write(void *opaque, target_phys_addr_t addr,
215
static void apb_pci_config_write(void *opaque, hwaddr addr,
216 216
                                 uint64_t val, unsigned size)
217 217
{
218 218
    APBState *s = opaque;
......
222 222
    pci_data_write(s->bus, addr, val, size);
223 223
}
224 224

  
225
static uint64_t apb_pci_config_read(void *opaque, target_phys_addr_t addr,
225
static uint64_t apb_pci_config_read(void *opaque, hwaddr addr,
226 226
                                    unsigned size)
227 227
{
228 228
    uint32_t ret;
......
234 234
    return ret;
235 235
}
236 236

  
237
static void pci_apb_iowriteb (void *opaque, target_phys_addr_t addr,
237
static void pci_apb_iowriteb (void *opaque, hwaddr addr,
238 238
                                  uint32_t val)
239 239
{
240 240
    cpu_outb(addr & IOPORTS_MASK, val);
241 241
}
242 242

  
243
static void pci_apb_iowritew (void *opaque, target_phys_addr_t addr,
243
static void pci_apb_iowritew (void *opaque, hwaddr addr,
244 244
                                  uint32_t val)
245 245
{
246 246
    cpu_outw(addr & IOPORTS_MASK, bswap16(val));
247 247
}
248 248

  
249
static void pci_apb_iowritel (void *opaque, target_phys_addr_t addr,
249
static void pci_apb_iowritel (void *opaque, hwaddr addr,
250 250
                                uint32_t val)
251 251
{
252 252
    cpu_outl(addr & IOPORTS_MASK, bswap32(val));
253 253
}
254 254

  
255
static uint32_t pci_apb_ioreadb (void *opaque, target_phys_addr_t addr)
255
static uint32_t pci_apb_ioreadb (void *opaque, hwaddr addr)
256 256
{
257 257
    uint32_t val;
258 258

  
......
260 260
    return val;
261 261
}
262 262

  
263
static uint32_t pci_apb_ioreadw (void *opaque, target_phys_addr_t addr)
263
static uint32_t pci_apb_ioreadw (void *opaque, hwaddr addr)
264 264
{
265 265
    uint32_t val;
266 266

  
......
268 268
    return val;
269 269
}
270 270

  
271
static uint32_t pci_apb_ioreadl (void *opaque, target_phys_addr_t addr)
271
static uint32_t pci_apb_ioreadl (void *opaque, hwaddr addr)
272 272
{
273 273
    uint32_t val;
274 274

  
......
351 351
    return 0;
352 352
}
353 353

  
354
PCIBus *pci_apb_init(target_phys_addr_t special_base,
355
                     target_phys_addr_t mem_base,
354
PCIBus *pci_apb_init(hwaddr special_base,
355
                     hwaddr mem_base,
356 356
                     qemu_irq *ivec_irqs, PCIBus **bus2, PCIBus **bus3,
357 357
                     qemu_irq **pbm_irqs)
358 358
{
b/hw/apb_pci.h
3 3

  
4 4
#include "qemu-common.h"
5 5

  
6
PCIBus *pci_apb_init(target_phys_addr_t special_base,
7
                     target_phys_addr_t mem_base,
6
PCIBus *pci_apb_init(hwaddr special_base,
7
                     hwaddr mem_base,
8 8
                     qemu_irq *ivec_irqs, PCIBus **bus2, PCIBus **bus3,
9 9
                     qemu_irq **pbm_irqs);
10 10
#endif
b/hw/apic.c
630 630
    apic_timer_update(s, s->next_time);
631 631
}
632 632

  
633
static uint32_t apic_mem_readb(void *opaque, target_phys_addr_t addr)
633
static uint32_t apic_mem_readb(void *opaque, hwaddr addr)
634 634
{
635 635
    return 0;
636 636
}
637 637

  
638
static uint32_t apic_mem_readw(void *opaque, target_phys_addr_t addr)
638
static uint32_t apic_mem_readw(void *opaque, hwaddr addr)
639 639
{
640 640
    return 0;
641 641
}
642 642

  
643
static void apic_mem_writeb(void *opaque, target_phys_addr_t addr, uint32_t val)
643
static void apic_mem_writeb(void *opaque, hwaddr addr, uint32_t val)
644 644
{
645 645
}
646 646

  
647
static void apic_mem_writew(void *opaque, target_phys_addr_t addr, uint32_t val)
647
static void apic_mem_writew(void *opaque, hwaddr addr, uint32_t val)
648 648
{
649 649
}
650 650

  
651
static uint32_t apic_mem_readl(void *opaque, target_phys_addr_t addr)
651
static uint32_t apic_mem_readl(void *opaque, hwaddr addr)
652 652
{
653 653
    DeviceState *d;
654 654
    APICCommonState *s;
......
732 732
    return val;
733 733
}
734 734

  
735
static void apic_send_msi(target_phys_addr_t addr, uint32_t data)
735
static void apic_send_msi(hwaddr addr, uint32_t data)
736 736
{
737 737
    uint8_t dest = (addr & MSI_ADDR_DEST_ID_MASK) >> MSI_ADDR_DEST_ID_SHIFT;
738 738
    uint8_t vector = (data & MSI_DATA_VECTOR_MASK) >> MSI_DATA_VECTOR_SHIFT;
......
743 743
    apic_deliver_irq(dest, dest_mode, delivery, vector, trigger_mode);
744 744
}
745 745

  
746
static void apic_mem_writel(void *opaque, target_phys_addr_t addr, uint32_t val)
746
static void apic_mem_writel(void *opaque, hwaddr addr, uint32_t val)
747 747
{
748 748
    DeviceState *d;
749 749
    APICCommonState *s;
b/hw/apic_common.c
89 89
    }
90 90
}
91 91

  
92
void apic_enable_vapic(DeviceState *d, target_phys_addr_t paddr)
92
void apic_enable_vapic(DeviceState *d, hwaddr paddr)
93 93
{
94 94
    APICCommonState *s = DO_UPCAST(APICCommonState, busdev.qdev, d);
95 95
    APICCommonClass *info = APIC_COMMON_GET_CLASS(s);
b/hw/apic_internal.h
124 124

  
125 125
    uint32_t vapic_control;
126 126
    DeviceState *vapic;
127
    target_phys_addr_t vapic_paddr; /* note: persistence via kvmvapic */
127
    hwaddr vapic_paddr; /* note: persistence via kvmvapic */
128 128
};
129 129

  
130 130
typedef struct VAPICState {
......
140 140
void apic_report_irq_delivered(int delivered);
141 141
bool apic_next_timer(APICCommonState *s, int64_t current_time);
142 142
void apic_enable_tpr_access_reporting(DeviceState *d, bool enable);
143
void apic_enable_vapic(DeviceState *d, target_phys_addr_t paddr);
143
void apic_enable_vapic(DeviceState *d, hwaddr paddr);
144 144

  
145 145
void vapic_report_tpr_access(DeviceState *dev, void *cpu, target_ulong ip,
146 146
                             TPRAccess access);
b/hw/arm-misc.h
30 30
    const char *kernel_cmdline;
31 31
    const char *initrd_filename;
32 32
    const char *dtb_filename;
33
    target_phys_addr_t loader_start;
33
    hwaddr loader_start;
34 34
    /* multicore boards that use the default secondary core boot functions
35 35
     * need to put the address of the secondary boot code, the boot reg,
36 36
     * and the GIC address in the next 3 values, respectively. boards that
37 37
     * have their own boot functions can use these values as they want.
38 38
     */
39
    target_phys_addr_t smp_loader_start;
40
    target_phys_addr_t smp_bootreg_addr;
41
    target_phys_addr_t gic_cpu_if_addr;
39
    hwaddr smp_loader_start;
40
    hwaddr smp_bootreg_addr;
41
    hwaddr gic_cpu_if_addr;
42 42
    int nb_cpus;
43 43
    int board_id;
44 44
    int (*atag_board)(const struct arm_boot_info *info, void *p);
......
56 56
                                     const struct arm_boot_info *info);
57 57
    /* Used internally by arm_boot.c */
58 58
    int is_linux;
59
    target_phys_addr_t initrd_size;
60
    target_phys_addr_t entry;
59
    hwaddr initrd_size;
60
    hwaddr entry;
61 61
};
62 62
void arm_load_kernel(ARMCPU *cpu, struct arm_boot_info *info);
63 63

  
b/hw/arm11mpcore.c
27 27

  
28 28
/* Per-CPU private memory mapped IO.  */
29 29

  
30
static uint64_t mpcore_scu_read(void *opaque, target_phys_addr_t offset,
30
static uint64_t mpcore_scu_read(void *opaque, hwaddr offset,
31 31
                                unsigned size)
32 32
{
33 33
    mpcore_priv_state *s = (mpcore_priv_state *)opaque;
......
48 48
    }
49 49
}
50 50

  
51
static void mpcore_scu_write(void *opaque, target_phys_addr_t offset,
51
static void mpcore_scu_write(void *opaque, hwaddr offset,
52 52
                             uint64_t value, unsigned size)
53 53
{
54 54
    mpcore_priv_state *s = (mpcore_priv_state *)opaque;
......
89 89
     * at 0x200, 0x300...
90 90
     */
91 91
    for (i = 0; i < (s->num_cpu + 1); i++) {
92
        target_phys_addr_t offset = 0x100 + (i * 0x100);
92
        hwaddr offset = 0x100 + (i * 0x100);
93 93
        memory_region_add_subregion(&s->container, offset,
94 94
                                    sysbus_mmio_get_region(gicbusdev, i + 1));
95 95
    }
......
98 98
     */
99 99
    for (i = 0; i < (s->num_cpu + 1) * 2; i++) {
100 100
        /* Timers at 0x600, 0x700, ...; watchdogs at 0x620, 0x720, ... */
101
        target_phys_addr_t offset = 0x600 + (i >> 1) * 0x100 + (i & 1) * 0x20;
101
        hwaddr offset = 0x600 + (i >> 1) * 0x100 + (i & 1) * 0x20;
102 102
        memory_region_add_subregion(&s->container, offset,
103 103
                                    sysbus_mmio_get_region(busdev, i));
104 104
    }
b/hw/arm_boot.c
89 89
static void set_kernel_args(const struct arm_boot_info *info)
90 90
{
91 91
    int initrd_size = info->initrd_size;
92
    target_phys_addr_t base = info->loader_start;
93
    target_phys_addr_t p;
92
    hwaddr base = info->loader_start;
93
    hwaddr p;
94 94

  
95 95
    p = base + KERNEL_ARGS_ADDR;
96 96
    /* ATAG_CORE */
......
142 142

  
143 143
static void set_kernel_args_old(const struct arm_boot_info *info)
144 144
{
145
    target_phys_addr_t p;
145
    hwaddr p;
146 146
    const char *s;
147 147
    int initrd_size = info->initrd_size;
148
    target_phys_addr_t base = info->loader_start;
148
    hwaddr base = info->loader_start;
149 149

  
150 150
    /* see linux/include/asm-arm/setup.h */
151 151
    p = base + KERNEL_ARGS_ADDR;
......
213 213
    }
214 214
}
215 215

  
216
static int load_dtb(target_phys_addr_t addr, const struct arm_boot_info *binfo)
216
static int load_dtb(hwaddr addr, const struct arm_boot_info *binfo)
217 217
{
218 218
#ifdef CONFIG_FDT
219 219
    uint32_t *mem_reg_property;
......
342 342
    int n;
343 343
    int is_linux = 0;
344 344
    uint64_t elf_entry;
345
    target_phys_addr_t entry;
345
    hwaddr entry;
346 346
    int big_endian;
347 347
    QemuOpts *machine_opts;
348 348

  
......
419 419
         */
420 420
        if (info->dtb_filename) {
421 421
            /* Place the DTB after the initrd in memory */
422
            target_phys_addr_t dtb_start = TARGET_PAGE_ALIGN(info->loader_start
422
            hwaddr dtb_start = TARGET_PAGE_ALIGN(info->loader_start
423 423
                                                             + INITRD_LOAD_ADDR
424 424
                                                             + initrd_size);
425 425
            if (load_dtb(dtb_start, info)) {
b/hw/arm_gic.c
212 212
    }
213 213
}
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff