blob: 22bd4bcb855cd787917bc7679af97842f731df95 [file] [log] [blame]
Kevin O'Connorc167e542015-09-29 09:40:46 -04001#ifndef __MEMMAP_H
2#define __MEMMAP_H
Kevin O'Connor59a23bb2008-06-08 23:09:42 -04003
Kevin O'Connoreee06e02015-09-29 10:14:58 -04004#include "types.h" // u32
5
Kevin O'Connor415d4292009-08-30 19:19:31 -04006// A typical OS page size
7#define PAGE_SIZE 4096
Kevin O'Connoreee06e02015-09-29 10:14:58 -04008#define PAGE_SHIFT 12
9
10static inline u32 virt_to_phys(void *v) {
11 return (u32)v;
12}
Kevin O'Connorfe6682d2015-09-22 14:45:25 -040013static inline void *memremap(u32 addr, u32 len) {
14 return (void*)addr;
15}
Kevin O'Connor415d4292009-08-30 19:19:31 -040016
Kevin O'Connor5d912262015-10-08 11:18:17 -040017// 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'Connorc167e542015-09-29 09:40:46 -040021#endif // memmap.h