diff options
author | benno <benno@FreeBSD.org> | 2003-02-05 11:16:36 +0000 |
---|---|---|
committer | benno <benno@FreeBSD.org> | 2003-02-05 11:16:36 +0000 |
commit | 53ee945def248d5dc6271513ea65d8cbea225e2f (patch) | |
tree | 41e32960fe09541fefdb8a76431fe6941b824a5c /sys/powerpc | |
parent | cb1b00f178acd296de226ff6b548687a07fdac36 (diff) | |
download | FreeBSD-src-53ee945def248d5dc6271513ea65d8cbea225e2f.zip FreeBSD-src-53ee945def248d5dc6271513ea65d8cbea225e2f.tar.gz |
- Rename the "powerpc" timecounter to the "decrementer" timecounter.
- Initialise it earlier.
Diffstat (limited to 'sys/powerpc')
-rw-r--r-- | sys/powerpc/aim/clock.c | 21 | ||||
-rw-r--r-- | sys/powerpc/aim/machdep.c | 5 | ||||
-rw-r--r-- | sys/powerpc/include/md_var.h | 2 | ||||
-rw-r--r-- | sys/powerpc/powerpc/clock.c | 21 | ||||
-rw-r--r-- | sys/powerpc/powerpc/machdep.c | 5 |
5 files changed, 40 insertions, 14 deletions
diff --git a/sys/powerpc/aim/clock.c b/sys/powerpc/aim/clock.c index a28d376..073f9eb 100644 --- a/sys/powerpc/aim/clock.c +++ b/sys/powerpc/aim/clock.c @@ -99,14 +99,14 @@ extern int adb_set_date_time(int); static int clockinitted = 0; -static timecounter_get_t powerpc_get_timecount; +static timecounter_get_t decr_get_timecount; -static struct timecounter powerpc_timecounter = { - powerpc_get_timecount, /* get_timecount */ +static struct timecounter decr_timecounter = { + decr_get_timecount, /* get_timecount */ 0, /* no poll_pps */ ~0u, /* counter_mask */ 0, /* frequency */ - "powerpc" /* name */ + "decrementer" /* name */ }; void @@ -236,6 +236,13 @@ decr_intr(struct clockframe *frame) void cpu_initclocks(void) { + + return; +} + +void +decr_init(void) +{ int qhandle, phandle; char name[32]; unsigned int msr; @@ -256,8 +263,8 @@ cpu_initclocks(void) msr = mfmsr(); mtmsr(msr & ~(PSL_EE|PSL_RI)); - powerpc_timecounter.tc_frequency = ticks_per_sec; - tc_init(&powerpc_timecounter); + decr_timecounter.tc_frequency = ticks_per_sec; + tc_init(&decr_timecounter); ns_per_tick = 1000000000 / ticks_per_sec; ticks_per_intr = ticks_per_sec / hz; @@ -292,7 +299,7 @@ mftb(void) } static unsigned -powerpc_get_timecount(struct timecounter *tc) +decr_get_timecount(struct timecounter *tc) { return mftb(); } diff --git a/sys/powerpc/aim/machdep.c b/sys/powerpc/aim/machdep.c index 48f6bc4..0aa3344 100644 --- a/sys/powerpc/aim/machdep.c +++ b/sys/powerpc/aim/machdep.c @@ -178,6 +178,11 @@ cpu_startup(void *dummy) { /* + * Initialise the decrementer-based clock. + */ + decr_init(); + + /* * Good {morning,afternoon,evening,night}. */ identifycpu(); diff --git a/sys/powerpc/include/md_var.h b/sys/powerpc/include/md_var.h index 5e4f93a..603a541 100644 --- a/sys/powerpc/include/md_var.h +++ b/sys/powerpc/include/md_var.h @@ -54,4 +54,6 @@ void cpu_reset(void); int is_physical_memory(vm_offset_t addr); void swi_vm(void *); +void decr_init(void); + #endif /* !_MACHINE_MD_VAR_H_ */ diff --git a/sys/powerpc/powerpc/clock.c b/sys/powerpc/powerpc/clock.c index a28d376..073f9eb 100644 --- a/sys/powerpc/powerpc/clock.c +++ b/sys/powerpc/powerpc/clock.c @@ -99,14 +99,14 @@ extern int adb_set_date_time(int); static int clockinitted = 0; -static timecounter_get_t powerpc_get_timecount; +static timecounter_get_t decr_get_timecount; -static struct timecounter powerpc_timecounter = { - powerpc_get_timecount, /* get_timecount */ +static struct timecounter decr_timecounter = { + decr_get_timecount, /* get_timecount */ 0, /* no poll_pps */ ~0u, /* counter_mask */ 0, /* frequency */ - "powerpc" /* name */ + "decrementer" /* name */ }; void @@ -236,6 +236,13 @@ decr_intr(struct clockframe *frame) void cpu_initclocks(void) { + + return; +} + +void +decr_init(void) +{ int qhandle, phandle; char name[32]; unsigned int msr; @@ -256,8 +263,8 @@ cpu_initclocks(void) msr = mfmsr(); mtmsr(msr & ~(PSL_EE|PSL_RI)); - powerpc_timecounter.tc_frequency = ticks_per_sec; - tc_init(&powerpc_timecounter); + decr_timecounter.tc_frequency = ticks_per_sec; + tc_init(&decr_timecounter); ns_per_tick = 1000000000 / ticks_per_sec; ticks_per_intr = ticks_per_sec / hz; @@ -292,7 +299,7 @@ mftb(void) } static unsigned -powerpc_get_timecount(struct timecounter *tc) +decr_get_timecount(struct timecounter *tc) { return mftb(); } diff --git a/sys/powerpc/powerpc/machdep.c b/sys/powerpc/powerpc/machdep.c index 48f6bc4..0aa3344 100644 --- a/sys/powerpc/powerpc/machdep.c +++ b/sys/powerpc/powerpc/machdep.c @@ -178,6 +178,11 @@ cpu_startup(void *dummy) { /* + * Initialise the decrementer-based clock. + */ + decr_init(); + + /* * Good {morning,afternoon,evening,night}. */ identifycpu(); |