From owner-freebsd-mobile Fri Dec 5 20:54:03 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id UAA17183 for mobile-outgoing; Fri, 5 Dec 1997 20:54:03 -0800 (PST) (envelope-from owner-freebsd-mobile) Received: from word.smith.net.au (ppp5.portal.net.au [202.12.71.105]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id UAA17161 for ; Fri, 5 Dec 1997 20:53:55 -0800 (PST) (envelope-from mike@word.smith.net.au) Received: from word (localhost [127.0.0.1]) by word.smith.net.au (8.8.7/8.8.5) with ESMTP id OAA01451; Sat, 6 Dec 1997 14:09:41 +1030 (CST) Message-Id: <199712060339.OAA01451@word.smith.net.au> X-Mailer: exmh version 2.0zeta 7/24/97 To: "Glenn Dicus" cc: "Mobile FreeBSD" Subject: Re: outb in pcic_probe In-reply-to: Your message of "Fri, 05 Dec 1997 14:28:47 -0800." <199712052226.OAA18721@mail.nomadix.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 06 Dec 1997 14:09:40 +1030 From: Mike Smith Sender: owner-freebsd-mobile@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > 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