Home | History | Annotate | Download | only in dev
History log of /src/sys/arch/sparc/dev/tctrl.c
RevisionDateAuthorComments
 1.65  26-Sep-2021  thorpej Driver "kqfilter" entry points return an error code, so if an invalid
filter is requested, return EINVAL rather than 1.
 1.64  26-Sep-2021  thorpej Change the kqueue filterops::f_isfd field to filterops::f_flags, and
define a flag FILTEROP_ISFD that has the meaning of the prior f_isfd.
Field and flag name aligned with OpenBSD.

This does not constitute a functional or ABI change, as the field location
and size, and the value placed in that field, are the same as the previous
code, but we're bumping __NetBSD_Version__ so 3rd-party module source code
can adapt, as needed.

NetBSD 9.99.89
 1.63  04-Jan-2021  thorpej Use sel{record,remove}_knote().
 1.62  13-Jun-2020  jdc branches: 1.62.2;
Initialise the mutex before we use it.
 1.61  25-Oct-2017  maya Use C99 initializer for filterops

Mostly done with spatch with touchups for indentation

@@
expression a;
identifier b,c,d;
identifier p;
@@
const struct filterops p =
- { a, b, c, d
+ {
+ .f_isfd = a,
+ .f_attach = b,
+ .f_detach = c,
+ .f_event = d,
};
 1.60  11-Dec-2016  christos catch up with sd changes.
 1.59  25-Jul-2014  dholland branches: 1.59.4; 1.59.8;
Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.
 1.58  16-Mar-2014  dholland branches: 1.58.2;
Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
 1.57  19-Oct-2013  mrg - remove unused but set variables.
- use __USE() where necessary.
- remove useless 'volatile' markers

kd.c:consinit() might be wrong for old proms, but i've not
changed it really.
 1.56  27-Oct-2012  chs branches: 1.56.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.55  25-Mar-2012  martin branches: 1.55.2;
Make explicitly clear that we mean raw I/O on device passthru, not just
generic passthru.
 1.54  13-Mar-2012  elad Replace the remaining KAUTH_GENERIC_ISSUSER authorization calls with
something meaningful. All relevant documentation has been updated or
written.

Most of these changes were brought up in the following messages:

http://mail-index.netbsd.org/tech-kern/2012/01/18/msg012490.html
http://mail-index.netbsd.org/tech-kern/2012/01/19/msg012502.html
http://mail-index.netbsd.org/tech-kern/2012/02/17/msg012728.html

Thanks to christos, manu, njoly, and jmmv for input.

Huge thanks to pgoyette for spinning these changes through some build
cycles and ATF.
 1.53  18-Jul-2011  mrg branches: 1.53.2; 1.53.6;
convert the remaining sparc drivers to CFATTACH_DECL_NEW/cfdata_t/device_t.
(cgsix_obio.c was only partially converted with the rest of the cgsix code
when it was changed some time ago.)
 1.52  01-Jul-2011  dyoung #include <sys/bus.h> instead of <machine/bus.h>.
 1.51  20-Jun-2011  pgoyette Initialize sensor states before registering
 1.50  21-Nov-2009  rmind branches: 1.50.10;
Use lwp_getpcb() on sparc{64} and sun2/3 MD code, clean from struct user usage.
 1.49  17-Jul-2008  cegger make this compile
 1.48  11-Jun-2008  drochner branches: 1.48.2;
mechanical changes to use device_private() or device_lookup_private()
to get softcs, makes the code compile under the stricter type checking
introduced earlier today
 1.47  28-Apr-2008  martin branches: 1.47.2; 1.47.4;
Remove clause 3 and 4 from TNF licenses
 1.46  01-Mar-2008  rmind branches: 1.46.2; 1.46.4;
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>
 1.45  12-Feb-2008  joerg branches: 1.45.2; 1.45.6;
Introduce device_find_by_xname and device_find_by_driver_unit to replace
alldevs iterations all over src.

Patch discussed with and improved on suggestioned from cube@.
 1.44  16-Nov-2007  xtraeme Extend the envsys2 API (one more time, sorry) as defined in:

http://mail-index.netbsd.org/tech-kern/2007/11/09/0001.html

sysmon_envsys_create() and sysmon_envsys_destroy() were added to
create/destroy sysmon_envsys objects (and its TAILQ/LIST for sensors/events).

sysmon_envsys_sensor_attach() and sysmon_envsys_sensor_detach() were
added to attach/detach sensors to a specified sysmon_envsys device.

The events framework is now per device and configurable via the
ENVSYS_SETDICTIONARY ioctl or /etc/envsys.conf and envstat(8).

Update all users and documentation to reflect these changes.
 1.43  17-Oct-2007  garbled branches: 1.43.2;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.42  09-Jul-2007  ad branches: 1.42.8; 1.42.10; 1.42.14;
Merge some of the less invasive changes from the vmlocking branch:

- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
 1.41  04-Jul-2007  xtraeme s/cur_tre/edata/ => should fix the build error reported by rjs@.
 1.40  01-Jul-2007  xtraeme Use PSWITCH_EVENT_{PRESSED,RELEASED} for consistency with other drivers
using the sysmon_power framework.
 1.39  01-Jul-2007  xtraeme Imported envsys 2, a brief description of the new features:
(Part 2: drivers)

* Support for detachable sensors.
* Cleaned up the API for simplicity and efficiency.
* Ability to send capacity/critical/warning events to powerd(8).
* Adapted all the code to the new locking order.
* Compatibility with the old envsys API: the ENVSYS_GTREINFO
and ENVSYS_GTREDATA ioctl(2)s are supported.
* Added support for a 'dictionary based communication channel' between
sysmon_power(9) and powerd(8), that means there is no 32 bytes event
size restriction anymore.
* Binary compatibility with old envstat(8) and powerd(8) via COMPAT_40.
* All drivers with the n^2 gtredata bug were fixed, PR kern/36226.

Tested by:

blymn: smsc(4).
bouyer: ipmi(4), mfi(4).
kefren: ug(4).
njoly: viaenv(4), adt7463.c.
riz: owtemp(4).
xtraeme: acpiacad(4), acpibat(4), acpitz(4), aiboost(4), it(4), lm(4).
 1.38  11-Apr-2007  macallan branches: 1.38.4;
clean up tadpole_request() API
from mrg
 1.37  04-Mar-2007  christos branches: 1.37.2; 1.37.4;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.36  04-Jan-2007  elad branches: 1.36.2;
Consistent usage of KAUTH_GENERIC_ISSUSER.
 1.35  23-Jul-2006  ad branches: 1.35.4;
Use the LWP cached credentials where sane.
 1.34  14-May-2006  elad integrate kauth.
 1.33  20-Apr-2006  blymn Prefix iostat structure elements with io_
 1.32  14-Apr-2006  blymn Make i/o statistics collection more generic, include tape drives and
nfs mounts in the set of devices that statistics will be reported on.
 1.31  08-Mar-2006  macallan branches: 1.31.2;
report lid and AC power state to sysmon
 1.30  06-Mar-2006  macallan branches: 1.30.2;
- use a lock to serialize tadpole_request()
- add a callback to signal monitor detection on the external VGA port
- don't call tadpole-request() in interrupt context
- use a kernel thread for various not time-critical work like device
monitoring, LCD status updates, external event handling and so on
(the monitoring stuff is preliminary and to be replaced by a more generic API)
 1.29  11-Dec-2005  christos branches: 1.29.4; 1.29.6; 1.29.8;
merge ktrace-lwp.
 1.28  16-Nov-2005  uwe ANSIify function declarations/defintions. Use uint<N>_t.
Drop trailing whitespace.
Same binary code is produced for GENERIC.MP + KGDB + DDB.
 1.27  06-Jul-2005  macallan branches: 1.27.6;
changed envsys support to use the sysmon API, added support for the power
button ( see powerd(8) )
 1.26  13-Feb-2004  wiz branches: 1.26.16;
Uppercase CPU, plural is CPUs.
 1.25  15-Jul-2003  lukem __KERNEL_RCSID()
 1.24  29-Jun-2003  fvdl branches: 1.24.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.23  29-Jun-2003  darrenr More changes for providing lwpid for ktrace (sparc GENERIC built)
 1.22  10-Dec-2002  pk Remove the `flags' argument from bus_intr_establish().
 1.21  26-Nov-2002  christos si_ -> sel_
 1.20  23-Oct-2002  jdolecek merge kqueue branch into -current

kqueue provides a stateful and efficient event notification framework
currently supported events include socket, file, directory, fifo,
pipe, tty and device changes, and monitoring of processes and signals

kqueue is supported by all writable filesystems in NetBSD tree
(with exception of Coda) and all device drivers supporting poll(2)

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.19  14-Oct-2002  takemura Moved MI APM definitions into dev/apm.
 1.18  02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.17  01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.16  27-Sep-2002  thorpej Declare all cfattach structures const.
 1.15  06-Sep-2002  gehenna Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
by using this grammer.

- Added the new naming convention.
The name of the device switch must be <prefix>_[bc]devsw for auto-generation
of device switch tables.

- The backward compatibility of loading block/character device
switch by LKM framework is broken. This is necessary to convert
from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.14  11-Mar-2002  pk branches: 1.14.4;
* `bus_type_t' is gone.
* Use BUS_ADDR() where appropriate to encode I/O space and physical
address offset into a `bus_addr_t' value.
* Drop obio_bus_map() since it's now completely equivalent to bus_space_map()
* Use bus_space_map2() to map device space at a fixed virtual address.
* Remove the virtual address argument from sbus_sbus_addr()
 1.13  20-Aug-2001  wiz branches: 1.13.2; 1.13.6;
"wierd" is weird.
 1.12  25-Jul-2000  toddpw branches: 1.12.4;
Ignore all undefined bits in the Tadpole microcontroller status register.
Only the low nibble is defined, and on at least one 3gx (mine) there is an
undefined bit which reads as a one -- bit 6 (0x40). This screwed tctrl_intr()
which would loop forever, thinking it always had new events to process.
 1.11  09-Jul-2000  pk Add a `device class' interrupt level argument (from machine/intr.h)
to bus_interrupt_establish().

It's currently only used in sparc64/dev/psycho.c to assign a CPU interrupt
level to devices in PCI slots.
 1.10  04-Jun-2000  cgd branches: 1.10.2;
Implement the more flexiable `evcnt' interface as discussed (briefly) on
tech-kern and now documented in evcnt(9).
 1.9  04-Apr-2000  thorpej branches: 1.9.2;
Fix fallout from callout.
 1.8  23-Mar-2000  thorpej New callout mechanism with two major improvements over the old
timeout()/untimeout() API:
- Clients supply callout handle storage, thus eliminating problems of
resource allocation.
- Insertion and removal of callouts is constant time, important as
this facility is used quite a lot in the kernel.

The old timeout()/untimeout() API has been removed from the kernel.
 1.7  14-Mar-2000  jdc Add port power management ioctls.
 1.6  09-Mar-2000  garbled New features:
tctrl now initializes the state of the internal LCD icons. The icons
are unprogrammed at boot time. This incidentally makes the DC-POWER icon
work.

Fixes:
Fix my stupidity in the ENVSYS stuff, and actually follow the API.
 1.5  17-Dec-1999  garbled avoid uninterruptable sleep on a CMD_REQ ioctl.
 1.4  15-Dec-1999  garbled add <machine/tctrl.h> where needed.
Add some undocumented commands to the ts102 registers file, and fix a few
typos.

Modifications to tctrl.c:

Add entrypoints to driver for open/close/ioctl/poll.
Make device work with apmd. (still no support for suspend/sleep)
Make device work with ENVSYS API.
Slightly restructure handling of events.
Add function to make microcontroller requests.
 1.3  21-Nov-1999  pk Check presence of Sbus interrupt properties before using them.
 1.2  11-Aug-1999  matt branches: 1.2.2; 1.2.8;
This now works properly and uses interrupts. If you close the lid, the
screen will turn off and when you open the lid screen turns on. If you
do too rapidly, the driver won't be notified but you can press the micro
switch and it will come back. Also "halt -p" now works so you don't
have to do Pause-P to powerdown.
 1.1  09-Aug-1999  matt Add a driver for the Tadpole SPARCbook microcontroller. It doesn't
do much yet (except for power down support). As sson as I figure
out to get its interrupts enabled, it will be much more functional.
(e.g., print console messages on low power warnings, be able to turn
off the TFT, etc.).
 1.2.8.1  27-Dec-1999  wrstuden Pull up to last week's -current.
 1.2.2.1  20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.9.2.1  22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.10.2.2  26-Jul-2000  toddpw Pull up tctrl.c 1.12, and ts102reg.h 1.6 (both requested by toddpw):
Prevent kernel freeze during boot on some Sparcbook 3gx's (namely, mine).
Sparc "tctrl0" device was sensitive to undefined bits in the hardware.
 1.10.2.1  19-Jul-2000  mrg pull up sparc/sparc64 bus_intr_establish() changes, necessary for sparc64
(originally done by pk, approved by thorpej):

>Add a `device class' interrupt level argument (from machine/intr.h)
>to bus_interrupt_establish().
>
>It's currently only used in sparc64/dev/psycho.c to assign a CPU interrupt
>level to devices in PCI slots.
 1.12.4.6  10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.12.4.5  02-Oct-2002  jdolecek do not need the (void *) cast for kn_hook anymore
 1.12.4.4  18-Jun-2002  jdolecek make compile
 1.12.4.3  16-Mar-2002  jdolecek Catch up with -current.
 1.12.4.2  09-Sep-2001  thorpej Add kqueue support (not yet compiled).
 1.12.4.1  25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.13.6.6  11-Dec-2002  thorpej Sync with HEAD.
 1.13.6.5  11-Nov-2002  nathanw Catch up to -current
 1.13.6.4  18-Oct-2002  nathanw Catch up to -current.
 1.13.6.3  17-Sep-2002  nathanw Catch up to -current.
 1.13.6.2  01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.13.6.1  20-Aug-2001  nathanw file tctrl.c was added on branch nathanw_sa on 2002-04-01 07:42:43 +0000
 1.13.2.1  10-Oct-2001  fvdl Convert all remaining devices.
 1.14.4.1  17-May-2002  gehenna Add device switch.
 1.24.2.6  11-Dec-2005  christos Sync with head.
 1.24.2.5  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.24.2.4  04-Feb-2005  skrll Adapt to branch.
 1.24.2.3  21-Sep-2004  skrll Fix the sync with head I botched.
 1.24.2.2  18-Sep-2004  skrll Sync with HEAD.
 1.24.2.1  03-Aug-2004  skrll Sync with HEAD
 1.26.16.7  17-Mar-2008  yamt sync with head.
 1.26.16.6  27-Feb-2008  yamt sync with head.
 1.26.16.5  07-Dec-2007  yamt sync with head
 1.26.16.4  03-Sep-2007  yamt sync with head.
 1.26.16.3  26-Feb-2007  yamt sync with head.
 1.26.16.2  30-Dec-2006  yamt sync with head.
 1.26.16.1  21-Jun-2006  yamt sync with head.
 1.27.6.1  22-Nov-2005  yamt sync with head.
 1.29.8.3  11-Aug-2006  yamt sync with head
 1.29.8.2  24-May-2006  yamt sync with head.
 1.29.8.1  13-Mar-2006  yamt sync with head.
 1.29.6.2  01-Jun-2006  kardel Sync with head.
 1.29.6.1  22-Apr-2006  simonb Sync with head.
 1.29.4.1  09-Sep-2006  rpaulo sync with head
 1.30.2.5  13-May-2006  elad sprinkle some #include <sys/kauth.h> in files that use kauth kpi but
don't include it yet. hopefully this will prevent some fallout.
 1.30.2.4  11-May-2006  elad sync with head
 1.30.2.3  19-Apr-2006  elad sync with head - hopefully this will work
 1.30.2.2  10-Mar-2006  elad generic_authorize() -> kauth_authorize_generic().
 1.30.2.1  08-Mar-2006  elad Adapt to kernel authorization KPI.

I expect *some* lossage here...
 1.31.2.1  24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.35.4.1  12-Jan-2007  ad Sync with head.
 1.36.2.2  15-Apr-2007  yamt sync with head.
 1.36.2.1  12-Mar-2007  rmind Sync with HEAD.
 1.37.4.1  11-Jul-2007  mjf Sync with head.
 1.37.2.3  03-Dec-2007  ad Sync with HEAD.
 1.37.2.2  15-Jul-2007  ad Sync with head.
 1.37.2.1  27-May-2007  ad Sync with head.
 1.38.4.1  03-Oct-2007  garbled Sync with HEAD
 1.42.14.1  18-Nov-2007  bouyer Sync with HEAD
 1.42.10.3  23-Mar-2008  matt sync with HEAD
 1.42.10.2  09-Jan-2008  matt sync with HEAD
 1.42.10.1  06-Nov-2007  matt sync with HEAD
 1.42.8.1  21-Nov-2007  joerg Sync with HEAD.
 1.43.2.2  18-Feb-2008  mjf Sync with HEAD.
 1.43.2.1  19-Nov-2007  mjf Sync with HEAD.
 1.45.6.4  28-Sep-2008  mjf Sync with HEAD.
 1.45.6.3  29-Jun-2008  mjf Sync with HEAD.
 1.45.6.2  02-Jun-2008  mjf Sync with HEAD.
 1.45.6.1  03-Apr-2008  mjf Sync with HEAD.
 1.45.2.1  24-Mar-2008  keiichi sync with head.
 1.46.4.3  11-Mar-2010  yamt sync with head
 1.46.4.2  04-May-2009  yamt sync with head.
 1.46.4.1  16-May-2008  yamt sync with head.
 1.46.2.2  17-Jun-2008  yamt sync with head.
 1.46.2.1  18-May-2008  yamt sync with head.
 1.47.4.2  18-Jul-2008  simonb Sync with head.
 1.47.4.1  18-Jun-2008  simonb Sync with head.
 1.47.2.2  18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.47.2.1  23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.48.2.1  19-Oct-2008  haad Sync with HEAD.
 1.50.10.1  23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.53.6.1  05-Apr-2012  mrg sync to latest -current.
 1.53.2.3  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.53.2.2  30-Oct-2012  yamt sync with head
 1.53.2.1  17-Apr-2012  yamt sync with head
 1.55.2.3  03-Dec-2017  jdolecek update from HEAD
 1.55.2.2  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.55.2.1  20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.56.2.1  18-May-2014  rmind sync with head
 1.58.2.1  10-Aug-2014  tls Rebase.
 1.59.8.1  07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.59.4.1  05-Feb-2017  skrll Sync with HEAD
 1.62.2.1  03-Apr-2021  thorpej Sync with HEAD.

RSS XML Feed