125540Sdfr/* $NetBSD$ */ 225540Sdfr 325540Sdfr/*- 425540Sdfr * Copyright (c) 2015 The NetBSD Foundation, Inc. 525540Sdfr * All rights reserved. 625540Sdfr * 725540Sdfr * Redistribution and use in source and binary forms, with or without 825540Sdfr * modification, are permitted provided that the following conditions 925540Sdfr * are met: 1025540Sdfr * 1. Redistributions of source code must retain the above copyright 1125540Sdfr * notice, this list of conditions and the following disclaimer. 1225540Sdfr * 2. Redistributions in binary form must reproduce the above copyright 1325540Sdfr * notice, this list of conditions and the following disclaimer in the 1425540Sdfr * documentation and/or other materials provided with the distribution. 1525540Sdfr * 1625540Sdfr * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 1725540Sdfr * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 1825540Sdfr * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 1925540Sdfr * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 2025540Sdfr * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 2125540Sdfr * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 2225540Sdfr * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 2325540Sdfr * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 2425540Sdfr * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 2525540Sdfr * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 2625540Sdfr * POSSIBILITY OF SUCH DAMAGE. 27114589Sobrien */ 28114589Sobrien 2932269Scharnier#include <sys/cdefs.h> 30193475Sbenno__KERNEL_RCSID(0, "$NetBSD: $"); 31193473Sbenno 32193473Sbenno#include <sys/param.h> 33193475Sbenno#include <sys/module.h> 34193475Sbenno 3530573Sjmg/* 3625540Sdfr * Last parameter of MODULE macro is a list of names (as string; names are 3778732Sdd * separated by commas) of dependencies. If module has no dependencies, 38193475Sbenno * then NULL should be passed. 3925540Sdfr */ 40233560Shselasky 4125540SdfrMODULE(MODULE_CLASS_MISC, hello, NULL); 42193475Sbenno 43193475Sbennostatic int 44193475Sbennohello_modcmd(modcmd_t cmd, void *arg __unused) 45193473Sbenno{ 46193473Sbenno switch (cmd) { 47193475Sbenno case MODULE_CMD_INIT: 48193475Sbenno printf("Example module loaded.\n"); 49193475Sbenno break; 50193475Sbenno 51193475Sbenno case MODULE_CMD_FINI: 52193475Sbenno printf("Example module unloaded.\n"); 53193475Sbenno break; 54193475Sbenno 55193475Sbenno case MODULE_CMD_STAT: 56193475Sbenno printf("Example module status queried.\n"); 57193475Sbenno break; 58193475Sbenno 59193475Sbenno default: 60193475Sbenno return ENOTTY; 61193475Sbenno } 62193475Sbenno 63193475Sbenno return 0; 64193475Sbenno} 65193475Sbenno