ia64/xen-unstable

view xen/include/asm-x86/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 0f917d63e960
line source
1 /******************************************************************************
2 * include/asm-x86/grant_table.h
3 *
4 * Copyright (c) 2004-2005 K A Fraser
5 */
7 #ifndef __ASM_GRANT_TABLE_H__
8 #define __ASM_GRANT_TABLE_H__
10 #define ORDER_GRANT_FRAMES 2
12 /*
13 * Caller must own caller's BIGLOCK, is responsible for flushing the TLB, and
14 * must hold a reference to the page.
15 */
16 int create_grant_host_mapping(
17 unsigned long addr, unsigned long frame, unsigned int flags);
18 int destroy_grant_host_mapping(
19 unsigned long addr, unsigned long frame, unsigned int flags);
21 #define gnttab_create_shared_page(d, t, i) \
22 do { \
23 share_xen_page_with_guest( \
24 virt_to_page((char *)(t)->shared + ((i) * PAGE_SIZE)), \
25 (d), XENSHARE_writable); \
26 } while ( 0 )
28 #define gnttab_shared_mfn(d, t, i) \
29 ((virt_to_maddr((t)->shared) >> PAGE_SHIFT) + (i))
31 #define gnttab_shared_gmfn(d, t, i) \
32 (mfn_to_gmfn(d, gnttab_shared_mfn(d, t, i)))
34 #define gnttab_log_dirty(d, f) mark_dirty((d), (f))
36 static inline void gnttab_clear_flag(unsigned long nr, uint16_t *addr)
37 {
38 clear_bit(nr, addr);
39 }
41 #endif /* __ASM_GRANT_TABLE_H__ */