From owner-freebsd-bugs  Tue Jun  6 07:11:07 1995
Return-Path: bugs-owner
Received: (from majordom@localhost)
          by freefall.cdrom.com (8.6.10/8.6.6) id HAA21116
          for bugs-outgoing; Tue, 6 Jun 1995 07:11:07 -0700
Received: from Root.COM (implode.Root.COM [198.145.90.1])
          by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id HAA21107
          ; Tue, 6 Jun 1995 07:11:01 -0700
Received: from corbin.Root.COM (corbin.Root.COM [198.145.90.18]) by Root.COM (8.6.8/8.6.5) with ESMTP id HAA01942; Tue, 6 Jun 1995 07:14:21 -0700
Received: from localhost (localhost [127.0.0.1]) by corbin.Root.COM (8.6.11/8.6.5) with SMTP id HAA00434; Tue, 6 Jun 1995 07:11:13 -0700
Message-Id: <199506061411.HAA00434@corbin.Root.COM>
To: Bruce Evans <bde@zeta.org.au>
cc: fenner@parc.xerox.com, freebsd-bugs@FreeBSD.org, gibbs@freefall.cdrom.com
Subject: Re: FTP install is *almost* there... 
In-reply-to: Your message of "Tue, 06 Jun 95 19:14:23 +1000."
             <199506060914.TAA00354@godzilla.zeta.org.au> 
From: David Greenman <davidg@Root.COM>
Reply-To: davidg@Root.COM
Date: Tue, 06 Jun 1995 07:11:12 -0700
Sender: bugs-owner@FreeBSD.org
Precedence: bulk

>>>The driver sees (1 << irq_number), or 0 for none/unspecified/auto.
>
>>   Gack, you're right. Userconfig has brokeness in this area. Specifying -1
>>will result in shifting the bit all the way off the end, resulting in "0".
>
>No, it handles -1 specially.


   Ahh, I forgot that "irq" was unsigned...so the test:

    parms[0].parm.dparm->id_irq = (irq < 16 ? 1 << irq : 0);

   Treats irq as 0xffffffff, not -1, and thus ends up with 0.


>-1 is converted to 0 in mkioconf().  irq numbers are exponentiated more
>machine-independently by converting them to a string and prefixing "IRQ".
>isa.h somewhat confusingly defines IRQ0 as 0x0001 etc.  I can't see where
>`?' and `none' are distinguished in config.y.  lang.l converts `?' to -1
>which is the same as the default (`none') value.  Anyway, the drivers
>apparently get it right by always dealing with the mask.  -1 isn't a
>valid mask and drivers apparently don't set id_irq to it.

   Huh? How could drivers deal with anything other than the mask? ...anyway,
you appear to be correct - '?' gets converted to 0 before it is output to
ioconf.c.
   So this brings us full circle and I'm not sure what we've accomplished by
this exercise. :-)  ...other than my test in if_ed.c for the irq should be
changed to irq == 0 rather than irq <= 0.

-DG