Revision c4241c7d target-arm/cpu.h

b/target-arm/cpu.h
827 827
    CP_ACCESS_TRAP_UNCATEGORIZED = 2,
828 828
} CPAccessResult;
829 829

  
830
/* Access functions for coprocessor registers. These should always succeed. */
831
typedef int CPReadFn(CPUARMState *env, const ARMCPRegInfo *opaque,
832
                     uint64_t *value);
833
typedef int CPWriteFn(CPUARMState *env, const ARMCPRegInfo *opaque,
834
                      uint64_t value);
830
/* Access functions for coprocessor registers. These cannot fail and
831
 * may not raise exceptions.
832
 */
833
typedef uint64_t CPReadFn(CPUARMState *env, const ARMCPRegInfo *opaque);
834
typedef void CPWriteFn(CPUARMState *env, const ARMCPRegInfo *opaque,
835
                       uint64_t value);
835 836
/* Access permission check functions for coprocessor registers. */
836 837
typedef CPAccessResult CPAccessFn(CPUARMState *env, const ARMCPRegInfo *opaque);
837 838
/* Hook function for register reset */
......
906 907
    /* Function for doing a "raw" read; used when we need to copy
907 908
     * coprocessor state to the kernel for KVM or out for
908 909
     * migration. This only needs to be provided if there is also a
909
     * readfn and it makes an access permission check.
910
     * readfn and it has side effects (for instance clear-on-read bits).
910 911
     */
911 912
    CPReadFn *raw_readfn;
912 913
    /* Function for doing a "raw" write; used when we need to copy KVM
913 914
     * kernel coprocessor state into userspace, or for inbound
914 915
     * migration. This only needs to be provided if there is also a
915
     * writefn and it makes an access permission check or masks out
916
     * "unwritable" bits or has write-one-to-clear or similar behaviour.
916
     * writefn and it masks out "unwritable" bits or has write-one-to-clear
917
     * or similar behaviour.
917 918
     */
918 919
    CPWriteFn *raw_writefn;
919 920
    /* Function for resetting the register. If NULL, then reset will be done
......
948 949
const ARMCPRegInfo *get_arm_cp_reginfo(GHashTable *cpregs, uint32_t encoded_cp);
949 950

  
950 951
/* CPWriteFn that can be used to implement writes-ignored behaviour */
951
int arm_cp_write_ignore(CPUARMState *env, const ARMCPRegInfo *ri,
952
                        uint64_t value);
952
void arm_cp_write_ignore(CPUARMState *env, const ARMCPRegInfo *ri,
953
                         uint64_t value);
953 954
/* CPReadFn that can be used for read-as-zero behaviour */
954
int arm_cp_read_zero(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t *value);
955
uint64_t arm_cp_read_zero(CPUARMState *env, const ARMCPRegInfo *ri);
955 956

  
956 957
/* CPResetFn that does nothing, for use if no reset is required even
957 958
 * if fieldoffset is non zero.

Also available in: Unified diff