All of lore.kernel.org
 help / color / mirror / Atom feed
* About "PC_MACHINE_CLASS" definition.
@ 2023-08-31  3:15 Liu Jaloo
  2023-08-31  6:11 ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 3+ messages in thread
From: Liu Jaloo @ 2023-08-31  3:15 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 122 bytes --]

Where actually defined the "PC_MACHINE_CLASS", I can't find it in source
code, please help to point out the file.
Thanks.

[-- Attachment #2: Type: text/html, Size: 178 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: About "PC_MACHINE_CLASS" definition.
  2023-08-31  3:15 About "PC_MACHINE_CLASS" definition Liu Jaloo
@ 2023-08-31  6:11 ` Philippe Mathieu-Daudé
  2023-08-31  7:41   ` Liu Jaloo
  0 siblings, 1 reply; 3+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-08-31  6:11 UTC (permalink / raw)
  To: Liu Jaloo, qemu-devel

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.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: About "PC_MACHINE_CLASS" definition.
  2023-08-31  6:11 ` Philippe Mathieu-Daudé
@ 2023-08-31  7:41   ` Liu Jaloo
  0 siblings, 0 replies; 3+ messages in thread
From: Liu Jaloo @ 2023-08-31  7:41 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé; +Cc: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1109 bytes --]

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.
>

[-- Attachment #2: Type: text/html, Size: 1601 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-08-31  7:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-31  3:15 About "PC_MACHINE_CLASS" definition Liu Jaloo
2023-08-31  6:11 ` Philippe Mathieu-Daudé
2023-08-31  7:41   ` Liu Jaloo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.