* [PATCH] xen: portability clean up and some minor clean up for xencomm.c
@ 2008-07-03 7:12 Isaku Yamahata
2008-07-03 21:53 ` Jeremy Fitzhardinge
0 siblings, 1 reply; 2+ messages in thread
From: Isaku Yamahata @ 2008-07-03 7:12 UTC (permalink / raw)
To: jeremy
Cc: linux-kernel, virtualization, linux-ia64, xen-devel,
xen-ia64-devel, Luck, Tony
clean up of xencomm.c. is_phys_contiguous() is arch dependent
function that depends on how virtual memory are laid out.
So split out the function into arch specific code.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Cc: "Luck, Tony" <tony.luck@intel.com>
---
drivers/xen/xencomm.c | 23 ++++-------------------
1 files changed, 4 insertions(+), 19 deletions(-)
diff --git a/drivers/xen/xencomm.c b/drivers/xen/xencomm.c
index 797cb4e..a240b2c 100644
--- a/drivers/xen/xencomm.c
+++ b/drivers/xen/xencomm.c
@@ -23,13 +23,7 @@
#include <asm/page.h>
#include <xen/xencomm.h>
#include <xen/interface/xen.h>
-#ifdef __ia64__
-#include <asm/xen/xencomm.h> /* for is_kern_addr() */
-#endif
-
-#ifdef HAVE_XEN_PLATFORM_COMPAT_H
-#include <xen/platform-compat.h>
-#endif
+#include <asm/xen/xencomm.h> /* for xencomm_is_phys_contiguous() */
static int xencomm_init(struct xencomm_desc *desc,
void *buffer, unsigned long bytes)
@@ -157,20 +151,11 @@ static int xencomm_create(void *buffer, unsigned long bytes,
return 0;
}
-/* check if memory address is within VMALLOC region */
-static int is_phys_contiguous(unsigned long addr)
-{
- if (!is_kernel_addr(addr))
- return 0;
-
- return (addr < VMALLOC_START) || (addr >= VMALLOC_END);
-}
-
static struct xencomm_handle *xencomm_create_inline(void *ptr)
{
unsigned long paddr;
- BUG_ON(!is_phys_contiguous((unsigned long)ptr));
+ BUG_ON(!xencomm_is_phys_contiguous((unsigned long)ptr));
paddr = (unsigned long)xencomm_pa(ptr);
BUG_ON(paddr & XENCOMM_INLINE_FLAG);
@@ -202,7 +187,7 @@ struct xencomm_handle *xencomm_map(void *ptr, unsigned long bytes)
int rc;
struct xencomm_desc *desc;
- if (is_phys_contiguous((unsigned long)ptr))
+ if (xencomm_is_phys_contiguous((unsigned long)ptr))
return xencomm_create_inline(ptr);
rc = xencomm_create(ptr, bytes, &desc, GFP_KERNEL);
@@ -219,7 +204,7 @@ struct xencomm_handle *__xencomm_map_no_alloc(void *ptr, unsigned long bytes,
int rc;
struct xencomm_desc *desc = NULL;
- if (is_phys_contiguous((unsigned long)ptr))
+ if (xencomm_is_phys_contiguous((unsigned long)ptr))
return xencomm_create_inline(ptr);
rc = xencomm_create_mini(ptr, bytes, xc_desc,
--
1.5.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] xen: portability clean up and some minor clean up for xencomm.c
2008-07-03 7:12 [PATCH] xen: portability clean up and some minor clean up for xencomm.c Isaku Yamahata
@ 2008-07-03 21:53 ` Jeremy Fitzhardinge
0 siblings, 0 replies; 2+ messages in thread
From: Jeremy Fitzhardinge @ 2008-07-03 21:53 UTC (permalink / raw)
To: Isaku Yamahata
Cc: linux-kernel, virtualization, linux-ia64, xen-devel,
xen-ia64-devel, Luck, Tony
Isaku Yamahata wrote:
> clean up of xencomm.c. is_phys_contiguous() is arch dependent
> function that depends on how virtual memory are laid out.
> So split out the function into arch specific code.
>
I suppose. But given that ia64 is the only user of xencomm, I'm not too
concerned about it. And unless Arm uses it, I suspect it may always be
the only user...
J
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-07-03 21:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-03 7:12 [PATCH] xen: portability clean up and some minor clean up for xencomm.c Isaku Yamahata
2008-07-03 21:53 ` Jeremy Fitzhardinge
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox