From 615168d1767d0d8ac4d0f56e924fd2e5089b30a3 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Fri, 19 Dec 2008 11:30:42 -0800 Subject: [PATCH] Stub out additional sunddi interfaces --- lib/libspl/Makefile.am | 2 +- lib/libspl/include/sys/sunddi.h | 41 +++++++++++++++++++++++++++++- lib/libspl/{strtoxx.c => sunddi.c} | 16 ++++++++++++ 3 files changed, 57 insertions(+), 2 deletions(-) rename lib/libspl/{strtoxx.c => sunddi.c} (87%) diff --git a/lib/libspl/Makefile.am b/lib/libspl/Makefile.am index 91e166d6c3..4c7eb722bc 100644 --- a/lib/libspl/Makefile.am +++ b/lib/libspl/Makefile.am @@ -14,7 +14,7 @@ libspl_la_SOURCES = \ ${top_srcdir}/lib/libspl/strlcat.c \ ${top_srcdir}/lib/libspl/strlcpy.c \ ${top_srcdir}/lib/libspl/strnlen.c \ - ${top_srcdir}/lib/libspl/strtoxx.c \ + ${top_srcdir}/lib/libspl/sunddi.c \ ${top_srcdir}/lib/libspl/u8_textprep.c \ ${top_srcdir}/lib/libspl/zone.c \ ${top_srcdir}/lib/libspl/include/sys/list.h \ diff --git a/lib/libspl/include/sys/sunddi.h b/lib/libspl/include/sys/sunddi.h index 5d28fe7737..df5f5b187e 100644 --- a/lib/libspl/include/sys/sunddi.h +++ b/lib/libspl/include/sys/sunddi.h @@ -24,11 +24,50 @@ */ #ifndef _SYS_SUNDDI_H -#define _SYS_SUNDDI_H +#define _SYS_SUNDDI_Ha + +#include + +/* + * Generic Sun DDI definitions. + */ +#define DDI_SUCCESS (0) /* successful return */ +#define DDI_FAILURE (-1) /* unsuccessful return */ +#define DDI_NOT_WELL_FORMED (-2) /* A dev_info node is not valid */ +#define DDI_EAGAIN (-3) /* not enough interrupt resources */ +#define DDI_EINVAL (-4) /* invalid request or arguments */ +#define DDI_ENOTSUP (-5) /* operation is not supported */ +#define DDI_EPENDING (-6) /* operation or an event is pending */ + +/* + * General-purpose DDI error return value definitions + */ +#define DDI_ENOMEM 1 /* memory not available */ +#define DDI_EBUSY 2 /* busy */ +#define DDI_ETRANSPORT 3 /* transport down */ +#define DDI_ECONTEXT 4 /* context error */ + +/* + * DDI_DEV_T_NONE: When creating, property is not associated with + * particular dev_t. + * DDI_DEV_T_ANY: Wildcard dev_t when searching properties. + */ +#define DDI_DEV_T_NONE ((dev_t)-1) +#define DDI_DEV_T_ANY ((dev_t)-2) + +/* + * Property flags: + */ +#define DDI_PROP_DONTPASS 0x0001 /* Don't pass request to parent */ +#define DDI_PROP_CANSLEEP 0x0002 /* Memory allocation may sleep */ + extern int ddi_strtoul(const char *, char **, int, unsigned long *); extern int ddi_strtol(const char *, char **, int, long *); extern int ddi_strtoull(const char *, char **, int, unsigned long long *); extern int ddi_strtoll(const char *, char **, int, long long *); +extern int ddi_prop_lookup_string(dev_t, dev_info_t *, uint_t, char *, char **); +extern void ddi_prop_free(void *); + #endif /* _SYS_SUNDDI_H */ diff --git a/lib/libspl/strtoxx.c b/lib/libspl/sunddi.c similarity index 87% rename from lib/libspl/strtoxx.c rename to lib/libspl/sunddi.c index bb9cee19da..cce3e2bff8 100644 --- a/lib/libspl/strtoxx.c +++ b/lib/libspl/sunddi.c @@ -83,3 +83,19 @@ ddi_strtoll(const char *str, char **endptr, int base, return errno; } + +/* FIXME: Unimplemented */ +int +ddi_prop_lookup_string(dev_t match_dev, dev_info_t *dip, uint_t flags, + char *name, char **data) +{ + *data = NULL; + return ENOSYS; +} + +/* FIXME: Unimplemented */ +void +ddi_prop_free(void *datap) +{ + return; +}