From owner-p4-projects@FreeBSD.ORG Sun Apr 2 08:07:15 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 6BB5716A420; Sun, 2 Apr 2006 08:07:15 +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 4457E16A401 for ; Sun, 2 Apr 2006 08:07:15 +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 D759243D48 for ; Sun, 2 Apr 2006 08:07:14 +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 k3287EUm020655 for ; Sun, 2 Apr 2006 08:07:14 GMT (envelope-from jmg@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k3287EIH020631 for perforce@freebsd.org; Sun, 2 Apr 2006 08:07:14 GMT (envelope-from jmg@freebsd.org) Date: Sun, 2 Apr 2006 08:07:14 GMT Message-Id: <200604020807.k3287EIH020631@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 94451 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 08:07:15 -0000 http://perforce.freebsd.org/chv.cgi?CH=94451 Change 94451 by jmg@jmg_carbon-60 on 2006/04/02 08:06:48 use casting instead of the union.. Affected files ... .. //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/hv_pci.c#9 edit Differences ... ==== //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/hv_pci.c#9 (text+ko) ==== @@ -158,7 +158,7 @@ { struct hvpci_softc *sc; pci_config_size_t size; - pci_cfg_data_t data; + uint32_t data; uint32_t ret; int r; @@ -182,18 +182,18 @@ reg, size, &data); printf("%d = read_config(%#x, %#x, %d, %d) = %#x\n", r, - sc->hs_devhandle, HVPCI_BDF(bus, slot, func), reg, width, data.dw); + sc->hs_devhandle, HVPCI_BDF(bus, slot, func), reg, width, data); if (r == H_EOK) { switch (width) { case 1: - ret = data.b; + ret = *(uint8_t *)&data; break; case 2: - ret = data.w; + ret = *(uint16_t *)&data; break; case 4: - ret = data.dw; + ret = data; break; } return ret; @@ -213,7 +213,7 @@ { struct hvpci_softc *sc; pci_config_size_t size; - pci_cfg_data_t data; + uint32_t data; uint32_t err_flags; sc = device_get_softc(dev); @@ -221,15 +221,15 @@ switch (width) { case 1: size = PCI_CFG_SIZE_BYTE; - data.b = val; + *(uint8_t *)&data = val; break; case 2: size = PCI_CFG_SIZE_WORD; - data.w = val; + *(uint16_t *)&data = val; break; case 4: size = PCI_CFG_SIZE_DWORD; - data.dw = val; + data = val; break; default: panic("unsupported width: %d", width);