From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/8829 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: sys/io.h lacks inb_p and outb_p on x86 Date: Sun, 8 Nov 2015 00:23:58 -0500 Message-ID: <20151108052358.GN3818@brightrain.aerifal.cx> References: <20151108112655.4ad63277@r2lynx> <20151108045045.GM3818@brightrain.aerifal.cx> <20151108121337.7114adab@r2lynx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1446960259 19853 80.91.229.3 (8 Nov 2015 05:24:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 8 Nov 2015 05:24:19 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-8842-gllmg-musl=m.gmane.org@lists.openwall.com Sun Nov 08 06:24:15 2015 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1ZvISa-0007mw-N8 for gllmg-musl@m.gmane.org; Sun, 08 Nov 2015 06:24:12 +0100 Original-Received: (qmail 19844 invoked by uid 550); 8 Nov 2015 05:24:10 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 19824 invoked from network); 8 Nov 2015 05:24:10 -0000 Content-Disposition: inline In-Reply-To: <20151108121337.7114adab@r2lynx> User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:8829 Archived-At: On Sun, Nov 08, 2015 at 12:13:37PM +0700, Рысь wrote: > On Sat, 7 Nov 2015 23:50:45 -0500 > Rich Felker wrote: > > > On Sun, Nov 08, 2015 at 11:26:55AM +0700, Рысь wrote: > > > x86 arch lacks inb_p and outb_p inline functions. This is required > > > for memtest86+. > > > > > > I don't know how properly make an assembly here, so when making > > > memtest I copied sys/io.h into local directory, and copied these > > > functions from uClibc. > > > > > > I attach modified header for reference (they should go into > > > bits/io.h). > > > > Any idea what these are intended to do? Are they documented anywhere? > > > > Rich > > I can't say much, but looking into memtest code I see they're used only > for beeping a PC speaker. > > Comment in io.h include file of memtest says: > > * This file contains the definitions for the x86 IO instructions > * inb/inw/inl/outb/outw/outl and the "string versions" of the same > * (insb/insw/insl/outsb/outsw/outsl). You can also use "pausing" > * versions of the single-IO instructions (inb_p/inw_p/..). > > However memtest builds with assumption they're present in sys/io.h from > host and io.h included with memtest does not define inb_p/outb_p in any > way. > > I probably will go with uClibc defines, or just nop memtest beeper. See http://stackoverflow.com/questions/6793899/what-does-the-0x80-port-address-connects So apparently these are convenience functions to show the most recent port io that was performed on a hardware debugging device in case the memtest crashes. I don't mind adding them is software expects them to be there, but they should be written in terms of the existing functions rather than duplicating asm. Rich