elan-mmcr.c revision 101225
1/*
2 * ----------------------------------------------------------------------------
3 * "THE BEER-WARE LICENSE" (Revision 42):
4 * <phk@FreeBSD.org> wrote this file.  As long as you retain this notice you
5 * can do whatever you want with this stuff. If we meet some day, and you think
6 * this stuff is worth it, you can buy me a beer in return.   Poul-Henning Kamp
7 * ----------------------------------------------------------------------------
8 *
9 * $FreeBSD: head/sys/i386/i386/elan-mmcr.c 101225 2002-08-02 15:53:04Z phk $
10 *
11 */
12#include <sys/param.h>
13#include <sys/systm.h>
14#include <sys/kernel.h>
15#include <sys/conf.h>
16
17#include <machine/md_var.h>
18
19/*
20 * Device driver initialization stuff
21 */
22
23static d_open_t	elan_open;
24static d_close_t elan_close;
25static d_ioctl_t elan_ioctl;
26static d_mmap_t elan_mmap;
27
28#define CDEV_MAJOR 100			/* Share with xrpu */
29static struct cdevsw elan_cdevsw = {
30	/* open */	elan_open,
31	/* close */	elan_close,
32	/* read */	noread,
33	/* write */	nowrite,
34	/* ioctl */	elan_ioctl,
35	/* poll */	nopoll,
36	/* mmap */	elan_mmap,
37	/* strategy */	nostrategy,
38	/* name */	"elan",
39	/* maj */	CDEV_MAJOR,
40	/* dump */	nodump,
41	/* psize */	nopsize,
42	/* flags */	0,
43};
44
45static int
46elan_open(dev_t dev, int flag, int mode, struct  thread *td)
47{
48	return (0);
49}
50
51static int
52elan_close(dev_t dev, int flag, int mode, struct  thread *td)
53{
54	return (0);
55}
56
57static int
58elan_mmap(dev_t dev, vm_offset_t offset, int nprot)
59{
60	if (offset >= 0x1000)
61		return (-1);
62	return (i386_btop(0xfffef000));
63}
64
65static int
66elan_ioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct  thread *tdr)
67{
68	return(ENOENT);
69}
70
71static void
72elan_drvinit(void)
73{
74
75	if (elan_mmcr == NULL)
76		return;
77	make_dev(&elan_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "elan-mmcr");
78	return;
79}
80
81
82SYSINIT(elan, SI_SUB_DRIVERS, SI_ORDER_MIDDLE+CDEV_MAJOR,elan_drvinit,NULL);
83