Print this page
OS-2366 ddi_periodic_add(9F) is entirely rubbish
@@ -21,11 +21,11 @@
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
/*
* Copyright (c) 1988, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2011, Joyent, Inc. All rights reserved.
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
*/
#include <sys/param.h>
#include <sys/t_lock.h>
#include <sys/types.h>
@@ -62,11 +62,11 @@
#include <sys/cyclic.h>
#include <sys/cpupart.h>
#include <sys/rctl.h>
#include <sys/task.h>
#include <sys/sdt.h>
-#include <sys/ddi_timer.h>
+#include <sys/ddi_periodic.h>
#include <sys/random.h>
#include <sys/modctl.h>
#include <sys/zone.h>
/*
@@ -314,11 +314,10 @@
int tod_needsync = 0; /* need to sync tod chip with software time */
static int tod_broken = 0; /* clock chip doesn't work */
time_t boot_time = 0; /* Boot time in seconds since 1970 */
cyclic_id_t clock_cyclic; /* clock()'s cyclic_id */
cyclic_id_t deadman_cyclic; /* deadman()'s cyclic_id */
-cyclic_id_t ddi_timer_cyclic; /* cyclic_timer()'s cyclic_id */
extern void clock_tick_schedule(int);
static int lgrp_ticks; /* counter to schedule lgrp load calcs */
@@ -945,11 +944,11 @@
}
void
clock_init(void)
{
- cyc_handler_t clk_hdlr, timer_hdlr, lbolt_hdlr;
+ cyc_handler_t clk_hdlr, lbolt_hdlr;
cyc_time_t clk_when, lbolt_when;
int i, sz;
intptr_t buf;
/*
@@ -961,18 +960,10 @@
clk_when.cyt_when = 0;
clk_when.cyt_interval = nsec_per_tick;
/*
- * cyclic_timer is dedicated to the ddi interface, which
- * uses the same clock resolution as the system one.
- */
- timer_hdlr.cyh_func = (cyc_func_t)cyclic_timer;
- timer_hdlr.cyh_level = CY_LOCK_LEVEL;
- timer_hdlr.cyh_arg = NULL;
-
- /*
* The lbolt cyclic will be reprogramed to fire at a nsec_per_tick
* interval to satisfy performance needs of the DDI lbolt consumers.
* It is off by default.
*/
lbolt_hdlr.cyh_func = (cyc_func_t)lbolt_cyclic;
@@ -1043,11 +1034,10 @@
* Grab cpu_lock and install all three cyclics.
*/
mutex_enter(&cpu_lock);
clock_cyclic = cyclic_add(&clk_hdlr, &clk_when);
- ddi_timer_cyclic = cyclic_add(&timer_hdlr, &clk_when);
lb_info->id.lbi_cyclic_id = cyclic_add(&lbolt_hdlr, &lbolt_when);
mutex_exit(&cpu_lock);
}