HaikuDepot: notify work status from main window
[haiku.git] / src / libs / compat / freebsd11_network / clock.c
blob43c774314441f8fb4c9650956b07441e5bc03d5c
1 /*
2 * Copyright 2009, Colin Günther, coling@gmx.de
3 * All rights reserved. Distributed under the terms of the MIT License.
4 */
7 #include "device.h"
9 #include <compat/sys/kernel.h>
12 int32 ticks;
13 static timer sHardClockTimer;
16 /*!
17 * Implementation of FreeBSD's hardclock timer.
19 static status_t
20 hardClock(timer* hardClockTimer)
22 atomic_add(&ticks, 1);
23 return B_OK;
27 /*!
28 * Initialization of the hardclock timer which ticks according to hz defined in
29 * compat/sys/kernel.h.
31 status_t
32 init_hard_clock()
34 ticks = 0;
35 return add_timer(&sHardClockTimer, hardClock, ticks_to_usecs(1),
36 B_PERIODIC_TIMER);
40 void
41 uninit_hard_clock()
43 cancel_timer(&sHardClockTimer);