mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-27 16:39:08 +00:00
The cyclic timer device. This is a cut down version of the one in
OpenSolaris. We don't have the lock levels that they do, so this is just hooked into clock interrupts.
This commit is contained in:
parent
597c90a27e
commit
5a3c3bfaa3
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=179260
133
sys/cddl/dev/cyclic/amd64/cyclic_machdep.c
Normal file
133
sys/cddl/dev/cyclic/amd64/cyclic_machdep.c
Normal file
@ -0,0 +1,133 @@
|
||||
/*-
|
||||
* Copyright 2007 John Birrell <jb@FreeBSD.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*
|
||||
*/
|
||||
|
||||
static void enable(cyb_arg_t);
|
||||
static void disable(cyb_arg_t);
|
||||
static void reprogram(cyb_arg_t, hrtime_t);
|
||||
static void xcall(cyb_arg_t, cpu_t *, cyc_func_t, void *);
|
||||
|
||||
static cyc_backend_t be = {
|
||||
NULL, /* cyb_configure */
|
||||
NULL, /* cyb_unconfigure */
|
||||
enable,
|
||||
disable,
|
||||
reprogram,
|
||||
xcall,
|
||||
NULL /* cyb_arg_t cyb_arg */
|
||||
};
|
||||
|
||||
static void
|
||||
cyclic_ap_start(void *dummy)
|
||||
{
|
||||
/* Initialise the rest of the CPUs. */
|
||||
cyclic_mp_init();
|
||||
}
|
||||
|
||||
SYSINIT(cyclic_ap_start, SI_SUB_SMP, SI_ORDER_ANY, cyclic_ap_start, NULL);
|
||||
|
||||
/*
|
||||
* Machine dependent cyclic subsystem initialisation.
|
||||
*/
|
||||
static void
|
||||
cyclic_machdep_init(void)
|
||||
{
|
||||
/* Register the cyclic backend. */
|
||||
cyclic_init(&be);
|
||||
}
|
||||
|
||||
static void
|
||||
cyclic_machdep_uninit(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i <= mp_maxid; i++)
|
||||
/* Reset the cyclic clock callback hook. */
|
||||
lapic_cyclic_clock_func[i] = NULL;
|
||||
|
||||
/* De-register the cyclic backend. */
|
||||
cyclic_uninit();
|
||||
}
|
||||
|
||||
static hrtime_t exp_due[MAXCPU];
|
||||
|
||||
/*
|
||||
* This function is the one registered by the machine dependent
|
||||
* initialiser as the callback for high speed timer events.
|
||||
*/
|
||||
static void
|
||||
cyclic_clock(struct trapframe *frame)
|
||||
{
|
||||
cpu_t *c = &solaris_cpu[curcpu];
|
||||
|
||||
if (c->cpu_cyclic != NULL && gethrtime() >= exp_due[curcpu]) {
|
||||
if (TRAPF_USERMODE(frame)) {
|
||||
c->cpu_profile_pc = 0;
|
||||
c->cpu_profile_upc = TRAPF_PC(frame);
|
||||
} else {
|
||||
c->cpu_profile_pc = TRAPF_PC(frame);
|
||||
c->cpu_profile_upc = 0;
|
||||
}
|
||||
|
||||
c->cpu_intr_actv = 1;
|
||||
|
||||
/* Fire any timers that are due. */
|
||||
cyclic_fire(c);
|
||||
|
||||
c->cpu_intr_actv = 0;
|
||||
}
|
||||
}
|
||||
|
||||
static void enable(cyb_arg_t arg)
|
||||
{
|
||||
/* Register the cyclic clock callback function. */
|
||||
lapic_cyclic_clock_func[curcpu] = cyclic_clock;
|
||||
}
|
||||
|
||||
static void disable(cyb_arg_t arg)
|
||||
{
|
||||
/* Reset the cyclic clock callback function. */
|
||||
lapic_cyclic_clock_func[curcpu] = NULL;
|
||||
}
|
||||
|
||||
static void reprogram(cyb_arg_t arg, hrtime_t exp)
|
||||
{
|
||||
exp_due[curcpu] = exp;
|
||||
}
|
||||
|
||||
static void xcall(cyb_arg_t arg, cpu_t *c, cyc_func_t func, void *param)
|
||||
{
|
||||
/*
|
||||
* If the target CPU is the current one, just call the
|
||||
* function. This covers the non-SMP case.
|
||||
*/
|
||||
if (c == &solaris_cpu[curcpu])
|
||||
(*func)(param);
|
||||
else
|
||||
smp_rendezvous_cpus((cpumask_t) (1 << c->cpuid), NULL,
|
||||
func, smp_no_rendevous_barrier, param);
|
||||
}
|
1421
sys/cddl/dev/cyclic/cyclic.c
Normal file
1421
sys/cddl/dev/cyclic/cyclic.c
Normal file
File diff suppressed because it is too large
Load Diff
301
sys/cddl/dev/cyclic/cyclic_test.c
Normal file
301
sys/cddl/dev/cyclic/cyclic_test.c
Normal file
@ -0,0 +1,301 @@
|
||||
/*-
|
||||
* Copyright 2007 John Birrell <jb@FreeBSD.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/conf.h>
|
||||
#include <sys/kthread.h>
|
||||
#include <sys/module.h>
|
||||
#include <sys/sysctl.h>
|
||||
#include <sys/cyclic.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
static struct timespec test_001_start;
|
||||
|
||||
static void
|
||||
cyclic_test_001_func(void *arg)
|
||||
{
|
||||
struct timespec ts;
|
||||
|
||||
nanotime(&ts);
|
||||
timespecsub(&ts,&test_001_start);
|
||||
printf("%s: called after %lu.%09lu on curcpu %d\n",__func__,(u_long) ts.tv_sec,(u_long) ts.tv_nsec, curcpu);
|
||||
}
|
||||
|
||||
static void
|
||||
cyclic_test_001(void)
|
||||
{
|
||||
int error = 0;
|
||||
cyc_handler_t hdlr;
|
||||
cyc_time_t when;
|
||||
cyclic_id_t id;
|
||||
|
||||
printf("%s: starting\n",__func__);
|
||||
|
||||
hdlr.cyh_func = (cyc_func_t) cyclic_test_001_func;
|
||||
hdlr.cyh_arg = 0;
|
||||
|
||||
when.cyt_when = 0;
|
||||
when.cyt_interval = 1000000000;
|
||||
|
||||
nanotime(&test_001_start);
|
||||
|
||||
mutex_enter(&cpu_lock);
|
||||
|
||||
id = cyclic_add(&hdlr, &when);
|
||||
|
||||
mutex_exit(&cpu_lock);
|
||||
|
||||
DELAY(1200000);
|
||||
|
||||
mutex_enter(&cpu_lock);
|
||||
|
||||
cyclic_remove(id);
|
||||
|
||||
mutex_exit(&cpu_lock);
|
||||
|
||||
printf("%s: %s\n",__func__, error == 0 ? "passed":"failed");
|
||||
}
|
||||
|
||||
static struct timespec test_002_start;
|
||||
|
||||
static void
|
||||
cyclic_test_002_func(void *arg)
|
||||
{
|
||||
struct timespec ts;
|
||||
|
||||
nanotime(&ts);
|
||||
timespecsub(&ts,&test_002_start);
|
||||
printf("%s: called after %lu.%09lu on curcpu %d\n",__func__,(u_long) ts.tv_sec,(u_long) ts.tv_nsec, curcpu);
|
||||
}
|
||||
|
||||
static void
|
||||
cyclic_test_002_online(void *arg, cpu_t *c, cyc_handler_t *hdlr, cyc_time_t *t)
|
||||
{
|
||||
printf("%s: online on curcpu %d\n",__func__, curcpu);
|
||||
hdlr->cyh_func = cyclic_test_002_func;
|
||||
hdlr->cyh_arg = NULL;
|
||||
t->cyt_when = 0;
|
||||
t->cyt_interval = 1000000000;
|
||||
}
|
||||
|
||||
static void
|
||||
cyclic_test_002_offline(void *arg, cpu_t *c, void *arg1)
|
||||
{
|
||||
printf("%s: offline on curcpu %d\n",__func__, curcpu);
|
||||
}
|
||||
|
||||
static void
|
||||
cyclic_test_002(void)
|
||||
{
|
||||
int error = 0;
|
||||
cyc_omni_handler_t hdlr;
|
||||
cyclic_id_t id;
|
||||
|
||||
printf("%s: starting\n",__func__);
|
||||
|
||||
hdlr.cyo_online = cyclic_test_002_online;
|
||||
hdlr.cyo_offline = cyclic_test_002_offline;
|
||||
hdlr.cyo_arg = NULL;
|
||||
|
||||
nanotime(&test_002_start);
|
||||
|
||||
mutex_enter(&cpu_lock);
|
||||
|
||||
id = cyclic_add_omni(&hdlr);
|
||||
|
||||
mutex_exit(&cpu_lock);
|
||||
|
||||
DELAY(1200000);
|
||||
|
||||
mutex_enter(&cpu_lock);
|
||||
|
||||
cyclic_remove(id);
|
||||
|
||||
mutex_exit(&cpu_lock);
|
||||
|
||||
printf("%s: %s\n",__func__, error == 0 ? "passed":"failed");
|
||||
}
|
||||
|
||||
static struct timespec test_003_start;
|
||||
|
||||
static void
|
||||
cyclic_test_003_func(void *arg)
|
||||
{
|
||||
struct timespec ts;
|
||||
|
||||
nanotime(&ts);
|
||||
timespecsub(&ts,&test_003_start);
|
||||
printf("%s: called after %lu.%09lu on curcpu %d id %ju\n",__func__,(u_long) ts.tv_sec,(u_long) ts.tv_nsec, curcpu, (uintmax_t)(uintptr_t) arg);
|
||||
}
|
||||
|
||||
static void
|
||||
cyclic_test_003(void)
|
||||
{
|
||||
int error = 0;
|
||||
cyc_handler_t hdlr;
|
||||
cyc_time_t when;
|
||||
cyclic_id_t id;
|
||||
cyclic_id_t id1;
|
||||
cyclic_id_t id2;
|
||||
cyclic_id_t id3;
|
||||
|
||||
printf("%s: starting\n",__func__);
|
||||
|
||||
hdlr.cyh_func = (cyc_func_t) cyclic_test_003_func;
|
||||
|
||||
when.cyt_when = 0;
|
||||
|
||||
nanotime(&test_003_start);
|
||||
|
||||
mutex_enter(&cpu_lock);
|
||||
|
||||
when.cyt_interval = 200000000;
|
||||
hdlr.cyh_arg = (void *) 0UL;
|
||||
id = cyclic_add(&hdlr, &when);
|
||||
|
||||
when.cyt_interval = 400000000;
|
||||
hdlr.cyh_arg = (void *) 1UL;
|
||||
id1 = cyclic_add(&hdlr, &when);
|
||||
|
||||
hdlr.cyh_arg = (void *) 2UL;
|
||||
when.cyt_interval = 1000000000;
|
||||
id2 = cyclic_add(&hdlr, &when);
|
||||
|
||||
hdlr.cyh_arg = (void *) 3UL;
|
||||
when.cyt_interval = 1300000000;
|
||||
id3 = cyclic_add(&hdlr, &when);
|
||||
|
||||
mutex_exit(&cpu_lock);
|
||||
|
||||
DELAY(1200000);
|
||||
|
||||
mutex_enter(&cpu_lock);
|
||||
|
||||
cyclic_remove(id);
|
||||
cyclic_remove(id1);
|
||||
cyclic_remove(id2);
|
||||
cyclic_remove(id3);
|
||||
|
||||
mutex_exit(&cpu_lock);
|
||||
|
||||
printf("%s: %s\n",__func__, error == 0 ? "passed":"failed");
|
||||
}
|
||||
|
||||
/* Kernel thread command routine. */
|
||||
static void
|
||||
cyclic_run_tests(void *arg)
|
||||
{
|
||||
intptr_t cmd = (intptr_t) arg;
|
||||
|
||||
switch (cmd) {
|
||||
case 1:
|
||||
cyclic_test_001();
|
||||
break;
|
||||
case 2:
|
||||
cyclic_test_002();
|
||||
break;
|
||||
case 3:
|
||||
cyclic_test_003();
|
||||
break;
|
||||
default:
|
||||
cyclic_test_001();
|
||||
cyclic_test_002();
|
||||
cyclic_test_003();
|
||||
break;
|
||||
}
|
||||
|
||||
printf("%s: finished\n",__func__);
|
||||
|
||||
kthread_exit();
|
||||
}
|
||||
|
||||
static int
|
||||
cyclic_test(SYSCTL_HANDLER_ARGS)
|
||||
{
|
||||
int error, cmd = 0;
|
||||
|
||||
error = sysctl_wire_old_buffer(req, sizeof(int));
|
||||
if (error == 0)
|
||||
error = sysctl_handle_int(oidp, &cmd, 0, req);
|
||||
if (error != 0 || req->newptr == NULL)
|
||||
return (error);
|
||||
|
||||
/* Check for command validity. */
|
||||
switch (cmd) {
|
||||
case 1:
|
||||
case 2:
|
||||
case -1:
|
||||
/*
|
||||
* Execute the tests in a kernel thread to avoid blocking
|
||||
* the sysctl. Look for the results in the syslog.
|
||||
*/
|
||||
error = kthread_add(cyclic_run_tests, (void *)(uintptr_t) cmd,
|
||||
NULL, NULL, 0, 0, "cyctest%d", cmd);
|
||||
break;
|
||||
default:
|
||||
printf("Usage: debug.cyclic.test=(1..9) or -1 for all tests\n");
|
||||
error = EINVAL;
|
||||
break;
|
||||
}
|
||||
|
||||
return (error);
|
||||
}
|
||||
|
||||
SYSCTL_NODE(_debug, OID_AUTO, cyclic, CTLFLAG_RW, NULL, "Cyclic nodes");
|
||||
SYSCTL_PROC(_debug_cyclic, OID_AUTO, test, CTLTYPE_INT | CTLFLAG_RW, 0, 0,
|
||||
cyclic_test, "I", "Enables a cyclic test. Use -1 for all tests.");
|
||||
|
||||
static int
|
||||
cyclic_test_modevent(module_t mod, int type, void *data)
|
||||
{
|
||||
int error = 0;
|
||||
|
||||
switch (type) {
|
||||
case MOD_LOAD:
|
||||
break;
|
||||
|
||||
case MOD_UNLOAD:
|
||||
break;
|
||||
|
||||
case MOD_SHUTDOWN:
|
||||
break;
|
||||
|
||||
default:
|
||||
error = EOPNOTSUPP;
|
||||
break;
|
||||
|
||||
}
|
||||
return (error);
|
||||
}
|
||||
|
||||
DEV_MODULE(cyclic_test, cyclic_test_modevent, NULL);
|
||||
MODULE_VERSION(cyclic_test, 1);
|
||||
MODULE_DEPEND(cyclic_test, cyclic, 1, 1, 1);
|
||||
MODULE_DEPEND(cyclic_test, opensolaris, 1, 1, 1);
|
133
sys/cddl/dev/cyclic/i386/cyclic_machdep.c
Normal file
133
sys/cddl/dev/cyclic/i386/cyclic_machdep.c
Normal file
@ -0,0 +1,133 @@
|
||||
/*-
|
||||
* Copyright 2006-2008 John Birrell <jb@FreeBSD.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*
|
||||
*/
|
||||
|
||||
static void enable(cyb_arg_t);
|
||||
static void disable(cyb_arg_t);
|
||||
static void reprogram(cyb_arg_t, hrtime_t);
|
||||
static void xcall(cyb_arg_t, cpu_t *, cyc_func_t, void *);
|
||||
|
||||
static cyc_backend_t be = {
|
||||
NULL, /* cyb_configure */
|
||||
NULL, /* cyb_unconfigure */
|
||||
enable,
|
||||
disable,
|
||||
reprogram,
|
||||
xcall,
|
||||
NULL /* cyb_arg_t cyb_arg */
|
||||
};
|
||||
|
||||
static void
|
||||
cyclic_ap_start(void *dummy)
|
||||
{
|
||||
/* Initialise the rest of the CPUs. */
|
||||
cyclic_mp_init();
|
||||
}
|
||||
|
||||
SYSINIT(cyclic_ap_start, SI_SUB_SMP, SI_ORDER_ANY, cyclic_ap_start, NULL);
|
||||
|
||||
/*
|
||||
* Machine dependent cyclic subsystem initialisation.
|
||||
*/
|
||||
static void
|
||||
cyclic_machdep_init(void)
|
||||
{
|
||||
/* Register the cyclic backend. */
|
||||
cyclic_init(&be);
|
||||
}
|
||||
|
||||
static void
|
||||
cyclic_machdep_uninit(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i <= mp_maxid; i++)
|
||||
/* Reset the cyclic clock callback hook. */
|
||||
lapic_cyclic_clock_func[i] = NULL;
|
||||
|
||||
/* De-register the cyclic backend. */
|
||||
cyclic_uninit();
|
||||
}
|
||||
|
||||
static hrtime_t exp_due[MAXCPU];
|
||||
|
||||
/*
|
||||
* This function is the one registered by the machine dependent
|
||||
* initialiser as the callback for high speed timer events.
|
||||
*/
|
||||
static void
|
||||
cyclic_clock(struct trapframe *frame)
|
||||
{
|
||||
cpu_t *c = &solaris_cpu[curcpu];
|
||||
|
||||
if (c->cpu_cyclic != NULL && gethrtime() >= exp_due[curcpu]) {
|
||||
if (TRAPF_USERMODE(frame)) {
|
||||
c->cpu_profile_pc = 0;
|
||||
c->cpu_profile_upc = TRAPF_PC(frame);
|
||||
} else {
|
||||
c->cpu_profile_pc = TRAPF_PC(frame);
|
||||
c->cpu_profile_upc = 0;
|
||||
}
|
||||
|
||||
c->cpu_intr_actv = 1;
|
||||
|
||||
/* Fire any timers that are due. */
|
||||
cyclic_fire(c);
|
||||
|
||||
c->cpu_intr_actv = 0;
|
||||
}
|
||||
}
|
||||
|
||||
static void enable(cyb_arg_t arg)
|
||||
{
|
||||
/* Register the cyclic clock callback function. */
|
||||
lapic_cyclic_clock_func[curcpu] = cyclic_clock;
|
||||
}
|
||||
|
||||
static void disable(cyb_arg_t arg)
|
||||
{
|
||||
/* Reset the cyclic clock callback function. */
|
||||
lapic_cyclic_clock_func[curcpu] = NULL;
|
||||
}
|
||||
|
||||
static void reprogram(cyb_arg_t arg, hrtime_t exp)
|
||||
{
|
||||
exp_due[curcpu] = exp;
|
||||
}
|
||||
|
||||
static void xcall(cyb_arg_t arg, cpu_t *c, cyc_func_t func, void *param)
|
||||
{
|
||||
/*
|
||||
* If the target CPU is the current one, just call the
|
||||
* function. This covers the non-SMP case.
|
||||
*/
|
||||
if (c == &solaris_cpu[curcpu])
|
||||
(*func)(param);
|
||||
else
|
||||
smp_rendezvous_cpus((cpumask_t) (1 << c->cpuid), NULL,
|
||||
func, smp_no_rendevous_barrier, param);
|
||||
}
|
Loading…
Reference in New Issue
Block a user