d222593f419344881e9ea34a86205a7f30662285
[rpi-open-firmware.git] / arm_chainloader / chainloader.h
1 #pragma once
2
3 #include <lib/runtime.h>
4 #include <stdint.h>
5 #include <stddef.h>
6 #include <memory_map.h>
7
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11
12 static inline void __attribute__((noreturn)) hang_cpu() {
13 __asm__ __volatile__ (
14 "wfi\n"
15 );
16
17 /* in case the above fails */
18 for (;;) {
19 __asm__ __volatile__ ("nop\nnop\nnop\nnop\nnop\nnop");
20 }
21 }
22
23 #define STATIC_INIT_PRIORITY(x) __attribute__((init_priority(x)))
24
25 #define STATIC_CPRMAN_DRIVER STATIC_INIT_PRIORITY(101)
26 #define STATIC_DRIVER STATIC_INIT_PRIORITY(200)
27 #define STATIC_FILESYSTEM STATIC_INIT_PRIORITY(300)
28 #define STATIC_APP STATIC_INIT_PRIORITY(600)
29
30 #define mfence() __sync_synchronize()
31
32 #define NBBY 8
33
34 #define __BIT(__n) \
35 (((uintmax_t)(__n) >= NBBY * sizeof(uintmax_t)) ? 0 : \
36 ((uintmax_t)1 << (uintmax_t)((__n) & (NBBY * sizeof(uintmax_t) - 1))))
37
38 #ifdef __cplusplus
39 }
40 #endif
41
This page took 0.061917 seconds and 3 git commands to generate.