Commit Graph

106 Commits

Author SHA1 Message Date
Poul-Henning Kamp
2ce7d7a033 GC various bits and pieces of USERCONFIG from all over the place. 2002-04-09 11:18:46 +00:00
Jeroen Ruigrok van der Werven
2bb113d084 Fix typo: conole -> console
PR:		33965
Submitted by:	Nicola Vitale <nivit@libero.it>
2002-04-08 19:19:10 +00:00
Murray Stokely
93c30e2e4d Fix spelling and grammar bogons in a comment.
PR:		kern/30540
Submitted by:	Tony Finch <dot@dotat.at>
MFC after:	3 days
2002-03-27 13:16:11 +00:00
Peter Wemm
5f4a0f788b Add the ia64 bus space tag for the IO ports (!).
Add a #else and #error so that this doesn't go unnoticed again.
2002-03-19 10:53:33 +00:00
Alfred Perlstein
85f190e4d1 Fixes to make select/poll mpsafe.
Problem:
  selwakeup required calling pfind which would cause lock order
  reversals with the allproc_lock and the per-process filedesc lock.
Solution:
  Instead of recording the pid of the select()'ing process into the
  selinfo structure, actually record a pointer to the thread.  To
  avoid dereferencing a bad address all the selinfo structures that
  are in use by a thread are kept in a list hung off the thread
  (protected by sellock).  When a selwakeup occurs the selinfo is
  removed from that threads list, it is also removed on the way out
  of select or poll where the thread will traverse its list removing
  all the selinfos from its own list.

Problem:
  Previously the PROC_LOCK was used to provide the mutual exclusion
  needed to ensure proper locking, this couldn't work because there
  was a single condvar used for select and poll and condvars can
  only be used with a single mutex.
Solution:
  Introduce a global mutex 'sellock' which is used to provide mutual
  exclusion when recording events to wait on as well as performing
  notification when an event occurs.

Interesting note:
  schedlock is required to manipulate the per-thread TDF_SELECT
  flag, however if given its own field it would not need schedlock,
  also because TDF_SELECT is only manipulated under sellock one
  doesn't actually use schedlock for syncronization, only to protect
  against corruption.

Proc locks are no longer used in select/poll.

Portions contributed by: davidc
2002-03-14 01:32:30 +00:00
Kazutaka YOKOTA
cd6cd68d18 Refine ACPI/PnP BIOS probe/attach routines a bit.
- Add workaround for the problematic PnP BIOS which does not assign
  irq resource for the PS/2 mouse device node; if there is no irq
  assigned for the PS/2 mouse node, refer to device.hints for an
  irq number. If we still don't find an irq number in the hints
  database, use a hard-coded value.
- Delete unused ivars.
- Bit of clean up in probe/attach.
- Add PnP ID for the PS/2 mouse port on some IBM ThinkPad models.
2001-09-15 04:38:20 +00:00
Julian Elischer
b40ce4165d KSE Milestone 2
Note ALL MODULES MUST BE RECOMPILED
make the kernel aware that there are smaller units of scheduling than the
process. (but only allow one thread per process at this time).
This is functionally equivalent to teh previousl -current except
that there is a thread associated with each process.

Sorry john! (your next MFC will be a doosie!)

Reviewed by: peter@freebsd.org, dillon@freebsd.org

X-MFC after:    ha ha ha ha
2001-09-12 08:38:13 +00:00
Kazutaka YOKOTA
ef92e4471a Update the atkbdc, atkbd, and psm drivers to probe/attach
more cleanly and consistently in all APCI, PnP BIOS, and "hint"
cases.

NOTE: this doesn't necessarily solve the problem that the PS/2
mouse is not detected after the recent ACPI update.
2001-09-06 12:09:26 +00:00
Kazutaka YOKOTA
9a1d7da7c1 Fix typo; the meaning of the 3rd parameter to genkbd_keyaction() is
'up' rather than 'down'.

PR: 22466
MFC after: 10 days
2001-07-20 14:49:54 +00:00
Kazutaka YOKOTA
764952572b Return consistent key action codes at key press and release
events. Otherwise you would see unexpected results if shift or
locking keys are defined to give different actions depending
on other shift/locking keys' state.

Please keep the ukbd module and the kernel in sync, otherwise
the USB keyboard won't work after this change.
MFC after:	10 days
2001-07-20 13:05:57 +00:00
Peter Wemm
f41325db5f With this commit, I hereby pronounce gensetdefs past its use-by date.
Replace the a.out emulation of 'struct linker_set' with something
a little more flexible.  <sys/linker_set.h> now provides macros for
accessing elements and completely hides the implementation.

