Home | History | Annotate | Download | only in common
History log of /src/sys/compat/linux/common/linux_ioctl.c
RevisionDateAuthorComments
 1.60  01-Oct-2024  riastradh sys/compat/linux/common: Nix trailing whitespace, and one blank line.

No functional change intended.
 1.59  19-Sep-2021  thorpej Add the timerfd syscalls to COMPAT_LINUX and COMPAT_LINUX32.
 1.58  23-Mar-2014  dholland branches: 1.58.10; 1.58.20; 1.58.42;
typos in comments
 1.57  19-Sep-2012  bouyer branches: 1.57.2;
Add a pass-through ioctl for mfi(4), allowing userland to send raw commands
to the controller. This is compatible with the linux and FreeBSD
implementations.
Add the needed conversion for mfi ioctls in COMPAT_LINUX
Allocate a character major number, and create /dev/mfi0 by default
on amd64 and i386.
This allows (along with a hand-created /emul/linux/proc/devices file)
to run the MegaCLI linux binary provided by LSI.
 1.56  14-Oct-2011  hannken branches: 1.56.2; 1.56.8; 1.56.12;
Change the vnode locking protocol of VOP_GETATTR() to request at least
a shared lock. Make all calls outside of file systems respect it.

The calls from file systems need review.

No objections from tech-kern.
 1.55  19-Jul-2008  jmcneill ioctl compatibility for v4l2 and drm
 1.54  28-Apr-2008  martin branches: 1.54.2; 1.54.4; 1.54.6;
Remove clause 3 and 4 from TNF licenses
 1.53  21-Mar-2008  ad branches: 1.53.2; 1.53.4;
Catch up with descriptor handling changes. See kern_descrip.c revision
1.173 for details.
 1.52  20-Dec-2007  dsl branches: 1.52.6;
Convert all the system call entry points from:
int foo(struct lwp *l, void *v, register_t *retval)
to:
int foo(struct lwp *l, const struct foo_args *uap, register_t *retval)
Fixup compat code to not write into 'uap' and (in some cases) to actually
pass a correctly formatted 'uap' structure with the right name to the
next routine.
A few 'compat' routines that just call standard ones have been deleted.
All the 'compat' code compiles (along with the kernels required to test
build it).
98% done by automated scripts.
 1.51  08-Dec-2007  dsl branches: 1.51.4;
ANSIfy most of the function definitions in sys/compat (but not ndis).
All by the magic of sed ...
 1.50  26-Nov-2007  pooka branches: 1.50.2;
Remove the "struct lwp *" argument from all VFS and VOP interfaces.
The general trend is to remove it from all kernel interfaces and
this is a start. In case the calling lwp is desired, curlwp should
be used.

quick consensus on tech-kern
 1.49  19-Oct-2007  njoly branches: 1.49.2;
Add compat_linux and exec_linux_elf lkm support for amd64:
- Add needed COMPAT_OSSAUDIO to GENERIC.
- Add missing includes needed by linux_syscallargs.h.
- Add lkm building.
 1.48  16-Jun-2007  dsl branches: 1.48.6; 1.48.8; 1.48.12;
Delete stuff in comment about use of stackgap.
 1.47  04-Mar-2007  christos branches: 1.47.2; 1.47.4;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.46  09-Feb-2007  ad branches: 1.46.2;
Merge newlock2 to head.
 1.45  23-Jul-2006  ad branches: 1.45.4;
Use the LWP cached credentials where sane.
 1.44  14-May-2006  elad integrate kauth.
 1.43  11-Dec-2005  christos branches: 1.43.4; 1.43.6; 1.43.8; 1.43.10; 1.43.12;
merge ktrace-lwp.
 1.42  28-Feb-2005  soren branches: 1.42.4;
Emulate basic mtio ioctls.
 1.41  26-Feb-2005  perry nuke trailing whitespace
 1.40  03-Feb-2005  christos Add linux scsi-generic to work for simple cases. Allows gendalia's change
to limp along. From soren with fixes from me.
 1.39  03-Jun-2004  yamt branches: 1.39.4; 1.39.6;
linux_sys_ioctl: map EPASSTHROUGH to EINVAL as sys_ioctl does.
otherwise, linux_syscall() returns garbage, at least on i386.
(it returns native_to_linux_errno[EPASSTHROUGH] where EPASSTHROUGH == -4.)

