Revision 8cb7da56 hw/ppc_prep.c

b/hw/ppc_prep.c
145 145

  
146 146
static uint32_t PPC_intack_readw (void *opaque, target_phys_addr_t addr)
147 147
{
148
#ifdef TARGET_WORDS_BIGENDIAN
149
    return bswap16(_PPC_intack_read(addr));
150
#else
151 148
    return _PPC_intack_read(addr);
152
#endif
153 149
}
154 150

  
155 151
static uint32_t PPC_intack_readl (void *opaque, target_phys_addr_t addr)
156 152
{
157
#ifdef TARGET_WORDS_BIGENDIAN
158
    return bswap32(_PPC_intack_read(addr));
159
#else
160 153
    return _PPC_intack_read(addr);
161
#endif
162 154
}
163 155

  
164 156
static CPUWriteMemoryFunc * const PPC_intack_write[] = {
......
210 202
static void PPC_XCSR_writew (void *opaque,
211 203
                             target_phys_addr_t addr, uint32_t value)
212 204
{
213
#ifdef TARGET_WORDS_BIGENDIAN
214
    value = bswap16(value);
215
#endif
216 205
    printf("%s: 0x" TARGET_FMT_plx " => 0x%08" PRIx32 "\n", __func__, addr,
217 206
           value);
218 207
}
......
220 209
static void PPC_XCSR_writel (void *opaque,
221 210
                             target_phys_addr_t addr, uint32_t value)
222 211
{
223
#ifdef TARGET_WORDS_BIGENDIAN
224
    value = bswap32(value);
225
#endif
226 212
    printf("%s: 0x" TARGET_FMT_plx " => 0x%08" PRIx32 "\n", __func__, addr,
227 213
           value);
228 214
}
......
243 229

  
244 230
    printf("%s: 0x" TARGET_FMT_plx " <= %08" PRIx32 "\n", __func__, addr,
245 231
           retval);
246
#ifdef TARGET_WORDS_BIGENDIAN
247
    retval = bswap16(retval);
248
#endif
249 232

  
250 233
    return retval;
251 234
}
......
256 239

  
257 240
    printf("%s: 0x" TARGET_FMT_plx " <= %08" PRIx32 "\n", __func__, addr,
258 241
           retval);
259
#ifdef TARGET_WORDS_BIGENDIAN
260
    retval = bswap32(retval);
261
#endif
262 242

  
263 243
    return retval;
264 244
}
......
484 464
    sysctrl_t *sysctrl = opaque;
485 465

  
486 466
    addr = prep_IO_address(sysctrl, addr);
487
#ifdef TARGET_WORDS_BIGENDIAN
488
    value = bswap16(value);
489
#endif
490 467
    PPC_IO_DPRINTF("0x" TARGET_FMT_plx " => 0x%08" PRIx32 "\n", addr, value);
491 468
    cpu_outw(addr, value);
492 469
}
......
498 475

  
499 476
    addr = prep_IO_address(sysctrl, addr);
500 477
    ret = cpu_inw(addr);
501
#ifdef TARGET_WORDS_BIGENDIAN
502
    ret = bswap16(ret);
503
#endif
504 478
    PPC_IO_DPRINTF("0x" TARGET_FMT_plx " <= 0x%08" PRIx32 "\n", addr, ret);
505 479

  
506 480
    return ret;
......
512 486
    sysctrl_t *sysctrl = opaque;
513 487

  
514 488
    addr = prep_IO_address(sysctrl, addr);
515
#ifdef TARGET_WORDS_BIGENDIAN
516
    value = bswap32(value);
517
#endif
518 489
    PPC_IO_DPRINTF("0x" TARGET_FMT_plx " => 0x%08" PRIx32 "\n", addr, value);
519 490
    cpu_outl(addr, value);
520 491
}
......
526 497

  
527 498
    addr = prep_IO_address(sysctrl, addr);
528 499
    ret = cpu_inl(addr);
529
#ifdef TARGET_WORDS_BIGENDIAN
530
    ret = bswap32(ret);
531
#endif
532 500
    PPC_IO_DPRINTF("0x" TARGET_FMT_plx " <= 0x%08" PRIx32 "\n", addr, ret);
533 501

  
534 502
    return ret;
......
691 659
    /* Register 8 MB of ISA IO space (needed for non-contiguous map) */
692 660
    PPC_io_memory = cpu_register_io_memory(PPC_prep_io_read,
693 661
                                           PPC_prep_io_write, sysctrl,
694
                                           DEVICE_NATIVE_ENDIAN);
662
                                           DEVICE_LITTLE_ENDIAN);
695 663
    cpu_register_physical_memory(0x80000000, 0x00800000, PPC_io_memory);
696 664

  
697 665
    /* init basic PC hardware */
......
757 725
    /* PCI intack location */
758 726
    PPC_io_memory = cpu_register_io_memory(PPC_intack_read,
759 727
                                           PPC_intack_write, NULL,
760
                                           DEVICE_NATIVE_ENDIAN);
728
                                           DEVICE_LITTLE_ENDIAN);
761 729
    cpu_register_physical_memory(0xBFFFFFF0, 0x4, PPC_io_memory);
762 730
    /* PowerPC control and status register group */
763 731
#if 0
764 732
    PPC_io_memory = cpu_register_io_memory(PPC_XCSR_read, PPC_XCSR_write,
765
                                           NULL, DEVICE_NATIVE_ENDIAN);
733
                                           NULL, DEVICE_LITTLE_ENDIAN);
766 734
    cpu_register_physical_memory(0xFEFF0000, 0x1000, PPC_io_memory);
767 735
#endif
768 736

  

Also available in: Unified diff