The linker_set.h macros have been on the back burner in various
forms since 1998 and has ideas and code from Mike Smith (SET_FOREACH()),
John Polstra (ELF clue) and myself (cleaned up API and the conversion
of the rest of the kernel to use it).

The macros declare a strongly typed set.  They return elements with the
type that you declare the set with, rather than a generic void *.

For ELF, we use the magic ld symbols (__start_<setname> and
__stop_<setname>).  Thanks to Richard Henderson <rth@redhat.com> for the
trick about how to force ld to provide them for kld's.

For a.out, we use the old linker_set struct.

NOTE: the item lists are no longer null terminated.  This is why
the code impact is high in certain areas.

The runtime linker has a new method to find the linker set
boundaries depending on which backend format is in use.

linker sets are still module/kld unfriendly and should never be used
for anything that may be modular one day.

Reviewed by:	eivind
2001-06-13 10:58:39 +00:00
Poul-Henning Kamp
f83880518b Send the remains (such as I have located) of "block major numbers" to
the bit-bucket.
2001-03-26 12:41:29 +00:00
Andrey A. Chernov
86f7cedfda Update default keyboard (PREV, PASTE) 2001-03-12 00:00:22 +00:00
David Malone
d2db050252 Free the kbd pointer when it isn't NULL, as opposed to when it is.
This was a typo in the M_ZERO patches.

Submitted by:	Mike Silbersack <silby@silby.com>
2001-01-22 22:54:02 +00:00
David Malone
7cc0979fd6 Convert more malloc+bzero to malloc+M_ZERO.
Submitted by:	josh@zipperup.org
Submitted by:	Robert Drehmel <robd@gmx.net>
2000-12-08 21:51:06 +00:00
Poul-Henning Kamp
53ce36d17a Remove unneeded #include <sys/proc.h> lines. 2000-10-29 13:57:19 +00:00
Poul-Henning Kamp
db7e3af111 Remove unneeded #include <machine/clock.h> 2000-10-15 14:19:01 +00:00
Poul-Henning Kamp
00d25f512c Initiate deorbit burn sequence for <machine/console.h>.
Replace all in-tree uses with necessary subset of <sys/{fb,kb,cons}io.h>.
This is also the appropriate fix for exo-tree sources.

Put warnings in <machine/console.h> to discourage use.
November 15th 2000 the warnings will be converted to errors.
January 15th 2001 the <machine/console.h> files will be removed.
2000-10-08 21:34:00 +00:00
David Malone
1c06ce6197 Add the ability to define a "shutdown" and "shutdown and poweroff" key
to syscons. I have a man page to follow describing the format of the
kbdmap file.

PR:		19273
Reviewed by:	sheldonh
2000-09-11 20:37:42 +00:00
Doug Rabson
21c3015a24 * Completely rewrite the alpha busspace to hide the implementation from
the drivers.
* Remove legacy inx/outx support from chipset and replace with macros
  which call busspace.
* Rework pci config accesses to route through the pcib device instead of
  calling a MD function directly.

With these changes it is possible to cleanly support machines which have
more than one independantly numbered PCI busses. As a bonus, the new
busspace implementation should be measurably faster than the old one.
2000-08-28 21:48:13 +00:00
Andrey A. Chernov
2073104f87 Manipulate with AltGR Led (really CapsLock Led) only in K_XLATE mode, because
all other modes not set ALKED flag and it means that CapsLock always turned
off for them.
Real bug example is X11 which never turn on CapsLock with Russian keyboard.

PR:		18651
Submitted by:	"Mike E. Matsnev" <mike@po.cs.msu.su>
2000-05-28 12:43:24 +00:00
Jake Burkholder
e39756439c Back out the previous change to the queue(3) interface.
It was not discussed and should probably not happen.

Requested by:		msmith and others
2000-05-26 02:09:24 +00:00
Jake Burkholder
740a1973a6 Change the way that the queue(3) structures are declared; don't assume that
the type argument to *_HEAD and *_ENTRY is a struct.

