Skip site navigation (1)Skip section navigation (2)
Date:      29 Jan 1996 20:24:42 +0100
From:      tom@smart.ruhr.de (Thomas Neumann)
To:        Chien-Ta Lee <jdli@Adonis.Dorm10.NCTU.edu.tw>
Cc:        freebsd-current@freebsd.org
Subject:   Re: lsdev broken
Message-ID:  <8720oikdmt.fsf@smart.ruhr.de>
In-Reply-To: Chien-Ta Lee's message of Mon, 29 Jan 1996 23:24:21 %2B0800 (CST)
References:  <199601291524.XAA16030@Adonis.Dorm10.NCTU.edu.tw>

next in thread | previous in thread | raw e-mail | index | archive | help

Yep, that one stopped my "make world" a few minutes ago, too.
I was so anoyed that I just *had* to fix it :-) See the patch
below, which modifies lsdev to print a comma separated list
of I/O ranges (if there's more than one entry. With a single
I/O range the output should be compatible with prevoius versions
of lsdev). Someone with an EISA system should try this, as
I don't have an EISA machine and thus the code is untested by me.

-t


*** usr.sbin/lsdev/i386.c.old	Wed Dec 13 17:07:19 1995
--- usr.sbin/lsdev/i386.c	Mon Jan 29 20:15:21 1996
***************
*** 159,171 ****
  
  static void
  print_eisa(struct devconf *dc)
  {
  	struct eisa_device *e_dev = (struct eisa_device *)dc->dc_data;
!         printf("%s%d\tat eisa0 slot %d # %#lx-%#lx",
  		dc->dc_name,              
  		dc->dc_unit,              
! 		e_dev->ioconf.slot,
! 		e_dev->ioconf.iobase,
! 		e_dev->ioconf.iobase + e_dev->ioconf.iosize - 1);
  	if(e_dev->ioconf.irq)
  		printf(" irq %d", ffs(e_dev->ioconf.irq) - 1);
--- 159,182 ----
  
  static void
+ print_eisa_ioaddrs(struct resvlist *list)
+ {
+ 	resvaddr_t *rp;
+ 
+ 	for (rp = list->lh_first; rp; rp = rp->links.le_next)
+ 		printf("%#lx-%#lx%s", rp->addr, rp->addr + rp->size - 1,
+ 			rp->links.le_next ? ", " : "");
+ }
+ 
+ static void
  print_eisa(struct devconf *dc)
  {
  	struct eisa_device *e_dev = (struct eisa_device *)dc->dc_data;
! 
!         printf("%s%d\tat eisa0 slot %d # ",
  		dc->dc_name,              
  		dc->dc_unit,              
! 		e_dev->ioconf.slot);
! 	print_eisa_ioaddrs(&e_dev->ioconf.ioaddrs);
! 
  	if(e_dev->ioconf.irq)
  		printf(" irq %d", ffs(e_dev->ioconf.irq) - 1);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?8720oikdmt.fsf>