Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Apr 1995 19:13:09 -0400 (EDT)
From:      "Jonathan M. Bresler" <jmb@kryten.Atinc.COM>
To:        "Jordan K. Hubbard" <jkh@freefall.cdrom.com>
Cc:        Bruce Evans <bde@zeta.org.au>, ache@astral.msk.su, rgrimes@gndrsh.aac.dev.com, freebsd-current@freefall.cdrom.com
Subject:   Re: Strange kernel printf... 
Message-ID:  <Pine.3.89.9504061902.A5004-0100000@kryten.atinc.com>
In-Reply-To: <9774.797139762@freefall.cdrom.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 5 Apr 1995, Jordan K. Hubbard wrote:
> 2. Accept a somewhat altered config file specification:
> 
> device <foo> at <bus>[#|?] port <port>[,<port> ..] irq <irq>[,<irq> ..] drq <drq>[, <drq> ..]
> 	[conflict_ok <conflict_type>[, <conflict-type> ..]]
> 
> Where "conflict_ok" would take arguments like "iomem, irq, drq, etc."
> to enable bits in an "allowed conflicts" mask.  This would eliminate
> the ALLOW_CONFLICT_* horrors I inflicted upon the code many months ago.

	here are diffs to 1.1.5.1 sources that remove the need to the 
ALLOW_XXX_CONFLICT flags.

	spec the two devices, how they can conflict, and the order in 
which they are probed--that conflict is then allowed.  alll other 
conflicts are treated as they are now--the second device is not probed.

	if this can be used, i will gen patches for 2.0-RELEASE and 
current as for the last sup.

	i have used kernels with these patches continuously since sept 
1994 when chuck robey helped me get a soundblaster working.  i just could 
live with the ALLOW options in the kernel.

	patches at end.

Jonathan M. Bresler  jmb@kryten.atinc.com	| Analysis & Technology, Inc.  
						| 2341 Jeff Davis Hwy
play go.					| Arlington, VA 22202
ride bike. hack FreeBSD.--ah the good life	| 703-418-2800 x346

*** sys/i386/isa/isa.c.orig	Fri Aug 26 15:51:21 1994
--- sys/i386/isa/isa.c	Sat Sep  3 23:37:34 1994
***************
*** 65,68 ****
--- 65,69 ----
  #include "i386/isa/ic/i8237.h"
  #include "i386/isa/ic/i8042.h"
+ #include "i386/isa/known_conflicts.h"
  
  /*
***************
*** 84,87 ****
--- 85,121 ----
  void config_isadev __P((struct isa_device *, u_int *));
  
+ unsigned short
+ strequal( one, two ) 
+ 	register const char	*one,  *two;
+ {
+ 
+ 	while ( *one || *two  ) 
+ 		if ( *one++ != *two++) 
+ 			return 0;
+ 	return 1;
+ }
+ 
+ /*
+  * check the conflict,  to see if its allowed
+  */
+ unsigned short
+ allowed(dvp, tmpdvp, reason)
+ 	struct isa_device	*dvp, *tmpdvp;
+ 	short			reason;
+ {
+ 	struct known_conflict	*this;
+ 
+ 	for( this = known_conflicts; this->sec_name; this++ ) {
+ 		if ( ( dvp->id_unit == this->sec_unit )
+ 		  && ( tmpdvp->id_unit == this->first_unit )
+ 		  && ( reason & this->type )
+ 		  && strequal(dvp->id_driver->name, this->sec_name)
+ 		  && strequal(tmpdvp->id_driver->name, this->first_name) ) {
+ 			return 1;
+ 		}
+ 	}
+ 	return 0;
+ }
+ 
  /*
   * print a conflict message
***************
*** 126,132 ****
  				  (tmpdvp->id_iobase + tmpdvp->id_alive - 1))) {
  #ifndef ALLOW_CONFLICT_IOADDR
! 				conflict(dvp, tmpdvp, dvp->id_iobase,
! 					 "I/O address", "0x%x");
! 				status = 1;
  #endif
  			}
--- 160,168 ----
  				  (tmpdvp->id_iobase + tmpdvp->id_alive - 1))) {
  #ifndef ALLOW_CONFLICT_IOADDR
! 				if ( !allowed(dvp, tmpdvp, IO_CONFLICT) ) {
! 					conflict(dvp, tmpdvp, dvp->id_iobase,
! 						 "I/O address", "0x%x");
! 					status = 1;
! 				}
  #endif
  			}
***************
*** 147,153 ****
  			   (tmpdvp->id_maddr + tmpdvp->id_msize - 1))) {
  #ifndef ALLOW_CONFLICT_MEMADDR
! 				conflict(dvp, tmpdvp, dvp->id_maddr, "maddr",
! 					"0x%x");
! 				status = 1;
  #endif
  			}
--- 183,191 ----
  			   (tmpdvp->id_maddr + tmpdvp->id_msize - 1))) {
  #ifndef ALLOW_CONFLICT_MEMADDR
! 				if ( !allowed(dvp, tmpdvp, MEM_CONFLICT) ) {
! 					conflict(dvp, tmpdvp, dvp->id_maddr,
! 						"maddr", "0x%x");
! 					status = 1;
! 				}
  #endif
  			}
***************
*** 159,165 ****
  		if(tmpdvp->id_irq) {
  			if (tmpdvp->id_irq == dvp->id_irq) {
! 				conflict(dvp, tmpdvp, ffs(dvp->id_irq) - 1,
! 					"irq", "%d");
! 				status = 1;
  			}
  		}
--- 197,205 ----
  		if(tmpdvp->id_irq) {
  			if (tmpdvp->id_irq == dvp->id_irq) {
! 				if ( !allowed(dvp, tmpdvp, IRQ_CONFLICT) ) {
! 					conflict(dvp, tmpdvp, ffs(dvp->id_irq) - 1,
! 						"irq", "%d");
! 					status = 1;
! 				}
  			}
  		}
***************
*** 171,177 ****
  		if(tmpdvp->id_drq != -1) {
  			if (tmpdvp->id_drq == dvp->id_drq) {
! 				conflict(dvp, tmpdvp, dvp->id_drq,
! 					"drq", "%d");
! 				status = 1;
  			}
  		}
--- 211,219 ----
  		if(tmpdvp->id_drq != -1) {
  			if (tmpdvp->id_drq == dvp->id_drq) {
! 				if ( !allowed(dvp, tmpdvp, DRQ_CONFLICT) ) {
! 					conflict(dvp, tmpdvp, dvp->id_drq,
! 						"drq", "%d");
! 					status = 1;
! 				}
  			}
  		}
*** sys/i386/isa/sound/sb16_dsp.c.orig	Fri Sep  2 13:09:13 1994
--- sys/i386/isa/sound/sb16_dsp.c	Fri Sep  2 13:38:12 1994
***************
*** 506,509 ****
--- 506,513 ----
    switch (level)
      {
+     case 2:		/* XXX jmb 940902 added this, set the lowest bit ?? */
+     case 9:		/* 	yes both irq 2 and irq 9 are the same 	*/
+       ival = 1;
+       break;
      case 5:
        ival = 2;
*** /dev/null	Mon Sep  5 12:37:56 1994
--- sys/i386/isa/known_conflicts.h	Mon Sep  5 12:57:05 1994
***************
*** 0 ****
--- 1,36 ----
+ /*
+ **	list of known conflicting isa bus devices and the manner in which 
+ **		which they conflict.
+ **
+ **	each entry in the known_conflicts strcuture defines a single allowed
+ **		conflict:
+ **	sec_name: name of the conflicting device as recorded in
+ **		isa_device->id_driver->name
+ **	sec_unit: unit number of conflicting device as recored in
+ **		isa_device->id_unit
+ **	first_name: name of the device conflicted with as recorded in
+ **		isa_device->isa_driver->name
+ **	first_unit: unit number of device conflicted with as recored in
+ **		isa_device->id_unit
+ **	flags:	OR of allowed types of conflict
+ **
+ */
+ #define MEM_CONFLICT	1
+ #define IRQ_CONFLICT	2
+ #define DRQ_CONFLICT	4
+ #define	IO_CONFLICT	8
+ 
+ struct known_conflict {
+ 	char	*sec_name;		/* second device probed for */
+ 	int	sec_unit;
+ 	char	*first_name;		/* first device found */
+ 	int	first_unit;
+ 	unsigned short	type;
+ }
+ 	known_conflicts[] =  {
+ 
+ {	"psm",		0,	"sc",		0,	IO_CONFLICT	},
+ {	"snd",		6,	"snd",		2,	IO_CONFLICT | IRQ_CONFLICT },
+ {	(char *)0,	0,	(char *)0,	0,	0 }
+ 
+ };





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.3.89.9504061902.A5004-0100000>