From: Richard Henderson <rth@twiddle.net>
To: qemu-devel@nongnu.org, "Paolo Bonzini" <pbonzini@redhat.com>,
"Peter Crosthwaite" <crosthwaite.peter@gmail.com>,
"Alex Bennée" <alex.bennee@linaro.org>
Subject: Re: [Qemu-devel] [PATCH v6 2/6] queue: Add macro for incremental traversal
Date: Mon, 26 Jun 2017 18:10:14 -0700 [thread overview]
Message-ID: <11b802c6-253c-1aaf-75d1-1f73e23c4d64@twiddle.net> (raw)
In-Reply-To: <877ezzapyu.fsf@frigg.lan>
On 06/26/2017 05:33 AM, Lluís Vilanova wrote:
> Richard Henderson writes:
>
>> On 06/12/2017 07:54 AM, Lluís Vilanova wrote:
>>> Adds macro QTAILQ_FOREACH_CONTINUE to support incremental list
>>> traversal.
>>>
>>> Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
>>> ---
>>> include/qemu/queue.h | 12 ++++++++++++
>>> 1 file changed, 12 insertions(+)
>>>
>>> diff --git a/include/qemu/queue.h b/include/qemu/queue.h
>>> index 35292c3155..eb2bf9cb1c 100644
>>> --- a/include/qemu/queue.h
>>> +++ b/include/qemu/queue.h
>>> @@ -415,6 +415,18 @@ struct { \
>>> (var); \
>>> (var) = ((var)->field.tqe_next))
>>> +/**
>>> + * QTAILQ_FOREACH_CONTINUE:
>>> + * @var: Variable to resume iteration from.
>>> + * @field: Field in @var holding a QTAILQ_ENTRY for this queue.
>>> + *
>>> + * Resumes iteration on a queue from the element in @var.
>>> + */
>>> +#define QTAILQ_FOREACH_CONTINUE(var, field) \
>>> + for ((var) = ((var)->field.tqe_next); \
>>> + (var); \
>>> + (var) = ((var)->field.tqe_next))
>>> +
>>> #define QTAILQ_FOREACH_SAFE(var, head, field, next_var) \
>>> for ((var) = ((head)->tqh_first); \
>>> (var) && ((next_var) = ((var)->field.tqe_next), 1); \
>>>
>>>
>
>> I still say this isn't required if the breakpoint loop is better structured.
>
> I can embed the use of QTAILQ into translate-block.c, but I wanted to keep the
> implementation of breakpoint lists hidden behind the cpu_breakpoint API.
I think using QTAILQ in the common main loop is better than twisting the logic
so that the loop is unnaturally split into a subroutine.
r~
next prev parent reply other threads:[~2017-06-27 1:10 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-12 14:53 [Qemu-devel] [RFC PATCH v6 0/6] translate: [tcg] Generic translation framework Lluís Vilanova
2017-06-12 14:53 ` [Qemu-devel] [PATCH v6 1/6] Pass generic CPUState to gen_intermediate_code() Lluís Vilanova
2017-06-13 1:40 ` David Gibson
2017-06-14 21:35 ` Eduardo Habkost
2017-06-14 22:30 ` Laurent Vivier
2017-06-16 14:07 ` Alex Bennée
2017-06-12 14:54 ` [Qemu-devel] [PATCH v6 2/6] queue: Add macro for incremental traversal Lluís Vilanova
2017-06-19 23:20 ` Richard Henderson
2017-06-26 12:33 ` Lluís Vilanova
2017-06-27 1:10 ` Richard Henderson [this message]
2017-06-27 9:13 ` Lluís Vilanova
2017-06-12 14:54 ` [Qemu-devel] [PATCH v6 3/6] target: [tcg] Add generic translation framework Lluís Vilanova
2017-06-15 22:05 ` [Qemu-devel] [PATCH] translator mega-patch Emilio G. Cota
2017-06-18 14:37 ` Lluís Vilanova
2017-06-18 18:26 ` Peter Maydell
2017-06-19 4:08 ` Emilio G. Cota
2017-06-19 7:15 ` Peter Maydell
2017-06-15 22:19 ` [Qemu-devel] [PATCH v6 3/6] target: [tcg] Add generic translation framework Emilio G. Cota
2017-06-15 23:25 ` Emilio G. Cota
2017-06-17 1:09 ` Emilio G. Cota
2017-06-18 14:24 ` Lluís Vilanova
2017-06-18 14:22 ` Lluís Vilanova
2017-06-18 15:47 ` Lluís Vilanova
2017-06-18 21:54 ` Lluís Vilanova
2017-06-19 4:10 ` Emilio G. Cota
2017-06-19 8:37 ` Lluís Vilanova
2017-06-18 14:20 ` Lluís Vilanova
2017-06-12 14:54 ` [Qemu-devel] [PATCH v6 4/6] target: [tcg] Redefine DISAS_* onto the generic translation framework (DJ_*) Lluís Vilanova
2017-06-12 14:54 ` [Qemu-devel] [PATCH v6 6/6] target: [tcg, arm] Port to generic translation framework Lluís Vilanova
2017-06-16 0:18 ` Emilio G. Cota
2017-06-18 14:41 ` Lluís Vilanova
2017-06-19 4:22 ` Emilio G. Cota
2017-06-15 18:02 ` [Qemu-devel] [RFC PATCH v6 0/6] translate: [tcg] Generic " Emilio G. Cota
2017-06-18 14:41 ` Lluís Vilanova
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=11b802c6-253c-1aaf-75d1-1f73e23c4d64@twiddle.net \
--to=rth@twiddle.net \
--cc=alex.bennee@linaro.org \
--cc=crosthwaite.peter@gmail.com \
--cc=pbonzini@redhat.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).