accel-cpu-target.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * Accelerator interface, specializes CPUClass
  3. * This header is used only by target-specific code.
  4. *
  5. * Copyright 2021 SUSE LLC
  6. *
  7. * This work is licensed under the terms of the GNU GPL, version 2 or later.
  8. * See the COPYING file in the top-level directory.
  9. */
  10. #ifndef ACCEL_CPU_TARGET_H
  11. #define ACCEL_CPU_TARGET_H
  12. /*
  13. * This header is used to define new accelerator-specific target-specific
  14. * accelerator cpu subclasses.
  15. * It uses CPU_RESOLVING_TYPE, so this is clearly target-specific.
  16. *
  17. * Do not try to use for any other purpose than the implementation of new
  18. * subclasses in target/, or the accel implementation itself in accel/
  19. */
  20. #define TYPE_ACCEL_CPU "accel-" CPU_RESOLVING_TYPE
  21. #define ACCEL_CPU_NAME(name) (name "-" TYPE_ACCEL_CPU)
  22. typedef struct AccelCPUClass AccelCPUClass;
  23. DECLARE_CLASS_CHECKERS(AccelCPUClass, ACCEL_CPU, TYPE_ACCEL_CPU)
  24. typedef struct AccelCPUClass {
  25. /*< private >*/
  26. ObjectClass parent_class;
  27. /*< public >*/
  28. void (*cpu_class_init)(CPUClass *cc);
  29. void (*cpu_instance_init)(CPUState *cpu);
  30. bool (*cpu_target_realize)(CPUState *cpu, Error **errp);
  31. } AccelCPUClass;
  32. #endif /* ACCEL_CPU_H */