i choose EINVAL rather than ENOTTY, because linux's pipe returns it
and i think that it's a common case.
 1.38  29-Jun-2003  fvdl branches: 1.38.2; 1.38.4;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.37  29-Jun-2003  enami Redo previous; struct proc *p is necessary if NSEQUENCER is non zero.
 1.36  28-Jun-2003  bouyer Kill unused variable.
 1.35  28-Jun-2003  darrenr Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records. The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
 1.34  23-Jun-2003  christos PR/21936: Todd Vierling: ioctl 'r' misinterpreted
 1.33  20-Jun-2003  christos PR/21936: Todd Vierling: compat/linux: ioctl 'r' misinterpreted
 1.32  27-Feb-2003  yamt make compat_linux struct file interlock friendly.
 1.31  18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.30  22-Oct-2002  simonb Don't call cdevsw_lookup() with an uninitialised variable in
linux_sys_ioctl().
 1.29  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.28  13-Nov-2001  lukem branches: 1.28.8; 1.28.10;
add RCSIDs (including regeneration of files as appropriate)
 1.27  14-Jun-2001  thorpej branches: 1.27.2; 1.27.4;
Fix a partial construction problem that can cause race conditions
between creation of a file descriptor and close(2) when using kernel
assisted threads. What we do is stick descriptors in the table, but
mark them as "larval". This causes essentially everything to treat
it as a non-existent descriptor, except for fdalloc(), which sees a
filled slot so that it won't (incorrectly) allocate it again. When
a descriptor is fully constructed, the code that has constructed it
marks it as "mature" (which actually clears the "larval" flag), and
things continue to work as normal.

While here, gather all the code that gets a descriptor from the table
into a fd_getfile() function, and call it, rather than having the
same (sometimes incorrect) code copied all over the place.
 1.26  30-May-2001  mrg use _KERNEL_OPT.
 1.25  10-Jan-2001  fvdl branches: 1.25.2;
Declare linux_ioctl_blkio and call it from the main routine.
 1.24  10-Dec-2000  fvdl Add some ioctls for harddisk, floppy disk and console handling.
Implement a few extra cdrom ioctl calls.
Make sure to correctly use FILE_USE and FILE_UNUSE.
 1.23  29-Nov-2000  jdolecek LKMify
 1.22  15-Dec-1998  augustss branches: 1.22.8; 1.22.18;
Slight code rearrangement and more defensive tests for the sequencer device.
 1.21  04-Oct-1998  fvdl Assign my copyright to TNF. Merge with others were appropriate.
Regen syscall files after script change.
 1.20  03-Oct-1998  christos Attempt to fix the mess.
 1.19  01-Oct-1998  erh Move compat/linux/linux_ioctl.c to common.
 1.18  07-Aug-1998  augustss Add MIDI support. The MIDI devices can be accessed as ``raw'' through
the /dev/rmidiN devices, or with a sequencer interface via /dev/music.
So far the only supported MIDI device is the MPU401 port on SoundBlaster
(and only on SB on isapnp, since we do not have locators with multiple
values yet).
 1.17  15-Jan-1998  christos PR/4794: Urban Boquist: Linux cdrom ioctls are missing
 1.16  04-Apr-1997  augustss * Move the Linux audio emulation into its own directory and rename it
OSS (aka VoxWare) audio emulation.
* Use the OSS audio emulation for Linux and FreeBSD.
* Add mixer emulation to the OSS emulator.
 1.15  19-Mar-1997  mycroft Emulate the SOUND_PCM_WRITE_CHANNELS ioctl. From PR 3356, by Lennart
Augustsson. Also add hooks for mixer ioctls.
 1.14  05-Apr-1996  christos Prototyping changes.
 1.13  08-Mar-1996  mycroft Separate ioctl emulation by group. Add (minimal) audio emulation.
 1.12  27-Feb-1996  mycroft Map SIOCGIFFLAGS and SIOCGIFADDR (et al).
 1.11  27-Feb-1996  mycroft Use OSIOCGIFCONF in previous.
 1.10  27-Feb-1996  mycroft Map SIOCGIFCONF.
 1.9  16-Nov-1995  thorpej Fix transposed copyin() args, from Niklas Hallqvist <niklas@appli.se>.
 1.8  07-Oct-1995  mycroft branches: 1.8.2;
