[parisc-linux-cvs] Re: 2.6.7-rc1-pa3 cache/ASSERT
Grant Grundler
grundler at parisc-linux.org
Sun May 30 13:04:31 MDT 2004
On Sun, May 30, 2004 at 12:57:24PM -0600, Grant Grundler wrote:
> Log message:
> 2.6.7-rc1-pa3 more cache info and relocate ASSERT definition
> o add cache associativity output to /proc/cpuinfo
> o move ASSERT definition out of asm/pci.h and into the couple of files
> that use it. One can now clean up ASSERT usage and/or convert to BUG_ON
> one file at a time.
Trying to keep willy happy. :^P
(just teasing :^)
ASSERT really didn't belong in asm/pci.h but it was convenient for
me to put it there and I needed it at the time. The ASSERT is less
useful these days and it could be entirely removed if no one is doing
major devel. For SBA driver, I need to add "IOMMU bypass" support for
pa8800 (on ZX1) and thus don't want to strip it out of SBA yet.
Other files are candidates though.
The firmware tells us what the cache associativity is set to.
Just advertise that data in case it doesn't match what our
expectations are.
grant
Index: Makefile
===================================================================
RCS file: /var/cvs/linux-2.6/Makefile,v
retrieving revision 1.200
diff -u -p -r1.200 Makefile
--- Makefile 26 May 2004 18:23:57 -0000 1.200
+++ Makefile 30 May 2004 18:53:36 -0000
@@ -1,7 +1,7 @@
VERSION = 2
PATCHLEVEL = 6
SUBLEVEL = 7
-EXTRAVERSION =-rc1-pa2
+EXTRAVERSION =-rc1-pa3
NAME=Zonked Quokka
# *DOCUMENTATION*
Index: arch/parisc/kernel/cache.c
===================================================================
RCS file: /var/cvs/linux-2.6/arch/parisc/kernel/cache.c,v
retrieving revision 1.16
diff -u -p -r1.16 cache.c
--- arch/parisc/kernel/cache.c 24 May 2004 01:19:12 -0000 1.16
+++ arch/parisc/kernel/cache.c 30 May 2004 18:53:37 -0000
@@ -82,10 +82,11 @@ show_cache_info(struct seq_file *m)
{
seq_printf(m, "I-cache\t\t: %ld KB\n",
cache_info.ic_size/1024 );
- seq_printf(m, "D-cache\t\t: %ld KB (%s)%s\n",
+ seq_printf(m, "D-cache\t\t: %ld KB (%s%s, %d-way associative)\n",
cache_info.dc_size/1024,
(cache_info.dc_conf.cc_wt ? "WT":"WB"),
- (cache_info.dc_conf.cc_sh ? " - shared I/D":"")
+ (cache_info.dc_conf.cc_sh ? ", shared I/D":""),
+ (cache_info.dc_conf.cc_assoc)
);
seq_printf(m, "ITLB entries\t: %ld\n" "DTLB entries\t: %ld%s\n",
Index: arch/parisc/kernel/pci-dma.c
===================================================================
RCS file: /var/cvs/linux-2.6/arch/parisc/kernel/pci-dma.c,v
retrieving revision 1.4
diff -u -p -r1.4 pci-dma.c
--- arch/parisc/kernel/pci-dma.c 17 Mar 2004 12:15:10 -0000 1.4
+++ arch/parisc/kernel/pci-dma.c 30 May 2004 18:53:37 -0000
@@ -32,6 +32,19 @@
#include <asm/pgalloc.h>
#include <asm/uaccess.h>
+#ifdef DEBUG_PCI
+#undef ASSERT
+#define ASSERT(expr) \
+ if(!(expr)) { \
+ printk("\n%s:%d: Assertion " #expr " failed!\n", \
+ __FILE__, __LINE__); \
+ panic(#expr); \
+ }
+#else
+#define ASSERT(expr)
+#endif
+
+
static struct proc_dir_entry * proc_gsc_root = NULL;
static int pcxl_proc_info(char *buffer, char **start, off_t offset, int length);
static unsigned long pcxl_used_bytes = 0;
Index: drivers/parisc/lba_pci.c
===================================================================
RCS file: /var/cvs/linux-2.6/drivers/parisc/lba_pci.c,v
retrieving revision 1.10
diff -u -p -r1.10 lba_pci.c
--- drivers/parisc/lba_pci.c 10 Mar 2004 07:09:51 -0000 1.10
+++ drivers/parisc/lba_pci.c 30 May 2004 18:53:38 -0000
@@ -34,7 +34,6 @@
#include <linux/kernel.h>
#include <linux/spinlock.h>
#include <linux/init.h> /* for __init and __devinit */
-/* #define PCI_DEBUG enable ASSERT */
#include <linux/pci.h>
#include <linux/ioport.h>
#include <linux/slab.h>
@@ -88,6 +87,19 @@
#else
#define DBG_PAT(x...)
#endif
+
+#ifdef DEBUG_LBA
+#undef ASSERT
+#define ASSERT(expr) \
+ if(!(expr)) { \
+ printk("\n%s:%d: Assertion " #expr " failed!\n", \
+ __FILE__, __LINE__); \
+ panic(#expr); \
+ }
+#else
+#define ASSERT(expr)
+#endif
+
/*
** Config accessor functions only pass in the 8-bit bus number and not
Index: drivers/parisc/sba_iommu.c
===================================================================
RCS file: /var/cvs/linux-2.6/drivers/parisc/sba_iommu.c,v
retrieving revision 1.9
diff -u -p -r1.9 sba_iommu.c
--- drivers/parisc/sba_iommu.c 16 Mar 2004 15:40:23 -0000 1.9
+++ drivers/parisc/sba_iommu.c 30 May 2004 18:53:38 -0000
@@ -27,9 +27,7 @@
#include <linux/mm.h>
#include <linux/string.h>
-#undef PCI_DEBUG /* for ASSERT */
#include <linux/pci.h>
-#undef PCI_DEBUG
#include <asm/byteorder.h>
#include <asm/io.h>
@@ -54,6 +52,7 @@
** Don't even think about messing with it unless you have
** plenty of 710's to sacrifice to the computer gods. :^)
*/
+#undef DEBUG_SBA_ASSERT
#undef DEBUG_SBA_INIT
#undef DEBUG_SBA_RUN
#undef DEBUG_SBA_RUN_SG
@@ -88,6 +87,19 @@
#else
#define DBG_RES(x...)
#endif
+
+#ifdef DEBUG_SBA_ASSERT
+#undef ASSERT
+#define ASSERT(expr) \
+ if(!(expr)) { \
+ printk("\n%s:%d: Assertion " #expr " failed!\n", \
+ __FILE__, __LINE__); \
+ panic(#expr); \
+ }
+#else
+#define ASSERT(expr)
+#endif
+
/*
** The number of pdir entries to "free" before issueing
Index: include/asm-parisc/pci.h
===================================================================
RCS file: /var/cvs/linux-2.6/include/asm-parisc/pci.h,v
retrieving revision 1.8
diff -u -p -r1.8 pci.h
--- include/asm-parisc/pci.h 18 Feb 2004 15:54:57 -0000 1.8
+++ include/asm-parisc/pci.h 30 May 2004 18:53:39 -0000
@@ -16,28 +16,6 @@
*/
#define PCI_MAX_BUSSES 256
-/* [soapbox on]
-** Who the hell can develop stuff without ASSERT or VASSERT?
-** No one understands all the modules across all platforms.
-** For linux add another dimension - processor architectures.
-**
-** This should be a standard/global macro used liberally
-** in all code. Every respectable engineer I know in HP
-** would support this argument. - grant
-** [soapbox off]
-*/
-#ifdef PCI_DEBUG
-#define ASSERT(expr) \
- if(!(expr)) { \
- printk("\n%s:%d: Assertion " #expr " failed!\n", \
- __FILE__, __LINE__); \
- panic(#expr); \
- }
-#else
-#define ASSERT(expr)
-#endif
-
-
/*
** pci_hba_data (aka H2P_OBJECT in HP/UX)
**
More information about the parisc-linux-cvs
mailing list