ofw_console.c (120544) | ofw_console.c (126076) |
---|---|
1/* 2 * Copyright (C) 2001 Benno Rice. 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 --- 10 unchanged lines hidden (view full) --- 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 20 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 21 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 22 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 23 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 */ 25 26#include <sys/cdefs.h> | 1/* 2 * Copyright (C) 2001 Benno Rice. 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 --- 10 unchanged lines hidden (view full) --- 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 20 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 21 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 22 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 23 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 */ 25 26#include <sys/cdefs.h> |
27__FBSDID("$FreeBSD: head/sys/dev/ofw/ofw_console.c 120544 2003-09-28 06:51:47Z jake $"); | 27__FBSDID("$FreeBSD: head/sys/dev/ofw/ofw_console.c 126076 2004-02-21 19:42:58Z phk $"); |
28 29#include <sys/cdefs.h> | 28 29#include <sys/cdefs.h> |
30__FBSDID("$FreeBSD: head/sys/dev/ofw/ofw_console.c 120544 2003-09-28 06:51:47Z jake $"); | 30__FBSDID("$FreeBSD: head/sys/dev/ofw/ofw_console.c 126076 2004-02-21 19:42:58Z phk $"); |
31 32#include "opt_ddb.h" 33#include "opt_comconsole.h" 34 35#include <sys/param.h> 36#include <sys/kernel.h> 37#include <sys/systm.h> 38#include <sys/types.h> --- 7 unchanged lines hidden (view full) --- 46#include <ddb/ddb.h> 47 48#define OFW_POLL_HZ 4 49 50static d_open_t ofw_dev_open; 51static d_close_t ofw_dev_close; 52static d_ioctl_t ofw_dev_ioctl; 53 | 31 32#include "opt_ddb.h" 33#include "opt_comconsole.h" 34 35#include <sys/param.h> 36#include <sys/kernel.h> 37#include <sys/systm.h> 38#include <sys/types.h> --- 7 unchanged lines hidden (view full) --- 46#include <ddb/ddb.h> 47 48#define OFW_POLL_HZ 4 49 50static d_open_t ofw_dev_open; 51static d_close_t ofw_dev_close; 52static d_ioctl_t ofw_dev_ioctl; 53 |
54#define CDEV_MAJOR 97 | |
55 56static struct cdevsw ofw_cdevsw = { 57 .d_open = ofw_dev_open, 58 .d_close = ofw_dev_close, 59 .d_read = ttyread, 60 .d_write = ttywrite, 61 .d_ioctl = ofw_dev_ioctl, 62 .d_poll = ttypoll, 63 .d_name = "ofw", | 54 55static struct cdevsw ofw_cdevsw = { 56 .d_open = ofw_dev_open, 57 .d_close = ofw_dev_close, 58 .d_read = ttyread, 59 .d_write = ttywrite, 60 .d_ioctl = ofw_dev_ioctl, 61 .d_poll = ttypoll, 62 .d_name = "ofw", |
64 .d_maj = CDEV_MAJOR, | |
65}; 66 67static struct tty *ofw_tp = NULL; 68static int polltime; 69static struct callout_handle ofw_timeouthandle 70 = CALLOUT_HANDLE_INITIALIZER(&ofw_timeouthandle); 71 72#if defined(DDB) && defined(ALT_BREAK_TO_DEBUGGER) --- 28 unchanged lines hidden (view full) --- 101 sizeof(output)) == -1) 102 return; 103 dev = make_dev(&ofw_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "%s", 104 output); 105 make_dev_alias(dev, "ofwcons"); 106 } 107} 108 | 63}; 64 65static struct tty *ofw_tp = NULL; 66static int polltime; 67static struct callout_handle ofw_timeouthandle 68 = CALLOUT_HANDLE_INITIALIZER(&ofw_timeouthandle); 69 70#if defined(DDB) && defined(ALT_BREAK_TO_DEBUGGER) --- 28 unchanged lines hidden (view full) --- 99 sizeof(output)) == -1) 100 return; 101 dev = make_dev(&ofw_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "%s", 102 output); 103 make_dev_alias(dev, "ofwcons"); 104 } 105} 106 |
109SYSINIT(cndev, SI_SUB_CONFIGURE, SI_ORDER_MIDDLE + CDEV_MAJOR, cn_drvinit, NULL) | 107SYSINIT(cndev, SI_SUB_CONFIGURE, SI_ORDER_MIDDLE, cn_drvinit, NULL) |
110 111static int stdin; 112static int stdout; 113 114static int 115ofw_dev_open(dev_t dev, int flag, int mode, struct thread *td) 116{ 117 struct tty *tp; --- 225 unchanged lines hidden --- | 108 109static int stdin; 110static int stdout; 111 112static int 113ofw_dev_open(dev_t dev, int flag, int mode, struct thread *td) 114{ 115 struct tty *tp; --- 225 unchanged lines hidden --- |