From owner-p4-projects@FreeBSD.ORG Sun Apr 2 20:59:57 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 73AB116A429; Sun, 2 Apr 2006 20:59:57 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 316A316A45E for ; Sun, 2 Apr 2006 20:59:57 +0000 (UTC) (envelope-from jmg@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id C175D43D6B for ; Sun, 2 Apr 2006 20:59:55 +0000 (GMT) (envelope-from jmg@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k32KxtrL099496 for ; Sun, 2 Apr 2006 20:59:55 GMT (envelope-from jmg@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k32KxtqB099493 for perforce@freebsd.org; Sun, 2 Apr 2006 20:59:55 GMT (envelope-from jmg@freebsd.org) Date: Sun, 2 Apr 2006 20:59:55 GMT Message-Id: <200604022059.k32KxtqB099493@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jmg@freebsd.org using -f From: John-Mark Gurney To: Perforce Change Reviews Cc: Subject: PERFORCE change 94486 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Apr 2006 20:59:57 -0000 http://perforce.freebsd.org/chv.cgi?CH=94486 Change 94486 by jmg@jmg_carbon-60 on 2006/04/02 20:59:42 the hv api assumes that data is a 32bit word, it does not write directly to memory, so just letoh the data value... hopefully this will fix thigns... Affected files ... .. //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/hv_pci.c#12 edit Differences ... ==== //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/hv_pci.c#12 (text+ko) ==== @@ -180,26 +180,25 @@ r = hvio_config_get(sc->hs_devhandle, HVPCI_BDF(bus, slot, func), reg, width, (pci_cfg_data_t *)&data); -#if 0 printf("%d = read_config(%#lx, %#x, %d, %d) = %#x\n", r, sc->hs_devhandle, HVPCI_BDF(bus, slot, func), reg, width, data); -#endif if (r == H_EOK) { switch (width) { case 1: - ret = *(uint8_t *)&data; + ret = data & 0xff; break; case 2: - ret = *(uint16_t *)&data; + ret = le16toh(data & 0xffff); break; case 4: - ret = data; + ret = le32toh(data); break; default: ret = -1; } - return data; + return ret; } + return -1; } @@ -218,13 +217,13 @@ sc = device_get_softc(dev); switch (width) { case 1: - *(uint8_t *)&data = val; + data = val; break; case 2: - *(uint16_t *)&data = val; + data = htole16(val); break; case 4: - data = val; + data = htole32(val); break; default: panic("unsupported width: %d", width); @@ -239,10 +238,12 @@ { } #endif + static int hvpci_setup_intr(device_t dev, device_t child, struct resource *ires, int flags, driver_intr_t *intr, void *arg, void **cookiep) { + return (0); } @@ -250,6 +251,7 @@ hvpci_teardown_intr(device_t dev, device_t child, struct resource *vec, void *cookie) { + return (0); } @@ -257,6 +259,7 @@ hvpci_alloc_resource(device_t bus, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags) { + return (NULL); } @@ -264,6 +267,7 @@ hvpci_activate_resource(device_t bus, device_t child, int type, int rid, struct resource *r) { + return (0); } @@ -271,6 +275,7 @@ hvpci_deactivate_resource(device_t bus, device_t child, int type, int rid, struct resource *r) { + return (0); } @@ -278,5 +283,6 @@ hvpci_release_resource(device_t bus, device_t child, int type, int rid, struct resource *r) { + return (0); }