Commit Graph

582 Commits

Author SHA1 Message Date
tsutsui b04b7da893 Switch NetBSD/hp300 to wscons with rasops. Simply ported from OpenBSD/hp300.
- Only A1416 Kathmandu (topcat) framebuffer on 425t is tested, but
  all other variants (TigerShark, Hyperion, DaVinci, GatorBox, Renaissance)
  should also work if they are working on OpenBSD/hp300.
- sti(4) and SGC bus support are not pulled because I don't have 425e
  and I can't confirm that 362 and 382 actually have SGC bus.
  (I'll commit a DIO based dumb driver for 362 and 382 framebuffers later)
- Xorg server with wsfb driver will also be integrated soon
  once after keycode with NoSymbol problem is addressed.
  (We have to re-think what code should be used on WSDISPLAY_COMPAT_RAWKBD)
- MI HIL keyboard and mouse drivers are working fine though
  cngetc via hilkbd has some problem (still we can input commands).
- No old HP-UX like HIL ioctl compatibility (we removed COMPAT_HPUX anyway).
  grfinfo(8) and hilinfo(8) will be removed shortly.

Demonstrated on NetBSD booth at Open Source Conference 2011 Kagawa.
2011-02-06 18:26:51 +00:00
macallan 195f4ebf1c Add support for asynchronous drawing in vcons.
This is not finished but good enough for others to play with, enable with
options VCONS_DRAW_ASYNC
With this all drawing operations will be posted to a ring buffer instead
of being run directly, and run by a kernel thread. This avoids having to wait
for drawing operations to finish with the kernel lock held ( to a degree at
least ) and scrolling a (slow) framebuffer console should not disrupt other
operations anymore.
Problems:
- we need to switch back to synchronous operations when panicing or entering
  ddb, also re-enable async drawing when leaving ddb
- there are still occasional glitches
tested on an SS20 with cg14 and cg6 for dumb and accelerated cases
2011-01-25 20:28:21 +00:00
cegger e28cc170ed Implement new WSDISPLAYIO_GET_BUSID ioctl.
It returns the bus id and allows userland (like Xorg) to create mapping
of ttyE? and bus id. For now only PCI is implemented.

First discussed with macallan@ then public on tech-kern@ and tech-x11@
2011-01-22 15:14:27 +00:00
jruoho 871220a39a Add wskbd_hotkey_deregister() to match wskbd_hotkey_register().
XXX: This is kind of futile; the only user of the wskbd(4)'s hotkey interface
     is hpqlb(4), which is a questionable driver, being, by design,
     limited only to the laptop model for which the driver was written.
2010-10-26 05:12:34 +00:00
macallan 17887680e3 clarify how backlight control ioctl()s are supposed to work
TODO: adapt r128fb and radeonfb
2010-10-02 00:52:02 +00:00
macallan 42092a5f99 add separate flags for putchar() based copycols() and copyrows() methods
for hw that can accelerate one but not the other, like Sun's Creator series
VCONS_DONT_READ does the same as before
2010-09-21 03:33:14 +00:00
macallan 9c10440f53 Add copycols() and copyrows() methods which, instead of calling the underlying
driver methods, call the driver's putchar() method to redraw the affected
areas.
For unaccelerated framebuffers where reads are expensive and we can't spare
any memory for a shadow framebuffer. Enabled by setting VCONS_DONT_READ in
scr_flags
2010-08-18 16:46:51 +00:00
ahoka d144c6d14a output ^_ on control-/ like xterm does. 2010-07-01 14:49:34 +00:00
rmind 3c507045e2 Remove pfind() and pgfind(), fix locking in various broken uses of these.
Rename real routines to proc_find() and pgrp_find(), remove PFIND_* flags
and have consistent behaviour.  Provide proc_find_raw() for special cases.
Fix memory leak in sysctl_proc_corename().

COMPAT_LINUX: rework ptrace() locking, minimise differences between
different versions per-arch.

Note: while this change adds some formal cosmetics for COMPAT_DARWIN and
COMPAT_IRIX - locking there is utterly broken (for ages).

Fixes PR/43176.
2010-07-01 02:38:26 +00:00
dholland 61655fede0 PR kern/38900 Arnaud Lacombe: don't try to do WSDISPLAY_SCROLLSUPPORT
things if NWSDISPLAY is 0.

Arguably the right fix is to not allow "options WSDISPLAY_SCROLLSUPPORT"
to be enabled in this case, but AIUI config doesn't know how to encode
rules like that.
2010-05-31 04:27:18 +00:00
drochner 8e8bf15598 add just as much "detach" code to keep the box from panicking on
removal of a USB "udl" device
(needs more work, but I got the hardware for a quick test only)
2010-04-11 14:04:10 +00:00
jdc 54c6f4b764 Add mappings for KS_End/KS_KP_End, so that the `End' key actually does
something.
2010-03-12 08:40:50 +00:00
mrg ebc9e23316 various aprint_* fixes. 2010-03-11 03:54:56 +00:00
drochner 4faa4ba521 retire our private definitions for the scan1/3/5/7/9 DEC graphics
symbols, use the unicode definitions instead (which apparently didn't
exist when I wrote that)
2010-02-25 11:20:09 +00:00
dyoung c1b390d493 A pointer typedef entails trading too much flexibility to declare const
and non-const types, and the kernel uses both const and non-const
PMF qualifiers and device suspensors, so change the pmf_qual_t and
device_suspensor_t typedefs from "pointers to const" to non-pointer,
non-const types.
2010-02-24 22:37:54 +00:00
drochner ff24957791 put back the "vt100base_data" variable which was souce of confusion,
it is really needed, as noted by Geoff Wing
2010-02-11 10:07:14 +00:00
skrll 6abd7610a4 Remove accidental commit. 2010-02-10 22:25:08 +00:00
skrll 1caeee472f Oops. Whitespace in previous. 2010-02-10 20:54:46 +00:00
drochner 265bc2e92c Allow big parts of the vt100 emulation code (what is in
wsemul_vt100_subr.c) to be used by alternative terminal emulators
(which are not in-tree yet but can be loaded as LKMs).
For this, split out that part of the state structure which is used
by the sharable code and include that in the original vt100 state.
This is only a query-replace and sed(1) job for now, it makes sense
to rearrange things a bit so that even more code can be changed --
will do so later.
2010-02-10 19:39:39 +00:00
drochner f4b5ad99de add some missing (mostly hungarian or polish) dead accent combinations,
from lkundrak's netbsd-sk_cz-howto
2010-02-05 18:26:38 +00:00
drochner 6d35fa3886 give up some silly macros which were only used ~once, and reduce
dependency on "locators.h"
makes the code more LKM frienly
2010-02-02 16:54:40 +00:00
drochner 1921d00aaf add hooks to allow terminal emulations to be installed by LKMs
(these are not available in early bootstrap, so this is not an
option for the system's default emulation)
2010-02-02 16:18:29 +00:00
drochner 25fb8de00b -rename the "KS_GROUP_Ascii" key symbol category to "Plain" because
this is what it meant all the time -- it includes characters >127
-delegate translation of all key symbols >127 to the terminal emulation
 layer -- formerly everything non-special was passed to the tty subsystem
 directly, involving truncation to a "char", which effectively meant
 some ISO-1 assumption
2010-01-28 22:36:19 +00:00
macallan 0e3560f1eb revert brainfart 2010-01-13 05:08:24 +00:00
macallan 179feaec06 send PMF events for volume control keys 2010-01-12 17:39:21 +00:00
dyoung 3022acc4eb Expand PMF_FN_* macros. 2010-01-08 19:42:11 +00:00
macallan 608f7f5569 add WSDISPLAY_TYPE_XVR1000 2009-12-31 05:08:05 +00:00
tsutsui 9dc186d614 Reserve WSDISPLAY_TYPE for DisplayLink DL-1x0/DL-1x5 USB LCDs and
USB-VGA adaptors (which may require a new ioctl for DUMBFB ops). From
FUKAUMI Naoki.
2009-11-15 17:42:24 +00:00
christos 28b2719313 Don't call usl_sync_check_sig from an interrupt context. Call it only if waitok.
Stack trace:	mutex_vector_enter <- usl_sync_check_sig <- usl_detachproc <-
		wsdisplay_switch <- wskbd_translate <- wskbd_input <-
		pckbd_input <- pckbcintr <- intr_biglock_wrapper <-
		Xintr_ioapic_edge1
Reported by Anon Ymous
2009-10-04 22:24:15 +00:00
macallan 19bc30d9ac add vcons_replay_msgbuf() for use by wsdisplay drivers to replay the message
buffer when attaching so older log messages will show up in the scrollback
buffer
Idea from gimpy
2009-08-20 02:01:08 +00:00
cegger 7cf2991222 struct device * -> device_t, no functional changes intended. 2009-05-12 14:38:26 +00:00
mkirby ff12b9febc Add a Czech (QWERTY) keyboard layout, and teach wscons about latin 2 characters.
Original code from Lubomir Kundrak, adapted to current and cleaned up by me.

Fixes PR kern/16216

ok agc@ jdc@
2009-04-06 17:32:09 +00:00
yamt 74ccc189c4 wsevent_copyout_events50: fix a bogus panic. 2009-02-18 13:20:02 +00:00
snj 3c510e6b43 s/portugese/portuguese/, spotted by Ari Constancio in PR misc/40202. 2009-02-18 04:17:44 +00:00
apb 0cc72e51ac Use "defopt MODULAR" in sys/conf/files, and #include "opt_modular.h"
in all kernel sources that use the MODULAR option.
Proposed in tech-kern on 18 Jan 2009.
2009-02-13 22:41:00 +00:00
uwe c795b4c2a9 G/c duplicate definition of WSCONS_EVENT_ASCII. 2009-02-08 22:58:56 +00:00
drochner cf45120117 Avoid deadlock in tty code if a terminal emulation responds to
type/status/etc inquiries. (PR kern/37915)
This is clearly a design problem in tty, but we need a cheap fix now.
The problem is that ttyinput() tries to pull a spinlock which
is already held on calls to t_oproc.
The workaround is based on the fact that within wscons code, the
wsdisplay_emulinput() function is only called directly from
wsdisplaystart(). So we can be sure that the tty lock is held,
and use an inofficial entry point in ttc.c which avoids the locking.
These ate certainly more assumptions than needed by the fix
proposed in the PR, but it doesn't affect (and slow down) other
tty drivers.
2009-01-22 20:40:20 +00:00
yamt cf5a92c11e always use the new version of wscons_event for in-kernel. 2009-01-16 15:14:11 +00:00
yamt 350f838fcf wsevent_init: always initialize version. pointed out by christos. 2009-01-16 14:38:09 +00:00
yamt 0915dface4 - reduce the number of #ifdefs.
- build compat glues if MODULAR.
2009-01-15 04:22:11 +00:00
christos 4c7a98373d Allocate the max size needed so that we don't need to realloc in setversion.
Problem pointed out by yamt.
2009-01-14 15:34:36 +00:00
christos 8945a0f495 provide wscons_event compatibility with 5.0. 2009-01-13 18:05:55 +00:00
he 761f38db5c In wsdisplay_kbdholdscreen(), just return if sc->sc_focus is NULL.
There is apparently no guarantee sc->sc_focus will be non-NULL,
as proved by a crash I experienced earlier today (admittedly on 4.0.1).
2008-11-07 19:33:13 +00:00
cegger ee1dc8ea5f use device_lookup_private to get softc
use device_lookup to get device_t
2008-06-12 23:04:37 +00:00
cegger 7028bd34e9 use device_lookup_private to get sc
ok cube
2008-06-11 16:17:01 +00:00
ghen 41f841e610 Add support for the Colemak keyboard layout variant, see http://colemak.com 2008-05-21 07:39:24 +00:00
martin 592397db3f Move to standard TNF 2 clause license 2008-05-04 12:59:38 +00:00
cegger d9b775927c hpqlb(4): driver for HP Quick Launch buttons - found on HP Pavilion Notebooks 2008-05-01 20:18:18 +00:00
ad 1498ad220e Make various bits of debug code compile again. 2008-04-30 14:07:13 +00:00
martin ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
cegger 4bd4cc6d3d aprint_verbose -> aprint_verbose_dev 2008-04-27 05:15:45 +00:00
ad 6d70f903e6 Network protocol interrupts can now block on locks, so merge the globals
proclist_mutex and proclist_lock into a single adaptive mutex (proc_lock).
Implications:

- Inspecting process state requires thread context, so signals can no longer
  be sent from a hardware interrupt handler. Signal activity must be
  deferred to a soft interrupt or kthread.

- As the proc state locking is simplified, it's now safe to take exit()
  and wait() out from under kernel_lock.

- The system spends less time at IPL_SCHED, and there is less lock activity.
2008-04-24 15:35:27 +00:00
cegger 3069a1f144 use aprint_*_dev and device_xname 2008-04-05 15:50:49 +00:00
cube d94699ecbb Split device_t and softc for wskbd(4), wsmouse(4) and that creepy wsmux(4). 2008-03-25 00:49:19 +00:00
drochner 3678498d59 -add a function to vga_post which can be called from DDB to get a
usable VGA console ("call ddb_vgapost")
-allow to switch from/to screens occupied by an X server if the graphics
 device is console and in polling mode (ie DDB)
This together allows to get a DDB session on a VGA console if the
system crashed while X11 was running.
As long as the protocol to tell X servers about virtual screen switches
is as primitive as it is, it is unsafe to restart an X session afterwards.
So this is basically for crash analysis.
2008-03-12 23:26:18 +00:00
rmind c6186face4 Welcome to 4.99.55:
- Add a lot of missing selinit() and seldestroy() calls.

- Merge selwakeup() and selnotify() calls into a single selnotify().

- Add an additional 'events' argument to selnotify() call.  It will
  indicate which event (POLL_IN, POLL_OUT, etc) happen.  If unknown,
  zero may be used.

Note: please pass appropriate value of 'events' where possible.
Proposed on: <tech-kern>
2008-03-01 14:16:49 +00:00
dyoung f580a3a869 Use PMF_FN_ARGS, PMF_FN_PROTO. 2008-02-29 06:13:39 +00:00
dyoung 9ab63bea7b Do not return EBUSY if this is the console. 2008-02-28 16:54:48 +00:00
dyoung c7d0c816a2 Return EBUSY and do not detach if we are the console.
Cosmetic: use device_t and accessors.  Temporarily use PMF_FN_PROTO,
PMF_FN_ARGS.
2008-02-22 22:29:16 +00:00
drochner 0c3c5106cb -Don't detach/attach the X server in the pmf suspend/resume functions
which are called somewhere in the middle of system suspend. Since the
 X server accesses hardware directly it is outside our control whether
 the devices it accesses are already/still suspended or not, so the only
 way is to detach it before any device suspends and re-attach after
 everything is awake again.
-For that, export a function ("wsdisplay_handlex" for now) which is
 to be called from central suspend/resume code.
-The right way to handle the (normally impossible) case that the X
 server is not detached on suspend is to return an error which should
 abort the suspend process. pmf doesn't yet handle errors of device
 suspend handlers, so as a temporary measure try to suspend anyway,
 to get at least a text console.
-Improve error handling of X server attach/detach and maintain a flag
 which tracks whether the X server is really active.
2008-02-20 22:33:18 +00:00
drochner 85b70008e0 make the mutex securing a flag which controls screen switched adaptive
for sanity -- it is not yet in a code path which is called from
keyboard interrupt handlers
2008-02-13 19:01:35 +00:00
drochner 84c211c56c On suspend/resume, just detach/attach the X server (or whatever might
be using the "syncops" protocol) rather than doing a full switch
to virtual screen 1. The latter doesn't have the expected result if
the X server is running on screen 1, and is too much policy for inside
the kernel anyway.
Introduce a mutex+condvar to synchronize these operations, to replace
the spltty()/tsleep(). (for now only used by the new functions,
should be extended to the normal vt switching code)
2008-01-14 21:38:50 +00:00
drochner 8644062c1c restructure things a bit so that proclist_mutex is held between the
p_find() and the psignal() which is its purpose after all
2008-01-14 21:17:00 +00:00
joerg 1c47f4bb86 Switch to console on suspend and shutdown, switch back to where the
system was before on resume. This is the second attempt and got more
complicated due to the async nature of VT_ACTIVE. After the initial
switch, check that we ended up on the first screen and if not, wait for
the switch to happen.
2007-12-13 15:14:48 +00:00
joerg 5141501598 Stop the key pressed timeout on suspend to avoid virtually hanging keys,
e.g. when calling sysctl -w machdep.sleep_state=3 manually.
2007-12-13 14:49:42 +00:00
jmcneill b36c96248a Wups, pmf_class_input_deregister is private; use pmf_device_deregister
instead
2007-12-10 01:13:38 +00:00
jmcneill cda2869251 Deregister input class handler on detach. 2007-12-10 01:11:49 +00:00
jmcneill 4c1d81b2b5 Merge jmcneill-pm branch. 2007-12-09 20:27:42 +00:00
pooka 4e38160d4d Do not "return 1" from kqfilter for errors. That value is passed
directly to the userland caller and results in a mysterious EPERM.
Instead, return EINVAL or something else sensible depending on the
case.
2007-12-05 17:19:46 +00:00
jmcneill 4fbe23fdd0 aprintify 2007-12-01 04:50:50 +00:00
ad dc26833bb6 - Factor out too many copies of the same bit of tty code.
- Fix another tty signalling/wakeup problem.
2007-11-19 18:51:36 +00:00
dogcow 96d14f0973 If you're going to use device_t, may as well include sys/device.h; unb0rks
the build for sparc{,64}.
2007-10-19 08:57:50 +00:00
joerg 6c51962b6c Calling device_private once is enough. Reported by macallan@ 2007-10-18 21:08:18 +00:00
joerg d238692c3e Initialise the callbacks for tty.t_rstrt_ch in ttymalloc
as all drivers but Sun/SPARC's kd.c use the same arguments.
Separate callout_reset into callout_schedule and the initial
callout_setfunc using that.
2007-10-18 18:54:56 +00:00
joerg e4a56b252c Use aprint API for output and convert to device_t/softc separation. 2007-10-18 18:09:52 +00:00
joerg 002c91440c Always declare wskbd_repeat to fix build without wsdisplay. 2007-10-18 14:51:25 +00:00
joerg 54575b3cd5 Use callout_setfunc/callout_schedule and don't cast function pointers. 2007-10-17 22:13:56 +00:00
joerg 55e50c10e7 Use callout_setfunc/callout_schedule instead of callout_reset.
Use mstohz for the calculations.
2007-10-16 21:06:09 +00:00
macallan 6a9b8ff83c add type for Fujitsu AG-10e 2007-08-27 02:01:23 +00:00
macallan 75a9d6c832 add scrollback support 2007-08-06 03:11:32 +00:00
macallan bf32d3c292 set the scrollmode flag when entering/leaving scroll mode, send scroll reset
when leaving
2007-08-06 03:07:52 +00:00
rumble 64dd04152b Set the 'ri' pointer before use. 2007-07-28 22:35:56 +00:00
mjf 05619021ad Implement bounds checking in some places in display driver code to avoid
the possibility of a local user panic.
2007-07-28 20:28:56 +00:00
nonaka 2462aff88e add WSDISPLAY_TYPE_PXALCD for PXA2x0 LCD controller. 2007-07-26 12:17:14 +00:00
macallan 6b4ea0adbe add WSDISPLAY_TYPE_CRIME for the SGI O2's graphics hardware 2007-07-26 01:59:07 +00:00
ad 88ab7da936 Merge some of the less invasive changes from the vmlocking branch:
- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
2007-07-09 20:51:58 +00:00
macallan 02be3c78f3 add WSDISPLAY_TYPE_GENFB 2007-04-11 04:09:10 +00:00
mishka 2f5bd28732 Revert previous commit until further investigation because it is
known as problematic.  Some problems obscured are dead Del key (I
can reproduce this with wscons scroll support) and panic (seen by
<elad> only).
2007-04-04 14:50:21 +00:00
mishka 933b97ecac Implement locking switcher for alternative layots (many languages
are based on completely different alphabet, and typesetting with
one of modifiers pressed all the time is just a PITA). See
http://mail-index.netbsd.org/tech-kern/2007/03/29/0002.html for
usage details.

While here, perform the following small cleanups:
- KS_Cmd_Scroll* execution should be explicitly interrupted with 'break'.
- Some 'human' cleanups in ksym extraction algorithm (no func. changes).
- Add a note: implemented ksym translation isn't sufficient for l10n.
2007-04-02 10:01:31 +00:00
drochner 9916a76d2e It was probably not a good idea to put that scroll stuff to accessops.
But now that it is there, keep it from crashing the box if there is
no valid focus screen.
2007-03-05 16:06:52 +00:00
christos 53524e44ef Kill caddr_t; there will be some MI fallout, but it will be fixed shortly. 2007-03-04 05:59:00 +00:00
ad b07ec3fc38 Merge newlock2 to head. 2007-02-09 21:55:00 +00:00
hubertf eda05c6413 Remove more duplicate headers.
Patch by Slava Semushin <slava.semushin@gmail.com>

Again, this was tested by comparing obj files from a pristine and a patched
source tree against an i386/ALL kernel, and also for src/sbin/fsck_ffs,
src/sbin/fsdb and src/usr.sbin/makefs. Only changes in assert() line numbers
were detected in 'objdump -d' output.
2007-01-29 01:52:43 +00:00
macallan cf6c447564 add #defines for ADB and pseudo mice 2007-01-19 20:59:45 +00:00
cube 4cdd8aada6 Complete initializers so those files compile. 2007-01-13 18:42:45 +00:00
elad d5ebb97b46 Consistent usage of KAUTH_GENERIC_ISSUSER. 2007-01-04 18:44:45 +00:00
elad 0ffd2bf379 Adapt to recent machdep scope changes.
Pointed out by Kouichirou Hiratsuka, thanks!
2006-12-26 16:42:06 +00:00
rumble 4bbcf8f210 Add type for sgimips/light(4). 2006-12-26 05:54:00 +00:00
peter d939731248 Add WSKBD_TYPE_ZAURUS (Sharp Zaurus keyboard). 2006-12-17 16:08:44 +00:00
freza e388b581bd Welcome to evbppc/virtex -- port to Xilinx Virtex series FPGA's with embedded
ibm405d5 core.

OK by Simon Burge
2006-12-02 22:18:47 +00:00