Blue Swirl wrote:
diff --git a/openbios-devel/include/arch/ppc/io.h b/openbios-devel/include/arch/ppc/io.h index 3449c5b..20586e4 100644 --- a/openbios-devel/include/arch/ppc/io.h +++ b/openbios-devel/include/arch/ppc/io.h @@ -9,6 +9,26 @@ extern char _start, _end; extern unsigned long virt_offset;
+static inline unsigned long
phys_addr_t?
+va2pa(unsigned long va) +{
- if ((va >= (unsigned long)&_start) &&
(va < (unsigned long)&_end))
return va - virt_offset;
- else
return va;
+}
+static inline unsigned long +pa2va(unsigned long pa)
phys_addr_t pa?
+{
- if ((pa + virt_offset >= (unsigned long)&_start) &&
(pa + virt_offset < (unsigned long)&_end))
return pa + virt_offset;
- else
return pa;
+}
Currently none of the SPARC pa <-> va conversion functions use phys_addr_t so I just copied what was already there. Perhaps it would make sense to change these to phys_addr_t before this commit?
ATB,
Mark.