ia64/xen-unstable

view xen/include/asm-ia64/grant_table.h @ 10614:86cae321e707

Use explicit accessors to handle unusually-sized atomic operations in grant table code.
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
author kaf24@firebug.cl.cam.ac.uk
date Fri Jun 30 10:10:39 2006 +0100 (2006-06-30)
parents ee3d10828937
children c3e20511c745
line source
1 /******************************************************************************
2 * include/asm-ia64/grant_table.h
3 */
5 #ifndef __ASM_GRANT_TABLE_H__
6 #define __ASM_GRANT_TABLE_H__
8 #define ORDER_GRANT_FRAMES 0
10 #ifndef CONFIG_XEN_IA64_DOM0_VP
11 // for grant map/unmap
12 #define create_grant_host_mapping(a, f, fl) 0
13 #define destroy_grant_host_mapping(a, f, fl) 0
15 #else
16 // for grant map/unmap
17 int create_grant_host_mapping(unsigned long gpaddr, unsigned long mfn, unsigned int flags);
18 int destroy_grant_host_mapping(unsigned long gpaddr, unsigned long mfn, unsigned int flags);
20 // for grant transfer
21 void guest_physmap_add_page(struct domain *d, unsigned long gpfn, unsigned long mfn);
23 #endif
25 // for grant table shared page
26 #define gnttab_create_shared_page(d, t, i) \
27 do { \
28 share_xen_page_with_guest( \
29 virt_to_page((char *)(t)->shared + ((i) << PAGE_SHIFT)), \
30 (d), XENSHARE_writable); \
31 } while (0)
34 /* Guest physical address of the grant table. */
35 #define IA64_GRANT_TABLE_PADDR (1UL << 40)
37 #define gnttab_shared_maddr(d, t, i) \
38 virt_to_maddr((char*)(t)->shared + ((i) << PAGE_SHIFT))
40 #ifndef CONFIG_XEN_IA64_DOM0_VP
41 # define gnttab_shared_gmfn(d, t, i) \
42 ({ ((d) == dom0) ? \
43 (virt_to_maddr((t)->shared) >> PAGE_SHIFT) + (i): \
44 assign_domain_page((d), \
45 IA64_GRANT_TABLE_PADDR + ((i) << PAGE_SHIFT), \
46 gnttab_shared_maddr(d, t, i)), \
47 (IA64_GRANT_TABLE_PADDR >> PAGE_SHIFT) + (i);})
48 #else
49 # define gnttab_shared_gmfn(d, t, i) \
50 ({ assign_domain_page((d), \
51 IA64_GRANT_TABLE_PADDR + ((i) << PAGE_SHIFT), \
52 gnttab_shared_maddr((d), (t), (i))); \
53 (IA64_GRANT_TABLE_PADDR >> PAGE_SHIFT) + (i);})
54 #endif
56 #define gnttab_log_dirty(d, f) ((void)0)
58 static inline void gnttab_clear_flag(unsigned long nr, uint16_t *addr)
59 {
60 clear_bit(nr, addr);
61 }
63 #endif /* __ASM_GRANT_TABLE_H__ */