~fboudra/qemu-linaro/new-upstream-release-1.2.0-2012.09-0ubuntu1

« back to all changes in this revision

Viewing changes to tcg/ppc/tcg-target.c

  • Committer: Fathi Boudra
  • Author(s): Fathi Boudra
  • Date: 2012-08-21 06:47:11 UTC
  • mfrom: (0.1.16)
  • Revision ID: fathi.boudra@linaro.org-20120821064711-7yxmubp2v8a44xce
Tags: 1.1.50-2012.08-0ubuntu1
* New upstream release.
  - support emulated systems with more than 2G of memory. (LP: #1030588)
* Drop powerpc-missing-include.patch - merged upstream.
* Update debian/control: 
  - drop perl build dependency.
  - add libfdt-dev build dependency.
* Update debian/qemu-keymaps.install file.
* Update debian/rules:
  - update QEMU_CPU for ARM architecture: armv4l -> armv7l.
  - update conf_audio_drv: default to PulseAudio since PA is the default on
    Ubuntu.
  - enable KVM on ARM architecture.
  - enable flat device tree support (--enable-fdt). (LP: #1030594)

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
 
25
25
static uint8_t *tb_ret_addr;
26
26
 
27
 
#ifdef _CALL_DARWIN
 
27
#if defined _CALL_DARWIN || defined __APPLE__
 
28
#define TCG_TARGET_CALL_DARWIN
 
29
#endif
 
30
 
 
31
#ifdef TCG_TARGET_CALL_DARWIN
28
32
#define LINKAGE_AREA_SIZE 24
29
33
#define LR_OFFSET 8
30
34
#elif defined _CALL_AIX
99
103
    TCG_REG_R29,
100
104
    TCG_REG_R30,
101
105
    TCG_REG_R31,
102
 
#ifdef _CALL_DARWIN
 
106
#ifdef TCG_TARGET_CALL_DARWIN
103
107
    TCG_REG_R2,
104
108
#endif
105
109
    TCG_REG_R3,
110
114
    TCG_REG_R8,
111
115
    TCG_REG_R9,
112
116
    TCG_REG_R10,
113
 
#ifndef _CALL_DARWIN
 
117
#ifndef TCG_TARGET_CALL_DARWIN
114
118
    TCG_REG_R11,
115
119
#endif
116
120
    TCG_REG_R12,
140
144
};
141
145
 
142
146
static const int tcg_target_callee_save_regs[] = {
143
 
#ifdef _CALL_DARWIN
 
147
#ifdef TCG_TARGET_CALL_DARWIN
144
148
    TCG_REG_R11,
145
149
    TCG_REG_R13,
146
150
#endif
244
248
        tcg_regset_set32(ct->u.regs, 0, 0xffffffff);
245
249
        tcg_regset_reset_reg(ct->u.regs, TCG_REG_R3);
246
250
        tcg_regset_reset_reg(ct->u.regs, TCG_REG_R4);
 
251
#ifdef CONFIG_TCG_PASS_AREG0
 
252
        tcg_regset_reset_reg(ct->u.regs, TCG_REG_R5);
 
253
#if TARGET_LONG_BITS == 64
 
254
        tcg_regset_reset_reg(ct->u.regs, TCG_REG_R6);
 
255
#ifdef TCG_TARGET_CALL_ALIGN_ARGS
 
256
        tcg_regset_reset_reg(ct->u.regs, TCG_REG_R7);
 
257
#endif
 
258
#endif
 
259
#else /* !AREG0 */
 
260
#if TARGET_LONG_BITS == 64
 
261
        tcg_regset_reset_reg(ct->u.regs, TCG_REG_R5);
 
262
#endif
 
263
#endif
247
264
        break;
248
265
    case 'K':                   /* qemu_st[8..32] constraint */
249
266
        ct->ct |= TCG_CT_REG;
251
268
        tcg_regset_reset_reg(ct->u.regs, TCG_REG_R3);
252
269
        tcg_regset_reset_reg(ct->u.regs, TCG_REG_R4);
253
270
        tcg_regset_reset_reg(ct->u.regs, TCG_REG_R5);
254
 
#if TARGET_LONG_BITS == 64
255
 
        tcg_regset_reset_reg(ct->u.regs, TCG_REG_R6);
 
271
#ifdef CONFIG_TCG_PASS_AREG0
 
272
        tcg_regset_reset_reg(ct->u.regs, TCG_REG_R6);
 
273
#if TARGET_LONG_BITS == 64
 
274
        tcg_regset_reset_reg(ct->u.regs, TCG_REG_R7);
 
275
#ifdef TCG_TARGET_CALL_ALIGN_ARGS
 
276
        tcg_regset_reset_reg(ct->u.regs, TCG_REG_R8);
 
277
#endif
 
278
#endif
 
279
#else /* !AREG0 */
 
280
#if TARGET_LONG_BITS == 64
 
281
        tcg_regset_reset_reg(ct->u.regs, TCG_REG_R6);
 
282
#endif
256
283
#endif
257
284
        break;
258
285
    case 'M':                   /* qemu_st64 constraint */
263
290
        tcg_regset_reset_reg(ct->u.regs, TCG_REG_R5);
264
291
        tcg_regset_reset_reg(ct->u.regs, TCG_REG_R6);
265
292
        tcg_regset_reset_reg(ct->u.regs, TCG_REG_R7);
 
293
#if defined(CONFIG_TCG_PASS_AREG0)
 
294
        tcg_regset_reset_reg(ct->u.regs, TCG_REG_R8);
 
295
#ifdef TCG_TARGET_CALL_ALIGN_ARGS
 
296
        tcg_regset_reset_reg(ct->u.regs, TCG_REG_R9);
 
297
#endif
 
298
#endif
266
299
        break;
267
300
#else
268
301
    case 'L':
508
541
 
509
542
#include "../../softmmu_defs.h"
510
543
 
 
544
#ifdef CONFIG_TCG_PASS_AREG0
 
545
/* helper signature: helper_ld_mmu(CPUState *env, target_ulong addr,
 
546
   int mmu_idx) */
 
547
static const void * const qemu_ld_helpers[4] = {
 
548
    helper_ldb_mmu,
 
549
    helper_ldw_mmu,
 
550
    helper_ldl_mmu,
 
551
    helper_ldq_mmu,
 
552
};
 
553
 
 
554
/* helper signature: helper_st_mmu(CPUState *env, target_ulong addr,
 
555
   uintxx_t val, int mmu_idx) */
 
556
static const void * const qemu_st_helpers[4] = {
 
557
    helper_stb_mmu,
 
558
    helper_stw_mmu,
 
559
    helper_stl_mmu,
 
560
    helper_stq_mmu,
 
561
};
 
562
#else
 
563
/* legacy helper signature: __ld_mmu(target_ulong addr, int
 
564
   mmu_idx) */
511
565
static void *qemu_ld_helpers[4] = {
512
566
    __ldb_mmu,
513
567
    __ldw_mmu,
515
569
    __ldq_mmu,
516
570
};
517
571
 
 
572
/* legacy helper signature: __ld_mmu(target_ulong addr, int
 
573
   mmu_idx) */
518
574
static void *qemu_st_helpers[4] = {
519
575
    __stb_mmu,
520
576
    __stw_mmu,
522
578
    __stq_mmu,
523
579
};
524
580
#endif
 
581
#endif
525
582
 
526
583
static void tcg_out_qemu_ld (TCGContext *s, const TCGArg *args, int opc)
527
584
{
528
585
    int addr_reg, data_reg, data_reg2, r0, r1, rbase, bswap;
529
586
#ifdef CONFIG_SOFTMMU
530
 
    int mem_index, s_bits, r2;
 
587
    int mem_index, s_bits, r2, ir;
531
588
    void *label1_ptr, *label2_ptr;
532
589
#if TARGET_LONG_BITS == 64
533
590
    int addr_reg2;
564
621
    tcg_out32 (s, (LWZU
565
622
                   | RT (r1)
566
623
                   | RA (r0)
567
 
                   | offsetof (CPUState, tlb_table[mem_index][0].addr_read)
 
624
                   | offsetof (CPUArchState, tlb_table[mem_index][0].addr_read)
568
625
                   )
569
626
        );
570
627
    tcg_out32 (s, (RLWINM
589
646
#endif
590
647
 
591
648
    /* slow path */
 
649
    ir = 3;
 
650
#ifdef CONFIG_TCG_PASS_AREG0
 
651
    tcg_out_mov (s, TCG_TYPE_I32, ir++, TCG_AREG0);
 
652
#endif
592
653
#if TARGET_LONG_BITS == 32
593
 
    tcg_out_mov (s, TCG_TYPE_I32, 3, addr_reg);
594
 
    tcg_out_movi (s, TCG_TYPE_I32, 4, mem_index);
 
654
    tcg_out_mov (s, TCG_TYPE_I32, ir++, addr_reg);
595
655
#else
596
 
    tcg_out_mov (s, TCG_TYPE_I32, 3, addr_reg2);
597
 
    tcg_out_mov (s, TCG_TYPE_I32, 4, addr_reg);
598
 
    tcg_out_movi (s, TCG_TYPE_I32, 5, mem_index);
599
 
#endif
 
656
#ifdef TCG_TARGET_CALL_ALIGN_ARGS
 
657
    ir |= 1;
 
658
#endif
 
659
    tcg_out_mov (s, TCG_TYPE_I32, ir++, addr_reg2);
 
660
    tcg_out_mov (s, TCG_TYPE_I32, ir++, addr_reg);
 
661
#endif
 
662
    tcg_out_movi (s, TCG_TYPE_I32, ir, mem_index);
600
663
 
601
664
    tcg_out_call (s, (tcg_target_long) qemu_ld_helpers[s_bits], 1);
602
665
    switch (opc) {
760
823
    tcg_out32 (s, (LWZU
761
824
                   | RT (r1)
762
825
                   | RA (r0)
763
 
                   | offsetof (CPUState, tlb_table[mem_index][0].addr_write)
 
826
                   | offsetof (CPUArchState, tlb_table[mem_index][0].addr_write)
764
827
                   )
765
828
        );
766
829
    tcg_out32 (s, (RLWINM
785
848
#endif
786
849
 
787
850
    /* slow path */
 
851
    ir = 3;
 
852
#ifdef CONFIG_TCG_PASS_AREG0
 
853
    tcg_out_mov (s, TCG_TYPE_I32, ir++, TCG_AREG0);
 
854
#endif
788
855
#if TARGET_LONG_BITS == 32
789
 
    tcg_out_mov (s, TCG_TYPE_I32, 3, addr_reg);
790
 
    ir = 4;
 
856
    tcg_out_mov (s, TCG_TYPE_I32, ir++, addr_reg);
791
857
#else
792
 
    tcg_out_mov (s, TCG_TYPE_I32, 3, addr_reg2);
793
 
    tcg_out_mov (s, TCG_TYPE_I32, 4, addr_reg);
794
858
#ifdef TCG_TARGET_CALL_ALIGN_ARGS
795
 
    ir = 5;
796
 
#else
797
 
    ir = 4;
 
859
    ir |= 1;
798
860
#endif
 
861
    tcg_out_mov (s, TCG_TYPE_I32, ir++, addr_reg2);
 
862
    tcg_out_mov (s, TCG_TYPE_I32, ir++, addr_reg);
799
863
#endif
800
864
 
801
865
    switch (opc) {
820
884
        break;
821
885
    case 3:
822
886
#ifdef TCG_TARGET_CALL_ALIGN_ARGS
823
 
        ir = 5;
 
887
        ir |= 1;
824
888
#endif
825
889
        tcg_out_mov (s, TCG_TYPE_I32, ir++, data_reg2);
826
890
        tcg_out_mov (s, TCG_TYPE_I32, ir, data_reg);
1801
1865
        break;
1802
1866
 
1803
1867
    default:
1804
 
        tcg_dump_ops (s, stderr);
 
1868
        tcg_dump_ops (s);
1805
1869
        tcg_abort ();
1806
1870
    }
1807
1871
}
1905
1969
    tcg_regset_set32(tcg_target_available_regs[TCG_TYPE_I32], 0, 0xffffffff);
1906
1970
    tcg_regset_set32(tcg_target_call_clobber_regs, 0,
1907
1971
                     (1 << TCG_REG_R0) |
1908
 
#ifdef _CALL_DARWIN
 
1972
#ifdef TCG_TARGET_CALL_DARWIN
1909
1973
                     (1 << TCG_REG_R2) |
1910
1974
#endif
1911
1975
                     (1 << TCG_REG_R3) |
1923
1987
    tcg_regset_clear(s->reserved_regs);
1924
1988
    tcg_regset_set_reg(s->reserved_regs, TCG_REG_R0);
1925
1989
    tcg_regset_set_reg(s->reserved_regs, TCG_REG_R1);
1926
 
#ifndef _CALL_DARWIN
 
1990
#ifndef TCG_TARGET_CALL_DARWIN
1927
1991
    tcg_regset_set_reg(s->reserved_regs, TCG_REG_R2);
1928
1992
#endif
1929
1993
#ifdef _CALL_SYSV