qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: Michael Rolnik <mrolnik@gmail.com>, qemu-devel@nongnu.org
Cc: Michael Rolnik <rolnik@amazon.com>
Subject: Re: [Qemu-devel] [PATCH 02/10] target-avr: adding AVR CPU features/flavors
Date: Sat, 4 Jun 2016 13:02:03 -0700	[thread overview]
Message-ID: <edcd7c44-b663-3be3-d85c-a698e5b90b24@twiddle.net> (raw)
In-Reply-To: <1464898022-97990-2-git-send-email-rolnik@amazon.com>

On 06/02/2016 01:06 PM, Michael Rolnik wrote:
> Signed-off-by: Michael Rolnik <mrolnik@gmail.com>
> ---
>  target-avr/cpu.c | 326 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
>  target-avr/cpu.h |  59 ++++++++++
>  2 files changed, 383 insertions(+), 2 deletions(-)
>
> diff --git a/target-avr/cpu.c b/target-avr/cpu.c
> index ff26018..9be0a1d 100644
> --- a/target-avr/cpu.c
> +++ b/target-avr/cpu.c
> @@ -31,7 +31,7 @@ static void         avr_cpu_set_pc(
>  {
>      AVRCPU   *cpu = AVR_CPU(cs);
>
> -    cpu->env.pc = value / 2;    /*  internaly PC points to words, not bytes */
> +    cpu->env.pc = value / 2;    /*  internally PC points to words   */
>  }
>
>  static bool         avr_cpu_has_work(
> @@ -52,7 +52,7 @@ static void         avr_cpu_synchronize_from_tb(
>      AVRCPU      *cpu = AVR_CPU(cs);
>      CPUAVRState *env = &cpu->env;
>
> -    env->pc     = tb->pc / 2;
> +    env->pc     = tb->pc / 2;   /*  internally PC points to words   */

Fold these fixups into the previous patch.

> @@ -61,12 +61,14 @@ static void         avr_cpu_reset(
>      AVRCPU         *cpu = AVR_CPU(s);
>      AVRCPUClass    *mcc = AVR_CPU_GET_CLASS(cpu);
>      CPUAVRState    *env = &cpu->env;
> +    uint32_t        features    = env->features;
>
>      mcc->parent_reset(s);
>
>      memset(env, 0, sizeof(CPUAVRState));
>      env->pc         = 0;
>      env->sregI      = 1;
> +    env->features   = features;

As I said re patch 1, this is fixed by only clearing to before features.

> +}
> +static void         avr_avr6_initfn(

Blank line between functions.  Many examples.

> +static inline int avr_feature(
> +                                CPUAVRState        *env,
> +                                int                 feature)
> +{
> +    return (env->features & (1UL << feature)) != 0;

features is type uint32_t; you don't need UL, just U.

> +static inline void  avr_del_feature(
> +                                CPUAVRState        *env,
> +                                int                 feature)
> +{
> +    env->features   &= ~(1Ul << feature);
> +}

When would you ever delete a feature?  Seems like this would be forever unused.


r~

  reply	other threads:[~2016-06-04 20:02 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-02 20:06 [Qemu-devel] [PATCH 01/10] target-avr: AVR cores support is added. 1. basic CPU structure 2. registers 3. no instructions Michael Rolnik
2016-06-02 20:06 ` [Qemu-devel] [PATCH 02/10] target-avr: adding AVR CPU features/flavors Michael Rolnik
2016-06-04 20:02   ` Richard Henderson [this message]
2016-06-02 20:06 ` [Qemu-devel] [PATCH 03/10] target-avr: adding a sample AVR board Michael Rolnik
2016-06-02 20:06 ` [Qemu-devel] [PATCH 04/10] target-avr: adding instructions encodings Michael Rolnik
2016-06-04 22:17   ` Richard Henderson
2016-06-05  5:09     ` Michael Rolnik
2016-06-05 16:08       ` Richard Henderson
2016-06-02 20:06 ` [Qemu-devel] [PATCH 05/10] target-avr: adding AVR interrupt handling Michael Rolnik
2016-06-04 22:26   ` Richard Henderson
2016-06-05  5:10     ` Michael Rolnik
2016-06-02 20:06 ` [Qemu-devel] [PATCH 06/10] target-avr: adding helpers for IN, OUT, SLEEP, WBR & unsupported instructions Michael Rolnik
2016-06-04 22:48   ` Richard Henderson
2016-06-05  5:10     ` Michael Rolnik
2016-06-02 20:06 ` [Qemu-devel] [PATCH 07/10] target-avr: adding instruction decoder Michael Rolnik
2016-06-04 23:00   ` Richard Henderson
2016-06-05  5:18     ` Michael Rolnik
2016-06-02 20:07 ` [Qemu-devel] [PATCH 08/10] target-avr: adding instruction translation Michael Rolnik
2016-06-05  3:27   ` Richard Henderson
2016-06-05 21:47     ` Michael Rolnik
2016-06-05 23:34       ` Richard Henderson
2016-06-06  6:52         ` Michael Rolnik
2016-06-06 19:17           ` Richard Henderson
2016-06-06 19:34             ` Michael Rolnik
2016-06-02 20:07 ` [Qemu-devel] [PATCH 09/10] target-avr: updating translate.c to use instructions translation Michael Rolnik
2016-06-05  3:33   ` Richard Henderson
2016-06-05 21:49     ` Michael Rolnik
2016-06-02 20:07 ` [Qemu-devel] [PATCH 10/10] target-avr: fixing code style Michael Rolnik
2016-06-02 23:10   ` Peter Maydell
2016-06-04 17:41     ` Richard Henderson
2016-06-04 18:34       ` Michael Rolnik
2016-06-04 22:33         ` Richard Henderson
2016-06-05 12:27           ` Peter Maydell
2016-06-05  3:34   ` Richard Henderson
2016-06-04 19:55 ` [Qemu-devel] [PATCH 01/10] target-avr: AVR cores support is added. 1. basic CPU structure 2. registers 3. no instructions Richard Henderson
  -- strict thread matches above, loose matches on Subject: below --
2016-06-02 20:03 Michael Rolnik
2016-06-02 20:03 ` [Qemu-devel] [PATCH 02/10] target-avr: adding AVR CPU features/flavors Michael Rolnik

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=edcd7c44-b663-3be3-d85c-a698e5b90b24@twiddle.net \
    --to=rth@twiddle.net \
    --cc=mrolnik@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rolnik@amazon.com \
    /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).