Prefix names of system call implementation functions with `sys_'.
 1.7  19-Sep-1995  thorpej Make system calls conform to a standard prototype and bring those
prototypes into scope.
 1.6  27-Aug-1995  fvdl Add a hook for MD ioctl calls, plus a couple of more changes to make
svgalib binaries work on the i386
 1.5  16-Aug-1995  mycroft Convert 230400 baud.
 1.4  14-Aug-1995  mycroft Rearrange #includes.
 1.3  24-Jun-1995  christos Use compat_util.[ch].
 1.2  22-Jun-1995  fvdl * Changed to use generic ELF code from kern/exec_elf.c (which was taken
from the svr4 exec code plus the linux compat mods)
* Include file change
* Add multicast sockopts (from John Brezak)
 1.1  28-Feb-1995  fvdl Added Linux compat code.
 1.8.2.1  16-Nov-1995  thorpej Update from trunk; fix transposed copyin() args.
 1.22.18.1  30-Mar-2001  he Pull up revisions 1.24-1.25 (requested by fvdl):
Add some required Linux emulation bits to support the Linux
version of VMware.
 1.22.8.3  18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.22.8.2  13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.22.8.1  08-Dec-2000  bouyer Sync with HEAD.
 1.25.2.6  11-Nov-2002  nathanw Catch up to -current
 1.25.2.5  17-Sep-2002  nathanw Catch up to -current.
 1.25.2.4  29-May-2002  nathanw #include <sys/sa.h> before <sys/syscallargs.h>, to provide sa_upcall_t
now that <sys/param.h> doesn't include <sys/sa.h>.

(Behold the Power of Ed)
 1.25.2.3  14-Nov-2001  nathanw Catch up to -current.
 1.25.2.2  21-Jun-2001  nathanw Catch up to -current.
 1.25.2.1  05-Mar-2001  nathanw Initial commit of scheduler activations and lightweight process support.
 1.27.4.1  07-Sep-2001  thorpej Commit my "devvp" changes to the thorpej-devvp branch. This
replaces the use of dev_t in most places with a struct vnode *.

This will form the basic infrastructure for real cloning device
support (besides being architecurally cleaner -- it'll be good
to get away from using numbers to represent objects).
 1.27.2.2  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.27.2.1  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.28.10.1  17-Aug-2003  tron Pull up revision 1.33 (requested by tv in ticket #1421):
PR/21936: Todd Vierling: compat/linux: ioctl 'r' misinterpreted
 1.28.8.1  16-May-2002  gehenna Replace the direct-access to devsw table with calling devsw API.
 1.38.4.1  08-Oct-2004  jmc Pullup rev 1.39 (requested by manu in ticket #904)

linux_sys_ioctl: map EPASSTHROUGH to EINVAL as sys_ioctl does.
otherwise, linux_syscall() returns garbage, at least on i386.
 1.38.2.9  04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.38.2.8  04-Feb-2005  skrll Sync with HEAD.
 1.38.2.7  21-Nov-2004  skrll Adapt to branch. Alpha kernels now compile.
 1.38.2.6  18-Nov-2004  skrll Adapt to branch. macppc release builds.
 1.38.2.5  21-Sep-2004  skrll Fix the sync with head I botched.
 1.38.2.4  18-Sep-2004  skrll Sync with HEAD.
 1.38.2.3  03-Aug-2004  skrll Sync with HEAD
 1.38.2.2  19-Aug-2003  skrll Fix patch botch. Closes PR 22043.
 1.38.2.1  02-Jul-2003  darrenr Apply the aborted ktrace-lwp changes to a specific branch. This is just for
others to review, I'm concerned that patch fuziness may have resulted in some
errant code being generated but I'll look at that later by comparing the diff
from the base to the branch with the file I attempt to apply to it. This will,
at the very least, put the changes in a better context for others to review
them and attempt to tinker with removing passing of 'struct lwp' through
the kernel.
 1.39.6.2  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.39.6.1  12-Feb-2005  yamt sync with head.
 1.39.4.1  29-Apr-2005  kent sync with -current
 1.42.4.8  24-Mar-2008  yamt sync with head.
 1.42.4.7  21-Jan-2008  yamt sync with head
 1.42.4.6  07-Dec-2007  yamt sync with head
 1.42.4.5  27-Oct-2007  yamt sync with head.
 1.42.4.4  03-Sep-2007  yamt sync with head.
 1.42.4.3  26-Feb-2007  yamt sync with head.
 1.42.4.2  30-Dec-2006  yamt sync with head.
 1.42.4.1  21-Jun-2006  yamt sync with head.
 1.43.12.1  24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.43.10.1  08-Mar-2006  elad Adapt to kernel authorization KPI.
 1.43.8.2  11-Aug-2006  yamt sync with head
 1.43.8.1  24-May-2006  yamt sync with head.
 1.43.6.1  01-Jun-2006  kardel Sync with head.
 1.43.4.1  09-Sep-2006  rpaulo sync with head
 1.45.4.1  30-Jan-2007  ad Remove support for SA. Ok core@.
 1.46.2.1  12-Mar-2007  rmind Sync with HEAD.
 1.47.4.1  11-Jul-2007  mjf Sync with head.
 1.47.2.1  15-Jul-2007  ad Sync with head.
 1.48.12.1  25-Oct-2007  bouyer Sync with HEAD.
 1.48.8.2  09-Jan-2008  matt sync with HEAD
 1.48.8.1  06-Nov-2007  matt sync with HEAD
 1.48.6.3  09-Dec-2007  jmcneill Sync with HEAD.
 1.48.6.2  27-Nov-2007  joerg Sync with HEAD. amd64 Xen support needs testing.
 1.48.6.1  26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.49.2.2  27-Dec-2007  mjf Sync with HEAD.
 1.49.2.1  08-Dec-2007  mjf Sync with HEAD.
 1.50.2.1  26-Dec-2007  ad Sync with head.
 1.51.4.1  02-Jan-2008  bouyer Sync with HEAD
 1.52.6.3  28-Sep-2008  mjf Sync with HEAD.
 1.52.6.2  02-Jun-2008  mjf Sync with HEAD.
 1.52.6.1  03-Apr-2008  mjf Sync with HEAD.
 1.53.4.2  04-May-2009  yamt sync with head.
 1.53.4.1  16-May-2008  yamt sync with head.
 1.53.2.1  18-May-2008  yamt sync with head.
 1.54.6.1  19-Oct-2008  haad Sync with HEAD.
 1.54.4.1  28-Jul-2008  simonb Sync with head.
 1.54.2.3  18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.54.2.2  14-May-2008  wrstuden Per discussion with ad, remove most of the #include <sys/sa.h> lines
as they were including sa.h just for the type(s) needed for syscallargs.h.

Instead, create a new file, sys/satypes.h, which contains just the
types needed for syscallargs.h. Yes, there's only one now, but that
may change and it's probably more likely to change if it'd be difficult
to handle. :-)

Per discussion with matt at n dot o, add an include of satypes.h to
sigtypes.h. Upcall handlers are kinda signal handlers, and signalling
is the header file that's already included for syscallargs.h that
closest matches SA.

This shaves about 3000 lines off of the diff of the branch relative
to the base. That also represents about 18% of the total before this
checkin.

I think this reduction is very good thing.
 1.54.2.1  10-May-2008  wrstuden Initial checkin of re-adding SA. Everything except kern_sa.c
compiles in GENERIC for i386. This is still a work-in-progress, but
this checkin covers most of the mechanical work (changing signalling
to be able to accomidate SA's process-wide signalling and re-adding
includes of sys/sa.h and savar.h). Subsequent changes will be much
more interesting.

Also, kern_sa.c has received partial cleanup. There's still more
to do, though.
 1.56.12.2  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.56.12.1  20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.56.8.1  24-Oct-2012  riz Pull up following revision(s) (requested by bouyer in ticket #629):
sys/compat/linux/common/linux_ioctl.c: revision 1.57
sys/dev/ic/mfi.c: revision 1.47
sys/conf/majors: revision 1.62
etc/etc.i386/MAKEDEV.conf: revision 1.24
sys/dev/ic/mfivar.h: revision 1.20
etc/MAKEDEV.tmpl: revision 1.159
sys/dev/ic/mfiio.h: revision 1.1
etc/etc.amd64/MAKEDEV.conf: revision 1.19
sys/dev/ic/mfireg.h: revision 1.8
Add a pass-through ioctl for mfi(4), allowing userland to send raw commands
to the controller. This is compatible with the linux and FreeBSD
implementations.
Add the needed conversion for mfi ioctls in COMPAT_LINUX
Allocate a character major number, and create /dev/mfi0 by default
on amd64 and i386.
This allows (along with a hand-created /emul/linux/proc/devices file)
to run the MegaCLI linux binary provided by LSI.
 1.56.2.2  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.56.2.1  30-Oct-2012  yamt sync with head
 1.57.2.1  18-May-2014  rmind sync with head
 1.58.42.1  15-Dec-2020  thorpej Add Linux eventfd, timerfd, and POSIX timer calls.
 1.58.20.1  27-Apr-2017  pgoyette Restore all work from the former pgoyette-localcount branch (which is
now abandoned doe to cvs merge botch).

The branch now builds, and installs via anita. There are still some
problems (cgd is non-functional and all atf tests time-out) but they
will get resolved soon.
 1.58.10.2  21-Jul-2016  pgoyette simplify for readability
 1.58.10.1  20-Jul-2016  pgoyette Adapt machine-independant code to the new {b,c}devsw reference-counting
(using localcount(9)). All callers of {b,c}devsw_lookup() now call
{b,c}devsw_lookup_acquire() which retains a reference on the 'struct
{b,c}devsw'. This reference must be released by the caller once it is
finished with the structure's content (or other data that would disappear
if the 'struct {b,c}devsw' were to disappear).

RSS XML Feed