Commit 43610b32 authored by Paul Mackerras's avatar Paul Mackerras Committed by Linus Torvalds

[PATCH] ppc64: update lparcfg to use seq_file

From: Will Schmidt <willschm@us.ibm.com>

This patch includes updates and cleanup for the PPC64 proc/lparcfg interface.
     - use seq_file's seq_printf for output
     - remove redundant e2a function. (use viopath.c's instead)
     - change to Kconfig to allow building as a module.
     - export required symbols from LparData.c

    Pass # 2 updates..
      - Per Pauls request I've removed the vpurr references, and left
	just a stub function get_purr().
      - this should apply clean to latest linus tree.  (test-applied against
	2.6.7-rc3).

    Pass # 3 updates...
      - Correcting my previously incorrect description of the
	lparcfg_count_active_processors() function..
	This is for the cases where we have some number of virtual
	processors that are different than the total number of threads
	in the system.  (i.e. systemcfg->processorcount isnt the desired
	value for partition_active_processors)
      - moved e2a function into its own file in arch/ppc64/lib.
      - changed lparcfg_count_active_processors() to use a while loop
	instead of a for loop.
      - removed redundant of_node_put in lparcfg_count_active_processors().
      - removed unneeded parms from get-system-parameter rtas_call.
Signed-off-by: default avatarWill Schmidt <willschm@us.ibm.com>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent bade7631
......@@ -225,7 +225,7 @@ config SCANLOG
depends on PPC_RTAS
config LPARCFG
bool "LPAR Configuration Data"
tristate "LPAR Configuration Data"
help
Provide system capacity information via human readable
<key word>=<value> pairs through a /proc/ppc64/lparcfg interface.
......
......@@ -10,6 +10,7 @@
#include <asm/page.h>
#include <stddef.h>
#include <linux/threads.h>
#include <linux/module.h>
#include <asm/processor.h>
#include <asm/ptrace.h>
#include <asm/naca.h>
......@@ -123,12 +124,14 @@ struct ItLpNaca itLpNaca = {
(u64)InstructionAccessSLB_Iseries /* 0x480 I-SLB */
}
};
EXPORT_SYMBOL(itLpNaca);
/* May be filled in by the hypervisor so cannot end up in the BSS */
struct ItIplParmsReal xItIplParmsReal __attribute__((__section__(".data")));
/* May be filled in by the hypervisor so cannot end up in the BSS */
struct ItExtVpdPanel xItExtVpdPanel __attribute__((__section__(".data")));
EXPORT_SYMBOL(xItExtVpdPanel);
#define maxPhysicalProcessors 32
......
This diff is collapsed.
......@@ -37,8 +37,10 @@
#include <linux/dma-mapping.h>
#include <linux/wait.h>
#include <linux/seq_file.h>
#include <linux/smp_lock.h>
#include <asm/hardirq.h>
#include <asm/system.h>
#include <asm/uaccess.h>
#include <asm/iSeries/LparData.h>
#include <asm/iSeries/HvLpEvent.h>
......@@ -108,85 +110,6 @@ static vio_event_handler_t *vio_handler[VIO_MAX_SUBTYPES];
#define VIOPATH_KERN_WARN KERN_WARNING "viopath: "
#define VIOPATH_KERN_INFO KERN_INFO "viopath: "
static unsigned char e2a(unsigned char x)
{
switch (x) {
case 0xF0:
return '0';
case 0xF1:
return '1';
case 0xF2:
return '2';
case 0xF3:
return '3';
case 0xF4:
return '4';
case 0xF5:
return '5';
case 0xF6:
return '6';
case 0xF7:
return '7';
case 0xF8:
return '8';
case 0xF9:
return '9';
case 0xC1:
return 'A';
case 0xC2:
return 'B';
case 0xC3:
return 'C';
case 0xC4:
return 'D';
case 0xC5:
return 'E';
case 0xC6:
return 'F';
case 0xC7:
return 'G';
case 0xC8:
return 'H';
case 0xC9:
return 'I';
case 0xD1:
return 'J';
case 0xD2:
return 'K';
case 0xD3:
return 'L';
case 0xD4:
return 'M';
case 0xD5:
return 'N';
case 0xD6:
return 'O';
case 0xD7:
return 'P';
case 0xD8:
return 'Q';
case 0xD9:
return 'R';
case 0xE2:
return 'S';
case 0xE3:
return 'T';
case 0xE4:
return 'U';
case 0xE5:
return 'V';
case 0xE6:
return 'W';
case 0xE7:
return 'X';
case 0xE8:
return 'Y';
case 0xE9:
return 'Z';
}
return ' ';
}
static int proc_viopath_show(struct seq_file *m, void *v)
{
char *buf;
......
......@@ -9,3 +9,9 @@ lib-y += copypage.o memcpy.o copyuser.o usercopy.o
# for non-SMP configs. Don't build the real versions.
lib-$(CONFIG_SMP) += locks.o
# e2a provides EBCDIC to ASCII conversions.
ifdef CONFIG_PPC_ISERIES
obj-$(CONFIG_PCI) += e2a.o
endif
/*
* arch/ppc64/lib/e2a.c
*
* EBCDIC to ASCII conversion
*
* This function moved here from arch/ppc64/kernel/viopath.c
*
* (C) Copyright 2000-2004 IBM Corporation
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) anyu later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include <linux/module.h>
unsigned char e2a(unsigned char x)
{
switch (x) {
case 0xF0:
return '0';
case 0xF1:
return '1';
case 0xF2:
return '2';
case 0xF3:
return '3';
case 0xF4:
return '4';
case 0xF5:
return '5';
case 0xF6:
return '6';
case 0xF7:
return '7';
case 0xF8:
return '8';
case 0xF9:
return '9';
case 0xC1:
return 'A';
case 0xC2:
return 'B';
case 0xC3:
return 'C';
case 0xC4:
return 'D';
case 0xC5:
return 'E';
case 0xC6:
return 'F';
case 0xC7:
return 'G';
case 0xC8:
return 'H';
case 0xC9:
return 'I';
case 0xD1:
return 'J';
case 0xD2:
return 'K';
case 0xD3:
return 'L';
case 0xD4:
return 'M';
case 0xD5:
return 'N';
case 0xD6:
return 'O';
case 0xD7:
return 'P';
case 0xD8:
return 'Q';
case 0xD9:
return 'R';
case 0xE2:
return 'S';
case 0xE3:
return 'T';
case 0xE4:
return 'U';
case 0xE5:
return 'V';
case 0xE6:
return 'W';
case 0xE7:
return 'X';
case 0xE8:
return 'Y';
case 0xE9:
return 'Z';
}
return ' ';
}
EXPORT_SYMBOL(e2a);
......@@ -128,6 +128,9 @@ static inline void flush_altivec_to_thread(struct task_struct *t)
}
#endif
/* EBCDIC -> ASCII conversion for [0-9A-Z] on iSeries */
extern unsigned char e2a(unsigned char);
extern struct task_struct *__switch_to(struct task_struct *,
struct task_struct *);
#define switch_to(prev, next, last) ((last) = __switch_to((prev), (next)))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment