ia64/xen-unstable

view extras/mini-os/include/mm.h @ 19836:d9890e67d2b7

tools: add SHAREDIR to buildmakevars2file

c/s 19818 dropped SHAREDIR from xen/util/path.py, which broke the "xm
new" command. This patch adds SHAREDIR back to the new
buildmakevars2file-closure function.

Signed-off-by: Ryan O'Connor <rjo@cs.ubc.ca>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Jun 25 13:05:10 2009 +0100 (2009-06-25)
parents 2377bb2d0316
children
line source
1 /* -*- Mode:C; c-basic-offset:4; tab-width:4 -*-
2 *
3 * (C) 2003 - Rolf Neugebauer - Intel Research Cambridge
4 * Copyright (c) 2005, Keir A Fraser
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to
8 * deal in the Software without restriction, including without limitation the
9 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 * sell copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
23 */
25 #ifndef _MM_H_
26 #define _MM_H_
28 #if defined(__i386__)
29 #include <xen/arch-x86_32.h>
30 #elif defined(__x86_64__)
31 #include <xen/arch-x86_64.h>
32 #elif defined(__ia64__)
33 #include <xen/arch-ia64.h>
34 #else
35 #error "Unsupported architecture"
36 #endif
38 #include <mini-os/lib.h>
40 #include <mini-os/arch_limits.h>
41 #include <mini-os/arch_mm.h>
43 #define STACK_SIZE_PAGE_ORDER __STACK_SIZE_PAGE_ORDER
44 #define STACK_SIZE __STACK_SIZE
47 void init_mm(void);
48 unsigned long alloc_pages(int order);
49 #define alloc_page() alloc_pages(0)
50 void free_pages(void *pointer, int order);
51 #define free_page(p) free_pages(p, 0)
53 static __inline__ int get_order(unsigned long size)
54 {
55 int order;
56 size = (size-1) >> PAGE_SHIFT;
57 for ( order = 0; size; order++ )
58 size >>= 1;
59 return order;
60 }
62 void arch_init_demand_mapping_area(unsigned long max_pfn);
63 void arch_init_mm(unsigned long* start_pfn_p, unsigned long* max_pfn_p);
64 void arch_init_p2m(unsigned long max_pfn_p);
66 unsigned long allocate_ondemand(unsigned long n, unsigned long alignment);
67 /* map f[i*stride]+i*increment for i in 0..n-1, aligned on alignment pages */
68 void *map_frames_ex(unsigned long *f, unsigned long n, unsigned long stride,
69 unsigned long increment, unsigned long alignment, domid_t id,
70 int may_fail, unsigned long prot);
71 void do_map_frames(unsigned long addr,
72 unsigned long *f, unsigned long n, unsigned long stride,
73 unsigned long increment, domid_t id, int may_fail, unsigned long prot);
74 int unmap_frames(unsigned long va, unsigned long num_frames);
75 unsigned long alloc_contig_pages(int order, unsigned int addr_bits);
76 #ifdef HAVE_LIBC
77 extern unsigned long heap, brk, heap_mapped, heap_end;
78 #endif
80 int free_physical_pages(xen_pfn_t *mfns, int n);
81 void fini_mm(void);
83 #endif /* _MM_H_ */