From owner-svn-src-stable@FreeBSD.ORG Sat Oct 6 18:42:40 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3391C1065713; Sat, 6 Oct 2012 18:42:40 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1C3F38FC18; Sat, 6 Oct 2012 18:42:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q96IgdZG017437; Sat, 6 Oct 2012 18:42:39 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q96Igdcj017435; Sat, 6 Oct 2012 18:42:39 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201210061842.q96Igdcj017435@svn.freebsd.org> From: Andriy Gapon Date: Sat, 6 Oct 2012 18:42:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r241257 - stable/8/sys/boot/i386/loader X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Oct 2012 18:42:40 -0000 Author: avg Date: Sat Oct 6 18:42:39 2012 New Revision: 241257 URL: http://svn.freebsd.org/changeset/base/241257 Log: MFC r240341,240637: loader/i386: replace ugly inb/outb re-implementations with cpufunc.h Modified: stable/8/sys/boot/i386/loader/main.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/boot/ (props changed) Modified: stable/8/sys/boot/i386/loader/main.c ============================================================================== --- stable/8/sys/boot/i386/loader/main.c Sat Oct 6 18:42:02 2012 (r241256) +++ stable/8/sys/boot/i386/loader/main.c Sat Oct 6 18:42:39 2012 (r241257) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -321,34 +322,19 @@ command_heap(int argc, char *argv[]) return(CMD_OK); } -/* ISA bus access functions for PnP, derived from */ -static int +/* ISA bus access functions for PnP. */ +static int isa_inb(int port) { - u_char data; - - if (__builtin_constant_p(port) && - (((port) & 0xffff) < 0x100) && - ((port) < 0x10000)) { - __asm __volatile("inb %1,%0" : "=a" (data) : "id" ((u_short)(port))); - } else { - __asm __volatile("inb %%dx,%0" : "=a" (data) : "d" (port)); - } - return(data); + + return (inb(port)); } static void isa_outb(int port, int value) { - u_char al = value; - - if (__builtin_constant_p(port) && - (((port) & 0xffff) < 0x100) && - ((port) < 0x10000)) { - __asm __volatile("outb %0,%1" : : "a" (al), "id" ((u_short)(port))); - } else { - __asm __volatile("outb %0,%%dx" : : "a" (al), "d" (port)); - } + + outb(port, value); } #ifdef LOADER_ZFS_SUPPORT