xref: /onnv-gate/usr/src/uts/common/os/smb_subr.c (revision 437:76c202dd62bf)
1*437Smws /*
2*437Smws  * CDDL HEADER START
3*437Smws  *
4*437Smws  * The contents of this file are subject to the terms of the
5*437Smws  * Common Development and Distribution License, Version 1.0 only
6*437Smws  * (the "License").  You may not use this file except in compliance
7*437Smws  * with the License.
8*437Smws  *
9*437Smws  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*437Smws  * or http://www.opensolaris.org/os/licensing.
11*437Smws  * See the License for the specific language governing permissions
12*437Smws  * and limitations under the License.
13*437Smws  *
14*437Smws  * When distributing Covered Code, include this CDDL HEADER in each
15*437Smws  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*437Smws  * If applicable, add the following below this CDDL HEADER, with the
17*437Smws  * fields enclosed by brackets "[]" replaced with your own identifying
18*437Smws  * information: Portions Copyright [yyyy] [name of copyright owner]
19*437Smws  *
20*437Smws  * CDDL HEADER END
21*437Smws  */
22*437Smws 
23*437Smws /*
24*437Smws  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
25*437Smws  * Use is subject to license terms.
26*437Smws  */
27*437Smws 
28*437Smws #pragma ident	"%Z%%M%	%I%	%E% SMI"
29*437Smws 
30*437Smws #include <sys/smbios_impl.h>
31*437Smws #include <sys/cmn_err.h>
32*437Smws #include <sys/varargs.h>
33*437Smws #include <sys/systm.h>
34*437Smws #include <sys/kmem.h>
35*437Smws 
36*437Smws /*ARGSUSED*/
37*437Smws const char *
smb_strerror(int err)38*437Smws smb_strerror(int err)
39*437Smws {
40*437Smws 	return (NULL);
41*437Smws }
42*437Smws 
43*437Smws void *
smb_alloc(size_t len)44*437Smws smb_alloc(size_t len)
45*437Smws {
46*437Smws 	return (kmem_alloc(len, KM_SLEEP));
47*437Smws }
48*437Smws 
49*437Smws void *
smb_zalloc(size_t len)50*437Smws smb_zalloc(size_t len)
51*437Smws {
52*437Smws 	return (kmem_zalloc(len, KM_SLEEP));
53*437Smws }
54*437Smws 
55*437Smws void
smb_free(void * buf,size_t len)56*437Smws smb_free(void *buf, size_t len)
57*437Smws {
58*437Smws 	kmem_free(buf, len);
59*437Smws }
60*437Smws 
61*437Smws /*PRINTFLIKE2*/
62*437Smws void
smb_dprintf(smbios_hdl_t * shp,const char * format,...)63*437Smws smb_dprintf(smbios_hdl_t *shp, const char *format, ...)
64*437Smws {
65*437Smws 	va_list ap;
66*437Smws 
67*437Smws 	if (!(shp->sh_flags & SMB_FL_DEBUG))
68*437Smws 		return;
69*437Smws 
70*437Smws 	va_start(ap, format);
71*437Smws 	vcmn_err(CE_CONT, format, ap);
72*437Smws 	va_end(ap);
73*437Smws }
74