From owner-svn-src-head@FreeBSD.ORG Sun Mar 16 12:31:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C8C5BF8D; Sun, 16 Mar 2014 12:31:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B5FA91FE; Sun, 16 Mar 2014 12:31:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2GCVScn055614; Sun, 16 Mar 2014 12:31:28 GMT (envelope-from tychon@svn.freebsd.org) Received: (from tychon@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2GCVS6I055613; Sun, 16 Mar 2014 12:31:28 GMT (envelope-from tychon@svn.freebsd.org) Message-Id: <201403161231.s2GCVS6I055613@svn.freebsd.org> From: Tycho Nightingale Date: Sun, 16 Mar 2014 12:31:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263236 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Mar 2014 12:31:28 -0000 Author: tychon Date: Sun Mar 16 12:31:28 2014 New Revision: 263236 URL: http://svnweb.freebsd.org/changeset/base/263236 Log: Support the bootloader's single 16-bit 'outw' access to the Divisor Latch MSB and LSB registers. Approved by: neel (co-mentor) Modified: head/usr.sbin/bhyve/pci_lpc.c Modified: head/usr.sbin/bhyve/pci_lpc.c ============================================================================== --- head/usr.sbin/bhyve/pci_lpc.c Sun Mar 16 11:06:05 2014 (r263235) +++ head/usr.sbin/bhyve/pci_lpc.c Sun Mar 16 12:31:28 2014 (r263236) @@ -125,15 +125,27 @@ lpc_uart_io_handler(struct vmctx *ctx, i int offset; struct lpc_uart_softc *sc = arg; - if (bytes != 1) - return (-1); - offset = port - sc->iobase; - if (in) - *eax = uart_read(sc->uart_softc, offset); - else - uart_write(sc->uart_softc, offset, *eax); + switch (bytes) { + case 1: + if (in) + *eax = uart_read(sc->uart_softc, offset); + else + uart_write(sc->uart_softc, offset, *eax); + break; + case 2: + if (in) { + *eax = uart_read(sc->uart_softc, offset); + *eax |= uart_read(sc->uart_softc, offset + 1) << 8; + } else { + uart_write(sc->uart_softc, offset, *eax); + uart_write(sc->uart_softc, offset + 1, *eax >> 8); + } + break; + default: + return (-1); + } return (0); }