[PATCH] show -1 for physical_id of non-present cpus
Nathan Lynch
nathanl at austin.ibm.com
Fri Jan 28 08:26:01 EST 2005
On Thu, 2005-01-27 at 13:27 +1100, Paul Mackerras wrote:
> Olof Johansson writes:
>
> > Nathan Lynch wrote:
> >
> > >Make the physical_id cpu attribute on ppc64 show -1 instead of 65535
> > >for non-present cpus.
> > >
> >
> > Good catch.
> >
> > I'm not sure if I prefer your patch or just switching hw_cpu_id to a s16
> > and using %d. Either way is fine with me.
>
> Changing hw_cpu_id to a signed quantity sounds cleaner to me.
OK.
Make the physical_id cpu sysfs attribute on ppc64 show -1 instead of
65535 for non-present cpus.
Signed-off-by: Nathan Lynch <nathanl at austin.ibm.com>
---
diff -puN arch/ppc64/kernel/sysfs.c~make-cpu-physical_id-signed arch/ppc64/kernel/sysfs.c
--- linux-2.6.11-rc2-mm1/arch/ppc64/kernel/sysfs.c~make-cpu-physical_id-signed 2005-01-27 15:03:16.000000000 -0600
+++ linux-2.6.11-rc2-mm1-nathanl/arch/ppc64/kernel/sysfs.c 2005-01-27 15:05:12.000000000 -0600
@@ -387,7 +387,7 @@ static ssize_t show_physical_id(struct s
{
struct cpu *cpu = container_of(dev, struct cpu, sysdev);
- return sprintf(buf, "%u\n", get_hard_smp_processor_id(cpu->sysdev.id));
+ return sprintf(buf, "%d\n", get_hard_smp_processor_id(cpu->sysdev.id));
}
static SYSDEV_ATTR(physical_id, 0444, show_physical_id, NULL);
diff -puN include/asm-ppc64/paca.h~make-cpu-physical_id-signed include/asm-ppc64/paca.h
--- linux-2.6.11-rc2-mm1/include/asm-ppc64/paca.h~make-cpu-physical_id-signed 2005-01-27 15:04:14.000000000 -0600
+++ linux-2.6.11-rc2-mm1-nathanl/include/asm-ppc64/paca.h 2005-01-27 15:04:51.000000000 -0600
@@ -68,7 +68,7 @@ struct paca_struct {
u64 stab_real; /* Absolute address of segment table */
u64 stab_addr; /* Virtual address of segment table */
void *emergency_sp; /* pointer to emergency stack */
- u16 hw_cpu_id; /* Physical processor number */
+ s16 hw_cpu_id; /* Physical processor number */
u8 cpu_start; /* At startup, processor spins until */
/* this becomes non-zero. */
_
More information about the Linuxppc64-dev
mailing list