8982 Support building with OpenSSL 1.1
[unleashed.git] / usr / src / common / devid / devid_impl.h
blob7305c3a53fc97b0469a311f21d8a8ac4034c47ff
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
20 * CDDL HEADER END
23 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #ifndef _DEVID_IMPL_H
28 #define _DEVID_IMPL_H
30 #pragma ident "%Z%%M% %I% %E% SMI"
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
36 #ifndef TRUE
37 #define TRUE 1
38 #endif /* TRUE */
40 #ifndef FALSE
41 #define FALSE 0
42 #endif /* FALSE */
45 * Macros to make kernel and library code identical.
47 * NOTE: to get ddi_ entrypoints to show up in cscope, DEVID_FUNC
48 * is NOT used in function definitions.
50 #ifdef _KERNEL
51 #include <sys/kmem.h>
52 #include <sys/sunddi.h>
54 #define DEVID_MALLOC(n) kmem_alloc(n, KM_SLEEP)
55 #define DEVID_FREE(x, n) kmem_free(x, n)
56 #define DEVID_FUNC(x) ddi_##x
57 #define DEVID_ASSERT(x) ASSERT(x)
58 #define DEVID_SUCCESS DDI_SUCCESS
59 #define DEVID_FAILURE DDI_FAILURE
60 #define DEVID_RETRY DDI_NOT_WELL_FORMED
61 #define DEVID_RET_VALID DDI_SUCCESS
62 #define DEVID_RET_INVALID DDI_FAILURE
63 #else /* !_KERNEL */
64 #include <stdlib.h>
65 #include <strings.h>
66 #include <devid.h>
68 #define DEVID_MALLOC(n) malloc(n)
69 #define DEVID_FREE(x, n) free(x)
70 #define DEVID_FUNC(x) x
71 #define DEVID_ASSERT(x)
72 #define DEVID_SUCCESS 0
73 #define DEVID_FAILURE -1
74 #define DEVID_RETRY -2
75 #define DEVID_RET_VALID 1
76 #define DEVID_RET_INVALID 0
77 #endif /* _KERNEL */
79 #ifdef __cplusplus
81 #endif
83 #endif /* _DEVID_IMPL_H */