Subject: possibly bugs ...
To: None <port-mac68k@NetBSD.ORG>
From: Taras Ivanenko <ivanenko@taras.mit.edu>
List: port-mac68k
Date: 10/20/1996 21:16:18
Here are two bits of code that do not look right for me. 

First, from via.c:add_nubus_intr(). If this function is called with
incorrect argument, the interrupt level is set to 'high'
permanently. Solution: check the arguments first, then mess with
interrupts.

Second, from mainbus.c:bus_mapin(). The local variable pmt is defined,
then used but never set to anything. I am not sure what the original
idea was, but we seem to be very fortunate that the value on stack or in
register assigned to 'pmt' is not very bad.

	Taras Ivanenko.


*** via.c	Sun Oct 20 16:04:04 1996
--- via.c~	Sat Oct 19 21:14:53 1996
***************
*** 292,298 ****
  	void (*func) __P((void *, int));
  	void *client_data;
  {
! 	int	s;
  
  	/*
  	 * Map Nubus slot 0 to "slot" 15; see note on Nubus slot
--- 292,298 ----
  	void (*func) __P((void *, int));
  	void *client_data;
  {
! 	int	s = splhigh();
  
  	/*
  	 * Map Nubus slot 0 to "slot" 15; see note on Nubus slot
***************
*** 300,309 ****
  	 */
  	if (slot == 0)
  		slot = 15;
! 	if (slot < 9 || slot > 15) 
  		return 0;
  
- 	s = splhigh();	
  	slotitab[slot-9] = func;
  	slotptab[slot-9] = client_data;
  
--- 300,308 ----
  	 */
  	if (slot == 0)
  		slot = 15;
! 	if (slot < 9 || slot > 15)
  		return 0;
  
  	slotitab[slot-9] = func;
  	slotptab[slot-9] = client_data;
  
*** mainbus.c	Sun Oct 20 11:59:49 1996
--- mainbus.c~	Mon Oct 14 12:11:48 1996
***************
*** 217,223 ****
  bus_mapin(bustype, paddr, sz)
  	int bustype, paddr, sz;
  {
! 	int off, pa, pmt=0;
  	vm_offset_t va, retval;
  
  	if (bustype != BUS_NUBUS)
--- 217,223 ----
  bus_mapin(bustype, paddr, sz)
  	int bustype, paddr, sz;
  {
! 	int off, pa, pmt;
  	vm_offset_t va, retval;
  
  	if (bustype != BUS_NUBUS)