HaikuDepot: notify work status from main window
[haiku.git] / src / libs / compat / freebsd_network / clock.c
blobfce43ccef2ed3b250d622edbe508302e7c3735f2
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 int ticks;
13 static timer sHardClockTimer;
16 /*!
17 * Implementation of FreeBSD's hardclock timer.
19 static status_t
20 hardClock(timer* hardClockTimer)
22 atomic_add((vint32*)&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);