1 /****************************************************************************** 2 * include/asm-x86/hap.h 3 * 4 * hardware-assisted paging 5 * Copyright (c) 2007 Advanced Micro Devices (Wei Huang) 6 * 7 * Parts of this code are Copyright (c) 2006 by XenSource Inc. 8 * Parts of this code are Copyright (c) 2006 by Michael A Fetterman 9 * Parts based on earlier work by Michael A Fetterman, Ian Pratt et al. 10 * 11 * This program is free software; you can redistribute it and/or modify 12 * it under the terms of the GNU General Public License as published by 13 * the Free Software Foundation; either version 2 of the License, or 14 * (at your option) any later version. 15 * 16 * This program is distributed in the hope that it will be useful, 17 * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 * GNU General Public License for more details. 20 * 21 * You should have received a copy of the GNU General Public License 22 * along with this program; If not, see <http://www.gnu.org/licenses/>. 23 */ 24 25 #ifndef _XEN_HAP_H 26 #define _XEN_HAP_H 27 28 #define HAP_PRINTK(_f, _a...) \ 29 debugtrace_printk("hap: %s(): " _f, __func__, ##_a) 30 #define HAP_ERROR(_f, _a...) \ 31 printk("hap error: %s(): " _f, __func__, ##_a) 32 33 /************************************************/ 34 /* hap domain level functions */ 35 /************************************************/ 36 void hap_domain_init(struct domain *d); 37 int hap_domctl(struct domain *d, struct xen_domctl_shadow_op *sc, 38 XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl); 39 int hap_enable(struct domain *d, u32 mode); 40 void hap_final_teardown(struct domain *d); 41 void hap_teardown(struct domain *d, bool *preempted); 42 void hap_vcpu_init(struct vcpu *v); 43 int hap_track_dirty_vram(struct domain *d, 44 unsigned long begin_pfn, 45 unsigned long nr, 46 XEN_GUEST_HANDLE_PARAM(void) dirty_bitmap); 47 48 extern const struct paging_mode *hap_paging_get_mode(struct vcpu *); 49 int hap_set_allocation(struct domain *d, unsigned int pages, bool *preempted); 50 51 #endif /* XEN_HAP_H */ 52 53 /* 54 * Local variables: 55 * mode: C 56 * c-file-style: "BSD" 57 * c-basic-offset: 4 58 * indent-tabs-mode: nil 59 * End: 60 */ 61