mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-07-06 10:30:38 +00:00
arm: UC_QUERY_MODE return hardware mode (see issue #397)
This commit is contained in:
parent
49974cd395
commit
e73cbf1c88
|
@ -116,10 +116,15 @@ static bool arm_stop_interrupt(int intno)
|
||||||
static uc_err arm_query(struct uc_struct *uc, uc_query_type type, size_t *result)
|
static uc_err arm_query(struct uc_struct *uc, uc_query_type type, size_t *result)
|
||||||
{
|
{
|
||||||
CPUState *mycpu = first_cpu;
|
CPUState *mycpu = first_cpu;
|
||||||
|
uint32_t mode;
|
||||||
|
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case UC_QUERY_MODE:
|
case UC_QUERY_MODE:
|
||||||
*result = (ARM_CPU(uc, mycpu)->env.thumb != 0);
|
// zero out ARM/THUMB mode
|
||||||
|
mode = uc->mode & ~(UC_MODE_ARM | UC_MODE_THUMB);
|
||||||
|
// THUMB mode or ARM MOde
|
||||||
|
mode += ((ARM_CPU(uc, mycpu)->env.thumb != 0)? UC_MODE_THUMB : UC_MODE_ARM);
|
||||||
|
*result = mode;
|
||||||
return UC_ERR_OK;
|
return UC_ERR_OK;
|
||||||
default:
|
default:
|
||||||
return UC_ERR_ARG;
|
return UC_ERR_ARG;
|
||||||
|
|
Loading…
Reference in a new issue