direct-io.hg

view xen/include/asm-ia64/grant_table.h @ 14394:809f36b1b685

Add two arch hooks to gnttab_release_mappings().
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author kfraser@localhost.localdomain
date Thu Mar 15 10:43:13 2007 +0000 (2007-03-15)
parents 01476c7804b2
children 1f7a6456c330
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 INITIAL_NR_GRANT_FRAMES 1
10 // for grant map/unmap
11 int create_grant_host_mapping(unsigned long gpaddr, unsigned long mfn, unsigned int flags);
12 int destroy_grant_host_mapping(unsigned long gpaddr, unsigned long mfn, unsigned int flags);
14 // for grant transfer
15 void guest_physmap_add_page(struct domain *d, unsigned long gpfn, unsigned long mfn);
17 /* XXX
18 * somewhere appropriate
19 * those constand shouldn't be pre-defined and
20 * those area should be reserved by EFI MD.
21 */
22 /* Guest phsyical address of shared_info */
23 #define IA64_SHARED_INFO_PADDR (1UL << 40)
24 /* Guest phsyical address of mapped_regs */
25 #define IA64_XMAPPEDREGS_BASE_PADDR (IA64_SHARED_INFO_PADDR + XSI_SIZE)
26 #define IA64_XMAPPEDREGS_PADDR(vcpu_id) \
27 (IA64_XMAPPEDREGS_BASE_PADDR + \
28 (vcpu_id) * max_t(unsigned long, PAGE_SIZE, XMAPPEDREGS_SIZE))
30 /* Guest physical address of the grant table. */
31 #define IA64_GRANT_TABLE_PADDR IA64_XMAPPEDREGS_PADDR(NR_CPUS)
33 #define gnttab_shared_maddr(t, i) (virt_to_maddr((t)->shared[(i)]))
34 #define gnttab_shared_page(t, i) (virt_to_page((t)->shared[(i)]))
36 #define ia64_gnttab_create_shared_page(d, t, i) \
37 do { \
38 BUG_ON((d)->arch.mm.pgd == NULL); \
39 assign_domain_page((d), \
40 IA64_GRANT_TABLE_PADDR + ((i) << PAGE_SHIFT), \
41 gnttab_shared_maddr((t), (i))); \
42 } while (0)
44 /*
45 * for grant table shared page
46 * grant_table_create() might call this macro before allocating the p2m table.
47 * In such case, arch_domain_create() completes the initialization.
48 */
49 #define gnttab_create_shared_page(d, t, i) \
50 do { \
51 share_xen_page_with_guest(gnttab_shared_page((t), (i)), \
52 (d), XENSHARE_writable); \
53 if ((d)->arch.mm.pgd) \
54 ia64_gnttab_create_shared_page((d), (t), (i)); \
55 } while (0)
57 #define gnttab_shared_gmfn(d, t, i) \
58 ((IA64_GRANT_TABLE_PADDR >> PAGE_SHIFT) + (i))
60 #define gnttab_mark_dirty(d, f) ((void)f)
62 static inline void gnttab_clear_flag(unsigned long nr, uint16_t *addr)
63 {
64 clear_bit(nr, addr);
65 }
67 #define gnttab_release_put_page(page) put_page((page))
68 #define gnttab_release_put_page_and_type(page) put_page_and_type((page))
70 #endif /* __ASM_GRANT_TABLE_H__ */