xref: /titanic_50/usr/src/uts/intel/sys/xen_errno.h (revision 575bd8a230f2c20b1878ebb473c30a12f0eb1b2e)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 
22 /*
23  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef	_SYS_XEN_ERRNO_H
28 #define	_SYS_XEN_ERRNO_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 /*
37  * Xen errno's for HYPERVISOR calls
38  *
39  * XXPV	This is maintained by hand :(
40  *
41  * Unfortunately native Xen currently uses the same namespace as the Solaris
42  * errno namespace but with (some) different numeric values.
43  *
44  * This set of errno values match Xen 3.0.3; sigh.
45  *
46  * In a better world, Xen would make it's namespace explicitly different
47  * e.g. something like below.
48  */
49 
50 #define	X_EPERM		1
51 #define	X_ENOENT	2
52 #define	X_ESRCH		3
53 #define	X_EINTR		4
54 #define	X_EIO		5
55 #define	X_ENXIO		6
56 #define	X_E2BIG		7
57 
58 #define	X_ENOMEM	12
59 #define	X_EACCES	13
60 #define	X_EFAULT	14
61 
62 #define	X_EBUSY		16
63 #define	X_EEXIST	17
64 
65 #define	X_ENODEV	19
66 #define	X_EISDIR	21
67 #define	X_EINVAL	22
68 
69 #define	X_ENOSPC	28
70 #define	X_ESPIPE	29
71 #define	X_EROFS		30
72 
73 #define	X_ENOSYS	38
74 #define	X_ENOTEMPTY	39
75 
76 #define	X_ENODATA	61
77 
78 #define	X_EISCONN	106
79 
80 #ifndef	_ASM
81 #if defined(_KERNEL)
82 /*
83  * Error code translation routine to translate xen error codes to
84  * Solaris error codes.  Xen returns negative error codes which this
85  * routine will translate to a positive one.
86  */
87 extern int xen_xlate_errcode(int);
88 #endif	/* _KERNEL */
89 #endif	/* _ASM */
90 
91 #ifdef __cplusplus
92 }
93 #endif
94 
95 #endif	/* _SYS_XEN_ERRNO_H */
96