ia64/xen-unstable

view tools/libfsimage/common/fsimage_grub.h @ 19648:f0e2df69a8eb

x86 hvm: Allow cross-vendor migration

Intercept #UD and emulate SYSCALL/SYSENTER/SYSEXIT as necessary.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue May 26 15:01:36 2009 +0100 (2009-05-26)
parents 64f790e90d3d
children
line source
1 /*
2 * Permission is hereby granted, free of charge, to any person obtaining a copy
3 * of this software and associated documentation files (the "Software"), to
4 * deal in the Software without restriction, including without limitation the
5 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
6 * sell copies of the Software, and to permit persons to whom the Software is
7 * furnished to do so, subject to the following conditions:
8 *
9 * The above copyright notice and this permission notice shall be included in
10 * all copies or substantial portions of the Software.
11 *
12 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
17 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
18 * DEALINGS IN THE SOFTWARE.
19 *
20 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
21 * Use is subject to license terms.
22 */
24 #ifndef _FSIMAGE_GRUB_H
25 #define _FSIMAGE_GRUB_H
27 #ifdef __cplusplus
28 extern C {
29 #endif
31 #include <sys/types.h>
32 #include <string.h>
33 #include <stdlib.h>
34 #include <ctype.h>
36 #include "fsimage.h"
37 #include "fsimage_plugin.h"
39 typedef struct fsig_plugin_ops {
40 int fpo_version;
41 int (*fpo_mount)(fsi_file_t *, const char *);
42 int (*fpo_dir)(fsi_file_t *, char *);
43 int (*fpo_read)(fsi_file_t *, char *, int);
44 } fsig_plugin_ops_t;
46 #define STAGE1_5
47 #define FSYS_BUFLEN 0x40000
48 #define SECTOR_BITS 9
49 #define SECTOR_SIZE 0x200
51 #define FSYS_BUF (fsig_file_buf(ffi))
52 #define filepos (*fsig_filepos(ffi))
53 #define filemax (*fsig_filemax(ffi))
54 #define devread fsig_devread
55 #define substring fsig_substring
56 #define errnum (*fsig_errnum(ffi))
57 #define disk_read_func (*fsig_disk_read_junk())
58 #define disk_read_hook (*fsig_disk_read_junk())
59 #define print_possibilities 0
60 #define noisy_printf
62 #define grub_memset memset
63 #define grub_memmove memmove
64 #define grub_log2 fsig_log2
66 extern char **fsig_disk_read_junk(void);
67 unsigned long fsig_log2(unsigned long);
69 #define ERR_FSYS_CORRUPT 1
70 #define ERR_OUTSIDE_PART 1
71 #define ERR_SYMLINK_LOOP 1
72 #define ERR_FILELENGTH 1
73 #define ERR_BAD_FILETYPE 1
74 #define ERR_FILE_NOT_FOUND 1
75 #define ERR_BAD_ARGUMENT 1
76 #define ERR_FILESYSTEM_NOT_FOUND 1
77 #define ERR_NO_BOOTPATH 1
78 #define ERR_DEV_VALUES 1
79 #define ERR_WONT_FIT 1
80 #define ERR_READ 1
82 fsi_plugin_ops_t *fsig_init(fsi_plugin_t *, fsig_plugin_ops_t *);
84 int fsig_devread(fsi_file_t *, unsigned int, unsigned int, unsigned int, char *);
85 int fsig_substring(const char *, const char *);
87 void *fsig_fs_buf(fsi_t *);
89 fsi_file_t *fsig_file_alloc(fsi_t *);
90 void *fsig_file_buf(fsi_file_t *);
91 uint64_t *fsig_filepos(fsi_file_t *);
92 uint64_t *fsig_filemax(fsi_file_t *);
93 int *fsig_int1(fsi_file_t *);
94 int *fsig_int2(fsi_file_t *);
95 int *fsig_errnum(fsi_file_t *);
97 #ifdef __cplusplus
98 };
99 #endif
101 #endif /* _FSIMAGE_GRUB_H */