summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Viro <viro@www.linux.org.uk>2004-07-26 07:03:51 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-07-26 07:03:51 -0700
commit32df7c9eff2deb4dba46ee9e6de2f64f146cbeb2 (patch)
tree50f208e1e92707560e74effc44fe62003678e372
parentc86b222c095265cf5df75328cbea99bb6da40b5f (diff)
[PATCH] asm-ppc/reg.h namespace pollution fixes
asm-ppc/reg.h defines pollutes namespace like there's no tomorrow; among other things there are LR SR0...SR15 DEC etc. That breaks quite a few drivers that should otherwise work on ppc. SR... and LR were never used by ppc code; commented out in reg.h (note that they are just aliases for SPRN_SR... and SPRN_LR). RPA commented out and its instances in ppc code (all four of them) replaced with SPRN_RPA. Ditto for DEC. The rest of the offenders (DAR and PVR) are left alone for now and #undef'ed in drivers in question. We probably want to rip all these guys out of reg.h and convert ppc users to SPRN_... forms - file ends up included in alot of places and namespace pollution like that is a Bad Thing(tm). Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--arch/ppc/kernel/head.S6
-rw-r--r--arch/ppc64/kernel/head.S2
-rw-r--r--drivers/char/pcmcia/synclink_cs.c5
-rw-r--r--drivers/char/synclinkmp.c4
-rw-r--r--include/asm-ppc/reg.h8
-rw-r--r--include/asm-ppc64/processor.h2
6 files changed, 19 insertions, 8 deletions
diff --git a/arch/ppc/kernel/head.S b/arch/ppc/kernel/head.S
index a7bb502329de..121978c19abe 100644
--- a/arch/ppc/kernel/head.S
+++ b/arch/ppc/kernel/head.S
@@ -552,7 +552,7 @@ InstructionTLBMiss:
rlwimi r3,r3,32-1,31,31 /* _PAGE_USER -> PP lsb */
ori r1,r1,0xe14 /* clear out reserved bits and M */
andc r1,r3,r1 /* PP = user? (rw&dirty? 2: 3): 0 */
- mtspr RPA,r1
+ mtspr SPRN_RPA,r1
mfspr r3,IMISS
tlbli r3
mfspr r3,SRR1 /* Need to restore CR0 */
@@ -626,7 +626,7 @@ DataLoadTLBMiss:
rlwimi r3,r3,32-1,31,31 /* _PAGE_USER -> PP lsb */
ori r1,r1,0xe14 /* clear out reserved bits and M */
andc r1,r3,r1 /* PP = user? (rw&dirty? 2: 3): 0 */
- mtspr RPA,r1
+ mtspr SPRN_RPA,r1
mfspr r3,DMISS
tlbld r3
mfspr r3,SRR1 /* Need to restore CR0 */
@@ -694,7 +694,7 @@ DataStoreTLBMiss:
rlwimi r3,r3,32-1,30,30 /* _PAGE_USER -> PP msb */
li r1,0xe15 /* clear out reserved bits and M */
andc r1,r3,r1 /* PP = user? 2: 0 */
- mtspr RPA,r1
+ mtspr SPRN_RPA,r1
mfspr r3,DMISS
tlbld r3
mfspr r3,SRR1 /* Need to restore CR0 */
diff --git a/arch/ppc64/kernel/head.S b/arch/ppc64/kernel/head.S
index 5163f68dbb10..f00918b02bce 100644
--- a/arch/ppc64/kernel/head.S
+++ b/arch/ppc64/kernel/head.S
@@ -683,7 +683,7 @@ Decrementer_Iseries_masked:
li r11,1
stb r11,PACALPPACA+LPPACADECRINT(r13)
lwz r12,PACADEFAULTDECR(r13)
- mtspr DEC,r12
+ mtspr SPRN_DEC,r12
/* fall through */
.globl HardwareInterrupt_Iseries_masked
diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c
index adfd48e298a8..2df2f2a6a196 100644
--- a/drivers/char/pcmcia/synclink_cs.c
+++ b/drivers/char/pcmcia/synclink_cs.c
@@ -257,6 +257,11 @@ typedef struct _mgslpc_info {
#define CHA 0x00 /* channel A offset */
#define CHB 0x40 /* channel B offset */
+
+/*
+ * FIXME: PPC has PVR defined in asm/reg.h. For now we just undef it.
+ */
+#undef PVR
#define RXFIFO 0
#define TXFIFO 0
diff --git a/drivers/char/synclinkmp.c b/drivers/char/synclinkmp.c
index bb3702c4fe78..1361ea04151c 100644
--- a/drivers/char/synclinkmp.c
+++ b/drivers/char/synclinkmp.c
@@ -361,6 +361,10 @@ typedef struct _synclinkmp_info {
#define TMCS 0x64
#define TEPR 0x65
+/*
+ * FIXME: DAR here clashed with asm-ppc/reg.h and asm-sh/.../dma.h
+ */
+#undef DAR
/* DMA Controller Register macros */
#define DAR 0x80
#define DARL 0x80
diff --git a/include/asm-ppc/reg.h b/include/asm-ppc/reg.h
index 15c93af4079a..73eab4528eb9 100644
--- a/include/asm-ppc/reg.h
+++ b/include/asm-ppc/reg.h
@@ -350,7 +350,7 @@
#define DBAT6U SPRN_DBAT6U /* Data BAT 6 Upper Register */
#define DBAT7L SPRN_DBAT7L /* Data BAT 7 Lower Register */
#define DBAT7U SPRN_DBAT7U /* Data BAT 7 Upper Register */
-#define DEC SPRN_DEC /* Decrement Register */
+//#define DEC SPRN_DEC /* Decrement Register */
#define DMISS SPRN_DMISS /* Data TLB Miss Register */
#define DSISR SPRN_DSISR /* Data Storage Interrupt Status Register */
#define EAR SPRN_EAR /* External Address Register */
@@ -380,9 +380,9 @@
#define IMMR SPRN_IMMR /* PPC 860/821 Internal Memory Map Register */
#define L2CR SPRN_L2CR /* Classic PPC L2 cache control register */
#define L3CR SPRN_L3CR /* PPC 745x L3 cache control register */
-#define LR SPRN_LR
+//#define LR SPRN_LR
#define PVR SPRN_PVR /* Processor Version */
-#define RPA SPRN_RPA /* Required Physical Address Register */
+//#define RPA SPRN_RPA /* Required Physical Address Register */
#define SDR1 SPRN_SDR1 /* MMU hash base register */
#define SPR0 SPRN_SPRG0 /* Supervisor Private Registers */
#define SPR1 SPRN_SPRG1
@@ -489,6 +489,7 @@
#define SVR_8555E 0x80790000
#define SVR_8560 0x80700000
+#if 0
/* Segment Registers */
#define SR0 0
#define SR1 1
@@ -506,6 +507,7 @@
#define SR13 13
#define SR14 14
#define SR15 15
+#endif
/* Macros for setting and retrieving special purpose registers */
#ifndef __ASSEMBLY__
diff --git a/include/asm-ppc64/processor.h b/include/asm-ppc64/processor.h
index 341c9513a67c..d5e383732c5c 100644
--- a/include/asm-ppc64/processor.h
+++ b/include/asm-ppc64/processor.h
@@ -348,7 +348,7 @@
#define PVR SPRN_PVR /* Processor Version */
#define PIR SPRN_PIR /* Processor ID */
#define PURR SPRN_PURR /* Processor Utilization of Resource Register */
-#define RPA SPRN_RPA /* Required Physical Address Register */
+//#define RPA SPRN_RPA /* Required Physical Address Register */
#define SDR1 SPRN_SDR1 /* MMU hash base register */
#define SPR0 SPRN_SPRG0 /* Supervisor Private Registers */
#define SPR1 SPRN_SPRG1