Commit 722f5b46 authored by Stephen Rothwell's avatar Stephen Rothwell Committed by Linus Torvalds

[PATCH] ppc64: remove debug_switch from the naca

The patch moves the debug_switch from the naca to a global variable.

Also, a couple of trivial naming tidy ups.
Signed-off-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 97215414
...@@ -56,7 +56,6 @@ ...@@ -56,7 +56,6 @@
#include <asm/dma.h> #include <asm/dma.h>
#include <asm/machdep.h> #include <asm/machdep.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/naca.h>
#include <asm/time.h> #include <asm/time.h>
#include <asm/nvram.h> #include <asm/nvram.h>
#include <asm/plpar_wrappers.h> #include <asm/plpar_wrappers.h>
...@@ -318,7 +317,7 @@ static void __init pSeries_discover_pic(void) ...@@ -318,7 +317,7 @@ static void __init pSeries_discover_pic(void)
else if (strstr(typep, "ppc-xicp")) else if (strstr(typep, "ppc-xicp"))
ppc64_interrupt_controller = IC_PPC_XIC; ppc64_interrupt_controller = IC_PPC_XIC;
else else
printk("initialize_naca: failed to recognize" printk("pSeries_discover_pic: failed to recognize"
" interrupt-controller\n"); " interrupt-controller\n");
break; break;
} }
......
...@@ -41,7 +41,6 @@ ...@@ -41,7 +41,6 @@
#include <asm/elf.h> #include <asm/elf.h>
#include <asm/machdep.h> #include <asm/machdep.h>
#include <asm/iSeries/LparData.h> #include <asm/iSeries/LparData.h>
#include <asm/naca.h>
#include <asm/paca.h> #include <asm/paca.h>
#include <asm/ppcdebug.h> #include <asm/ppcdebug.h>
#include <asm/time.h> #include <asm/time.h>
...@@ -113,6 +112,7 @@ int boot_cpuid = 0; ...@@ -113,6 +112,7 @@ int boot_cpuid = 0;
int boot_cpuid_phys = 0; int boot_cpuid_phys = 0;
dev_t boot_dev; dev_t boot_dev;
u64 ppc64_pft_size; u64 ppc64_pft_size;
u64 ppc64_debug_switch;
struct ppc64_caches ppc64_caches; struct ppc64_caches ppc64_caches;
...@@ -161,7 +161,7 @@ struct screen_info screen_info = { ...@@ -161,7 +161,7 @@ struct screen_info screen_info = {
*/ */
void __init ppcdbg_initialize(void) void __init ppcdbg_initialize(void)
{ {
naca->debug_switch = PPC_DEBUG_DEFAULT; /* | PPCDBG_BUSWALK | */ ppc64_debug_switch = PPC_DEBUG_DEFAULT; /* | PPCDBG_BUSWALK | */
/* PPCDBG_PHBINIT | PPCDBG_MM | PPCDBG_MMINIT | PPCDBG_TCEINIT | PPCDBG_TCE */; /* PPCDBG_PHBINIT | PPCDBG_MM | PPCDBG_MMINIT | PPCDBG_TCEINIT | PPCDBG_TCE */;
} }
...@@ -399,7 +399,7 @@ void __init early_setup(unsigned long dt_ptr) ...@@ -399,7 +399,7 @@ void __init early_setup(unsigned long dt_ptr)
DBG(" -> early_setup()\n"); DBG(" -> early_setup()\n");
/* /*
* Fill the default DBG level in naca (do we want to keep * Fill the default DBG level (do we want to keep
* that old mecanism around forever ?) * that old mecanism around forever ?)
*/ */
ppcdbg_initialize(); ppcdbg_initialize();
...@@ -453,17 +453,17 @@ void __init early_setup(unsigned long dt_ptr) ...@@ -453,17 +453,17 @@ void __init early_setup(unsigned long dt_ptr)
/* /*
* Initialize some remaining members of the naca and systemcfg structures * Initialize some remaining members of the ppc64_caches and systemcfg structures
* (at least until we get rid of them completely). This is mostly some * (at least until we get rid of them completely). This is mostly some
* cache informations about the CPU that will be used by cache flush * cache informations about the CPU that will be used by cache flush
* routines and/or provided to userland * routines and/or provided to userland
*/ */
static void __init initialize_naca(void) static void __init initialize_cache_info(void)
{ {
struct device_node *np; struct device_node *np;
unsigned long num_cpus = 0; unsigned long num_cpus = 0;
DBG(" -> initialize_naca()\n"); DBG(" -> initialize_cache_info()\n");
for (np = NULL; (np = of_find_node_by_type(np, "cpu"));) { for (np = NULL; (np = of_find_node_by_type(np, "cpu"));) {
num_cpus += 1; num_cpus += 1;
...@@ -530,7 +530,7 @@ static void __init initialize_naca(void) ...@@ -530,7 +530,7 @@ static void __init initialize_naca(void)
systemcfg->version.minor = SYSTEMCFG_MINOR; systemcfg->version.minor = SYSTEMCFG_MINOR;
systemcfg->processor = mfspr(SPRN_PVR); systemcfg->processor = mfspr(SPRN_PVR);
DBG(" <- initialize_naca()\n"); DBG(" <- initialize_cache_info()\n");
} }
static void __init check_for_initrd(void) static void __init check_for_initrd(void)
...@@ -591,7 +591,7 @@ void __init setup_system(void) ...@@ -591,7 +591,7 @@ void __init setup_system(void)
unflatten_device_tree(); unflatten_device_tree();
/* /*
* Fill the naca & systemcfg structures with informations * Fill the ppc64_caches & systemcfg structures with informations
* retreived from the device-tree. Need to be called before * retreived from the device-tree. Need to be called before
* finish_device_tree() since the later requires some of the * finish_device_tree() since the later requires some of the
* informations filled up here to properly parse the interrupt * informations filled up here to properly parse the interrupt
...@@ -600,7 +600,7 @@ void __init setup_system(void) ...@@ -600,7 +600,7 @@ void __init setup_system(void)
* routines like flush_icache_range (used by the hash init * routines like flush_icache_range (used by the hash init
* later on). * later on).
*/ */
initialize_naca(); initialize_cache_info();
#ifdef CONFIG_PPC_PSERIES #ifdef CONFIG_PPC_PSERIES
/* /*
...@@ -661,9 +661,8 @@ void __init setup_system(void) ...@@ -661,9 +661,8 @@ void __init setup_system(void)
printk("Starting Linux PPC64 %s\n", UTS_RELEASE); printk("Starting Linux PPC64 %s\n", UTS_RELEASE);
printk("-----------------------------------------------------\n"); printk("-----------------------------------------------------\n");
printk("naca = 0x%p\n", naca);
printk("ppc64_pft_size = 0x%lx\n", ppc64_pft_size); printk("ppc64_pft_size = 0x%lx\n", ppc64_pft_size);
printk("naca->debug_switch = 0x%lx\n", naca->debug_switch); printk("ppc64_debug_switch = 0x%lx\n", ppc64_debug_switch);
printk("ppc64_interrupt_controller = 0x%ld\n", ppc64_interrupt_controller); printk("ppc64_interrupt_controller = 0x%ld\n", ppc64_interrupt_controller);
printk("systemcfg = 0x%p\n", systemcfg); printk("systemcfg = 0x%p\n", systemcfg);
printk("systemcfg->platform = 0x%x\n", systemcfg->platform); printk("systemcfg->platform = 0x%x\n", systemcfg->platform);
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
#include <linux/types.h> #include <linux/types.h>
#include <asm/ppcdebug.h> #include <asm/ppcdebug.h>
#include <asm/processor.h> #include <asm/processor.h>
#include <asm/naca.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/machdep.h> #include <asm/machdep.h>
#include <asm/io.h> #include <asm/io.h>
...@@ -323,7 +322,7 @@ void udbg_printf(const char *fmt, ...) ...@@ -323,7 +322,7 @@ void udbg_printf(const char *fmt, ...)
/* Special print used by PPCDBG() macro */ /* Special print used by PPCDBG() macro */
void udbg_ppcdbg(unsigned long debug_flags, const char *fmt, ...) void udbg_ppcdbg(unsigned long debug_flags, const char *fmt, ...)
{ {
unsigned long active_debugs = debug_flags & naca->debug_switch; unsigned long active_debugs = debug_flags & ppc64_debug_switch;
if (active_debugs) { if (active_debugs) {
va_list ap; va_list ap;
...@@ -357,5 +356,5 @@ void udbg_ppcdbg(unsigned long debug_flags, const char *fmt, ...) ...@@ -357,5 +356,5 @@ void udbg_ppcdbg(unsigned long debug_flags, const char *fmt, ...)
unsigned long udbg_ifdebug(unsigned long flags) unsigned long udbg_ifdebug(unsigned long flags)
{ {
return (flags & naca->debug_switch); return (flags & ppc64_debug_switch);
} }
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
#include <asm/pgtable.h> #include <asm/pgtable.h>
#include <asm/mmu.h> #include <asm/mmu.h>
#include <asm/mmu_context.h> #include <asm/mmu_context.h>
#include <asm/naca.h>
#include <asm/paca.h> #include <asm/paca.h>
#include <asm/ppcdebug.h> #include <asm/ppcdebug.h>
#include <asm/cputable.h> #include <asm/cputable.h>
...@@ -2372,9 +2371,9 @@ static void debug_trace(void) ...@@ -2372,9 +2371,9 @@ static void debug_trace(void)
if (cmd == '\n') { if (cmd == '\n') {
/* show current state */ /* show current state */
unsigned long i; unsigned long i;
printf("naca->debug_switch = 0x%lx\n", naca->debug_switch); printf("ppc64_debug_switch = 0x%lx\n", ppc64_debug_switch);
for (i = 0; i < PPCDBG_NUM_FLAGS ;i++) { for (i = 0; i < PPCDBG_NUM_FLAGS ;i++) {
on = PPCDBG_BITVAL(i) & naca->debug_switch; on = PPCDBG_BITVAL(i) & ppc64_debug_switch;
printf("%02x %s %12s ", i, on ? "on " : "off", trace_names[i] ? trace_names[i] : ""); printf("%02x %s %12s ", i, on ? "on " : "off", trace_names[i] ? trace_names[i] : "");
if (((i+1) % 3) == 0) if (((i+1) % 3) == 0)
printf("\n"); printf("\n");
...@@ -2388,7 +2387,7 @@ static void debug_trace(void) ...@@ -2388,7 +2387,7 @@ static void debug_trace(void)
on = (cmd == '+'); on = (cmd == '+');
cmd = inchar(); cmd = inchar();
if (cmd == ' ' || cmd == '\n') { /* Turn on or off based on + or - */ if (cmd == ' ' || cmd == '\n') { /* Turn on or off based on + or - */
naca->debug_switch = on ? PPCDBG_ALL:PPCDBG_NONE; ppc64_debug_switch = on ? PPCDBG_ALL:PPCDBG_NONE;
printf("Setting all values to %s...\n", on ? "on" : "off"); printf("Setting all values to %s...\n", on ? "on" : "off");
if (cmd == '\n') return; if (cmd == '\n') return;
else cmd = skipbl(); else cmd = skipbl();
...@@ -2403,10 +2402,10 @@ static void debug_trace(void) ...@@ -2403,10 +2402,10 @@ static void debug_trace(void)
return; return;
} }
if (on) { if (on) {
naca->debug_switch |= PPCDBG_BITVAL(val); ppc64_debug_switch |= PPCDBG_BITVAL(val);
printf("enable debug %x %s\n", val, trace_names[val] ? trace_names[val] : ""); printf("enable debug %x %s\n", val, trace_names[val] ? trace_names[val] : "");
} else { } else {
naca->debug_switch &= ~PPCDBG_BITVAL(val); ppc64_debug_switch &= ~PPCDBG_BITVAL(val);
printf("disable debug %x %s\n", val, trace_names[val] ? trace_names[val] : ""); printf("disable debug %x %s\n", val, trace_names[val] ? trace_names[val] : "");
} }
cmd = skipbl(); cmd = skipbl();
......
...@@ -19,9 +19,6 @@ struct naca_struct { ...@@ -19,9 +19,6 @@ struct naca_struct {
void *xItVpdAreas; /* VPD Data 0x00 */ void *xItVpdAreas; /* VPD Data 0x00 */
void *xRamDisk; /* iSeries ramdisk 0x08 */ void *xRamDisk; /* iSeries ramdisk 0x08 */
u64 xRamDiskSize; /* In pages 0x10 */ u64 xRamDiskSize; /* In pages 0x10 */
u64 debug_switch; /* Debug print control 0x20 */
u64 banner; /* Ptr to banner string 0x28 */
u64 log; /* Ptr to log buffer 0x30 */
}; };
extern struct naca_struct *naca; extern struct naca_struct *naca;
......
...@@ -16,13 +16,14 @@ ...@@ -16,13 +16,14 @@
********************************************************************/ ********************************************************************/
#include <linux/config.h> #include <linux/config.h>
#include <linux/types.h>
#include <asm/udbg.h> #include <asm/udbg.h>
#include <stdarg.h> #include <stdarg.h>
#define PPCDBG_BITVAL(X) ((1UL)<<((unsigned long)(X))) #define PPCDBG_BITVAL(X) ((1UL)<<((unsigned long)(X)))
/* Defined below are the bit positions of various debug flags in the /* Defined below are the bit positions of various debug flags in the
* debug_switch variable (defined in naca.h). * ppc64_debug_switch variable.
* -- When adding new values, please enter them into trace names below -- * -- When adding new values, please enter them into trace names below --
* *
* Values 62 & 63 can be used to stress the hardware page table management * Values 62 & 63 can be used to stress the hardware page table management
...@@ -64,6 +65,8 @@ ...@@ -64,6 +65,8 @@
#define PPCDBG_NUM_FLAGS 64 #define PPCDBG_NUM_FLAGS 64
extern u64 ppc64_debug_switch;
#ifdef WANT_PPCDBG_TAB #ifdef WANT_PPCDBG_TAB
/* A table of debug switch names to allow name lookup in xmon /* A table of debug switch names to allow name lookup in xmon
* (and whoever else wants it. * (and whoever else wants it.
......
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