qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>
To: Kaige Li <likaige@loongson.cn>
Cc: Aleksandar Rikalo <aleksandar.rikalo@syrmia.com>,
	Aurelien Jarno <aurelien@aurel32.net>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [PATCH 1/2] target/mips: Coding style update to fix checkpatch errors
Date: Thu, 13 Aug 2020 20:27:26 +0200	[thread overview]
Message-ID: <CAHiYmc45WM45Ug2jam0NGuFqGSMV6JpV5ZR5C=oji_RuZQBYiQ@mail.gmail.com> (raw)
In-Reply-To: <1597311707-27565-1-git-send-email-likaige@loongson.cn>

[-- Attachment #1: Type: text/plain, Size: 5720 bytes --]

On Thursday, August 13, 2020, Kaige Li <likaige@loongson.cn> wrote:

> This will help ensure that style guidelines are being maintained during
> subsequent changes.
>
> Signed-off-by: Kaige Li <likaige@loongson.cn>
> ---


Agreed.

Reviewed-by: Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>


>  target/mips/translate_init.inc.c | 61 ++++++++++++++++++++----------
> ----------
>  1 file changed, 31 insertions(+), 30 deletions(-)
>
> diff --git a/target/mips/translate_init.inc.c
> b/target/mips/translate_init.inc.c
> index 637cacc..0740819 100644
> --- a/target/mips/translate_init.inc.c
> +++ b/target/mips/translate_init.inc.c
> @@ -53,8 +53,7 @@
>
>  /***********************************************************
> ******************/
>  /* MIPS CPU definitions */
> -const mips_def_t mips_defs[] =
> -{
> +const mips_def_t mips_defs[] = {
>      {
>          .name = "4Kc",
>          .CP0_PRid = 0x00018000,
> @@ -766,8 +765,8 @@ const mips_def_t mips_defs[] =
>          .name = "Loongson-2E",
>          .CP0_PRid = 0x6302,
>          /* 64KB I-cache and d-cache. 4 way with 32 bit cache line size.
> */
> -        .CP0_Config0 = (0x1<<17) | (0x1<<16) | (0x1<<11) | (0x1<<8) |
> -                       (0x1<<5) | (0x1<<4) | (0x1<<1),
> +        .CP0_Config0 = (0x1 << 17) | (0x1 << 16) | (0x1 << 11) | (0x1 <<
> 8) |
> +                       (0x1 << 5) | (0x1 << 4) | (0x1 << 1),
>          /* Note: Config1 is only used internally,
>             Loongson-2E has only Config0.  */
>          .CP0_Config1 = (1 << CP0C1_FP) | (47 << CP0C1_MMU),
> @@ -786,8 +785,8 @@ const mips_def_t mips_defs[] =
>          .name = "Loongson-2F",
>          .CP0_PRid = 0x6303,
>          /* 64KB I-cache and d-cache. 4 way with 32 bit cache line size.
> */
> -        .CP0_Config0 = (0x1<<17) | (0x1<<16) | (0x1<<11) | (0x1<<8) |
> -                       (0x1<<5) | (0x1<<4) | (0x1<<1),
> +        .CP0_Config0 = (0x1 << 17) | (0x1 << 16) | (0x1 << 11) | (0x1 <<
> 8) |
> +                       (0x1 << 5) | (0x1 << 4) | (0x1 << 1),
>          /* Note: Config1 is only used internally,
>             Loongson-2F has only Config0.  */
>          .CP0_Config1 = (1 << CP0C1_FP) | (47 << CP0C1_MMU),
> @@ -932,19 +931,19 @@ void mips_cpu_list(void)
>  }
>
>  #ifndef CONFIG_USER_ONLY
> -static void no_mmu_init (CPUMIPSState *env, const mips_def_t *def)
> +static void no_mmu_init(CPUMIPSState *env, const mips_def_t *def)
>  {
>      env->tlb->nb_tlb = 1;
>      env->tlb->map_address = &no_mmu_map_address;
>  }
>
> -static void fixed_mmu_init (CPUMIPSState *env, const mips_def_t *def)
> +static void fixed_mmu_init(CPUMIPSState *env, const mips_def_t *def)
>  {
>      env->tlb->nb_tlb = 1;
>      env->tlb->map_address = &fixed_mmu_map_address;
>  }
>
> -static void r4k_mmu_init (CPUMIPSState *env, const mips_def_t *def)
> +static void r4k_mmu_init(CPUMIPSState *env, const mips_def_t *def)
>  {
>      env->tlb->nb_tlb = 1 + ((def->CP0_Config1 >> CP0C1_MMU) & 63);
>      env->tlb->map_address = &r4k_map_address;
> @@ -956,40 +955,41 @@ static void r4k_mmu_init (CPUMIPSState *env, const
> mips_def_t *def)
>      env->tlb->helper_tlbinvf = r4k_helper_tlbinvf;
>  }
>
> -static void mmu_init (CPUMIPSState *env, const mips_def_t *def)
> +static void mmu_init(CPUMIPSState *env, const mips_def_t *def)
>  {
>      env->tlb = g_malloc0(sizeof(CPUMIPSTLBContext));
>
>      switch (def->mmu_type) {
> -        case MMU_TYPE_NONE:
> -            no_mmu_init(env, def);
> -            break;
> -        case MMU_TYPE_R4000:
> -            r4k_mmu_init(env, def);
> -            break;
> -        case MMU_TYPE_FMT:
> -            fixed_mmu_init(env, def);
> -            break;
> -        case MMU_TYPE_R3000:
> -        case MMU_TYPE_R6000:
> -        case MMU_TYPE_R8000:
> -        default:
> -            cpu_abort(env_cpu(env), "MMU type not supported\n");
> +    case MMU_TYPE_NONE:
> +        no_mmu_init(env, def);
> +        break;
> +    case MMU_TYPE_R4000:
> +        r4k_mmu_init(env, def);
> +        break;
> +    case MMU_TYPE_FMT:
> +        fixed_mmu_init(env, def);
> +        break;
> +    case MMU_TYPE_R3000:
> +    case MMU_TYPE_R6000:
> +    case MMU_TYPE_R8000:
> +    default:
> +        cpu_abort(env_cpu(env), "MMU type not supported\n");
>      }
>  }
>  #endif /* CONFIG_USER_ONLY */
>
> -static void fpu_init (CPUMIPSState *env, const mips_def_t *def)
> +static void fpu_init(CPUMIPSState *env, const mips_def_t *def)
>  {
>      int i;
>
> -    for (i = 0; i < MIPS_FPU_MAX; i++)
> +    for (i = 0; i < MIPS_FPU_MAX; i++) {
>          env->fpus[i].fcr0 = def->CP1_fcr0;
> +    }
>
>      memcpy(&env->active_fpu, &env->fpus[0], sizeof(env->active_fpu));
>  }
>
> -static void mvp_init (CPUMIPSState *env, const mips_def_t *def)
> +static void mvp_init(CPUMIPSState *env, const mips_def_t *def)
>  {
>      env->mvp = g_malloc0(sizeof(CPUMIPSMVPContext));
>
> @@ -999,9 +999,10 @@ static void mvp_init (CPUMIPSState *env, const
> mips_def_t *def)
>         implemented, 5 TCs implemented. */
>      env->mvp->CP0_MVPConf0 = (1U << CP0MVPC0_M) | (1 << CP0MVPC0_TLBS) |
>                               (0 << CP0MVPC0_GS) | (1 << CP0MVPC0_PCP) |
> -// TODO: actually do 2 VPEs.
> -//                             (1 << CP0MVPC0_TCA) | (0x1 <<
> CP0MVPC0_PVPE) |
> -//                             (0x04 << CP0MVPC0_PTC);
> +/* TODO: actually do 2 VPEs.
> + *                            (1 << CP0MVPC0_TCA) | (0x1 <<
> CP0MVPC0_PVPE) |
> + *                            (0x04 << CP0MVPC0_PTC);
> + */
>                               (1 << CP0MVPC0_TCA) | (0x0 << CP0MVPC0_PVPE)
> |
>                               (0x00 << CP0MVPC0_PTC);
>  #if !defined(CONFIG_USER_ONLY)
> --
> 2.1.0
>
>

[-- Attachment #2: Type: text/html, Size: 7742 bytes --]

      parent reply	other threads:[~2020-08-13 18:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-13  9:41 [PATCH 1/2] target/mips: Coding style update to fix checkpatch errors Kaige Li
2020-08-13  9:41 ` [PATCH 2/2] target/mips: Add definition of Loongson-3A3000 CPU Kaige Li
2020-08-13 10:37   ` Jiaxun Yang
2020-08-14  2:43     ` Kaige Li
2020-08-14  2:48       ` Jiaxun Yang
2020-08-20  7:44         ` Kaige Li
2020-08-13 18:27 ` Aleksandar Markovic [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='CAHiYmc45WM45Ug2jam0NGuFqGSMV6JpV5ZR5C=oji_RuZQBYiQ@mail.gmail.com' \
    --to=aleksandar.qemu.devel@gmail.com \
    --cc=aleksandar.rikalo@syrmia.com \
    --cc=aurelien@aurel32.net \
    --cc=likaige@loongson.cn \
    --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).