linux-mips
[Top] [All Lists]

Re: Distincting very similar CPUs in cpu-probe.c

To: linux-mips@linux-mips.org
Subject: Re: Distincting very similar CPUs in cpu-probe.c
From: Rafał Miłecki <zajec5@gmail.com>
Date: Wed, 30 Jan 2013 11:03:12 +0100
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type:content-transfer-encoding; bh=rAXCAA2JHZfj+v3E4mNd+SUCKjpQfIGloWVU8qQUDho=; b=oJvq2ajomS4G1N19JOrAhFKAYrpZX5RRWpilfC3wtuBOJjP1MfvC2hSsYnVmrxvxy5 JkaxJRPpE2HFFbsp+hYS/MdKVDhE99gG0Yazm+JGzlnu7hQAZL1dCBe4lVA3kw/ty6yZ TdKOd6z3DwDS3tGe/+1rCoTSbaWpcxKafJAxefc6GHJw0APjHBpL+OIPROCOYaqFOzrx KjuRkwrj2DRfZVkxazZalvkcZ6p7X4tC0uwG+cjaxQfIo27YDeOBwEgBFiY8mxh8cQO7 kSYtZMGp8fxQ9F2Bp9eJQby1MBEgcTNC2DBVPChQgy6WgQWIEsM5Vz3m2WDmzLtlDROr kU+w==
In-reply-to: <CACna6ryTefwz2McxQOaafwsGJJA7Kf46TYAP+BqGLxirYrEP7A@mail.gmail.com>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
References: <CACna6ryTefwz2McxQOaafwsGJJA7Kf46TYAP+BqGLxirYrEP7A@mail.gmail.com>
Sender: linux-mips-bounce@linux-mips.org
2013/1/30 Rafał Miłecki <zajec5@gmail.com>:
> I can see current code in cpu-probe.c handles some (very slightly)
> different CPUs in the same way:
>
> case PRID_IMP_24K:
> case PRID_IMP_24KE:
>         c->cputype = CPU_24K;
>         __cpu_name[cpu] = "MIPS 24Kc";
>         break;
>
> There is almost nothing wrong about this, but setting the same name is
> a little confusing for users. I wish to see different names in
> /proc/cpuinfo for PRID_IMP_24K==24Kc and PRID_IMP_24KE==24KEc.
>
> Is there a preferred way of handling this? The simplest one seems to
> be using separated "cases" while still using CPU_24K:
> case PRID_IMP_24K:
>         c->cputype = CPU_24K;
>         __cpu_name[cpu] = "MIPS 24Kc";
>         break;
> case PRID_IMP_24KE:
>         c->cputype = CPU_24K;
>         __cpu_name[cpu] = "MIPS 24KEc";
>         break;
>
> What do you think about this? Is this acceptable?
>
> For some reason I'm not aware of you may prefer adding CPU_24KE at the
> same time. Does it make any sense?

Yet another option would be to use
__cpu_name[cpu] = "MIPS 24Kc / MIPS 24KEc";

User still won't know which CPU he has, but at least we won't make
aware MIPS 24KEc owners confused.

-- 
Rafał

<Prev in Thread] Current Thread [Next in Thread>