1 /******************************************************************************
2 *
3 * Copyright 2007-2008 Samuel Thibault <samuel.thibault@eu.citrix.com>.
4 * All rights reserved.
5 * Use is subject to license terms.
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation;
10 * version 2.1 of the License.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; If not, see <http://www.gnu.org/licenses/>.
19 */
20
21 #undef NDEBUG
22 #include <mini-os/types.h>
23 #include <mini-os/os.h>
24 #include <mini-os/mm.h>
25 #include <mini-os/lib.h>
26
27 #include <xen/memory.h>
28 #include <unistd.h>
29 #include <fcntl.h>
30 #include <stdio.h>
31 #include <assert.h>
32 #include <stdint.h>
33 #include <inttypes.h>
34 #include <malloc.h>
35
36 #include "xc_private.h"
37
38 /* Optionally flush file to disk and discard page cache */
discard_file_cache(xc_interface * xch,int fd,int flush)39 void discard_file_cache(xc_interface *xch, int fd, int flush)
40 {
41 if (flush)
42 fsync(fd);
43 }
44
xc_memalign(xc_interface * xch,size_t alignment,size_t size)45 void *xc_memalign(xc_interface *xch, size_t alignment, size_t size)
46 {
47 return memalign(alignment, size);
48 }
49
50 /*
51 * Local variables:
52 * mode: C
53 * c-file-style: "BSD"
54 * c-basic-offset: 4
55 * tab-width: 4
56 * indent-tabs-mode: nil
57 * End:
58 */
59