Suggested by:	phk
Reviewed by:	phk
Approved by:	mdodd
2000-05-23 20:41:01 +00:00
Kazutaka YOKOTA
db3e34cb71 - Properly keep track of I/O port resources.
- Use bus_space_read/write() to access the ports.
2000-03-19 03:25:13 +00:00
Kazutaka YOKOTA
3346e881c1 - Add Support for the following PS/2 mice:
- Microsoft IntelliMouse Explorer: 2 buttons on top, 2 side buttons
    and a wheel which also acts as the middle button.  The mouse is
    recognized as "IntelliMouse Explorer".
  - Genius NetScroll Optical: 2 buttons on top, 2 side buttons and a
    wheel which also acts as the middle button.  The mouse is recognized
    as "NetMouse/NetScroll Optical".
  - MouseSystems SmartScroll Mouse (OEM from Genius?): 3 buttons on top,
    1 side button and a wheel.  The mouse is recognized as Genius
    "NetScroll".
  - IBM ScrollPoint: 2 buttons on top and a stick between the buttons.
    The stick can perform "horizontal scroll" in W*ndows environment.
    The horizontal movement of the stick is detected.  It is currently
    mapped to the Z axis movement in the same way as the first wheel.
    The mouse is recognized as "MouseMan+", as it is considered to be
    a variation of MouseMan.
  - A4 Tech 4D and 4D+ mice. These mice have two wheels! The movement
    of the second wheel is reported as the Z axis movement in the
    same way as the first wheel. These mice are recognized as "4D
    Mouse" and "4D+ Mouse".
  - Tweak IntelliMouse support code a bit so that less-than-compatible
    wheel mice can work properly with the psm driver.
- Add driver configuration flags which correspond to the kernel
  options PSM_HOOKRESUME and PSM_RESETAFTERSUSPEND, so that we don't
  need to recompile the kernel when we need these functions.
- Properly keep track of the irq resource.
- Add a watchdog timer in case interrupts are lost (experimental).
- Add `detach' function (experimental).
2000-03-18 15:21:40 +00:00
Yoshihiro Takahashi
49c57093b7 Changed key assign for PC-98.
shift+TAB  : BackTab
HELP       : End
STOP       : ScrollLock
shift+STOP : ScreenSaver
GRPH +STOP : Suspend(susp)
COPY       : NextScreen(nscr)
ctrl +COPY : Debug
NFER       : Meta

Submitted by:   chi@bd.mbn.or.jp (Chiharu Shibata)
2000-03-16 12:10:43 +00:00
Kazutaka YOKOTA
a68d00e3fe One more patch for the atkbd driver. It will make sure that the
keyboard port and interrupt is enabled and the driver is attached even
when the keyboard itself is not present when the system is booting.
(This has been the behavior through out 2.X and 3.X, but is somehow
broken in 4.0.)

# I certainly don't recommend people to `hot-plug' the AT keyboard,
# because the interface isn't designed for hot-plugging and such act
# will often break the keyboard controller.  But, so many people want to
# do that anyway...

