aboutsummaryrefslogtreecommitdiff
path: root/target-xtensa/cpu.h
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2012-05-06 12:41:53 +0200
committerAndreas Färber <afaerber@suse.de>2012-06-04 23:00:41 +0200
commit15be3171392a14cb90abd89ac7310681556f736e (patch)
treeaa94158ba64f8b1ec057cb6cfbe79f63373d0a74 /target-xtensa/cpu.h
parentf6932a867d862a5d39506701e9b9d8abcdf1f4ff (diff)
target-xtensa: Let cpu_xtensa_init() return XtensaCPU
Make the include paths for cpu-qom.h consistent to allow using XtensaCPU in cpu.h. Turn cpu_init macro into a static inline function returning CPUXtensaState for backwards compatibility. Signed-off-by: Andreas Färber <afaerber@suse.de> Acked-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'target-xtensa/cpu.h')
-rw-r--r--target-xtensa/cpu.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/target-xtensa/cpu.h b/target-xtensa/cpu.h
index 6d0ea7c038..81f7833039 100644
--- a/target-xtensa/cpu.h
+++ b/target-xtensa/cpu.h
@@ -344,13 +344,24 @@ typedef struct CPUXtensaState {
CPU_COMMON
} CPUXtensaState;
-#define cpu_init cpu_xtensa_init
+#include "cpu-qom.h"
+
#define cpu_exec cpu_xtensa_exec
#define cpu_gen_code cpu_xtensa_gen_code
#define cpu_signal_handler cpu_xtensa_signal_handler
#define cpu_list xtensa_cpu_list
-CPUXtensaState *cpu_xtensa_init(const char *cpu_model);
+XtensaCPU *cpu_xtensa_init(const char *cpu_model);
+
+static inline CPUXtensaState *cpu_init(const char *cpu_model)
+{
+ XtensaCPU *cpu = cpu_xtensa_init(cpu_model);
+ if (cpu == NULL) {
+ return NULL;
+ }
+ return &cpu->env;
+}
+
void xtensa_translate_init(void);
int cpu_xtensa_exec(CPUXtensaState *s);
void xtensa_register_core(XtensaConfigList *node);
@@ -471,7 +482,6 @@ static inline void cpu_get_tb_cpu_state(CPUXtensaState *env, target_ulong *pc,
}
#include "cpu-all.h"
-#include "cpu-qom.h"
#include "exec-all.h"
static inline int cpu_has_work(CPUXtensaState *env)