xref: /illumos-gate/usr/src/uts/intel/sys/xen_errno.h (revision 349b53dd4e695e3d833b5380540385145b2d3ae8)
1551bc2a6Smrj /*
2551bc2a6Smrj  * CDDL HEADER START
3551bc2a6Smrj  *
4551bc2a6Smrj  * The contents of this file are subject to the terms of the
5551bc2a6Smrj  * Common Development and Distribution License (the "License").
6551bc2a6Smrj  * You may not use this file except in compliance with the License.
7551bc2a6Smrj  *
8551bc2a6Smrj  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9551bc2a6Smrj  * or http://www.opensolaris.org/os/licensing.
10551bc2a6Smrj  * See the License for the specific language governing permissions
11551bc2a6Smrj  * and limitations under the License.
12551bc2a6Smrj  *
13551bc2a6Smrj  * When distributing Covered Code, include this CDDL HEADER in each
14551bc2a6Smrj  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15551bc2a6Smrj  * If applicable, add the following below this CDDL HEADER, with the
16551bc2a6Smrj  * fields enclosed by brackets "[]" replaced with your own identifying
17551bc2a6Smrj  * information: Portions Copyright [yyyy] [name of copyright owner]
18551bc2a6Smrj  *
19551bc2a6Smrj  * CDDL HEADER END
20551bc2a6Smrj  */
21551bc2a6Smrj 
22551bc2a6Smrj /*
23*349b53ddSStuart Maybee  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
24551bc2a6Smrj  * Use is subject to license terms.
25551bc2a6Smrj  */
26551bc2a6Smrj 
27551bc2a6Smrj #ifndef	_SYS_XEN_ERRNO_H
28551bc2a6Smrj #define	_SYS_XEN_ERRNO_H
29551bc2a6Smrj 
30551bc2a6Smrj #ifdef __cplusplus
31551bc2a6Smrj extern "C" {
32551bc2a6Smrj #endif
33551bc2a6Smrj 
34551bc2a6Smrj /*
35551bc2a6Smrj  * Xen errno's for HYPERVISOR calls
36551bc2a6Smrj  *
37551bc2a6Smrj  * XXPV	This is maintained by hand :(
38551bc2a6Smrj  *
39551bc2a6Smrj  * Unfortunately native Xen currently uses the same namespace as the Solaris
40551bc2a6Smrj  * errno namespace but with (some) different numeric values.
41551bc2a6Smrj  *
42551bc2a6Smrj  * This set of errno values match Xen 3.0.3; sigh.
43551bc2a6Smrj  *
44*349b53ddSStuart Maybee  * In a better world, Xen would make its namespace explicitly different
45551bc2a6Smrj  * e.g. something like below.
46551bc2a6Smrj  */
47551bc2a6Smrj 
48551bc2a6Smrj #define	X_EPERM		1
49551bc2a6Smrj #define	X_ENOENT	2
50551bc2a6Smrj #define	X_ESRCH		3
51551bc2a6Smrj #define	X_EINTR		4
52551bc2a6Smrj #define	X_EIO		5
53551bc2a6Smrj #define	X_ENXIO		6
54551bc2a6Smrj #define	X_E2BIG		7
55551bc2a6Smrj 
56*349b53ddSStuart Maybee #define	X_EAGAIN	11
57551bc2a6Smrj #define	X_ENOMEM	12
58551bc2a6Smrj #define	X_EACCES	13
59551bc2a6Smrj #define	X_EFAULT	14
60551bc2a6Smrj 
61551bc2a6Smrj #define	X_EBUSY		16
62551bc2a6Smrj #define	X_EEXIST	17
63551bc2a6Smrj 
64551bc2a6Smrj #define	X_ENODEV	19
65551bc2a6Smrj #define	X_EISDIR	21
66551bc2a6Smrj #define	X_EINVAL	22
67551bc2a6Smrj 
68551bc2a6Smrj #define	X_ENOSPC	28
69551bc2a6Smrj #define	X_ESPIPE	29
70551bc2a6Smrj #define	X_EROFS		30
71551bc2a6Smrj 
72551bc2a6Smrj #define	X_ENOSYS	38
73551bc2a6Smrj #define	X_ENOTEMPTY	39
74551bc2a6Smrj 
75551bc2a6Smrj #define	X_ENODATA	61
76551bc2a6Smrj 
77551bc2a6Smrj #define	X_EISCONN	106
78551bc2a6Smrj 
79551bc2a6Smrj #ifndef	_ASM
80551bc2a6Smrj #if defined(_KERNEL)
81551bc2a6Smrj /*
82551bc2a6Smrj  * Error code translation routine to translate xen error codes to
83551bc2a6Smrj  * Solaris error codes.  Xen returns negative error codes which this
84551bc2a6Smrj  * routine will translate to a positive one.
85551bc2a6Smrj  */
86551bc2a6Smrj extern int xen_xlate_errcode(int);
87551bc2a6Smrj #endif	/* _KERNEL */
88551bc2a6Smrj #endif	/* _ASM */
89551bc2a6Smrj 
90551bc2a6Smrj #ifdef __cplusplus
91551bc2a6Smrj }
92551bc2a6Smrj #endif
93551bc2a6Smrj 
94551bc2a6Smrj #endif	/* _SYS_XEN_ERRNO_H */
95