The get_security_mode functions corresponds to the expression
(cpsr.mode != Monitor && scr.ns) ? Arm_Trustzone_Non_Secure :
Arm_Trustzone_Secure
. The mem_op_security_mode function
always returns Arm_Trustzone_Non_Secure
when the processor is in
non-secure mode, in secure mode it returns the ns
bit in the
first-level page table entry for the actual area being accessed.
typedef enum { Arm_Trustzone_Secure = 0, Arm_Trustzone_Non_Secure = 1 } arm_trustzone_mode_t; SIM_INTERFACE(arm_trustzone) { arm_trustzone_mode_t (*get_security_mode)(conf_object_t *NOTNULL obj); arm_trustzone_mode_t (*mem_op_security_mode)( conf_object_t *NOTNULL obj, generic_transaction_t *NOTNULL memop); }; #define ARM_TRUSTZONE_INTERFACE "arm_trustzone"