Kevin O'Connor | c167e54 | 2015-09-29 09:40:46 -0400 | [diff] [blame] | 1 | #ifndef __MEMMAP_H |
| 2 | #define __MEMMAP_H |
Kevin O'Connor | 59a23bb | 2008-06-08 23:09:42 -0400 | [diff] [blame] | 3 | |
Kevin O'Connor | eee06e0 | 2015-09-29 10:14:58 -0400 | [diff] [blame] | 4 | #include "types.h" // u32 |
| 5 | |
Kevin O'Connor | 415d429 | 2009-08-30 19:19:31 -0400 | [diff] [blame] | 6 | // A typical OS page size |
| 7 | #define PAGE_SIZE 4096 |
Kevin O'Connor | eee06e0 | 2015-09-29 10:14:58 -0400 | [diff] [blame] | 8 | #define PAGE_SHIFT 12 |
| 9 | |
| 10 | static inline u32 virt_to_phys(void *v) { |
| 11 | return (u32)v; |
| 12 | } |
Kevin O'Connor | fe6682d | 2015-09-22 14:45:25 -0400 | [diff] [blame] | 13 | static inline void *memremap(u32 addr, u32 len) { |
| 14 | return (void*)addr; |
| 15 | } |
Kevin O'Connor | 415d429 | 2009-08-30 19:19:31 -0400 | [diff] [blame] | 16 | |
Kevin O'Connor | 5d91226 | 2015-10-08 11:18:17 -0400 | [diff] [blame] | 17 | // Return the value of a linker script symbol (see scripts/layoutrom.py) |
| 18 | #define SYMBOL(SYM) ({ extern char SYM; (u32)&SYM; }) |
| 19 | #define VSYMBOL(SYM) ((void*)SYMBOL(SYM)) |
| 20 | |
Kevin O'Connor | c167e54 | 2015-09-29 09:40:46 -0400 | [diff] [blame] | 21 | #endif // memmap.h |