summaryrefslogtreecommitdiffstats
path: root/sys/sparc64/include/cache.h
diff options
context:
space:
mode:
authorjake <jake@FreeBSD.org>2003-11-11 06:41:54 +0000
committerjake <jake@FreeBSD.org>2003-11-11 06:41:54 +0000
commit47e6302cb24801f5fa8e757115fb1c2da29bc0a3 (patch)
treec3fd2c7f5c0070c940ad4c69ea1d708eeec1d0f1 /sys/sparc64/include/cache.h
parenta1d40b05dca6a04066d9767cfd93c1af0ec26774 (diff)
downloadFreeBSD-src-47e6302cb24801f5fa8e757115fb1c2da29bc0a3.zip
FreeBSD-src-47e6302cb24801f5fa8e757115fb1c2da29bc0a3.tar.gz
Fix a bug in the data access error recorvery. Before re-enabling the data
cache after a data access error we must discard all cache lines. When disabled existing cache lines are not invalidated by stores to memory, so we risk reading stale data that was cached before the data access error if we don't flush them. This is especially fatal when the memory involved is the active part of the kernel or user stack. For good measure we also flush the instruction cache. This fixes random crashes when the X server probes the PCI bus through /dev/pci.
Diffstat (limited to 'sys/sparc64/include/cache.h')
-rw-r--r--sys/sparc64/include/cache.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/sparc64/include/cache.h b/sys/sparc64/include/cache.h
index 94c65e5..7c97705 100644
--- a/sys/sparc64/include/cache.h
+++ b/sys/sparc64/include/cache.h
@@ -97,16 +97,25 @@ struct cacheinfo {
#ifdef _KERNEL
+typedef void cache_enable_t(void);
+typedef void cache_flush_t(void);
typedef void dcache_page_inval_t(vm_paddr_t pa);
typedef void icache_page_inval_t(vm_paddr_t pa);
void cache_init(phandle_t node);
+cache_enable_t cheetah_cache_enable;
+cache_flush_t cheetah_cache_flush;
dcache_page_inval_t cheetah_dcache_page_inval;
icache_page_inval_t cheetah_icache_page_inval;
+
+cache_enable_t spitfire_cache_enable;
+cache_flush_t spitfire_cache_flush;
dcache_page_inval_t spitfire_dcache_page_inval;
icache_page_inval_t spitfire_icache_page_inval;
+extern cache_enable_t *cache_enable;
+extern cache_flush_t *cache_flush;
extern dcache_page_inval_t *dcache_page_inval;
extern icache_page_inval_t *icache_page_inval;
OpenPOWER on IntegriCloud