Revision b26eefb6 target-arm/helper.c
b/target-arm/helper.c | ||
---|---|---|
5 | 5 |
#include "cpu.h" |
6 | 6 |
#include "exec-all.h" |
7 | 7 |
#include "gdbstub.h" |
8 |
#include "helpers.h" |
|
8 | 9 |
|
9 | 10 |
static uint32_t cortexa8_cp15_c0_c1[8] = |
10 | 11 |
{ 0x1031, 0x11, 0x400, 0, 0x31100003, 0x20000000, 0x01202000, 0x11 }; |
... | ... | |
174 | 175 |
{ |
175 | 176 |
CPUARMState *env; |
176 | 177 |
uint32_t id; |
178 |
static int inited = 0; |
|
177 | 179 |
|
178 | 180 |
id = cpu_arm_find_by_name(cpu_model); |
179 | 181 |
if (id == 0) |
... | ... | |
182 | 184 |
if (!env) |
183 | 185 |
return NULL; |
184 | 186 |
cpu_exec_init(env); |
187 |
if (!inited) { |
|
188 |
inited = 1; |
|
189 |
arm_translate_init(); |
|
190 |
} |
|
191 |
|
|
185 | 192 |
env->cpu_model_str = cpu_model; |
186 | 193 |
env->cp15.c0_cpuid = id; |
187 | 194 |
cpu_reset(env); |
... | ... | |
315 | 322 |
env->uncached_cpsr = (env->uncached_cpsr & ~mask) | (val & mask); |
316 | 323 |
} |
317 | 324 |
|
325 |
#define HELPER(x) helper_##x |
|
326 |
/* Sign/zero extend */ |
|
327 |
uint32_t HELPER(sxtb16)(uint32_t x) |
|
328 |
{ |
|
329 |
uint32_t res; |
|
330 |
res = (uint16_t)(int8_t)x; |
|
331 |
res |= (uint32_t)(int8_t)(x >> 16) << 16; |
|
332 |
return res; |
|
333 |
} |
|
334 |
|
|
335 |
uint32_t HELPER(uxtb16)(uint32_t x) |
|
336 |
{ |
|
337 |
uint32_t res; |
|
338 |
res = (uint16_t)(uint8_t)x; |
|
339 |
res |= (uint32_t)(uint8_t)(x >> 16) << 16; |
|
340 |
return res; |
|
341 |
} |
|
342 |
|
|
318 | 343 |
#if defined(CONFIG_USER_ONLY) |
319 | 344 |
|
320 | 345 |
void do_interrupt (CPUState *env) |
... | ... | |
1861 | 1886 |
} |
1862 | 1887 |
|
1863 | 1888 |
#endif |
1889 |
|
Also available in: Unified diff