Philip Homburg [Wed, 19 Jul 2006 11:50:18 +0000 (11:50 +0000)]
Switch to vc 0 and softscrolling when /dev/video is opened and switch back
at the close. This should prevent problems with X on (emulated) Cirrus
cards.
Ben Gras [Thu, 13 Jul 2006 14:50:23 +0000 (14:50 +0000)]
. DS understands publishing and subscribing where keys are in string
form. Subscriptions are regular expressions.
. different types are stored per key; currently u32 and/or string.
the same key can be referenced (publish, subscribe, check) as any type.
. notify()s are sent when subscriptions are triggered (publishing or
updating of matching keys); optionally, a subscribe flag sends
updates for all matching keys at subscription time, instead of only
after updates after subscribing
. all interfacing to ds is in /usr/src/lib/syslib/ds.c.
. subscribe is ds_subscribe
publish functions are ds_publish_<type>
retrieve functions are ds_retrieve_<type> (one-time retrieval of a value)
check functions are ds_check_<type> (check for updated key caller
subscribes to not yet checked for, or ESRCH for none)
. ramdisk driver updated with new ds interface
Philip Homburg [Thu, 13 Jul 2006 13:19:48 +0000 (13:19 +0000)]
More stack for tcpd.
Safecopies renders the NWIOQUERYPARAM ioctl useless. This functionality
is now replaced with /dev/ipstat. Write the request to the device and
read the answer in one read request.
Philip Homburg [Mon, 10 Jul 2006 12:13:29 +0000 (12:13 +0000)]
Added SI_CALL_STATS and ENABLE_SYSCALL_STATS for system call statistics.
Added BUSC_PCI_DEV_NAME_S and BUSC_PCI_SLOT_NAME_S to support safecopies in PCI.
Added DL_WRITEV_S, DL_READV_S, DL_GETSTAT_S, DL_GRANT, and iovec_s_t to support
safecopies in ethernet drviers. Renamed DL_INIT to DL_CONF, and DL_INIT_REPLY
to DL_CONF_REPLY.
Added SYS_READBIOS and sys_readbios to read from BIOS data areas.
Added GET_KMESS_S for safecopy support in LOG.
Added sys_safe_insb and sys_safe_outsb.
Ben Gras [Fri, 30 Jun 2006 14:35:38 +0000 (14:35 +0000)]
Split do_brk in a stub and a function that does the real work, so that
the real work can be called from elsewhere too. Specifically, to allow PM
its own brk().
Ben Gras [Tue, 27 Jun 2006 16:47:35 +0000 (16:47 +0000)]
. satisfy some gcc warnings (uninitialized/unused variables)
. change cloexec mask from long to fd_set to remove 32 fd's per
process restriction (from cloexec at least)
Ben Gras [Mon, 26 Jun 2006 16:08:42 +0000 (16:08 +0000)]
. expanded grant manipulation interface to more direct
manipulation
. made fs allocate a grant for every ioctl, even if no data
is being copied, in order to disambiguate concurrent ioctls
on the same minor
Ben Gras [Fri, 23 Jun 2006 11:51:56 +0000 (11:51 +0000)]
. leave out dead code from device.c
. don't loop doing a receive() after sendrec() - chance of recovering is not
high, and can lead to receive()ing a notify() (which can't happen in sendrec()),
which is terrible
. return status from device when DEV_CANCEL is done on a signal; hardcode EAGAIN to
become EINTR though
Ben Gras [Tue, 20 Jun 2006 10:12:09 +0000 (10:12 +0000)]
FS support for grant-based i/o.
For character device i/o, FS does a so-called 'magic' grant to let the
driver copy from or to user space. As this is done in FS address space,
the driver is told to do this in FS address space. The redirection to
the right user process then happens at copy-time in the kernel, using the
FS grant table. This also happens for DEV_READ and DEV_WRITE on block
devices.
For other block device i/o, which happens from/to FS buffers, FS does
a 'direct' grant to its own address space for the driver.
After the i/o returns, this access has to be K-I-L-L-E-D, revoked.
Sometimes this is after a SUSPEND and DEV_REVIVE, in which case the
revoking happens in pipe.c.
This conversion happens in safe_io_conversion() in device.c, called
by dev_io and dev_bio.
FS has to pre-allocate its own space for these grant tables. This happens
in main.c.
Ben Gras [Tue, 20 Jun 2006 10:03:10 +0000 (10:03 +0000)]
Changed do_devio not to require DIO_TYPE, but to extract type
from DIO_REQUEST. Also do_vdevio. Also do_sdevio, but this
function also supports grant id's and offsets.
do_segctl: rename protected to prot.
do_umap: support for GRANT_SEG umap.
do_privctl: support SYS_PRIV_SET_GRANTS, which sets location and size
of in-own-address-space grant table.
do_safecopy: functions to verify and perform 'safe' (grant-based) copies.
Ben Gras [Tue, 20 Jun 2006 09:56:06 +0000 (09:56 +0000)]
Change allowed kernel call bitmap to an array of bitmaps to allow
any number of kernel calls.
Allowed kernel calls are stored in table.c for every image process as a
variably-sized array of allowed calls. This is used to fill the bitmap
of size determined at compile time by the number of kernel calls. This
filling is done by main.c. There is a special call called SYS_ALL_CALLS
which fills the bitmap of allowed calls completely, if that is the only
entry in the array.
Ben Gras [Tue, 20 Jun 2006 09:02:54 +0000 (09:02 +0000)]
. Safe I/O, ioctl() and DIAGNOSTICS variants conversion - safe copies,
include grant id in DEV_REVIVE messages.
. Removal of TTY_FLAGS field (and so O_NONBLOCK support).
. Fixed CANCEL behaviour and return code on blocking I/O,
previously handled by O_NONBLOCK
. Totally removed REVIVE replies, previously still possible on
blocking ioctls (REVIVE directly called) and ptys (missing TTY_REVIVE
check), removes deadlock bug with FS
. Removed obsolete *COMPAT options and associated code
Ben Gras [Tue, 20 Jun 2006 08:49:51 +0000 (08:49 +0000)]
. made libdriver understand *_S variants
. ioctl, transfer and 'other' functions get an extra parameter: 'safe', int
is nonzero if function is called with *_S variant ('other' if ioctl)
Ben Gras [Tue, 20 Jun 2006 08:45:04 +0000 (08:45 +0000)]
. removed const from putenv() for g++
. added safecopies.c:
these are library functions to maintain grant tables in own address space
. sys_safecopy.c:
interfaces to kernel calls to perform safe copy functions in from or to
foreign process
. changes in i/o fields (type merged with request) reflected in
library functions (sys_out.c, sys_vinb.c, sys_vinl.c, sys_vinw.c,
sys_voutb.c, sys_voutl.c, sys_voutw.c)
. type merged with request in sys_sdevio, also now accepts offset which
is used when a grant is specified (the _DIO_SAFE subtype)
. system printf() function changed to send DIAGNOSTICS_S messages, which
specify a grant id instead of a direct address for the buffer to be
printed; tty and log can then safecopy the buffer
Ben Gras [Tue, 20 Jun 2006 08:40:26 +0000 (08:40 +0000)]
. renamed __str to __makestr to allow for g++
. changed some CMOS ioctl codes to have correct sizes (struct tm instead
of u32_t), a disk ioctl code from W to RW, and memory ioctl codes from R
to W, needed for proper matching of grant in FS