Esempio n. 1
0
/*
 * XXX - This won't work as written if we ever have more than two nodes
 * on a crossbow.  In that case, we'll need an array or partners.
 */
int
hub_check_pci_equiv(void *addra, void *addrb)
{
    nasid_t nasida, nasidb;

    /*
     * This is for a permanent workaround that causes us to use a
     * big window in place of small window 0.
     */
    if (!hub_check_window_equiv(addra, addrb))
        return 0;

    /* If the offsets aren't the same, forget it. */
    if (SWIN_WIDGETADDR((__psunsigned_t)addra) !=
            (SWIN_WIDGETADDR((__psunsigned_t)addrb)))
        return 0;

    /* Now, check the nasids */
    nasida = NASID_GET(addra);
    nasidb = NASID_GET(addrb);

    ASSERT(NASID_TO_COMPACT_NODEID(nasida) != INVALID_NASID);
    ASSERT(NASID_TO_COMPACT_NODEID(nasidb) != INVALID_NASID);

    /*
     * Either the NASIDs must be the same or they must be crossbow
     * partners (on the same crossbow).
     */
    return (check_nasid_equiv(nasida, nasidb));
}
Esempio n. 2
0
int
is_master_baseio_nasid_widget(nasid_t test_nasid, xwidgetnum_t test_wid)
{
	/*
	 * If the widget numbers are different, we're not the master.
	 */
	if (test_wid != (xwidgetnum_t) master_baseio_wid) {
		return 0;
	}

	/*
	 * If the NASIDs are the same or equivalent, we're the master.
	 */
	if (check_nasid_equiv(test_nasid, master_baseio_nasid)) {
		return 1;
	} else {
		return 0;
	}
}