Approved by: jkh
2000-03-11 07:44:10 +00:00
Kazutaka YOKOTA
aec1fa1ca3 - Be slightly more cautious and try to make more sure the keyboard
input queue is emptied when initializing the keyboard controller.
- Remove an unnecessary `if' statement.

Approved by: jkh
2000-02-11 01:22:30 +00:00
Peter Wemm
8f8e587948 Use config's conditional compilation rather than using #ifdefs that make
modular compilation harder.  I'm doing this because people seem to like
cut/pasting examples of bad practices in existing code.
2000-01-29 15:08:56 +00:00
Kazutaka YOKOTA
7c6f57a384 - Add some comment from bde on the keyboard interrupt.
- Fix obsolete comments.
2000-01-20 13:32:53 +00:00
Kazutaka YOKOTA
7642cc829e Rework shifta/ctla/alta key handling. It appears that there was
misunderstanding between the PR originator and me.  I hope I got it
right this time.
2000-01-11 13:39:05 +00:00
Kazutaka YOKOTA
56f5e27c4b Obtain the initial key repeat rate setting via BIOS in i386 if
possible.
2000-01-10 08:52:32 +00:00
Kazutaka YOKOTA
934d11e395 Add some keyboard IDs. 2000-01-10 08:50:43 +00:00
Yoshihiro Takahashi
b3ef0af491 - Fixed warnings.
- Removed unnecessary include files.
2000-01-04 04:46:50 +00:00
Peter Wemm
664a31e496 Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL"
is an application space macro and the applications are supposed to be free
to use it as they please (but cannot).  This is consistant with the other
BSD's who made this change quite some time ago.  More commits to come.
1999-12-29 04:46:21 +00:00
Kazutaka YOKOTA
7a4803c7f6 - Add a module event function to the ukbd driver and make the ukbd KLD
module work.
- Delete unnecessary #include.
1999-12-13 10:36:36 +00:00
Kazutaka YOKOTA
579958932a - Remember the keyboard repeat delay and rate.
- Add a new ioctl, KDGETREPEAT, to retrieve the keyboard repeat rate.
- Delete unnecessary #include.
1999-12-13 09:31:43 +00:00
Kazutaka YOKOTA
82d654e855 Add support new keys: lshifta, rshifta, lctrla, rctrla, lalta, and
ralta.  These keys combine shift/ctrl/alt function and the AltLock
function.  When these keys pressed together with another key, they act
just like the ordinary shift/ctrl/alt keys.  When these keys are
pressed and released alone, Alt lock state is toggled.

PR: kern/12475
1999-12-10 04:31:33 +00:00
Poul-Henning Kamp
d6a0e38a1b Remove five now unused fields from struct cdevsw. They should never
have been there in the first place.  A GENERIC kernel shrinks almost 1k.

Add a slightly different safetybelt under nostop for tty drivers.

Add some missing FreeBSD tags
1999-09-25 18:24:47 +00:00
Peter Wemm
c3aac50f28 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
Poul-Henning Kamp
9dcbe2404a Convert DEVFS hooks in (most) drivers to make_dev().
Diskslice/label code not yet handled.

Vinum, i4b, alpha, pc98 not dealt with (left to respective Maintainers)

Add the correct hook for devfs to kern_conf.c

The net result of this excercise is that a lot less files depends on DEVFS,
and devtoname() gets more sensible output in many cases.

A few drivers had minor additional cleanups performed relating to cdevsw
registration.

A few drivers don't register a cdevsw{} anymore, but only use make_dev().
1999-08-23 20:59:21 +00:00
Kazutaka YOKOTA
800da3b22a - Remove cdevsw entry points in individual keyboard drivers;
instead, use generic entry points for all drivers.
- Eliminate bogus makedev().
- Eliminate softc in the lower drivers, as it is no longer necessary.

Submitted (95%) by: phk
1999-08-22 09:52:33 +00:00
Kazutaka YOKOTA
6c6028fffb Correctly save `flags' bits. 1999-08-15 06:06:14 +00:00
Kazutaka YOKOTA
29e59d7deb - Move the `return' statement the correct place so that the keyboard
won't be initialized if `atkbd?' is disabled.
1999-07-18 06:16:25 +00:00
Poul-Henning Kamp
2447bec829 Simplify cdevsw registration.
The cdevsw_add() function now finds the major number(s) in the
struct cdevsw passed to it.  cdevsw_add_generic() is no longer
needed, cdevsw_add() does the same thing.

cdevsw_add() will print an message if the d_maj field looks bogus.

Remove nblkdev and nchrdev variables.  Most places they were used
bogusly.  Instead check a dev_t for validity by seeing if devsw()
or bdevsw() returns NULL.

Move bdevsw() and devsw() functions to kern/kern_conf.c

Bump __FreeBSD_version to 400006

This commit removes:
        72 bogus makedev() calls
        26 bogus SYSINIT functions

if_xe.c bogusly accessed cdevsw[], author/maintainer please fix.

I4b and vinum not changed.  Patches emailed to authors.  LINT
probably broken until they catch up.
1999-05-31 11:29:30 +00:00
Poul-Henning Kamp
4e2f199e0c This commit should be a extensive NO-OP:
Reformat and initialize correctly all "struct cdevsw".

        Initialize the d_maj and d_bmaj fields.

        The d_reset field was not removed, although it is never used.

I used a program to do most of this, so all the files now use the
same consistent format.  Please keep it that way.

Vinum and i4b not modified, patches emailed to respective authors.
1999-05-30 16:53:49 +00:00
Poul-Henning Kamp
7a1c7bc99f Don't bogusly define a d_reset_t function. 1999-05-30 14:55:24 +00:00
Kazutaka YOKOTA
d3c87b8512 - Include isa/isareg.h rather than i386/isa/isa.h for i386.
- Remove unused (thus, commented out) section of code.
1999-05-20 09:49:33 +00:00
Kazutaka YOKOTA
aee1b285f1 Include sys/isa/isareg.h rather than i386/isa/isa.h for i386. 1999-05-20 09:48:13 +00:00
Kazutaka YOKOTA
ec6948ccea Slight reorganization of internal interface in the keyboard controller
driver.
1999-05-18 11:33:14 +00:00