ia64/xen-unstable

view linux-2.6-xen-sparse/arch/ia64/xen/drivers/patches/gnttab.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 c22741d000a5
children
line source
1 diff -Naur xen/core/gnttab.c xen.patched/core/gnttab.c
2 --- xen/core/gnttab.c 2005-09-23 10:54:50.000000000 -0600
3 +++ xen.patched/core/gnttab.c 2005-09-23 10:57:51.000000000 -0600
4 @@ -346,6 +350,10 @@
5 if ( hypercall.op != __HYPERVISOR_grant_table_op )
6 return -ENOSYS;
8 +
9 +#ifdef __ia64__
10 + ret = HYPERVISOR_grant_table_op(hypercall.arg[0], (void *)hypercall.arg[1], hypercall.arg[2]);
11 +#else
12 /* hypercall-invoking asm taken from privcmd.c */
13 __asm__ __volatile__ (
14 "pushl %%ebx; pushl %%ecx; pushl %%edx; "
15 @@ -359,6 +367,7 @@
16 TRAP_INSTR "; "
17 "popl %%edi; popl %%esi; popl %%edx; popl %%ecx; popl %%ebx"
18 : "=a" (ret) : "0" (&hypercall) : "memory" );
19 +#endif
21 return ret;
22 }
23 @@ -423,8 +432,13 @@
24 BUG_ON(HYPERVISOR_grant_table_op(GNTTABOP_setup_table, &setup, 1));
25 BUG_ON(setup.status != 0);
27 +#ifdef __ia64__
28 + shared = __va(frames[0] << PAGE_SHIFT);
29 + printk("grant table at %p\n", shared);
30 +#else
31 for (i = 0; i < NR_GRANT_FRAMES; i++)
32 set_fixmap(FIX_GNTTAB_END - i, frames[i] << PAGE_SHIFT);
33 +#endif
35 return 0;
36 }
37 @@ -450,7 +466,9 @@
39 BUG_ON(gnttab_resume());
41 +#ifndef __ia64__
42 shared = (grant_entry_t *)fix_to_virt(FIX_GNTTAB_END);
43 +#endif
45 for (i = NR_RESERVED_ENTRIES; i < NR_GRANT_ENTRIES; i++)
46 gnttab_list[i] = i + 1;