Subject: Exception in sun3_stop()
To: None <tsarna@endicor.com>
From: Gordon W. Ross <gwr@jericho.mc.com>
List: port-sun3
Date: 03/16/1994 11:11:52
> From: tsarna@endicor.com (Ty Sarna)
> Date: Tue, 15 Mar 1994 22:40:46 GMT
[...]
> the netbsd kernel gives me this (some stuff scrolled out the top of my
> buffer, but the important stuff is there):
> 
> context_allocate: for pmap e084f14
> context_allocate: pmap e084f14 associated with context e0807e8 num 0
> nfs_callrpc: rpc denied, errno=1
> nfs_boot_getfh: callrpc error=1
> panic: nfs_mountroot: getfh for root
> booting....
> sun3_stop: kernel ended deliberately
> sun3_stop: clock(0,0)
> pos
> Exception 0x74 at 0FEF54D8

That exception is caused by an NMI getting in while the original
vector table is being restored.  My prom console patches turned NMI
back on, and as a consequence of this, sun3_stop() needs to disable
NMI again before playing with the vector base register.  Fix follows:

*** arch/sun3/sun3/sun3_startup.c.orig	Tue Mar  1 06:21:55 1994
--- arch/sun3/sun3/sun3_startup.c	Wed Mar  9 21:17:37 1994
***************
*** 108,121 ****
  {
      unsigned int *new_vect;
      mon_printf("sun3_stop: kernel ended deliberately\n");
! /*    set_clk_mode(0, IREG_CLOCK_ENAB_5);*/
!     mon_printf("sun3_stop: clock(0,0)\n");
      setvbr(old_vector_table);
      new_vect = getvbr();
      mon_printf("post: nmi vec %x\n", new_vect[VEC_LEVEL_7_INT]);
! /*    set_clk_mode(IREG_CLOCK_ENAB_7,0);*/
      mon_printf("interrupt_reg_value: %x\n", *interrupt_reg);
-     mon_printf("sun3_stop: clock(7,1)\n");
      mon_exit_to_mon();
  }
  
--- 108,121 ----
  {
      unsigned int *new_vect;
      mon_printf("sun3_stop: kernel ended deliberately\n");
!     set_clk_mode(0, IREG_CLOCK_ENAB_5, 0);
!     mon_printf("sun3_stop: clock(0,5,0)\n");
      setvbr(old_vector_table);
      new_vect = getvbr();
      mon_printf("post: nmi vec %x\n", new_vect[VEC_LEVEL_7_INT]);
!     set_clk_mode(IREG_CLOCK_ENAB_7,0,1);
!     mon_printf("sun3_stop: clock(7,0,1)\n");
      mon_printf("interrupt_reg_value: %x\n", *interrupt_reg);
      mon_exit_to_mon();
  }
  

Gordon W. Ross  		Mercury Computer Systems
gwr@mc.com      		199 Riverneck Road
508-256-1300			Chelmsford, MA 01824-2820

------------------------------------------------------------------------------