mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-01-22 03:11:09 +00:00
rename UC_QUERY_ARM_MODE to a more generic name UC_QUERY_MODE. make all bindings support this new constant
This commit is contained in:
parent
4dbad9aa9b
commit
6f3d48077e
|
@ -90,6 +90,7 @@ module Common =
|
|||
let UC_HOOK_MEM_WRITE_INVALID = 288
|
||||
let UC_HOOK_MEM_FETCH_INVALID = 576
|
||||
let UC_HOOK_MEM_INVALID = 1008
|
||||
let UC_QUERY_MODE = 1
|
||||
|
||||
let UC_PROT_NONE = 0
|
||||
let UC_PROT_READ = 1
|
||||
|
|
|
@ -85,6 +85,7 @@ const (
|
|||
HOOK_MEM_WRITE_INVALID = 288
|
||||
HOOK_MEM_FETCH_INVALID = 576
|
||||
HOOK_MEM_INVALID = 1008
|
||||
QUERY_MODE = 1
|
||||
|
||||
PROT_NONE = 0
|
||||
PROT_READ = 1
|
||||
|
|
|
@ -87,6 +87,7 @@ public interface UnicornConst {
|
|||
public static final int UC_HOOK_MEM_WRITE_INVALID = 288;
|
||||
public static final int UC_HOOK_MEM_FETCH_INVALID = 576;
|
||||
public static final int UC_HOOK_MEM_INVALID = 1008;
|
||||
public static final int UC_QUERY_MODE = 1;
|
||||
|
||||
public static final int UC_PROT_NONE = 0;
|
||||
public static final int UC_PROT_READ = 1;
|
||||
|
|
|
@ -83,6 +83,7 @@ UC_HOOK_MEM_READ_INVALID = 144
|
|||
UC_HOOK_MEM_WRITE_INVALID = 288
|
||||
UC_HOOK_MEM_FETCH_INVALID = 576
|
||||
UC_HOOK_MEM_INVALID = 1008
|
||||
UC_QUERY_MODE = 1
|
||||
|
||||
UC_PROT_NONE = 0
|
||||
UC_PROT_READ = 1
|
||||
|
|
|
@ -257,8 +257,9 @@ typedef struct uc_mem_region {
|
|||
|
||||
// All type of queries for uc_query() API.
|
||||
typedef enum uc_query_type {
|
||||
// Query current hardware mode for ARM. Return 1 for Thumb, 0 for ARM
|
||||
UC_QUERY_ARM_MODE = 1,
|
||||
// Dynamically query current hardware mode.
|
||||
// For ARM, uc_query() return 1 for Thumb mode, and 0 for Arm mode
|
||||
UC_QUERY_MODE = 1,
|
||||
} uc_query_type;
|
||||
|
||||
/*
|
||||
|
@ -325,8 +326,9 @@ uc_err uc_close(uc_engine *uc);
|
|||
Query internal status of engine.
|
||||
|
||||
@uc: handle returned by uc_open()
|
||||
@type: query type
|
||||
@result: status retrieved
|
||||
@type: query type. See uc_query_type
|
||||
|
||||
@result: save the internal status queried
|
||||
|
||||
@return: error code of uc_err enum type (UC_ERR_*, see above)
|
||||
*/
|
||||
|
|
|
@ -113,7 +113,7 @@ static uc_err arm_query(struct uc_struct *uc, uc_query_type type, size_t *result
|
|||
CPUState *mycpu = first_cpu;
|
||||
|
||||
switch(type) {
|
||||
case UC_QUERY_ARM_MODE:
|
||||
case UC_QUERY_MODE:
|
||||
*result = (ARM_CPU(uc, mycpu)->env.thumb != 0);
|
||||
return UC_ERR_OK;
|
||||
default:
|
||||
|
|
Loading…
Reference in a new issue