Re: [PATCH 1/2] asm-generic: add MMU variants of io.h functions
From: Mike Frysinger <hidden>
Date: 2011-07-02 17:04:28
Also in:
lkml
From: Mike Frysinger <hidden>
Date: 2011-07-02 17:04:28
Also in:
lkml
On Sat, Jul 2, 2011 at 12:47, Jonas Bonn wrote:
On Sat, 2011-07-02 at 12:38 -0400, Mike Frysinger wrote:quoted
On Sat, Jul 2, 2011 at 11:53, Jonas Bonn wrote:quoted
+#ifdef CONFIG_MMU +#define xlate_dev_mem_ptr(p) __va(p) +#else #define xlate_dev_mem_ptr(p) ((void *) (p)) +#endifi wonder if we could do: #ifndef __va #define __va(p) ((void *)(p)) #endif #define xlate_dev_mem_ptr(p) __va(p) -mikeThis seems to introduce an artificial definition of a "virtual" address for systems without an MMU, which strikes me as a bit odd. If this is what people prefer, that's fine... I think I prefer the former variant, though.
this isnt a problem. we do this sort of thing in many places since people develop under MMU and use the API that exists there. however, i see that we already have __va() in asm-generic/page.h. so you can assume __va() exists. so just change the existing definition to: #define xlate_dev_mem_ptr(p) __va(p) -mike