diff options
Diffstat (limited to 'util/cbfstool/common.c')
-rw-r--r-- | util/cbfstool/common.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/util/cbfstool/common.c b/util/cbfstool/common.c index e10d9fb4c4..0aaeb13178 100644 --- a/util/cbfstool/common.c +++ b/util/cbfstool/common.c @@ -150,9 +150,19 @@ void *loadfile(const char *filename, uint32_t * romsize_p, void *content, static struct cbfs_header *cbfstool_master_header; static uint32_t phys_start, phys_end, align; uint32_t romsize; -void *cbfstool_offset; +static void *cbfstool_offset; uint32_t arch = CBFS_ARCHITECTURE_UNKNOWN; +static inline void *phys_to_virt(uint32_t addr) +{ + return cbfstool_offset + addr; +} + +static inline uint32_t virt_to_phys(void *addr) +{ + return (unsigned long)(addr - cbfstool_offset) & 0xffffffff; +} + static struct { uint32_t arch; const char *name; |