From owner-freebsd-hackers Sun Oct 19 23:46:47 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id XAA02703 for hackers-outgoing; Sun, 19 Oct 1997 23:46:47 -0700 (PDT) (envelope-from owner-freebsd-hackers) Received: from safeconcept.utimaco.co.at (mail-gw.utimaco.co.at [195.96.28.162]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id XAA02694 for ; Sun, 19 Oct 1997 23:46:26 -0700 (PDT) (envelope-from Michael.Schuster@utimaco.co.at) Received: (from uucp@localhost) by safeconcept.utimaco.co.at (8.8.5/8.8.5) id IAA13517 for ; Mon, 20 Oct 1997 08:35:15 +0200 (CEST) Received: from wshpux.utimaco.co.at(10.0.0.18) by safeconcept via smap (V2.0) id xma013515; Mon, 20 Oct 97 08:35:13 +0200 Message-ID: <344AFDD1.52D4AF96@utimaco.co.at> Date: Mon, 20 Oct 1997 08:44:33 +0200 From: Michael Schuster Organization: Utimaco Safe Concept GmbH., Linz, Austria X-Mailer: Mozilla 4.02b7 [en] (X11; I; HP-UX B.10.01 9000/715) MIME-Version: 1.0 To: "hackers@FreeBSD.ORG" Subject: Re: outb() / inb() Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk 0000-Administrator wrote: > outb (0x250, *c++); /* doesn't work whereas */ > outb (0x250, *c); c++; /* works */ > > I would guess (but cannot verify) that > > > *c++ = inb (0x250); /* probably works since the increment expression is > * not part of the macro */ > > can somebody verify this for me I am pretty sure about the inb (even > though I can't test it easily), as for the outb since outb just is a macro > that puts in an inline function outbv() why does it not work? right: (copied by hand from /usr/include/machine/coufuncs.h): >#define outb(port,data) \ > <....> \ > ? outbc(port,data):outbv(port,data)) which means that if you write outb (0x250, *c++); then the expression "*c++" gets evaluated twice, and only every other byte is output to port 0x250. Your solution is correct. Michael -- Michael Schuster Utimaco Safe Concept GmbH. | Tel: +43 732 655755 41 Europaplatz 6 | Fax: +43 732 655755 5 A-4020 Linz Austria | email: Michael.Schuster@utimaco.co.at