diff options
Diffstat (limited to 'usr/src/uts')
-rw-r--r-- | usr/src/uts/common/Makefile.files | 1 | ||||
-rw-r--r-- | usr/src/uts/common/Makefile.rules | 6 | ||||
-rw-r--r-- | usr/src/uts/common/io/foo/LICENSE | 25 | ||||
-rw-r--r-- | usr/src/uts/common/io/foo/LICENSE.descrip | 1 | ||||
-rw-r--r-- | usr/src/uts/common/io/foo/foo.c | 219 | ||||
-rw-r--r-- | usr/src/uts/common/io/foo/foo.conf | 16 | ||||
-rw-r--r-- | usr/src/uts/common/sys/Makefile | 3 | ||||
-rw-r--r-- | usr/src/uts/common/sys/foo.h | 36 | ||||
-rw-r--r-- | usr/src/uts/intel/foo/Makefile | 103 | ||||
-rw-r--r-- | usr/src/uts/sparc/foo/Makefile | 101 |
10 files changed, 1 insertions, 510 deletions
diff --git a/usr/src/uts/common/Makefile.files b/usr/src/uts/common/Makefile.files index 502a97f..1cc38bd 100644 --- a/usr/src/uts/common/Makefile.files +++ b/usr/src/uts/common/Makefile.files @@ -56,7 +56,6 @@ GENSTUBS_OBJS += $(COMMON_GENSTUBS_OBJS) $($(MACH)_GENSTUBS_OBJS) # Driver (pseudo-driver) Modules # -FOO_OBJS += foo.o diff --git a/usr/src/uts/common/Makefile.rules b/usr/src/uts/common/Makefile.rules index 6507381..ecd9df3 100644 --- a/usr/src/uts/common/Makefile.rules +++ b/usr/src/uts/common/Makefile.rules @@ -43,13 +43,7 @@ # Section 1a: C objects build rules # -$(OBJS_DIR)/%.o: $(UTSBASE)/common/io/foo/%.c - $(COMPILE.c) -o $@ $< - $(CTFCONVERT_O) # # Section 1b: Lint `objects' # - -$(LINTS_DIR)/%.ln: $(UTSBASE)/common/io/foo/%.c - @($(LHEAD) $(LINT.c) $< $(LTAIL)) diff --git a/usr/src/uts/common/io/foo/LICENSE b/usr/src/uts/common/io/foo/LICENSE deleted file mode 100644 index 27d86ba..0000000 --- a/usr/src/uts/common/io/foo/LICENSE +++ /dev/null @@ -1,25 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License (the "License"). - * You may not use this file except in compliance with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - * - * Copyright 2009 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - * - * Copyright 2011 Nexenta Systems, Inc. All rights reserved. - */ diff --git a/usr/src/uts/common/io/foo/LICENSE.descrip b/usr/src/uts/common/io/foo/LICENSE.descrip deleted file mode 100644 index db9ad86..0000000 --- a/usr/src/uts/common/io/foo/LICENSE.descrip +++ /dev/null @@ -1 +0,0 @@ -"foo" example driver diff --git a/usr/src/uts/common/io/foo/foo.c b/usr/src/uts/common/io/foo/foo.c deleted file mode 100644 index 2780878..0000000 --- a/usr/src/uts/common/io/foo/foo.c +++ /dev/null @@ -1,219 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License (the "License"). - * You may not use this file except in compliance with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - * - * Copyright 2009 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - * - * Copyright 2011 Nexenta Systems, Inc. All rights reserved. - */ - - -/* - * Sample driver - */ - -#include <sys/types.h> -#include <sys/errno.h> -#include <sys/stat.h> - -#include <sys/file.h> -#include <sys/open.h> -#include <sys/poll.h> -#include <sys/uio.h> -#include <sys/cred.h> -#include <sys/modctl.h> -#include <sys/conf.h> -#include <sys/ddi.h> -#include <sys/sunddi.h> - -#include <sys/foo.h> - -static dev_info_t *foo_dip; -static uint32_t foo_count; - -static int foo_open(dev_t *, int, int, cred_t *); -static int foo_close(dev_t, int, int, cred_t *); -static int foo_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, - cred_t *credp, int *rvalp); - -static int foo_attach(dev_info_t *, ddi_attach_cmd_t); -static int foo_detach(dev_info_t *, ddi_detach_cmd_t); -static int foo_getinfo(dev_info_t *, ddi_info_cmd_t, void *, void **); - -/* DDI declarations */ -static struct cb_ops foo_cb_ops = { - foo_open, /* open */ - foo_close, /* close */ - nodev, /* strategy */ - nodev, /* print */ - nodev, /* dump */ - nodev, /* read */ - nodev, /* write */ - foo_ioctl, /* ioctl */ - nodev, /* devmap */ - nodev, /* mmap */ - nodev, /* segmap */ - nochpoll, /* chpoll */ - ddi_prop_op, /* prop_op */ - NULL, /* streamtab */ - (D_NEW | D_MP), /* cb_flag */ - CB_REV, /* cb_rev */ - nodev, /* aread */ - nodev /* awrite */ -}; - -static struct dev_ops foo_ops = { - DEVO_REV, /* devo_rev, */ - 0, /* refcnt */ - foo_getinfo, /* get_dev_info */ - nulldev, /* identify */ - nulldev, /* probe */ - foo_attach, /* attach */ - foo_detach, /* detach */ - nodev, /* reset */ - &foo_cb_ops, /* driver operations */ - NULL, /* bus operations */ - NULL, /* power */ - ddi_quiesce_not_needed, /* quiesce */ -}; - -/* Modlinkage */ -static struct modldrv modldrv = { - &mod_driverops, - "foo sample device", - &foo_ops -}; - -static struct modlinkage modlinkage = { MODREV_1, { &modldrv, NULL } }; - - -/* DDI glue */ - -int -_init(void) -{ - return (mod_install(&modlinkage)); -} - -int -_fini(void) -{ - return (mod_remove(&modlinkage)); -} - -int -_info(struct modinfo *modinfop) -{ - return (mod_info(&modlinkage, modinfop)); -} - -static int -foo_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) -{ - if (cmd != DDI_ATTACH) - return (DDI_FAILURE); - - if (ddi_create_minor_node(dip, "foo", S_IFCHR, 0, - DDI_PSEUDO, 0) == DDI_FAILURE) { - ddi_remove_minor_node(dip, NULL); - return (DDI_FAILURE); - } - - foo_dip = dip; - - return (DDI_SUCCESS); -} - -static int -foo_detach(dev_info_t *dip, ddi_detach_cmd_t cmd) -{ - if (cmd != DDI_DETACH) - return (DDI_FAILURE); - - foo_dip = NULL; - ddi_remove_minor_node(dip, NULL); - - return (DDI_SUCCESS); -} - -/*ARGSUSED*/ -static int -foo_getinfo(dev_info_t *dip, ddi_info_cmd_t infocmd, void *arg, void **result) -{ - int error; - - switch (infocmd) { - case DDI_INFO_DEVT2DEVINFO: - *result = foo_dip; - error = DDI_SUCCESS; - break; - case DDI_INFO_DEVT2INSTANCE: - *result = (void *)0; - error = DDI_SUCCESS; - break; - default: - error = DDI_FAILURE; - } - return (error); -} - -/*ARGSUSED3*/ -static int -foo_open(dev_t *devp, int flag, int otyp, cred_t *credp) -{ - if (otyp != OTYP_CHR) - return (EINVAL); - - if (flag & FEXCL) - return (EINVAL); - - return (0); -} - -/*ARGSUSED*/ -static int -foo_close(dev_t dev, int flag, int otyp, cred_t *credp) -{ - return (0); -} - -/*ARGSUSED*/ -static int -foo_ioctl(dev_t dev, int cmd, intptr_t arg, int flags, /* model.h */ - cred_t *cr, int *rvalp) -{ - int err; - - err = 0; - switch (cmd) { - case FOO_IOC_GETCNT: - atomic_inc_32(&foo_count); - if (ddi_copyout(&foo_count, (void *)arg, - sizeof (foo_count), flags)) - err = EFAULT; - break; - - default: - err = ENOTTY; - break; - } - - return (err); -} diff --git a/usr/src/uts/common/io/foo/foo.conf b/usr/src/uts/common/io/foo/foo.conf deleted file mode 100644 index e3ea1cc..0000000 --- a/usr/src/uts/common/io/foo/foo.conf +++ /dev/null @@ -1,16 +0,0 @@ -# -# This file and its contents are supplied under the terms of the -# Common Development and Distribution License ("CDDL"), version 1.0. -# You may only use this file in accordance with the terms of version -# 1.0 of the CDDL. -# -# A full copy of the text of the CDDL should have accompanied this -# source. A copy of the CDDL is also available via the Internet at -# http://www.illumos.org/license/CDDL. -# - -# -# Copyright 2011 Nexenta Systems, Inc. All rights reserved. -# -name="foo" parent="pseudo"; - diff --git a/usr/src/uts/common/sys/Makefile b/usr/src/uts/common/sys/Makefile index c43bcf2..118fed0 100644 --- a/usr/src/uts/common/sys/Makefile +++ b/usr/src/uts/common/sys/Makefile @@ -49,8 +49,7 @@ sparc_HDRS= GENHDRS= # Normal headers -CHKHDRS= \ - foo.h +CHKHDRS= HDRS= $(GENHDRS) $(CHKHDRS) diff --git a/usr/src/uts/common/sys/foo.h b/usr/src/uts/common/sys/foo.h deleted file mode 100644 index ddc515a..0000000 --- a/usr/src/uts/common/sys/foo.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * This file and its contents are supplied under the terms of the - * Common Development and Distribution License ("CDDL"), version 1.0. - * You may only use this file in accordance with the terms of version - * 1.0 of the CDDL. - * - * A full copy of the text of the CDDL should have accompanied this - * source. A copy of the CDDL is also available via the Internet at - * http://www.illumos.org/license/CDDL. - */ - -/* - * Copyright 2014 Nexenta Systems, Inc. All rights reserved. - */ - -#ifndef _SYS_FOO_H -#define _SYS_FOO_H - -#include <sys/types.h> - -#ifdef __cplusplus -extern "C" { -#endif - -#define FOO_IOC_GETCNT 1 -typedef uint32_t foocnt_t; - -#ifndef _KERNEL -extern int foo_getcnt(uint32_t *); -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* _SYS_FOO_H */ diff --git a/usr/src/uts/intel/foo/Makefile b/usr/src/uts/intel/foo/Makefile deleted file mode 100644 index 0d0946a..0000000 --- a/usr/src/uts/intel/foo/Makefile +++ /dev/null @@ -1,103 +0,0 @@ -# -# CDDL HEADER START -# -# The contents of this file are subject to the terms of the -# Common Development and Distribution License (the "License"). -# You may not use this file except in compliance with the License. -# -# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE -# or http://www.opensolaris.org/os/licensing. -# See the License for the specific language governing permissions -# and limitations under the License. -# -# When distributing Covered Code, include this CDDL HEADER in each -# file and include the License file at usr/src/OPENSOLARIS.LICENSE. -# If applicable, add the following below this CDDL HEADER, with the -# fields enclosed by brackets "[]" replaced with your own identifying -# information: Portions Copyright [yyyy] [name of copyright owner] -# -# CDDL HEADER END -# -# -# uts/intel/foo/Makefile -# -# Copyright 2008 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# -# Copyright 2011 Nexenta Systems, Inc. All rights reserved. -# -# This makefile drives the production of the foo `drv' -# kernel module. -# -# intel implementation architecture dependent -# - -# -# Path to the base of the uts directory tree (usually /usr/src/uts). -# -UTSBASE = ../.. - -# -# Define the module and object file sets. -# -MODULE = foo -OBJECTS = $(FOO_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(FOO_OBJS:%.o=$(LINTS_DIR)/%.ln) -ROOTMODULE = $(ROOT_DRV_DIR)/$(MODULE) -CONF_SRCDIR = $(UTSBASE)/common/io/foo - -# -# Include common rules. -# -include $(UTSBASE)/intel/Makefile.intel - -# -# Define targets -# -ALL_TARGET = $(BINARY) # $(SRC_CONFILE) -LINT_TARGET = $(MODULE).lint -INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) - -# -# Overrides -# - -# -# For now, disable these lint checks; maintainers should endeavor -# to investigate and remove these for maximum lint coverage. -# Please do not carry these forward to new Makefiles. -# -LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN - -CERRWARN += -_gcc=-Wno-unused-parameter - -# -# Driver depends on MAC -# -# LDFLAGS += -dy -N misc/mac - -# -# Default build targets. -# -.KEEP_STATE: - -def: $(DEF_DEPS) - -all: $(ALL_DEPS) - -clean: $(CLEAN_DEPS) - -clobber: $(CLOBBER_DEPS) - -lint: $(LINT_DEPS) - -modlintlib: $(MODLINTLIB_DEPS) - -clean.lint: $(CLEAN_LINT_DEPS) - -install: $(INSTALL_DEPS) - -# -# Include common targets. -# -include $(UTSBASE)/intel/Makefile.targ diff --git a/usr/src/uts/sparc/foo/Makefile b/usr/src/uts/sparc/foo/Makefile deleted file mode 100644 index f24f608..0000000 --- a/usr/src/uts/sparc/foo/Makefile +++ /dev/null @@ -1,101 +0,0 @@ -# -# CDDL HEADER START -# -# The contents of this file are subject to the terms of the -# Common Development and Distribution License (the "License"). -# You may not use this file except in compliance with the License. -# -# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE -# or http://www.opensolaris.org/os/licensing. -# See the License for the specific language governing permissions -# and limitations under the License. -# -# When distributing Covered Code, include this CDDL HEADER in each -# file and include the License file at usr/src/OPENSOLARIS.LICENSE. -# If applicable, add the following below this CDDL HEADER, with the -# fields enclosed by brackets "[]" replaced with your own identifying -# information: Portions Copyright [yyyy] [name of copyright owner] -# -# CDDL HEADER END -# -# -# uts/sparc/foo/Makefile -# -# Copyright 2008 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# -# Copyright 2011 Nexenta Systems, Inc. All rights reserved. -# -# This makefile drives the production of the foo `drv' -# kernel module. -# - -# -# Path to the base of the uts directory tree (usually /usr/src/uts). -# -UTSBASE = ../.. - -# -# Define the module and object file sets. -# -MODULE = foo -OBJECTS = $(FOO_OBJS:%=$(OBJS_DIR)/%) -LINTS = $(FOO_OBJS:%.o=$(LINTS_DIR)/%.ln) -ROOTMODULE = $(ROOT_DRV_DIR)/$(MODULE) -CONF_SRCDIR = $(UTSBASE)/common/io/foo - -# -# Include common rules. -# -include $(UTSBASE)/sparc/Makefile.sparc - -# -# Define targets -# -ALL_TARGET = $(BINARY) # $(SRC_CONFILE) -LINT_TARGET = $(MODULE).lint -INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) - -# -# Overrides -# - -# -# For now, disable these lint checks; maintainers should endeavor -# to investigate and remove these for maximum lint coverage. -# Please do not carry these forward to new Makefiles. -# -LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN - -CERRWARN += -_gcc=-Wno-unused-parameter - -# -# Driver depends on MAC -# -# LDFLAGS += -dy -N misc/mac - -# -# Default build targets. -# -.KEEP_STATE: - -def: $(DEF_DEPS) - -all: $(ALL_DEPS) - -clean: $(CLEAN_DEPS) - -clobber: $(CLOBBER_DEPS) - -lint: $(LINT_DEPS) - -modlintlib: $(MODLINTLIB_DEPS) - -clean.lint: $(CLEAN_LINT_DEPS) - -install: $(INSTALL_DEPS) - -# -# Include common targets. -# -include $(UTSBASE)/sparc/Makefile.targ |