mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-01 23:03:54 -06:00

CPU_RESOLVING_TYPE is declared per target in "cpu.h". Include it (along with "qom/object.h") to avoid when moving code around: include/accel/accel-cpu-target.h:26:50: error: expected ')' 26 | DECLARE_CLASS_CHECKERS(AccelCPUClass, ACCEL_CPU, TYPE_ACCEL_CPU) | ^ include/accel/accel-cpu-target.h:23:33: note: expanded from macro 'TYPE_ACCEL_CPU' 23 | #define TYPE_ACCEL_CPU "accel-" CPU_RESOLVING_TYPE | ^ include/accel/accel-cpu-target.h:26:1: note: to match this '(' 26 | DECLARE_CLASS_CHECKERS(AccelCPUClass, ACCEL_CPU, TYPE_ACCEL_CPU) | ^ include/qom/object.h:196:14: note: expanded from macro 'DECLARE_CLASS_CHECKERS' 196 | { return OBJECT_GET_CLASS(ClassType, obj, TYPENAME); } \ | ^ include/qom/object.h:558:5: note: expanded from macro 'OBJECT_GET_CLASS' 558 | OBJECT_CLASS_CHECK(class, object_get_class(OBJECT(obj)), name) | ^ include/qom/object.h:544:74: note: expanded from macro 'OBJECT_CLASS_CHECK' 544 | ((class_type *)object_class_dynamic_cast_assert(OBJECT_CLASS(class), (name), \ | ^ Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Acked-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20250123234415.59850-13-philmd@linaro.org>
41 lines
1.2 KiB
C
41 lines
1.2 KiB
C
/*
|
|
* Accelerator interface, specializes CPUClass
|
|
* This header is used only by target-specific code.
|
|
*
|
|
* Copyright 2021 SUSE LLC
|
|
*
|
|
* This work is licensed under the terms of the GNU GPL, version 2 or later.
|
|
* See the COPYING file in the top-level directory.
|
|
*/
|
|
|
|
#ifndef ACCEL_CPU_TARGET_H
|
|
#define ACCEL_CPU_TARGET_H
|
|
|
|
/*
|
|
* This header is used to define new accelerator-specific target-specific
|
|
* accelerator cpu subclasses.
|
|
* It uses CPU_RESOLVING_TYPE, so this is clearly target-specific.
|
|
*
|
|
* Do not try to use for any other purpose than the implementation of new
|
|
* subclasses in target/, or the accel implementation itself in accel/
|
|
*/
|
|
|
|
#include "qom/object.h"
|
|
#include "cpu.h"
|
|
|
|
#define TYPE_ACCEL_CPU "accel-" CPU_RESOLVING_TYPE
|
|
#define ACCEL_CPU_NAME(name) (name "-" TYPE_ACCEL_CPU)
|
|
typedef struct AccelCPUClass AccelCPUClass;
|
|
DECLARE_CLASS_CHECKERS(AccelCPUClass, ACCEL_CPU, TYPE_ACCEL_CPU)
|
|
|
|
typedef struct AccelCPUClass {
|
|
/*< private >*/
|
|
ObjectClass parent_class;
|
|
/*< public >*/
|
|
|
|
void (*cpu_class_init)(CPUClass *cc);
|
|
void (*cpu_instance_init)(CPUState *cpu);
|
|
bool (*cpu_target_realize)(CPUState *cpu, Error **errp);
|
|
} AccelCPUClass;
|
|
|
|
#endif /* ACCEL_CPU_H */
|