Revision c227f099 target-sparc/helper.c

b/target-sparc/helper.c
36 36

  
37 37
/* thread support */
38 38

  
39
static a_spinlock global_cpu_lock = SPIN_LOCK_UNLOCKED;
39
static spinlock_t global_cpu_lock = SPIN_LOCK_UNLOCKED;
40 40

  
41 41
void cpu_lock(void)
42 42
{
......
100 100
    }
101 101
};
102 102

  
103
static int get_physical_address(CPUState *env, a_target_phys_addr *physical,
103
static int get_physical_address(CPUState *env, target_phys_addr_t *physical,
104 104
                                int *prot, int *access_index,
105 105
                                target_ulong address, int rw, int mmu_idx)
106 106
{
107 107
    int access_perms = 0;
108
    a_target_phys_addr pde_ptr;
108
    target_phys_addr_t pde_ptr;
109 109
    uint32_t pde;
110 110
    target_ulong virt_addr;
111 111
    int error_code = 0, is_dirty, is_user;
......
214 214

  
215 215
    /* Even if large ptes, we map only one 4KB page in the cache to
216 216
       avoid filling it too fast */
217
    *physical = ((a_target_phys_addr)(pde & PTE_ADDR_MASK) << 4) + page_offset;
217
    *physical = ((target_phys_addr_t)(pde & PTE_ADDR_MASK) << 4) + page_offset;
218 218
    return error_code;
219 219
}
220 220

  
......
222 222
int cpu_sparc_handle_mmu_fault (CPUState *env, target_ulong address, int rw,
223 223
                              int mmu_idx, int is_softmmu)
224 224
{
225
    a_target_phys_addr paddr;
225
    target_phys_addr_t paddr;
226 226
    target_ulong vaddr;
227 227
    int error_code = 0, prot, ret = 0, access_index;
228 228

  
......
264 264

  
265 265
target_ulong mmu_probe(CPUState *env, target_ulong address, int mmulev)
266 266
{
267
    a_target_phys_addr pde_ptr;
267
    target_phys_addr_t pde_ptr;
268 268
    uint32_t pde;
269 269

  
270 270
    /* Context base + context number */
271
    pde_ptr = (a_target_phys_addr)(env->mmuregs[1] << 4) +
271
    pde_ptr = (target_phys_addr_t)(env->mmuregs[1] << 4) +
272 272
        (env->mmuregs[2] << 2);
273 273
    pde = ldl_phys(pde_ptr);
274 274

  
......
330 330
{
331 331
    target_ulong va, va1, va2;
332 332
    unsigned int n, m, o;
333
    a_target_phys_addr pde_ptr, pa;
333
    target_phys_addr_t pde_ptr, pa;
334 334
    uint32_t pde;
335 335

  
336 336
    printf("MMU dump:\n");
337 337
    pde_ptr = (env->mmuregs[1] << 4) + (env->mmuregs[2] << 2);
338 338
    pde = ldl_phys(pde_ptr);
339 339
    printf("Root ptr: " TARGET_FMT_plx ", ctx: %d\n",
340
           (a_target_phys_addr)env->mmuregs[1] << 4, env->mmuregs[2]);
340
           (target_phys_addr_t)env->mmuregs[1] << 4, env->mmuregs[2]);
341 341
    for (n = 0, va = 0; n < 256; n++, va += 16 * 1024 * 1024) {
342 342
        pde = mmu_probe(env, va, 2);
343 343
        if (pde) {
......
370 370
#else /* !TARGET_SPARC64 */
371 371

  
372 372
// 41 bit physical address space
373
static inline a_target_phys_addr ultrasparc_truncate_physical(uint64_t x)
373
static inline target_phys_addr_t ultrasparc_truncate_physical(uint64_t x)
374 374
{
375 375
    return x & 0x1ffffffffffULL;
376 376
}
......
388 388
// requires virtual address mask value calculated from TTE entry size
389 389
static inline int ultrasparc_tag_match(SparcTLBEntry *tlb,
390 390
                                       uint64_t address, uint64_t context,
391
                                       a_target_phys_addr *physical)
391
                                       target_phys_addr_t *physical)
392 392
{
393 393
    uint64_t mask;
394 394

  
......
422 422
}
423 423

  
424 424
static int get_physical_address_data(CPUState *env,
425
                                     a_target_phys_addr *physical, int *prot,
425
                                     target_phys_addr_t *physical, int *prot,
426 426
                                     target_ulong address, int rw, int is_user)
427 427
{
428 428
    unsigned int i;
......
481 481
}
482 482

  
483 483
static int get_physical_address_code(CPUState *env,
484
                                     a_target_phys_addr *physical, int *prot,
484
                                     target_phys_addr_t *physical, int *prot,
485 485
                                     target_ulong address, int is_user)
486 486
{
487 487
    unsigned int i;
......
527 527
    return 1;
528 528
}
529 529

  
530
static int get_physical_address(CPUState *env, a_target_phys_addr *physical,
530
static int get_physical_address(CPUState *env, target_phys_addr_t *physical,
531 531
                                int *prot, int *access_index,
532 532
                                target_ulong address, int rw, int mmu_idx)
533 533
{
......
546 546
                              int mmu_idx, int is_softmmu)
547 547
{
548 548
    target_ulong virt_addr, vaddr;
549
    a_target_phys_addr paddr;
549
    target_phys_addr_t paddr;
550 550
    int error_code = 0, prot, ret = 0, access_index;
551 551

  
552 552
    error_code = get_physical_address(env, &paddr, &prot, &access_index,
......
649 649

  
650 650

  
651 651
#if defined(CONFIG_USER_ONLY)
652
a_target_phys_addr cpu_get_phys_page_debug(CPUState *env, target_ulong addr)
652
target_phys_addr_t cpu_get_phys_page_debug(CPUState *env, target_ulong addr)
653 653
{
654 654
    return addr;
655 655
}
656 656

  
657 657
#else
658
a_target_phys_addr cpu_get_phys_page_debug(CPUState *env, target_ulong addr)
658
target_phys_addr_t cpu_get_phys_page_debug(CPUState *env, target_ulong addr)
659 659
{
660
    a_target_phys_addr phys_addr;
660
    target_phys_addr_t phys_addr;
661 661
    int prot, access_index;
662 662

  
663 663
    if (get_physical_address(env, &phys_addr, &prot, &access_index, addr, 2,

Also available in: Unified diff