Commit 5b146dc7 authored by Richard Henderson's avatar Richard Henderson
Browse files

cpu: Introduce CPUNegativeOffsetState



Nothing in there so far, but all of the plumbing done
within the target ArchCPU state.

Reviewed-by: default avatarAlistair Francis <alistair.francis@wdc.com>
Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
Signed-off-by: default avatarRichard Henderson <richard.henderson@linaro.org>
parent 7506ed90
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
@@ -404,4 +404,28 @@ static inline CPUState *env_cpu(CPUArchState *env)
    return &env_archcpu(env)->parent_obj;
}

/**
 * env_neg(env)
 * @env: The architecture environment
 *
 * Return the CPUNegativeOffsetState associated with the environment.
 */
static inline CPUNegativeOffsetState *env_neg(CPUArchState *env)
{
    ArchCPU *arch_cpu = container_of(env, ArchCPU, env);
    return &arch_cpu->neg;
}

/**
 * cpu_neg(cpu)
 * @cpu: The generic CPUState
 *
 * Return the CPUNegativeOffsetState associated with the cpu.
 */
static inline CPUNegativeOffsetState *cpu_neg(CPUState *cpu)
{
    ArchCPU *arch_cpu = container_of(cpu, ArchCPU, parent_obj);
    return &arch_cpu->neg;
}

#endif /* CPU_ALL_H */
+8 −0
Original line number Diff line number Diff line
@@ -227,4 +227,12 @@ typedef struct CPUTLB {

#endif  /* !CONFIG_USER_ONLY && CONFIG_TCG */

/*
 * This structure must be placed in ArchCPU immedately
 * before CPUArchState, as a field named "neg".
 */
typedef struct CPUNegativeOffsetState {
    /* Empty */
} CPUNegativeOffsetState;

#endif
+1 −0
Original line number Diff line number Diff line
@@ -272,6 +272,7 @@ struct AlphaCPU {
    CPUState parent_obj;
    /*< public >*/

    CPUNegativeOffsetState neg;
    CPUAlphaState env;

    /* This alarm doesn't exist in real hardware; we wish it did.  */
+1 −0
Original line number Diff line number Diff line
@@ -721,6 +721,7 @@ struct ARMCPU {
    CPUState parent_obj;
    /*< public >*/

    CPUNegativeOffsetState neg;
    CPUARMState env;

    /* Coprocessor information */
+1 −0
Original line number Diff line number Diff line
@@ -180,6 +180,7 @@ struct CRISCPU {
    CPUState parent_obj;
    /*< public >*/

    CPUNegativeOffsetState neg;
    CPUCRISState env;
};

Loading