e34aea5bface37d08eec8267b97cad628ba1168b
[rpi-open-firmware.git] / lib / runtime.h
1 #pragma once
2
3 #include <stdint.h>
4 #include <stdarg.h>
5 #include <stddef.h>
6
7 #include <lib/panic.h>
8 #include <lib/xprintf.h>
9
10 #ifdef __arm__
11 #define HAS_DYNAMIC_ALLOCATIONS
12 #endif
13
14 #ifdef HAS_DYNAMIC_ALLOCATIONS
15 #include <lib/tlsf/tlsf.h>
16 #endif
17
18 #ifdef __VIDEOCORE4__
19 #include <vc4_types.h>
20 #endif
21
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25
26 extern void udelay(uint32_t time);
27 extern void __cxx_init();
28
29 #ifdef __VIDEOCORE4__
30 extern void *__memcpy(void *_dst, const void *_src, unsigned len);
31 #define memcpy(d,s,l) __memcpy(d,s,l)
32 #endif
33
34 #define bcopy(s,d,l) memcpy(d,s,l)
35
36 #ifndef HAS_DYNAMIC_ALLOCATIONS
37 static inline void* malloc(size_t size) { panic("malloc: dynamic allocations not supported on this configuration"); }
38 static inline void free(void* obj) { panic("free: dynamic allocations not supported on this configuration"); }
39 #endif
40
41 #ifdef __cplusplus
42 }
43 #endif
This page took 0.065253 seconds and 3 git commands to generate.