FreeBSD/Linux Kernel Cross Reference
sys/i386ipsc/iopl.c
1 /*
2 * Mach Operating System
3 * Copyright (c) 1991 Carnegie Mellon University
4 * All Rights Reserved.
5 *
6 * Permission to use, copy, modify and distribute this software and its
7 * documentation is hereby granted, provided that both the copyright
8 * notice and this permission notice appear in all copies of the
9 * software, derivative works or modified versions, and any portions
10 * thereof, and that both notices appear in supporting documentation.
11 *
12 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
13 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
14 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
15 *
16 * Carnegie Mellon requests users of this software to return to
17 *
18 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
19 * School of Computer Science
20 * Carnegie Mellon University
21 * Pittsburgh PA 15213-3890
22 *
23 * any improvements or extensions that they make and grant Carnegie Mellon
24 * the rights to redistribute these changes.
25 */
26 /*
27 * Copyright 1988, 1989, 1990, 1991 by Intel Corporation,
28 * Santa Clara, California.
29 *
30 * All Rights Reserved
31 *
32 * Permission to use, copy, modify, and distribute this software and its
33 * documentation for any purpose and without fee is hereby granted,
34 * provided that the above copyright notice appears in all copies and that
35 * both the copyright notice and this permission notice appear in
36 * supporting documentation, and that the name of Intel not be used in
37 * advertising or publicity pertaining to distribution of the software
38 * without specific, written prior permission.
39 *
40 * INTEL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING
41 * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT
42 * SHALL INTEL BE LIABLE FOR ANY SPECIAL, INDIRECT, OR CONSEQUENTIAL
43 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
44 * PROFITS, WHETHER IN ACTION OF CONTRACT, NEGLIGENCE, OR OTHER TORTIOUS
45 * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
46 * THIS SOFTWARE.
47 */
48 /*
49 * HISTORY
50 * $Log: iopl.c,v $
51 * Revision 2.3 91/06/18 20:50:20 jsb
52 * New copyright from Intel.
53 * [91/06/18 20:06:41 jsb]
54 *
55 * Revision 2.2 90/12/04 14:47:21 jsb
56 * First checkin.
57 * [90/12/04 10:56:56 jsb]
58 *
59 */
60
61 #include <mach/vm_prot.h>
62 #include <mach/i386/vm_types.h>
63 #include <mach/i386/vm_param.h>
64 #include <device/io_req.h>
65 #include <ipc/ipc_port.h>
66
67 /*
68 * IOPL device.
69 */
70 ipc_port_t iopl_device_port = IP_NULL;
71
72 int
73 ioplopen(dev, flag, ior)
74 int dev;
75 int flag;
76 io_req_t ior;
77 {
78 iopl_device_port = ior->io_device->port;
79 return (0);
80 }
81
82 /*ARGSUSED*/
83 int
84 ioplclose(dev, flag)
85 int dev;
86 int flag;
87 {
88 iopl_device_port = IP_NULL;
89 return (0);
90 }
91
92 /*ARGSUSED*/
93 int
94 ioplmmap(dev, off, prot)
95 int dev;
96 vm_offset_t off;
97 vm_prot_t prot;
98 {
99 if (off >= 0x60000)
100 return (-1);
101 return (i386_btop(0xa0000+off));
102 }
Cache object: 07a95a480eee333df4e802a5676d3522
|