Commit Graph

548 Commits

Author SHA1 Message Date
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
christos
168cd830d2 __unused removal on arguments; approved by core. 2006-11-16 01:32:37 +00:00
plunky
57c0199dcf Tidy away wsmouse_input() abstractions and update
documentation to include the W direction.
2006-11-12 19:00:42 +00:00
bjh21
7cd2ca16b5 COMPAT_10 implies COMPAT_11, so there's no need to test both.
Also collapse two tightly-nested #ifs into one.
2006-11-11 17:28:16 +00:00
macallan
1009b21c56 add wsdisplay_preattach() to attach an early console that can be overridden
by wsdisplay_cnattach() for instance when a hardware-specific display driver
attaches.
as discussed on tech-kern
2006-11-06 19:51:12 +00:00
dogcow
372e6ef309 now that we have -Wno-unused-parameter, back out all the tremendously ugly
code to gratuitously access said parameters.
2006-10-17 18:21:29 +00:00
dogcow
2023789a40 More -Wunused fallout. sprinkle __unused when possible; otherwise, use the
do { if (&x) {} } while (/* CONSTCOND */ 0);
construct as suggested by uwe in <20061012224845.GA9449@snark.ptc.spbu.ru>.
2006-10-13 16:53:35 +00:00
christos
4d595fd7b1 - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
2006-10-12 01:30:41 +00:00
elad
08544bdaa5 Use kauth(9) instead of securelevel.
okay cube@
2006-10-10 10:23:58 +00:00
peter
85e327e25c KNF: No variable names in the prototype. 2006-10-09 11:03:43 +00:00
peter
56a1ab047b s/REGENTS/AUTHOR/ 2006-10-09 10:37:23 +00:00
peter
9eddf38521 Remove (the default) #define XXXDEBUG and add the options to the relevant
files.xxx file.
2006-10-09 10:33:42 +00:00
elad
bdc51baebb Adapt MD code to KAUTH_DEVICE_TTY_OPEN, batch #2 from Matt Fleming, thanks!
Also, add forgotten splx() calls in some places.
2006-10-01 19:28:43 +00:00
elad
9033a1369b In struct vcons_data, don't depend on DIAGNOSTIC and always include
switch_poll_count.

okay chs@
2006-09-22 15:16:03 +00:00
uebayasi
c1a02ec4d9 Typo. 2006-09-08 06:38:55 +00:00
christos
f7747a2a56 fix incomplete struct decl. 2006-08-28 21:37:37 +00:00
christos
a0917ad69e fix incomplete initializers 2006-08-28 21:33:16 +00:00
ad
3029ac48c7 - Use the LWP cached credentials where sane.
- Minor cosmetic changes.
2006-07-21 16:48:45 +00:00
drochner
270bc37d08 add a missing splx() in an error path 2006-06-28 16:19:01 +00:00
gdamore
a5c89047c0 Initial import of bluetooth stack on behalf of Iain Hibbert. (plunky@,
NetBSD Foundation Membership still pending.)  This stack was written by
Iain under sponsorship from Itronix Inc.

The stack includes support for rfcomm networking (networking via your
bluetooth enabled cell phone), hid devices (keyboards/mice), and headsets.

Drivers for both PCMCIA and USB bluetooth controllers are included.
2006-06-19 15:44:33 +00:00
kardel
de4337ab21 merge FreeBSD timecounters from branch simonb-timecounters
- struct timeval time is gone
  time.tv_sec -> time_second
- struct timeval mono_time is gone
  mono_time.tv_sec -> time_uptime
- access to time via
	{get,}{micro,nano,bin}time()
	get* versions are fast but less precise
- support NTP nanokernel implementation (NTP API 4)
- further reading:
  Timecounter Paper: http://phk.freebsd.dk/pubs/timecounter.pdf
  NTP Nanokernel: http://www.eecis.udel.edu/~mills/ntp/html/kern.html
2006-06-07 22:33:33 +00:00
elad
2867b68bc3 integrate kauth. 2006-05-14 21:42:26 +00:00
martin
01903cbdf3 Fix typo in comment. From Mátyás János in PR kern/33477. 2006-05-14 10:25:16 +00:00
jmmv
aec18036fd Remove the getwschar and putwschar accessops from wsdisplay drivers as
requested by uwe@.  These were wrong because they were receiving an
emulcookie yet they were accessops (thus having to receive an accesscookie).
Instead, just handle the WSDISPLAYIO_{GET,PUT}WSCHAR ioctls from the
driver's ioctl accessop.

As this reduces the amount of code needed to handle these operations to
two small functions in each driver, remove the WSDISPLAY_CHARFUNCS kernel
option.

Reviewed by, at least, uwe@ and macallan@.  No objections in tech-kern@.
2006-04-15 17:48:23 +00:00
christos
1b815db766 Coverity CID 1084: Don't call suser if we don't have a process context. 2006-04-14 16:19:44 +00:00
macallan
767a272758 pass the right cookie to ioctl() and mmap() instead of struct wsscreen * 2006-04-13 01:15:27 +00:00
macallan
9ba325f38a correct typo 2006-04-12 20:13:21 +00:00
jmmv
7a51d4dddc Add an extra cookie to the ioctl and mmap wsdisplay accessops that points
to the screen on which they are being called.  The driver cannot guess
this by itself but it is needed to implement, at least, the getwschar and
putwschar functions in the correct place.  There are no functional changes
yet.

Tested on i386 (vga, vga_raster, machfb, vesafb), macppc and sparc64.
Suggested and reviewed by macallan@.
2006-04-12 19:38:22 +00:00
drochner
3d2bb104a8 don't include opt_wsdisplay_border.h here, to limit dependencies 2006-04-07 14:30:20 +00:00
drochner
5b4dd527c3 Use the existing ioctl path to call WSDISPLAYIO_GBORDER/WSDISPLAYIO_SBORDER
instead of a separate accessops entry. There is no need to introduce bloat
for the majority of drivers which don't implement this feature.
This should also resolve PR kern/33186 by Valeriy E. Ushakov.
2006-04-05 15:18:25 +00:00
christos
89bc0d7869 Greek console keymap from Eye of the Beholder 2006-04-01 23:02:32 +00:00
thorpej
2be6494fc9 Use device_cfdata(). 2006-03-29 04:16:44 +00:00
thorpej
39cd836ee1 Use device_unit(). 2006-03-28 17:38:24 +00:00
jmcneill
a737ed394b Don't use intarg uninitialized in wsdisplay_usl_ioctl2. Fixes CID 2507 2006-03-18 13:06:38 +00:00
uwe
4030a5d7d5 Make this compile with WSKBD_DEBUG again. 2006-03-14 23:41:45 +00:00