qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC PATCH] arm boot: added QOM device definition


From: Paul Brook
Subject: Re: [Qemu-devel] [RFC PATCH] arm boot: added QOM device definition
Date: Thu, 9 Feb 2012 12:03:45 +0000
User-agent: KMail/1.13.7 (Linux/3.1.0-1-amd64; KDE/4.6.5; x86_64; ; )

>     /* multicore boards that use the default secondary core boot functions
>      * can ignore these two function calls. If the default functions won't
>      * work, then write_secondary_boot() should write a suitable blob of
>      * code mimicing the secondary CPU startup process used by the board's
>      * boot loader/boot ROM code, and secondary_cpu_reset_hook() should
>      * perform any necessary CPU reset handling and set the PC for thei
>      * secondary CPUs to point at this boot blob.
>      */
>     void (*write_secondary_boot)(CPUState *env,
>                                  const struct arm_boot_info *info);
>     void (*secondary_cpu_reset_hook)(CPUState *env,
>                                      const struct arm_boot_info *info);
> };
> 
> The addresses, ints and string are easy, but the hard ones are the
> callbacks. The qdev ptr is a possible implementation but I see a movement
> away from that. I guess the solution is to provide an abstraction through
> QOM no? The boards that need to implement their own secondary
> boot-loop/reset (theres only 1) or atag boot sequence (again only 1) create
> an object that inherits for the arm boot device and instantiate that?

This sounds like an ideal use-case for derived classes and virtual functions.

Paul



reply via email to

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