Revision f59df3f2 target-arm/cpu.h
b/target-arm/cpu.h | ||
---|---|---|
811 | 811 |
|
812 | 812 |
typedef struct ARMCPRegInfo ARMCPRegInfo; |
813 | 813 |
|
814 |
/* Access functions for coprocessor registers. These should return |
|
815 |
* 0 on success, or one of the EXCP_* constants if access should cause |
|
816 |
* an exception (in which case *value is not written). |
|
817 |
*/ |
|
814 |
typedef enum CPAccessResult { |
|
815 |
/* Access is permitted */ |
|
816 |
CP_ACCESS_OK = 0, |
|
817 |
/* Access fails due to a configurable trap or enable which would |
|
818 |
* result in a categorized exception syndrome giving information about |
|
819 |
* the failing instruction (ie syndrome category 0x3, 0x4, 0x5, 0x6, |
|
820 |
* 0xc or 0x18). |
|
821 |
*/ |
|
822 |
CP_ACCESS_TRAP = 1, |
|
823 |
/* Access fails and results in an exception syndrome 0x0 ("uncategorized"). |
|
824 |
* Note that this is not a catch-all case -- the set of cases which may |
|
825 |
* result in this failure is specifically defined by the architecture. |
|
826 |
*/ |
|
827 |
CP_ACCESS_TRAP_UNCATEGORIZED = 2, |
|
828 |
} CPAccessResult; |
|
829 |
|
|
830 |
/* Access functions for coprocessor registers. These should always succeed. */ |
|
818 | 831 |
typedef int CPReadFn(CPUARMState *env, const ARMCPRegInfo *opaque, |
819 | 832 |
uint64_t *value); |
820 | 833 |
typedef int CPWriteFn(CPUARMState *env, const ARMCPRegInfo *opaque, |
821 | 834 |
uint64_t value); |
835 |
/* Access permission check functions for coprocessor registers. */ |
|
836 |
typedef CPAccessResult CPAccessFn(CPUARMState *env, const ARMCPRegInfo *opaque); |
|
822 | 837 |
/* Hook function for register reset */ |
823 | 838 |
typedef void CPResetFn(CPUARMState *env, const ARMCPRegInfo *opaque); |
824 | 839 |
|
... | ... | |
872 | 887 |
* 2. both readfn and writefn are specified |
873 | 888 |
*/ |
874 | 889 |
ptrdiff_t fieldoffset; /* offsetof(CPUARMState, field) */ |
890 |
/* Function for making any access checks for this register in addition to |
|
891 |
* those specified by the 'access' permissions bits. If NULL, no extra |
|
892 |
* checks required. The access check is performed at runtime, not at |
|
893 |
* translate time. |
|
894 |
*/ |
|
895 |
CPAccessFn *accessfn; |
|
875 | 896 |
/* Function for handling reads of this register. If NULL, then reads |
876 | 897 |
* will be done by loading from the offset into CPUARMState specified |
877 | 898 |
* by fieldoffset. |
Also available in: Unified diff