2005-01-07 02:29:27 +00:00
|
|
|
/*-
|
1998-06-10 10:57:29 +00:00
|
|
|
* Kernel interface to machine-dependent clock driver.
|
|
|
|
* Garrett Wollman, September 1994.
|
|
|
|
* This file is in the public domain.
|
|
|
|
*
|
1999-08-28 01:08:13 +00:00
|
|
|
* $FreeBSD$
|
1998-06-10 10:57:29 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _MACHINE_CLOCK_H_
|
|
|
|
#define _MACHINE_CLOCK_H_
|
|
|
|
|
1999-12-29 04:46:21 +00:00
|
|
|
#ifdef _KERNEL
|
1998-06-10 10:57:29 +00:00
|
|
|
|
1998-10-06 08:40:18 +00:00
|
|
|
extern int disable_rtc_set;
|
1998-06-10 10:57:29 +00:00
|
|
|
extern int wall_cmos_clock;
|
|
|
|
extern int adjkerntz;
|
|
|
|
|
2005-12-24 08:27:45 +00:00
|
|
|
struct trapframe;
|
|
|
|
|
2002-03-20 23:17:50 +00:00
|
|
|
int sysbeep(int pitch, int period);
|
|
|
|
int acquire_timer2(int mode);
|
|
|
|
int release_timer2(void);
|
1998-06-10 10:57:29 +00:00
|
|
|
|
Tweak how the MD code calls the fooclock() methods some. Instead of
passing a pointer to an opaque clockframe structure and requiring the
MD code to supply CLKF_FOO() macros to extract needed values out of the
opaque structure, just pass the needed values directly. In practice this
means passing the pair (usermode, pc) to hardclock() and profclock() and
passing the boolean (usermode) to hardclock_cpu() and hardclock_process().
Other details:
- Axe clockframe and CLKF_FOO() macros on all architectures. Basically,
all the archs were taking a trapframe and converting it into a clockframe
one way or another. Now they can just extract the PC and usermode values
directly out of the trapframe and pass it to fooclock().
- Renamed hardclock_process() to hardclock_cpu() as the latter is more
accurate.
- On Alpha, we now run profclock() at hz (profhz == hz) rather than at
the slower stathz.
- On Alpha, for the TurboLaser machines that don't have an 8254
timecounter, call hardclock() directly. This removes an extra
conditional check from every clock interrupt on Alpha on the BSP.
There is probably room for even further pruning here by changing Alpha
to use the simplified timecounter we use on x86 with the lapic timer
since we don't get interrupts from the 8254 on Alpha anyway.
- On x86, clkintr() shouldn't ever be called now unless using_lapic_timer
is false, so add a KASSERT() to that affect and remove a condition
to slightly optimize the non-lapic case.
- Change prototypeof arm_handler_execute() so that it's first arg is a
trapframe pointer rather than a void pointer for clarity.
- Use KCOUNT macro in profclock() to lookup the kernel profiling bucket.
Tested on: alpha, amd64, arm, i386, ia64, sparc64
Reviewed by: bde (mostly)
2005-12-22 22:16:09 +00:00
|
|
|
void decr_intr(struct trapframe *);
|
2001-06-16 07:14:07 +00:00
|
|
|
|
1999-12-29 04:46:21 +00:00
|
|
|
#endif
|
1998-06-10 10:57:29 +00:00
|
|
|
|
|
|
|
#endif /* !_MACHINE_CLOCK_H_ */
|