px_lib4v.c (f9721e07) px_lib4v.c (b65731f1)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
8 *

--- 6 unchanged lines hidden (view full) ---

15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 *
20 * CDDL HEADER END
21 */
22/*
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
8 *

--- 6 unchanged lines hidden (view full) ---

15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 *
20 * CDDL HEADER END
21 */
22/*
23 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
23 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 */
26
27#pragma ident "%Z%%M% %I% %E% SMI"
28
29#include <sys/types.h>
30#include <sys/sysmacros.h>
31#include <sys/ddi.h>
32#include <sys/async.h>
33#include <sys/sunddi.h>
34#include <sys/ddifm.h>
35#include <sys/fm/protocol.h>
36#include <sys/vmem.h>
37#include <sys/intr.h>
38#include <sys/ivintr.h>
39#include <sys/errno.h>
40#include <sys/hypervisor_api.h>
41#include <px_obj.h>
42#include <sys/machsystm.h>
24 * Use is subject to license terms.
25 */
26
27#pragma ident "%Z%%M% %I% %E% SMI"
28
29#include <sys/types.h>
30#include <sys/sysmacros.h>
31#include <sys/ddi.h>
32#include <sys/async.h>
33#include <sys/sunddi.h>
34#include <sys/ddifm.h>
35#include <sys/fm/protocol.h>
36#include <sys/vmem.h>
37#include <sys/intr.h>
38#include <sys/ivintr.h>
39#include <sys/errno.h>
40#include <sys/hypervisor_api.h>
41#include <px_obj.h>
42#include <sys/machsystm.h>
43#include <sys/hotplug/pci/pcihp.h>
43#include "px_lib4v.h"
44#include "px_err.h"
45
46/* mask for the ranges property in calculating the real PFN range */
47uint_t px_ranges_phi_mask = ((1 << 28) -1);
48
49int
50px_lib_dev_init(dev_info_t *dip, devhandle_t *dev_hdl)

--- 16 unchanged lines hidden (view full) ---

67 * a SUN4V device. It consists of the lower 28-bits of the hi-cell
68 * of the first entry of the SUN4V device's "reg" property as
69 * defined by the SUN4V Bus Binding to Open Firmware.
70 */
71 *dev_hdl = (devhandle_t)((rp->phys_addr >> 32) & DEVHDLE_MASK);
72
73 ddi_prop_free(rp);
74
44#include "px_lib4v.h"
45#include "px_err.h"
46
47/* mask for the ranges property in calculating the real PFN range */
48uint_t px_ranges_phi_mask = ((1 << 28) -1);
49
50int
51px_lib_dev_init(dev_info_t *dip, devhandle_t *dev_hdl)

--- 16 unchanged lines hidden (view full) ---

68 * a SUN4V device. It consists of the lower 28-bits of the hi-cell
69 * of the first entry of the SUN4V device's "reg" property as
70 * defined by the SUN4V Bus Binding to Open Firmware.
71 */
72 *dev_hdl = (devhandle_t)((rp->phys_addr >> 32) & DEVHDLE_MASK);
73
74 ddi_prop_free(rp);
75
76 /*
77 * hotplug implementation requires this property to be associated with
78 * any indirect PCI config access services
79 */
80 (void) ddi_prop_update_int(makedevice(ddi_driver_major(dip),
81 PCIHP_AP_MINOR_NUM(ddi_get_instance(dip), PCIHP_DEVCTL_MINOR)), dip,
82 PCI_BUS_CONF_MAP_PROP, 1);
83
75 DBG(DBG_ATTACH, dip, "px_lib_dev_init: dev_hdl 0x%llx\n", *dev_hdl);
76
77 return (DDI_SUCCESS);
78}
79
80/*ARGSUSED*/
81int
82px_lib_dev_fini(dev_info_t *dip)
83{
84 DBG(DBG_DETACH, dip, "px_lib_dev_fini: dip 0x%p\n", dip);
85
84 DBG(DBG_ATTACH, dip, "px_lib_dev_init: dev_hdl 0x%llx\n", *dev_hdl);
85
86 return (DDI_SUCCESS);
87}
88
89/*ARGSUSED*/
90int
91px_lib_dev_fini(dev_info_t *dip)
92{
93 DBG(DBG_DETACH, dip, "px_lib_dev_fini: dip 0x%p\n", dip);
94
95 (void) ddi_prop_remove(makedevice(ddi_driver_major(dip),
96 PCIHP_AP_MINOR_NUM(ddi_get_instance(dip), PCIHP_DEVCTL_MINOR)), dip,
97 PCI_BUS_CONF_MAP_PROP);
98
86 return (DDI_SUCCESS);
87}
88
89/*ARGSUSED*/
90int
91px_lib_intr_devino_to_sysino(dev_info_t *dip, devino_t devino,
92 sysino_t *sysino)
93{

--- 1725 unchanged lines hidden (view full) ---

1819 uint32_t val) {
1820 pci_cfg_data_t wdata = { 0 };
1821
1822 wdata.qw = (uint32_t)val;
1823 (void) hvio_config_put(px_p->px_dev_hdl,
1824 (bdf << PX_RA_BDF_SHIFT), offset, 4, wdata);
1825}
1826
99 return (DDI_SUCCESS);
100}
101
102/*ARGSUSED*/
103int
104px_lib_intr_devino_to_sysino(dev_info_t *dip, devino_t devino,
105 sysino_t *sysino)
106{

--- 1725 unchanged lines hidden (view full) ---

1832 uint32_t val) {
1833 pci_cfg_data_t wdata = { 0 };
1834
1835 wdata.qw = (uint32_t)val;
1836 (void) hvio_config_put(px_p->px_dev_hdl,
1837 (bdf << PX_RA_BDF_SHIFT), offset, 4, wdata);
1838}
1839
1840/*ARGSUSED*/
1841int
1842px_lib_hotplug_init(dev_info_t *dip, void *arg)
1843{
1844 return (DDI_ENOTSUP);
1845}
1846
1847/*ARGSUSED*/
1848void
1849px_lib_hotplug_uninit(dev_info_t *dip)
1850{
1851}
1852
1827/* Dummy cpr add callback */
1828/*ARGSUSED*/
1829void
1830px_cpr_add_callb(px_t *px_p)
1831{
1832}
1833
1834/* Dummy cpr rem callback */
1835/*ARGSUSED*/
1836void
1837px_cpr_rem_callb(px_t *px_p)
1838{
1839}
1853/* Dummy cpr add callback */
1854/*ARGSUSED*/
1855void
1856px_cpr_add_callb(px_t *px_p)
1857{
1858}
1859
1860/* Dummy cpr rem callback */
1861/*ARGSUSED*/
1862void
1863px_cpr_rem_callb(px_t *px_p)
1864{
1865}