-/* $OpenBSD: _types.h,v 1.20 2018/03/05 01:15:25 deraadt Exp $ */
+/* $OpenBSD: _types.h,v 1.21 2022/12/06 01:19:35 cheloha Exp $ */
/*-
* Copyright (c) 1990, 1993
#ifndef _SH__TYPES_H_
#define _SH__TYPES_H_
+#define __HAVE_CLOCKINTR
+
#if defined(_KERNEL)
typedef struct label_t {
long val[9];
-/* $OpenBSD: cpu.h,v 1.33 2022/02/21 10:44:58 jsg Exp $ */
+/* $OpenBSD: cpu.h,v 1.34 2022/12/06 01:19:35 cheloha Exp $ */
/* $NetBSD: cpu.h,v 1.41 2006/01/21 04:24:12 uwe Exp $ */
/*-
*/
#include <machine/intr.h>
+#include <sys/clockintr.h>
#include <sys/sched.h>
struct cpu_info {
int ci_want_resched;
+ struct clockintr_queue ci_queue;
+
char ci_panicbuf[512];
};
-/* $OpenBSD: clock.c,v 1.11 2020/10/20 15:59:17 cheloha Exp $ */
+/* $OpenBSD: clock.c,v 1.12 2022/12/06 01:19:35 cheloha Exp $ */
/* $NetBSD: clock.c,v 1.32 2006/09/05 11:09:36 uwe Exp $ */
/*-
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
+#include <sys/clockintr.h>
#include <sys/device.h>
#include <sys/timetc.h>
void
setstatclockrate(int newhz)
{
- /* XXX not yet */
+ clockintr_setstatclockrate(newhz);
}
u_int
tick = 1000000 / hz;
tick_nsec = 1000000000 / hz;
+ stathz = hz;
+ profhz = stathz;
+ clockintr_init(0);
+
+ clockintr_cpu_init(NULL);
+
/*
* Use TMU channel 0 as hard clock
*/
/* clear underflow status */
_reg_bclr_2(SH3_TCR0, TCR_UNF);
- hardclock(arg);
+ clockintr_dispatch(arg);
return (1);
}
/* clear underflow status */
_reg_bclr_2(SH4_TCR0, TCR_UNF);
- hardclock(arg);
+ clockintr_dispatch(arg);
return (1);
}