From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Atlas Khan <atlaskhan90@gmail.com>
Cc: qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] Some line of codes in a file that I cant understand
Date: Tue, 25 Feb 2014 14:44:06 +0000 [thread overview]
Message-ID: <20140225144406.GC3656@work-vm> (raw)
In-Reply-To: <CAN7x1o79u9ZL9SqZ=YMPe0SjEfxiYOeYb8W5g6DPbTsNJmaq=g@mail.gmail.com>
* Atlas Khan (atlaskhan90@gmail.com) wrote:
> I am watching i8259.c in \hw folder in QEMU. here is something like this
>
>
> static const VMStateDescription vmstate_pic = {
> .name = "i8259",
> .version_id = 1,
> .minimum_version_id = 1,
> .minimum_version_id_old = 1,
> .fields = (VMStateField[]) {
> VMSTATE_UINT8(last_irr, PicState),
> VMSTATE_UINT8(irr, PicState),
> VMSTATE_UINT8(imr, PicState),
> VMSTATE_UINT8(isr, PicState),
> VMSTATE_UINT8(priority_add, PicState),
> VMSTATE_UINT8(irq_base, PicSthisate),
> VMSTATE_UINT8(read_reg_select, PicState),
> VMSTATE_UINT8(poll, PicState),
> VMSTATE_UINT8(special_mask, PicState),
> VMSTATE_UINT8(init_state, PicState),
> VMSTATE_UINT8(auto_eoi, PicState),
> VMSTATE_UINT8(rotate_on_auto_eoi, PicState),
> VMSTATE_UINT8(special_fully_nested_mode, PicState),
> VMSTATE_UINT8(init4, PicState),
> VMSTATE_UINT8(single_mode, PicState),
> VMSTATE_UINT8(elcr, PicState),
> VMSTATE_END_OF_LIST()
> }
> };
>
> here what does this dot shows and what is this VMSTATE_UINT8 function?
The . is about assigning into named fields in a structure; it's just
neater than the old C way of having to keep all the fields in order.
See the def of VMStateDescription in include/migration/vmstate.h
The VMSTATE_UINT8 is a macro declaring that there is a byte/uint8 member
see ./include/migration/vmstate.h and docs/migration.txt for a bit
of a description.
Dave
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
prev parent reply other threads:[~2014-02-25 14:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-25 13:27 [Qemu-devel] Some line of codes in a file that I cant understand Atlas Khan
2014-02-25 14:44 ` Dr. David Alan Gilbert [this message]
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=20140225144406.GC3656@work-vm \
--to=dgilbert@redhat.com \
--cc=atlaskhan90@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).