blob: 2e32e1f2a14b44bc3be07ff9cb12f9b4485f639f [file] [log] [blame]
Dennis Huang6d037712014-04-22 19:20:59 -07001/*
2 * Copyright (c) 2008 Travis Geiselbrecht
3 * Copyright (c) 2012-2013, NVIDIA CORPORATION. All rights reserved
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining
6 * a copy of this software and associated documentation files
7 * (the "Software"), to deal in the Software without restriction,
8 * including without limitation the rights to use, copy, modify, merge,
9 * publish, distribute, sublicense, and/or sell copies of the Software,
10 * and to permit persons to whom the Software is furnished to do so,
11 * subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be
14 * included in all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 */
24#ifndef __PLATFORM_H
25#define __PLATFORM_H
26
27#include <sys/types.h>
28
29lk_time_t current_time(void);
30lk_bigtime_t current_time_hires(void);
31
32/* super early platform initialization, before almost everything */
33void platform_early_init(void);
34
35/* later init, after the kernel has come up */
36void platform_init(void);
37
38/* called by the arch init code to get the platform to set up any mmu mappings it may need */
39void platform_init_mmu_mappings(void);
40
41/* used by platforms to implement their own idle routine */
42void platform_idle(void);
43
44/* return l2x0 base address */
45uint32_t platform_l2x0_base(void);
46
47/* init outer cache */
48void platform_init_outer(void);
49
50/* handle syscall */
51bool platform_syscall_handler(void *arg);
52
Dennis Huang6d037712014-04-22 19:20:59 -070053/* Get a random number */
54uint32_t platform_get_rand32(void);
55#endif