qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: About "PC_MACHINE_CLASS" definition.


From: Liu Jaloo
Subject: Re: About "PC_MACHINE_CLASS" definition.
Date: Thu, 31 Aug 2023 15:41:47 +0800

Thanks a lot.

On Thu, Aug 31, 2023 at 2:11 PM Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
Hi,

On 31/8/23 05:15, Liu Jaloo wrote:
> Where actually defined the "PC_MACHINE_CLASS", I can't find it in source
> code, please help to point out the file.

It is defined in include/hw/i386/pc.h:

OBJECT_DECLARE_TYPE(PCMachineState, PCMachineClass, PC_MACHINE)

The macro itself is defined in include/qom/object.h:

/**
  * OBJECT_DECLARE_TYPE:
  * @InstanceType: instance struct name
  * @ClassType: class struct name
  * @MODULE_OBJ_NAME: the object name in uppercase with underscore
separators
  *
  * This macro is typically used in a header file, and will:
  *
  *   - create the typedefs for the object and class structs
  *   - register the type for use with g_autoptr
  *   - provide three standard type cast functions
  *
  * The object struct and class struct need to be declared manually.
  */

See the QOM documentation:

https://qemu-project.gitlab.io/qemu/devel/qom.html

Regards,

Phil.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]