memdev.c (a20ad05beb32b120fab7f8cfaee81601d7851d92) memdev.c (2fea6431120dc19a04430c68b2484524074b2e43)
1/*-
2 * Copyright (c) 2004 Mark R V Murray
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

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

29__FBSDID("$FreeBSD$");
30
31#include <sys/param.h>
32#include <sys/conf.h>
33#include <sys/fcntl.h>
34#include <sys/kernel.h>
35#include <sys/lock.h>
36#include <sys/malloc.h>
1/*-
2 * Copyright (c) 2004 Mark R V Murray
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

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

29__FBSDID("$FreeBSD$");
30
31#include <sys/param.h>
32#include <sys/conf.h>
33#include <sys/fcntl.h>
34#include <sys/kernel.h>
35#include <sys/lock.h>
36#include <sys/malloc.h>
37#include <sys/memrange.h>
37#include <sys/module.h>
38#include <sys/mutex.h>
39#include <sys/proc.h>
40#include <sys/signalvar.h>
41#include <sys/systm.h>
42#include <sys/uio.h>
43
44#include <vm/vm.h>

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

75/* ARGSUSED */
76static int
77mem_modevent(module_t mod __unused, int type, void *data __unused)
78{
79 switch(type) {
80 case MOD_LOAD:
81 if (bootverbose)
82 printf("mem: <memory>\n");
38#include <sys/module.h>
39#include <sys/mutex.h>
40#include <sys/proc.h>
41#include <sys/signalvar.h>
42#include <sys/systm.h>
43#include <sys/uio.h>
44
45#include <vm/vm.h>

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

76/* ARGSUSED */
77static int
78mem_modevent(module_t mod __unused, int type, void *data __unused)
79{
80 switch(type) {
81 case MOD_LOAD:
82 if (bootverbose)
83 printf("mem: <memory>\n");
83 dev_mem_md_init(); /* Machine dependant bit */
84 mem_range_init();
84 memdev = make_dev(&mem_cdevsw, CDEV_MINOR_MEM,
85 UID_ROOT, GID_KMEM, 0640, "mem");
86 kmemdev = make_dev(&mem_cdevsw, CDEV_MINOR_KMEM,
87 UID_ROOT, GID_KMEM, 0640, "kmem");
88 break;
89
90 case MOD_UNLOAD:
85 memdev = make_dev(&mem_cdevsw, CDEV_MINOR_MEM,
86 UID_ROOT, GID_KMEM, 0640, "mem");
87 kmemdev = make_dev(&mem_cdevsw, CDEV_MINOR_KMEM,
88 UID_ROOT, GID_KMEM, 0640, "kmem");
89 break;
90
91 case MOD_UNLOAD:
92 mem_range_destroy();
91 destroy_dev(memdev);
92 destroy_dev(kmemdev);
93 break;
94
95 case MOD_SHUTDOWN:
96 break;
97
98 default:
99 return(EOPNOTSUPP);
100
101 }
102
103 return (0);
104}
105
106DEV_MODULE(mem, mem_modevent, NULL);
107MODULE_VERSION(mem, 1);
93 destroy_dev(memdev);
94 destroy_dev(kmemdev);
95 break;
96
97 case MOD_SHUTDOWN:
98 break;
99
100 default:
101 return(EOPNOTSUPP);
102
103 }
104
105 return (0);
106}
107
108DEV_MODULE(mem, mem_modevent, NULL);
109MODULE_VERSION(mem, 1);