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