diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2007-03-19 09:29:34 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2007-03-19 09:29:34 +0000 |
commit | 6d87e1b021587ee59ac15be3eb645ca8734e8874 (patch) | |
tree | feaa14cde66e41d6ab8b73713e9ded1e5f7cbbb1 /sys/arch/i386/include | |
parent | 5804b4d58b53df720ee518760e62566e9c32f13c (diff) |
Move i386 to timecounters. This is more or less the same code as amd64.
The "lapic" timer is ripped out since it wasn't actually a lapic timer,
but a hacked up tsc timer with some synchronization for MP. There is no
tsc timer right now since they are very unreliable on MP systems, systems
with apm, and systems that change the cpu clock. Which basically means
every modern machine out there. We're running with the i8259 timer now.
deraadt@ ok
Diffstat (limited to 'sys/arch/i386/include')
-rw-r--r-- | sys/arch/i386/include/_types.h | 3 | ||||
-rw-r--r-- | sys/arch/i386/include/cpu.h | 21 |
2 files changed, 6 insertions, 18 deletions
diff --git a/sys/arch/i386/include/_types.h b/sys/arch/i386/include/_types.h index cef2a372f29..52cbef65faa 100644 --- a/sys/arch/i386/include/_types.h +++ b/sys/arch/i386/include/_types.h @@ -1,4 +1,4 @@ -/* $OpenBSD: _types.h,v 1.4 2007/02/20 21:15:01 tom Exp $ */ +/* $OpenBSD: _types.h,v 1.5 2007/03/19 09:29:33 art Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -117,5 +117,6 @@ typedef void * __wctype_t; /* Feature test macros */ #define __HAVE_CPUINFO #define __HAVE_MUTEX +#define __HAVE_TIMECOUNTER #endif /* _I386__TYPES_H_ */ diff --git a/sys/arch/i386/include/cpu.h b/sys/arch/i386/include/cpu.h index a066cbea0bb..faebea52539 100644 --- a/sys/arch/i386/include/cpu.h +++ b/sys/arch/i386/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.88 2007/03/15 10:22:29 art Exp $ */ +/* $OpenBSD: cpu.h,v 1.89 2007/03/19 09:29:33 art Exp $ */ /* $NetBSD: cpu.h,v 1.35 1996/05/05 19:29:26 christos Exp $ */ /*- @@ -237,30 +237,15 @@ extern void need_resched(struct cpu_info *); */ extern void (*delay_func)(int); struct timeval; -extern void (*microtime_func)(struct timeval *); #define DELAY(x) (*delay_func)(x) #define delay(x) (*delay_func)(x) -#define microtime(tv) (*microtime_func)(tv) #if defined(I586_CPU) || defined(I686_CPU) /* * High resolution clock support (Pentium only) */ void calibrate_cyclecounter(void); -#ifndef HZ -extern u_quad_t pentium_base_tsc; -#define CPU_CLOCKUPDATE() \ - do { \ - if (cpuspeed) { \ - __asm __volatile("cli\n" \ - "rdtsc\n" \ - : "=A" (pentium_base_tsc) \ - : ); \ - __asm __volatile("sti"); \ - } \ - } while (0) -#endif #endif /* @@ -357,8 +342,10 @@ void initrtclock(void); void startrtclock(void); void rtcdrain(void *); void i8254_delay(int); -void i8254_microtime(struct timeval *); void i8254_initclocks(void); +void i8254_inittimecounter(void); +void i8254_inittimecounter_simple(void); + /* est.c */ #if !defined(SMALL_KERNEL) && defined(I686_CPU) |