Subject: Re: NetBSD 1.3 panics on Sparc 5 when only option sun4m is defined
To: Brian Buhrow <buhrow@cats.ucsc.edu>
From: Paul Kranenburg <pk@cs.few.eur.nl>
List: port-sparc
Date: 01/26/1998 22:01:00
And here is the patch:


Index: iommureg.h
===================================================================
RCS file: /cvsroot/src/sys/arch/sparc/sparc/iommureg.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -c -r1.3 -r1.4
*** iommureg.h	1997/09/14 19:16:04	1.3
--- iommureg.h	1998/01/24 16:22:47	1.4
***************
*** 1,4 ****
! /*	$NetBSD: iommureg.h,v 1.3 1997/09/14 19:16:04 pk Exp $ */
  
  /*
   * Copyright (c) 1996
--- 1,4 ----
! /*	$NetBSD: iommureg.h,v 1.4 1998/01/24 16:22:47 pk Exp $ */
  
  /*
   * Copyright (c) 1996
***************
*** 59,69 ****
--- 59,77 ----
  #define IOMMU_FLPG_VADDR	0xfffff000
  #define IOMMU_FLUSH_MASK	0xfffff000
  
+ /*
+  * Read something back from the IOMMU control space after writing
+  * to a flush register to drain write buffers (?).   This seems to
+  * avoid utter lossage on some machines (SS4s & SS5s) where our caller
+  * would see some of its local (`%lx') registers trashed.
+  */
  #define IOMMU_FLUSHPAGE(sc, va)	do {				\
  	(sc)->sc_reg->io_flushpage = (va) & IOMMU_FLUSH_MASK;	\
+ 	(*(volatile u_int32_t *)&(sc)->sc_reg->io_bar);		\
  } while (0);
  #define IOMMU_FLUSHALL(sc)	do {				\
  	(sc)->sc_reg->io_flashclear = 0;			\
+ 	(*(volatile u_int32_t *)&(sc)->sc_reg->io_bar);		\
  } while (0)
  
  /* to pte.h ? */