Exemple #1
0
/*
 * Sends a cross-call to a specified processor.  The caller assumes
 * responsibility for repetition of cross-calls, as appropriate (MARSA for
 * debugging).
 */
static int
kdi_xc_one(int cpuid, void (*func)(uintptr_t, uintptr_t), uintptr_t arg1,
           uintptr_t arg2)
{
    uint64_t idsr;
    uint64_t endtick, tick;

    init_mondo_nocheck((xcfunc_t *)func, arg1, arg2);

    shipit(cpuid, 0);

    /* Spin for at most 1 second for checking */
    endtick = gettick() + (uint64_t)sys_tick_freq;

    idsr = getidsr();

    if (idsr & IDSR_BUSY) {
        do {
            idsr = getidsr();
            tick = gettick();
            if (tick > endtick) {
                return (KDI_XC_RES_BUSY);
            }
        } while (idsr & IDSR_BUSY);
    }

    kdi_tickwait(20000);

    if (idsr & IDSR_NACK)
        return (KDI_XC_RES_NACK);
    else
        return (KDI_XC_RES_OK);
}
Exemple #2
0
/*
 * Sends a cross-call to a specified processor.  The caller assumes
 * responsibility for repetition of cross-calls, as appropriate (MARSA for
 * debugging).
 */
static int
kdi_xc_one(int cpuid, void (*func)(uintptr_t, uintptr_t), uintptr_t arg1,
    uintptr_t arg2)
{
	uint64_t idsr;

	/*
	 * if (idsr_busy())
	 *	return (KDI_XC_RES_ERR);
	 */

	init_mondo_nocheck((xcfunc_t *)func, arg1, arg2);

	shipit(CPUID_TO_UPAID(cpuid));

	if ((idsr = getidsr()) == 0)
		return (KDI_XC_RES_OK);
	else if (idsr & IDSR_BUSY)
		return (KDI_XC_RES_BUSY);
	else
		return (KDI_XC_RES_NACK);
}