Commit Graph

17 Commits

Author SHA1 Message Date
John Baldwin
c46fd01853 adb: Remove unused devclass arguments to DRIVER_MODULE. 2022-05-10 10:21:38 -07:00
Mateusz Guzik
06261cf209 adb: clean up empty lines in .c and .h files 2020-09-01 21:34:24 +00:00
Pawel Biernacki
7029da5c36 Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)
r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are
still not MPSAFE (or already are but aren’t properly marked).
Use it in preparation for a general review of all nodes.

This is non-functional change that adds annotations to SYSCTL_NODE and
SYSCTL_PROC nodes using one of the soon-to-be-required flags.

Mark all obvious cases as MPSAFE.  All entries that haven't been marked
as MPSAFE before are by default marked as NEEDGIANT

Approved by:	kib (mentor, blanket)
Commented by:	kib, gallatin, melifaro
Differential Revision:	https://reviews.freebsd.org/D23718
2020-02-26 14:26:36 +00:00
Conrad Meyer
e2e050c8ef Extract eventfilter declarations to sys/_eventfilter.h
This allows replacing "sys/eventfilter.h" includes with "sys/_eventfilter.h"
in other header files (e.g., sys/{bus,conf,cpu}.h) and reduces header
pollution substantially.

EVENTHANDLER_DECLARE and EVENTHANDLER_LIST_DECLAREs were moved out of .c
files into appropriate headers (e.g., sys/proc.h, powernv/opal.h).

As a side effect of reduced header pollution, many .c files and headers no
longer contain needed definitions.  The remainder of the patch addresses
adding appropriate includes to fix those files.

LOCK_DEBUG and LOCK_FILE_LINE_ARG are moved to sys/_lock.h, as required by
sys/mutex.h since r326106 (but silently protected by header pollution prior
to this change).

No functional change (intended).  Of course, any out of tree modules that
relied on header pollution for sys/eventhandler.h, sys/lock.h, or
sys/mutex.h inclusion need to be fixed.  __FreeBSD_version has been bumped.
2019-05-20 00:38:23 +00:00
Pedro F. Giffuni
718cf2ccb9 sys/dev: further adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.
2017-11-27 14:52:40 +00:00
Justin Hibbits
605e7281dc Force the setting of bit 7 in the sysmouse packet byte 1 to be unsigned.
Clang complains about the shift of (1 << 7) into a int8_t changing the value:

warning: implicit conversion from 'int' to 'int8_t' (aka 'signed char') changes
value from 128 to -128 [-Wconstant-conversion]

Squash this warning by forcing clang to see it as an unsigned bit.

This seems odd, given that it's still a conversion of 128->-128, but I'm
guessing the explicit unsigned attribute notifies clang that sign really doesn't
matter in this case.

Reported by:	Mark Millard <markmi AT dsl-only DOT net>
MFC after:	2 weeks
2017-01-30 02:32:33 +00:00
Pedro F. Giffuni
d9c9c81c08 sys: use our roundup2/rounddown2() macros when param.h is available.
rounddown2 tends to produce longer lines than the original code
and when the code has a high indentation level it was not really
advantageous to do the replacement.

This tries to strike a balance between readability using the macros
and flexibility of having the expressions, so not everything is
converted.
2016-04-21 19:57:40 +00:00
Justin Hibbits
c821b4820f Properly sort the arguments to mtx_init(9).
PR:		misc/186020
Submitted by:	alfred
MFC after:	1 week
2014-01-23 01:09:33 +00:00
Justin Hibbits
791ab37d80 Fix powerpc/161045. ams_poll() needs to return that any data is available, not
just a new packet.

PR:		powerpc/161045
Approved by:	re(marius)
MFC after:	1 week
2013-09-28 02:13:59 +00:00
Kevin Lo
07ab70a447 Use uiomove return value instead of returning 0. 2012-11-13 06:03:43 +00:00
Nathan Whitehorn
f697a802bb Add support for interpreting taps on ADB touchpads as a button click.
Submitted by:	Andreas Tobler <andreast-list at fgznet dot ch>
MFC after:	2 weeks
2009-11-28 17:48:25 +00:00
John Baldwin
be57da218c Use si_drv1 to hold the softc for the adb_mouse character device instead of
using devclass_get_softc().

Tested by:	nwhitehorn
2009-01-29 16:18:49 +00:00
Ed Schouten
218653a7fc Make adb_mouse use dev2unit() instead of minor().
A real fix would be to migrate it to si_drv0 to store the softc
directly, but this is the quickest way to fix it right now.
2009-01-29 05:59:42 +00:00
Nathan Whitehorn
582434bd08 Fix some nasty race conditions in the VIA-CUDA driver that ended up preventing
my right mouse button and keyboard LEDs from working due to mangled
configuration packets. Fixed several other races and associated problems in the
main ADB stack that were exposed while fixing this.
2008-12-06 23:26:02 +00:00
Ed Schouten
3c5f535bbf Make the touch pad on my PowerBook G4 12" a little more usable.
For an unknown reason the touch pad of my PowerBook generates button 5
events when you operate it. This causes the adb_mouse code to convert
them to button 2 events, which is not what we want.

Add a new flag, AMS_TOUCHPAD, which is used to distinguish the touch
pad. When set, don't convert button events of unknown buttons to the
last button.

There are still three problems left with respect to user input:

- The mouse button events are not properly processed when the touch pad
  isn't touched.

- The arrow keys on the keyboard don't work inside X11.

- The power button isn't handled by the kernel, similar to the ACPI
  power button on i386/amd64.

Approved by:	nwhitehorn
2008-11-02 19:08:10 +00:00
Ed Schouten
b75d197096 Allow a read() on /dev/ams[0-9] to be interrupted.
Right now ams_read() uses cv_wait() to wait for new data to arrive on
the mouse device. This means that when you run `cat /dev/ams0', it
cannot be interrupted directly. After you press ^C, you first need to
move the mouse before cat will quit. Make this function use
cv_wait_sig(), which allows it to be interrupted directly.

Reviewed by:	nwhitehorn
2008-11-01 08:07:02 +00:00
Nathan Whitehorn
b4dbc59983 Add ADB support. This provides support for the external ADB bus on the PowerMac
G3 as well as the internal ADB keyboard and mice in PowerBooks and iBooks. This
also brings in Mac GPIO support, for which we should eventually have a better
interface.

Obtained from:  NetBSD (CUDA and PMU drivers)
2008-10-26 19:37:38 +00:00