btrfs: Attempt to fix GCC2 build.
[haiku.git] / src / system / kernel / arch / ppc / arch_timer.cpp
blobd8bc17fc0dc495ca09c3a01e6c197e3b35bf4303
1 /*
2 ** Copyright 2001, Travis Geiselbrecht. All rights reserved.
3 ** Distributed under the terms of the NewOS License.
4 */
7 #include <boot/stage2.h>
8 #include <kernel.h>
9 #include <debug.h>
11 #include <timer.h>
12 #include <arch/timer.h>
15 static bigtime_t sTickRate;
18 void
19 arch_timer_set_hardware_timer(bigtime_t timeout)
21 bigtime_t new_val_64;
23 if(timeout < 1000)
24 timeout = 1000;
26 new_val_64 = (timeout * sTickRate) / 1000000;
28 asm("mtdec %0" :: "r"((uint32)new_val_64));
32 void
33 arch_timer_clear_hardware_timer()
35 asm("mtdec %0" :: "r"(0x7fffffff));
39 int
40 arch_init_timer(kernel_args *ka)
42 sTickRate = ka->arch_args.time_base_frequency;
44 return 0;