diff options
author | Franck Bui-Huu <fbuihuu@gmail.com> | 2007-01-10 03:44:05 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2007-02-06 11:53:13 -0500 |
commit | 6f284a2ce7b8bc49cb8455b1763357897a899abb (patch) | |
tree | abf59702fad617780f59594aa8939db7ec4c76d6 /include/asm-mips/io.h | |
parent | db84dc61552ae0d198a8133d28b80c3838930ba8 (diff) |
[MIPS] FLATMEM: introduce PHYS_OFFSET.
The old code was assuming that min_low_pfn was always 0. This
means that platforms having a big hole at their memory start
paid the price of wasting some memory for the allocation of
unused entries in mem_map[].
This patch prevents this waste.
It introduces PHYS_OFFSET define which is the start of the
physical memory and uses it wherever needed. Specially when
converting physical/virtual addresses into virtual/physical
ones.
Currently all platforms defines PHYS_OFFSET to 0.
Signed-off-by: Franck Bui-Huu <fbuihuu@gmail.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'include/asm-mips/io.h')
-rw-r--r-- | include/asm-mips/io.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/asm-mips/io.h b/include/asm-mips/io.h index d77b657c09c7..67f081078904 100644 --- a/include/asm-mips/io.h +++ b/include/asm-mips/io.h | |||
@@ -115,7 +115,7 @@ static inline void set_io_port_base(unsigned long base) | |||
115 | */ | 115 | */ |
116 | static inline unsigned long virt_to_phys(volatile const void *address) | 116 | static inline unsigned long virt_to_phys(volatile const void *address) |
117 | { | 117 | { |
118 | return (unsigned long)address - PAGE_OFFSET; | 118 | return (unsigned long)address - PAGE_OFFSET + PHYS_OFFSET; |
119 | } | 119 | } |
120 | 120 | ||
121 | /* | 121 | /* |
@@ -132,7 +132,7 @@ static inline unsigned long virt_to_phys(volatile const void *address) | |||
132 | */ | 132 | */ |
133 | static inline void * phys_to_virt(unsigned long address) | 133 | static inline void * phys_to_virt(unsigned long address) |
134 | { | 134 | { |
135 | return (void *)(address + PAGE_OFFSET); | 135 | return (void *)(address + PAGE_OFFSET - PHYS_OFFSET); |
136 | } | 136 | } |
137 | 137 | ||
138 | /* | 138 | /* |