From: Markus Armbruster <armbru@redhat.com>
To: Blue Swirl <blauwirbel@gmail.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 1/4] Confine use of global rtc_state to PC CMOS functions
Date: Tue, 19 May 2009 08:56:34 +0200 [thread overview]
Message-ID: <87pre5twbh.fsf@pike.pond.sub.org> (raw)
In-Reply-To: <f43fc5580905050922t1ce4d707n5a668ed5a2ceb3e2@mail.gmail.com> (Blue Swirl's message of "Tue\, 5 May 2009 19\:22\:33 +0300")
Sorry for the sloooow respons, I was on vacation.
Blue Swirl <blauwirbel@gmail.com> writes:
> On 5/4/09, Markus Armbruster <armbru@redhat.com> wrote:
>> Blue Swirl <blauwirbel@gmail.com> writes:
>>
>> > On 4/30/09, Markus Armbruster <armbru@redhat.com> wrote:
>> >> Pass the state as argument to cmos_init() and cmos_init_hd().
>> >> cmos_init() still needs to save it in rtc_state for use by
>> >> cmos_set_s3_resume().
>> >
>> > pc.c could pass acpi an opaque handle (former rtc_state) at init or
>> > acpi could export a function to set the handle, called by pc.c. Then
>> > cmos_set_s3_resume could take a state parameter.
>>
>>
>> We'd just move a global variable from pc.c to acpi.c, wouldn't we?
>> Could you explain why that's a better place?
>
> No, acpi would only have an opaque pointer to the variable stored in
> PIIX4PMState, the "owner" would still be pc.c.
Okay, so we'd just move a global variable from pc.c into only instance
of struct PIIX4PMState, referenced from a global variable in acpi.c.
The fact that it becomes opaque in the process isn't much of an
improvement, isn't it?
>> Passing rtc_state to piix4_pm_init() doesn't work well for pcdt.c,
>> because we'd have to pass it from RTC device to PIIX3 ACPI device
>> somehow, creating one of those ugly "non-tree" device dependencies,
>> i.e. one that doesn't follow device tree or interrupt tree edges. Your
>> other idea (a function to set the handle) allows me to keep the two
>> devices decoupled, provided I can set the handle even before
>> piix4_pm_init().
>
> Still one idea: a signal (qemu_irq) could be used to convey the s3
> resume condition. That may be another tree.
Hmm.
How does the hardware do it? Does it update CMOS all by itself?
> Setting the handle before piix4_pm_init will fail if the handle is
> going to be stored in PIIX4PMState,
Correct.
> but the setup can be reversed:
> piix4_pm_init can call a function to get the handle.
Where from?
A global variable in pc.c? But then we create global state in acpi.c
without reducing it in pc.c.
In the context of pcdt.c: creates the same non-tree device dependency,
only in the opposite direction.
next prev parent reply other threads:[~2009-05-19 6:56 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1241106809.git.armbru@redhat.com>
2009-04-30 16:03 ` [Qemu-devel] [PATCH 1/4] Confine use of global rtc_state to PC CMOS functions Markus Armbruster
2009-05-01 17:27 ` Blue Swirl
2009-05-04 13:54 ` Markus Armbruster
2009-05-05 16:22 ` Blue Swirl
2009-05-19 6:56 ` Markus Armbruster [this message]
2009-05-19 16:51 ` Blue Swirl
2009-05-19 16:57 ` Avi Kivity
2009-04-30 16:03 ` [Qemu-devel] [PATCH 2/4] Remove global floppy_controller Markus Armbruster
2009-05-01 17:31 ` Blue Swirl
2009-04-30 16:03 ` [Qemu-devel] [PATCH 3/4] Give parse_macaddr() external linkage Markus Armbruster
2009-04-30 16:03 ` [Qemu-devel] [PATCH 4/4] Machine description as data Markus Armbruster
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87pre5twbh.fsf@pike.pond.sub.org \
--to=armbru@redhat.com \
--cc=blauwirbel@gmail.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.