Sun Nov 8 16:49:41 2015 UTC ()
Untangle.


(christos)
diff -r1.28 -r1.29 src/sys/dev/wscons/wsemul_sun.c

cvs diff -r1.28 -r1.29 src/sys/dev/wscons/wsemul_sun.c (expand / switch to unified diff)

--- src/sys/dev/wscons/wsemul_sun.c 2010/03/12 08:40:50 1.28
+++ src/sys/dev/wscons/wsemul_sun.c 2015/11/08 16:49:41 1.29
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: wsemul_sun.c,v 1.28 2010/03/12 08:40:50 jdc Exp $ */ 1/* $NetBSD: wsemul_sun.c,v 1.29 2015/11/08 16:49:41 christos Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved. 4 * Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright 11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the 12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution. 13 * documentation and/or other materials provided with the distribution.
14 * 3. All advertising materials mentioning features or use of this software 14 * 3. All advertising materials mentioning features or use of this software
@@ -23,27 +23,27 @@ @@ -23,27 +23,27 @@
23 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 23 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 24 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
25 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 25 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 */ 31 */
32 32
33/* XXX DESCRIPTION/SOURCE OF INFORMATION */ 33/* XXX DESCRIPTION/SOURCE OF INFORMATION */
34 34
35#include <sys/cdefs.h> 35#include <sys/cdefs.h>
36__KERNEL_RCSID(0, "$NetBSD: wsemul_sun.c,v 1.28 2010/03/12 08:40:50 jdc Exp $"); 36__KERNEL_RCSID(0, "$NetBSD: wsemul_sun.c,v 1.29 2015/11/08 16:49:41 christos Exp $");
37 37
38#include <sys/param.h> 38#include <sys/param.h>
39#include <sys/systm.h> 39#include <sys/systm.h>
40#include <sys/time.h> 40#include <sys/time.h>
41#include <sys/malloc.h> 41#include <sys/malloc.h>
42#include <sys/fcntl.h> 42#include <sys/fcntl.h>
43 43
44#include <dev/wscons/wsconsio.h> 44#include <dev/wscons/wsconsio.h>
45#include <dev/wscons/wsdisplayvar.h> 45#include <dev/wscons/wsdisplayvar.h>
46#include <dev/wscons/wsemulvar.h> 46#include <dev/wscons/wsemulvar.h>
47#include <dev/wscons/wsksymdef.h> 47#include <dev/wscons/wsksymdef.h>
48#include <dev/wscons/ascii.h> 48#include <dev/wscons/ascii.h>
49 49
@@ -141,31 +141,31 @@ wsemul_sun_cnattach(const struct wsscree @@ -141,31 +141,31 @@ wsemul_sun_cnattach(const struct wsscree
141#endif 141#endif
142#ifndef WS_KERNEL_MONOATTR 142#ifndef WS_KERNEL_MONOATTR
143#define WS_KERNEL_MONOATTR 0 143#define WS_KERNEL_MONOATTR 0
144#endif 144#endif
145 if (type->capabilities & WSSCREEN_WSCOLORS) 145 if (type->capabilities & WSSCREEN_WSCOLORS)
146 res = (*edp->emulops->allocattr)(cookie, 146 res = (*edp->emulops->allocattr)(cookie,
147 WS_KERNEL_FG, WS_KERNEL_BG, 147 WS_KERNEL_FG, WS_KERNEL_BG,
148 WS_KERNEL_COLATTR | WSATTR_WSCOLORS, 148 WS_KERNEL_COLATTR | WSATTR_WSCOLORS,
149 &edp->kernattr); 149 &edp->kernattr);
150 else 150 else
151 res = (*edp->emulops->allocattr)(cookie, 0, 0, 151 res = (*edp->emulops->allocattr)(cookie, 0, 0,
152 WS_KERNEL_MONOATTR, 152 WS_KERNEL_MONOATTR,
153 &edp->kernattr); 153 &edp->kernattr);
154 if (res) 
155#else 154#else
156 res = 0; /* XXX gcc */ 155 res = EINVAL;
157#endif 156#endif
158 edp->kernattr = defattr; 157 if (res)
 158 edp->kernattr = defattr;
159 159
160 edp->cbcookie = NULL; 160 edp->cbcookie = NULL;
161 161
162 edp->state = SUN_EMUL_STATE_NORMAL; 162 edp->state = SUN_EMUL_STATE_NORMAL;
163 edp->scrolldist = 1; 163 edp->scrolldist = 1;
164#ifdef DIAGNOSTIC 164#ifdef DIAGNOSTIC
165 edp->console = 1; 165 edp->console = 1;
166#endif 166#endif
167 return (edp); 167 return (edp);
168} 168}
169 169
170void * 170void *
171wsemul_sun_attach(int console, const struct wsscreen_descr *type, 171wsemul_sun_attach(int console, const struct wsscreen_descr *type,