Deleted Added
full compact
kern_module.c (47330) kern_module.c (50107)
1/*-
2 * Copyright (c) 1997 Doug Rabson
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
1/*-
2 * Copyright (c) 1997 Doug Rabson
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 * $Id: kern_module.c,v 1.17 1999/05/08 13:01:57 peter Exp $
26 * $Id: kern_module.c,v 1.18 1999/05/20 00:00:58 peter Exp $
27 */
28
29#include <sys/param.h>
30#include <sys/kernel.h>
31#include <sys/systm.h>
27 */
28
29#include <sys/param.h>
30#include <sys/kernel.h>
31#include <sys/systm.h>
32#include <sys/eventhandler.h>
32#include <sys/malloc.h>
33#include <sys/sysproto.h>
34#include <sys/sysent.h>
35#include <sys/module.h>
36#include <sys/linker.h>
37#include <sys/proc.h>
38
39#define M_MODULE M_TEMP /* XXX */

--- 11 unchanged lines hidden (view full) ---

51 modspecific_t data; /* module specific data */
52};
53
54#define MOD_EVENT(mod, type) (mod)->handler((mod), (type), (mod)->arg)
55
56static modulelist_t modules;
57static int nextid = 1;
58
33#include <sys/malloc.h>
34#include <sys/sysproto.h>
35#include <sys/sysent.h>
36#include <sys/module.h>
37#include <sys/linker.h>
38#include <sys/proc.h>
39
40#define M_MODULE M_TEMP /* XXX */

--- 11 unchanged lines hidden (view full) ---

52 modspecific_t data; /* module specific data */
53};
54
55#define MOD_EVENT(mod, type) (mod)->handler((mod), (type), (mod)->arg)
56
57static modulelist_t modules;
58static int nextid = 1;
59
59static void module_shutdown(int, void*);
60static void module_shutdown(void*, int);
60
61static void
62module_init(void* arg)
63{
64 TAILQ_INIT(&modules);
61
62static void
63module_init(void* arg)
64{
65 TAILQ_INIT(&modules);
65 at_shutdown(module_shutdown, 0, SHUTDOWN_POST_SYNC);
66 EVENTHANDLER_REGISTER(shutdown_post_sync, module_shutdown, NULL,
67 SHUTDOWN_PRI_DEFAULT);
66}
67
68SYSINIT(module, SI_SUB_KLD, SI_ORDER_FIRST, module_init, 0);
69
70static void
68}
69
70SYSINIT(module, SI_SUB_KLD, SI_ORDER_FIRST, module_init, 0);
71
72static void
71module_shutdown(int arg1, void* arg2)
73module_shutdown(void* arg1, int arg2)
72{
73 module_t mod;
74
75 for (mod = TAILQ_FIRST(&modules); mod; mod = TAILQ_NEXT(mod, link))
76 MOD_EVENT(mod, MOD_SHUTDOWN);
77}
78
79void

--- 264 unchanged lines hidden ---
74{
75 module_t mod;
76
77 for (mod = TAILQ_FIRST(&modules); mod; mod = TAILQ_NEXT(mod, link))
78 MOD_EVENT(mod, MOD_SHUTDOWN);
79}
80
81void

--- 264 unchanged lines hidden ---