From 5e0b8d508ed51004bd836384293be00950ee62c9 Mon Sep 17 00:00:00 2001 From: Pasha Date: Tue, 20 Feb 2024 18:49:50 +0000 Subject: init gnumach copy --- i386/i386at/conf.c | 172 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 172 insertions(+) create mode 100644 i386/i386at/conf.c (limited to 'i386/i386at/conf.c') diff --git a/i386/i386at/conf.c b/i386/i386at/conf.c new file mode 100644 index 0000000..ecbf1e4 --- /dev/null +++ b/i386/i386at/conf.c @@ -0,0 +1,172 @@ +/* + * Mach Operating System + * Copyright (c) 1993-1989 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + * Device switch for i386 AT bus. + */ + +#include +#include +#include +#include + +#define timename "time" + +#ifndef MACH_HYP +#include +#define kdname "kd" + +#if NCOM > 0 +#include +#define comname "com" +#endif /* NCOM > 0 */ + +#if NLPR > 0 +#include +#define lprname "lpr" +#endif /* NLPR > 0 */ +#endif /* MACH_HYP */ + +#include +#define kbdname "kbd" + +#ifndef MACH_HYP +#include +#define mousename "mouse" + +#include +#define memname "mem" +#endif /* MACH_HYP */ + +#include +#define kmsgname "kmsg" + +#ifdef MACH_HYP +#include +#define hypcnname "hyp" +#endif /* MACH_HYP */ + +#include +#define irqname "irq" + +/* + * List of devices - console must be at slot 0 + */ +struct dev_ops dev_name_list[] = +{ + /*name, open, close, read, + write, getstat, setstat, mmap, + async_in, reset, port_death, subdev, + dev_info */ + + /* We don't assign a console here, when we find one via + cninit() we stick something appropriate here through the + indirect list */ + { "cn", nulldev_open, nulldev_close, nulldev_read, + nulldev_write, nulldev_getstat, nulldev_setstat, nomap, + nodev_async_in, nulldev_reset, nulldev_portdeath, 0, + nodev_info}, + +#ifndef MACH_HYP +#if ENABLE_IMMEDIATE_CONSOLE + { "immc", nulldev_open, nulldev_close, nulldev_read, + nulldev_write, nulldev_getstat, nulldev_setstat, + nomap, nodev_async_in, nulldev_reset, nulldev_portdeath, 0, + nodev_info }, +#endif /* ENABLE_IMMEDIATE_CONSOLE */ + { kdname, kdopen, kdclose, kdread, + kdwrite, kdgetstat, kdsetstat, kdmmap, + nodev_async_in, nulldev_reset, kdportdeath, 0, + nodev_info }, +#endif /* MACH_HYP */ + + { timename, timeopen, timeclose, nulldev_read, + nulldev_write, nulldev_getstat, nulldev_setstat, timemmap, + nodev_async_in, nulldev_reset, nulldev_portdeath, 0, + nodev_info }, + +#ifndef MACH_HYP +#if NCOM > 0 + { comname, comopen, comclose, comread, + comwrite, comgetstat, comsetstat, nomap, + nodev_async_in, nulldev_reset, comportdeath, 0, + nodev_info }, +#endif + +#ifdef MACH_LPR + { lprname, lpropen, lprclose, lprread, + lprwrite, lprgetstat, lprsetstat, nomap, + nodev_async_in, nulldev_reset, lprportdeath, 0, + nodev_info }, +#endif + + { mousename, mouseopen, mouseclose, mouseread, + nulldev_write, mousegetstat, nulldev_setstat, nomap, + nodev_async_in, nulldev_reset, nulldev_portdeath, 0, + nodev_info }, + + { kbdname, kbdopen, kbdclose, kbdread, + nulldev_write, kbdgetstat, kbdsetstat, nomap, + nodev_async_in, nulldev_reset, nulldev_portdeath, 0, + nodev_info }, + + { memname, nulldev_open, nulldev_close, nulldev_read, + nulldev_write, nulldev_getstat, nulldev_setstat, memmmap, + nodev_async_in, nulldev_reset, nulldev_portdeath, 0, + nodev_info }, +#endif /* MACH_HYP */ + +#ifdef MACH_KMSG + { kmsgname, kmsgopen, kmsgclose, kmsgread, + nulldev_write, kmsggetstat, nulldev_setstat, nomap, + nodev_async_in, nulldev_reset, nulldev_portdeath, 0, + nodev_info }, +#endif + +#ifdef MACH_HYP + { hypcnname, hypcnopen, hypcnclose, hypcnread, + hypcnwrite, hypcngetstat, hypcnsetstat, nomap, + nodev_async_in, nulldev_reset, hypcnportdeath, 0, + nodev_info }, +#endif /* MACH_HYP */ + + { irqname, nulldev_open, nulldev_close, nulldev_read, + nulldev_write,nulldev_getstat,nulldev_setstat, nomap, + nodev_async_in, nulldev_reset, nulldev_portdeath,0, + nodev_info }, + +}; +int dev_name_count = sizeof(dev_name_list)/sizeof(dev_name_list[0]); + +/* + * Indirect list. + */ +struct dev_indirect dev_indirect_list[] = { + + /* console */ + { "console", &dev_name_list[0], 0 } +}; +int dev_indirect_count = sizeof(dev_indirect_list) + / sizeof(dev_indirect_list[0]); -- cgit v1.2.1