Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 06 Dec 1997 14:09:40 +1030
From:      Mike Smith <mike@smith.net.au>
To:        "Glenn Dicus" <gdicus@nomadix.com>
Cc:        "Mobile FreeBSD" <mobile@freebsd.org>
Subject:   Re: outb in pcic_probe 
Message-ID:  <199712060339.OAA01451@word.smith.net.au>
In-Reply-To: Your message of "Fri, 05 Dec 1997 14:28:47 -0800." <199712052226.OAA18721@mail.nomadix.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
> Looking over the sourc code for outb I have noticed that there are several
> definitions for outb, all of which are hard to understand. 

They are less hard to understand if you some familiarity with the Intel 
instruction set, or a reference thereto.  There is only one definition 
of outb() however, and it does what you expect; writes a value to a 
port.

> In pcic_probe
> there are two successive outb() calls to the same configuration port
> 
> outb(sp->index, 0x0E);
> outb(sp->index, 0x37);
> 
> Then 
> 
> setb(sp, 0x3A, 0x40);
>
> Does anyone know what this code is doing to the registers?  If so, which
> definition of outb(), setb() are being implemented?  I am using FreeBSD
> 2.2.2-RELEASE.

The first two calls are obvious; the second is defined in pcic and even 
has a *comment* attached to the definition.

/*
 * Set bit(s) of a register
 */
static inline void
setb(struct pcic_slot *sp, int reg, unsigned char mask)
{
        sp->putb(sp, reg, sp->getb(sp, reg) | mask);
}

mike





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