diff options
-rw-r--r-- | cp_regs.h | 5 | ||||
-rw-r--r-- | global.h | 5 | ||||
-rw-r--r-- | paging.h | 2 | ||||
-rw-r--r-- | psr.h | 4 | ||||
-rw-r--r-- | strings.h | 5 | ||||
-rw-r--r-- | translation_table_descriptors.h | 4 | ||||
-rw-r--r-- | uart.h | 5 |
7 files changed, 28 insertions, 2 deletions
@@ -1,5 +1,7 @@ -#include <stdint.h> +#ifndef CP_REGS_H +#define CP_REGS_H +#include <stdint.h> // SCTLR - System Control Register @@ -109,3 +111,4 @@ typedef union } fields; } TTBR_t; +#endif // CP_REGS_H @@ -1,3 +1,6 @@ +#ifndef GLOBAL_H +#define GLOBAL_H + // board type, raspi2 #define RASPI 2 @@ -10,3 +13,5 @@ #define GPIO_BASE 0x20200000 #endif // RASPI == 3 || RASPI == 2 #endif // RASPI == 4 + +#endif // GLOBAL_H @@ -3,4 +3,4 @@ void setup_flat_map(void); -#endif +#endif // PAGING_H @@ -1,3 +1,6 @@ +#ifndef PSR_H +#define PSR_H + #include <stdint.h> enum execution_mode { @@ -116,3 +119,4 @@ inline static void set_system_mode(void) // nop function, that just calls itself a given number of times) // doesn't have this magical property :( +#endif // PSR_H @@ -1,3 +1,6 @@ +#ifndef STRINGS_H +#define STRINGS_H + #include <stdint.h> void uint32_to_bits(uint32_t number, char *buf) @@ -7,3 +10,5 @@ void uint32_to_bits(uint32_t number, char *buf) buf[32] = '\0'; } + +#endif // STRINGS_H diff --git a/translation_table_descriptors.h b/translation_table_descriptors.h index b73f594..981c3c7 100644 --- a/translation_table_descriptors.h +++ b/translation_table_descriptors.h @@ -1,3 +1,6 @@ +#ifndef TRANSLATION_TABLE_DESCRIPTORS_H +#define TRANSLATION_TABLE_DESCRIPTORS_H + #include <stdint.h> // ARM lets you choose between 32-bit abd 64-bit translation table @@ -174,3 +177,4 @@ typedef union // 0b11 should not be used #define SHORT_DESCRIPTOR_RESERVED 0b11 +#endif // TRANSLATION_TABLE_DESCRIPTORS_H @@ -1,3 +1,6 @@ +#ifndef UART_H +#define UART_H + #include <stddef.h> #include <stdint.h> #include <global.h> @@ -39,3 +42,5 @@ void uart_init(); void uart_putc(unsigned char c); unsigned char uart_getc(); void uart_puts(const char* str); + +#endif // UART_H |