ia64/xen-unstable

view linux-2.6-xen-sparse/arch/ia64/xen/drivers/patches/privcmd.c.patch @ 7514:5a4893a537ca

Minor driver code changes/rearrangement to reduce ia64-specific patches
Signed-off by: Dan Magenheimer <dan.magenheimer@hp.com>
author djm@kirby.fc.hp.com
date Fri Nov 04 10:40:29 2005 -0600 (2005-11-04)
parents aa81f4e44ca5
children
line source
1 diff -Naur xen/privcmd/privcmd.c xen.patched/privcmd/privcmd.c
2 --- xen/privcmd/privcmd.c 2005-09-23 10:54:50.000000000 -0600
3 +++ xen.patched/privcmd/privcmd.c 2005-09-23 10:57:51.000000000 -0600
4 @@ -180,6 +183,15 @@
5 for (i = 0; i < m.num; i++, addr += PAGE_SIZE, p++) {
6 if (get_user(mfn, p))
7 return -EFAULT;
8 +#ifdef __ia64__
9 + ret = remap_pfn_range(vma,
10 + addr&PAGE_MASK,
11 + mfn,
12 + 1<<PAGE_SHIFT,
13 + vma->vm_page_prot);
14 + if (ret < 0)
15 + goto batch_err;
16 +#else
18 ret = create_lookup_pte_addr(vma->vm_mm, addr, &ptep);
19 if (ret)
20 @@ -190,6 +202,7 @@
22 if (HYPERVISOR_mmu_update(&u, 1, NULL, m.dom) < 0)
23 put_user(0xF0000000 | mfn, p);
24 +#endif
25 }
27 ret = 0;
28 @@ -205,6 +218,7 @@
29 break;
30 #endif
32 +#ifndef __ia64__
33 case IOCTL_PRIVCMD_GET_MACH2PHYS_START_MFN: {
34 unsigned long m2pv = (unsigned long)machine_to_phys_mapping;
35 pgd_t *pgd = pgd_offset_k(m2pv);
36 @@ -216,6 +230,7 @@
37 -EFAULT: 0;
38 }
39 break;
40 +#endif
42 default:
43 ret = -EINVAL;