1 // Copyright 2016 The Fuchsia Authors
2 // Copyright (c) 2008 Travis Geiselbrecht
3 //
4 // Use of this source code is governed by a MIT-style
5 // license that can be found in the LICENSE file or at
6 // https://opensource.org/licenses/MIT
7 
8 #pragma once
9 
10 #include <sys/types.h>
11 #include <zircon/compiler.h>
12 #include <zircon/types.h>
13 
14 __BEGIN_CDECLS
15 
16 typedef void(*platform_timer_callback)(zx_time_t now);
17 
18 // API to set/clear a hardware timer that is responsible for calling timer_tick() when it fires
19 zx_status_t platform_set_oneshot_timer(zx_time_t deadline);
20 void        platform_stop_timer(void);
21 
22 // Shutdown the calling CPU's platform timer.
23 //
24 // Should be called after |platform_stop_timer|, but before taking the CPU offline.
25 //
26 // TODO(maniscalco): Provide a "resume" function so we can suspend/resume.
27 void platform_shutdown_timer(void);
28 
29 void timer_tick(zx_time_t now);
30 
31 __END_CDECLS
32