3 * Copyright (c) 2004,2005 Kip Macy
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * 4. The name of the author may not be used to endorse or promote products
15 * derived from this software without specific prior written permission.
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 #ifndef _XEN_XENFUNC_H_
33 #define _XEN_XENFUNC_H_
35 #include <machine/xen/xen-os.h>
36 #include <xen/hypervisor.h>
37 #include <machine/xen/xenpmap.h>
38 #include <machine/segments.h>
40 #define BKPT __asm__("int3");
41 #define XPQ_CALL_DEPTH 5
42 #define XPQ_CALL_COUNT 2
43 #define PG_PRIV PG_AVAIL3
46 unsigned long pt_eip[XPQ_CALL_COUNT][XPQ_CALL_DEPTH];
49 extern pteinfo_t *pteinfo_list;
51 #define __PRINTK(x) printk x
56 char *xen_setbootenv(char *cmd_line);
58 int xen_boothowto(char *envp);
60 void _xen_machphys_update(vm_paddr_t, vm_paddr_t, char *file, int line);
63 #define xen_machphys_update(a, b) _xen_machphys_update((a), (b), __FILE__, __LINE__)
65 #define xen_machphys_update(a, b) _xen_machphys_update((a), (b), NULL, 0)
68 void xen_update_descriptor(union descriptor *, union descriptor *);
70 extern struct mtx balloon_lock;
72 #define balloon_lock(__flags) mtx_lock_irqsave(&balloon_lock, __flags)
73 #define balloon_unlock(__flags) mtx_unlock_irqrestore(&balloon_lock, __flags)
75 #define balloon_lock(__flags) __flags = 1
76 #define balloon_unlock(__flags) __flags = 0
81 #endif /* _XEN_XENFUNC_H_ */