diff options
author | vetch <vetch97@gmail.com> | 2020-01-04 11:26:57 +0100 |
---|---|---|
committer | vetch <vetch97@gmail.com> | 2020-01-04 11:26:57 +0100 |
commit | 885a097da42317f48cead2d91c0e0240066943a8 (patch) | |
tree | 0ee86dbaf5678b32f496b99c48ea81bbd20971f2 /global.h | |
parent | 2d31012739a11724844701d07db12e6e1307925e (diff) | |
parent | 814d4a5357d849c4988422d48afa4aaa5432ce78 (diff) | |
download | rpi-MMU-example-885a097da42317f48cead2d91c0e0240066943a8.tar.gz rpi-MMU-example-885a097da42317f48cead2d91c0e0240066943a8.zip |
Merge branch 'bob' of https://repo.or.cz/RPi-MMU-example into alice
# Conflicts:
# demo_functionality.h
# interrupt_vector.S
# interrupts.c
Diffstat (limited to 'global.h')
-rw-r--r-- | global.h | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -1,6 +1,8 @@ #ifndef GLOBAL_H #define GLOBAL_H +#include <stdint.h> + // board type, raspi2 #define RASPI 2 @@ -38,4 +40,14 @@ #define ARM_DISABLE_IRQS_2 (ARM_BASE + 0x220) #define ARM_DISABLE_BASIC_IRQS (ARM_BASE + 0x224) +inline static uint32_t rd32(uint32_t addr) +{ + return *(uint32_t volatile*) addr; +} + +inline static void wr32(uint32_t addr, uint32_t value) +{ + *(uint32_t volatile*) addr = value; +} + #endif // GLOBAL_H |