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

« back to all changes in this revision

Viewing changes to target-unicore32/softmmu.c

  • 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:
33
33
/* Map CPU modes onto saved register banks.  */
34
34
static inline int bank_number(CPUUniCore32State *env, int mode)
35
35
{
 
36
    UniCore32CPU *cpu = uc32_env_get_cpu(env);
 
37
 
36
38
    switch (mode) {
37
39
    case ASR_MODE_USER:
38
40
    case ASR_MODE_SUSR:
46
48
    case ASR_MODE_INTR:
47
49
        return 4;
48
50
    }
49
 
    cpu_abort(env, "Bad mode %x\n", mode);
 
51
    cpu_abort(CPU(cpu), "Bad mode %x\n", mode);
50
52
    return -1;
51
53
}
52
54
 
79
81
    uint32_t addr;
80
82
    int new_mode;
81
83
 
82
 
    switch (env->exception_index) {
 
84
    switch (cs->exception_index) {
83
85
    case UC32_EXCP_PRIV:
84
86
        new_mode = ASR_MODE_PRIV;
85
87
        addr = 0x08;
99
101
        addr = 0x18;
100
102
        break;
101
103
    default:
102
 
        cpu_abort(env, "Unhandled exception 0x%x\n", env->exception_index);
 
104
        cpu_abort(cs, "Unhandled exception 0x%x\n", cs->exception_index);
103
105
        return;
104
106
    }
105
107
    /* High vectors.  */
121
123
        int access_type, int is_user, uint32_t *phys_ptr, int *prot,
122
124
        target_ulong *page_size)
123
125
{
 
126
    UniCore32CPU *cpu = uc32_env_get_cpu(env);
 
127
    CPUState *cs = CPU(cpu);
124
128
    int code;
125
129
    uint32_t table;
126
130
    uint32_t desc;
130
134
    /* Lookup l1 descriptor.  */
131
135
    table = env->cp0.c2_base & 0xfffff000;
132
136
    table |= (address >> 20) & 0xffc;
133
 
    desc = ldl_phys(table);
 
137
    desc = ldl_phys(cs->as, table);
134
138
    code = 0;
135
139
    switch (PAGETABLE_TYPE(desc)) {
136
140
    case 3:
152
156
            goto do_fault;
153
157
        }
154
158
        table = (desc & 0xfffff000) | ((address >> 10) & 0xffc);
155
 
        desc = ldl_phys(table);
 
159
        desc = ldl_phys(cs->as, table);
156
160
        /* 4k page.  */
157
161
        if (is_user) {
158
162
            DPRINTF("PTE address %x, desc %x\n", table, desc);
167
171
            *page_size = TARGET_PAGE_SIZE;
168
172
            break;
169
173
        default:
170
 
            cpu_abort(env, "wrong page type!");
 
174
            cpu_abort(CPU(cpu), "wrong page type!");
171
175
        }
172
176
        break;
173
177
    default:
174
 
        cpu_abort(env, "wrong page type!");
 
178
        cpu_abort(CPU(cpu), "wrong page type!");
175
179
    }
176
180
 
177
181
    *phys_ptr = phys_addr;
208
212
    return code;
209
213
}
210
214
 
211
 
int uc32_cpu_handle_mmu_fault(CPUUniCore32State *env, target_ulong address,
 
215
int uc32_cpu_handle_mmu_fault(CPUState *cs, vaddr address,
212
216
                              int access_type, int mmu_idx)
213
217
{
 
218
    UniCore32CPU *cpu = UNICORE32_CPU(cs);
 
219
    CPUUniCore32State *env = &cpu->env;
214
220
    uint32_t phys_addr;
215
221
    target_ulong page_size;
216
222
    int prot;
230
236
            ret = get_phys_addr_ucv2(env, address, access_type, is_user,
231
237
                                    &phys_addr, &prot, &page_size);
232
238
            if (is_user) {
233
 
                DPRINTF("user space access: ret %x, address %x, "
 
239
                DPRINTF("user space access: ret %x, address %" VADDR_PRIx ", "
234
240
                        "access_type %x, phys_addr %x, prot %x\n",
235
241
                        ret, address, access_type, phys_addr, prot);
236
242
            }
247
253
        /* Map a single page.  */
248
254
        phys_addr &= TARGET_PAGE_MASK;
249
255
        address &= TARGET_PAGE_MASK;
250
 
        tlb_set_page(env, address, phys_addr, prot, mmu_idx, page_size);
 
256
        tlb_set_page(cs, address, phys_addr, prot, mmu_idx, page_size);
251
257
        return 0;
252
258
    }
253
259
 
254
260
    env->cp0.c3_faultstatus = ret;
255
261
    env->cp0.c4_faultaddr = address;
256
262
    if (access_type == 2) {
257
 
        env->exception_index = UC32_EXCP_ITRAP;
 
263
        cs->exception_index = UC32_EXCP_ITRAP;
258
264
    } else {
259
 
        env->exception_index = UC32_EXCP_DTRAP;
 
265
        cs->exception_index = UC32_EXCP_DTRAP;
260
266
    }
261
267
    return ret;
262
268
}
265
271
{
266
272
    UniCore32CPU *cpu = UNICORE32_CPU(cs);
267
273
 
268
 
    cpu_abort(&cpu->env, "%s not supported yet\n", __func__);
 
274
    cpu_abort(CPU(cpu), "%s not supported yet\n", __func__);
269
275
    return addr;
270
276
}