Home | History | Annotate | Download | only in netbsd32
History log of /src/sys/compat/netbsd32/netbsd32_ioctl.h
RevisionDateAuthorComments
 1.80  11-May-2024  martin PR 58235: add support for SIOCGIFDATA and SIOCZIFDATA ioctls.
 1.79  22-Dec-2021  roy Handle the SIOCGNBRINFO ioctl for compat32.
arp -a works with compat32 now.

Credit to simonb@ for the ndp fix from which this is cribbed.
 1.78  14-Apr-2021  mlelstv Add DIOCGDISKINFO compat.
 1.77  17-Jan-2021  simonb branches: 1.77.2;
Handle the SIOCGNBRINFO_IN6 ioctl for compat32. ndp -a works with
compat32 now.
 1.76  14-Jan-2021  simonb Handle the KFILTER_BYFILTER and KFILTER_BYNAME ioctls for compat32.
Passes "atf kernel/kqueue/t_ioctl".
 1.75  14-Jan-2021  simonb Handle FSSIOCSET and FSSIOCGET; vndconfig(8) works with compat32 now.
XXX: FSSIOCSET50 and FSSIOCGET50 are not (yet) handled.
 1.74  14-Jan-2021  simonb Use netbsd32_* types instead of relying on __packed in the vnd ioctl
structures. __packed didn't work on archs where 64-bit types were
64-bit aligned with a 32-bit ABI (eg MIPS n32).

OK mrg@
 1.73  07-Sep-2020  mrg branches: 1.73.2;
remove __packed from struct netbsd32_lsdisable. the structure
is already properly aligned (the embedded int64 already has
align(4) marker applied where needed.)

same size structure generated.
 1.72  21-Jul-2020  simonb Add lockstat(1) ioctl handling.

mrg@: "looks ok."
 1.71  18-Jul-2020  jmcneill Add BIOCSETWF32 (bpf)
 1.70  18-Nov-2019  rin Sorry, revert unintentional parts of the previous commit:
http://mail-index.netbsd.org/source-changes/2019/11/18/msg110946.html

I was going to commit only netbsd32_signal.c.
 1.69  18-Nov-2019  rin Belatedly catch up with kern_sig.c rev 1.358:
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/kern/kern_sig.c#rev1.358

Provide syscall information with SIGTRAP TRAP_SCE/TRAP_SCX so that
picotrace/truss, for example, works fine on COMPAT_NETBSD32.

With some minor changes:

- Centralize netbsd32_si{,32}_si{32,}() into netbsd32_ksi{,32}_ksi{32,}().
- Provide si_status with SIGCHLD.
- Remove the remaining of SA.

XXX
pullup to netbsd-9
 1.68  20-Aug-2019  christos compat32 drm ioctl support from Surya Shankar at GSoC 2019
 1.67  17-May-2019  msaitoh The max subtype of the ifmedia word is 31. It's too small for Ethernet now.
We currently use use it up to 30. We should extend the limit to be able to use
more than 10Gbps speeds. Our ifmedia(4) is inconvenience and have some problem
so we should redesign the interface, but it's too late for netbsd-9 to do it.
So, we keep the data structure size and modify the structure a bit. The
strategy is almost the same as FreeBSD. Many bits of IFM_OMASK for Ethernet
have not used, so use some of them for Ethernet's subtype.

The differences against FreeBSD are:
- We use NetBSD style compat code (i.e. no SIOCGIFXMEDIA).
- FreeBSD's IFM_ETH_XTYPE's bit location is from 11 to "14" even though
IFM_OMASK is from 8 to "15". We use _IFM_ETH_XTMASK from bit 13 to "15".
- FreeBSD changed the meaning of IFM_TYPE_MATCH(). I think we should
not do it. We keep it not changing and added new IFM_TYPE_SUBTYPE_MATCH()
macro for matching both TYPE and SUBTYPE.
- Added up to 400GBASE-SR16.

New layout of the media word is as follows (from ifmedia_h):

* if_media Options word:
* Bits Use
* ---- -------
* 0-4 Media subtype MAX SUBTYPE == 255 for ETH and 31 for others
* 5-7 Media type
* 8-15 Type specific options
* 16-18 Mode (for multi-mode devices)
* 19 (Reserved for Future Use)
* 20-27 Shared (global) options
* 28-31 Instance
*
* 3 2 1
* 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
* +-------+---------------+-+-----+---------------+-----+---------+
* | | |R| | | | |
* | IMASK | GMASK |F|MMASK+-----+ OMASK |NMASK| TMASK |
* | | |U| |XTMSK| | | |
* +-------+---------------+-+-----+-----+---------+-----+---------+
* <-----> <---> <--->
* IFM_INST() IFM_MODE() IFM_TYPE()
*
* IFM_SUBTYPE(other than ETH)<------->
*
* <---> IFM_SUBTYPE(ETH)<------->
*
*
* <-------------> <------------->
* IFM_OPTIONS()
 1.66  25-Nov-2018  mlelstv Restore netbsd32 compat code for new NPF ABI.
 1.65  11-Oct-2018  christos PR/53666: Rin Okuyama: tcpdump for i386 does not work with COMPAT_NETBSD32
on amd64. Add BIOCSRTIMEOUT32.
 1.64  29-Sep-2018  rmind NPF: Major rework -- migrate NPF to the libnv library.
- This conversion significantly simplifies the code and moves NPF to
a binary serialisation format (replacing the XML-like format).
- Fix some memory/reference leaks and possibly use-after-free bugs.
- Bump NPF_VERSION as this change makes libnpf incompatible with the
previous versions. Also, different serialisation format means NPF
connection/config saving and loading is not compatible with the
previous versions either.

Thanks to christos@ for extra testing.
 1.63  24-Sep-2018  jdolecek fix DIOCLWEDGES to at least not fail with ENOTTY due to struct size difference,
but probably more needs to be done to work if any actual wedges are configured
 1.62  24-Sep-2018  jdolecek add support for DIOCGSTRATEGY and DIOCSSTRATEGY
 1.61  06-Sep-2018  maxv Remove the network ATM code.
 1.60  02-Sep-2018  maxv remove dead references to IPF; also remove references to netccitt/, it was
removed 12 years ago.
 1.59  06-Mar-2018  mlelstv branches: 1.59.2;
Add DIOCLWEDGES
 1.58  19-Jan-2018  macallan branches: 1.58.2;
add conversion goop for WSDISPLAYIO_LDFONT and _SFONT
tested on mips64
 1.57  26-Nov-2017  jmcneill Add support for SIOCGIFGENERIC and SIOCSIFGENERIC ioctls.
 1.56  26-Dec-2016  christos branches: 1.56.8;
Sync NPF with the version on github: backport standalone NPF changes,
which allow us to create and run separate NPF instances. Minor fixes.
(from rmind@)
 1.55  12-Nov-2016  mlelstv Fix netbsd32 emulation for clockctl_ntp_adjtime.

The ioctl args reference a timex structure that needs to be
transformed to 64bit layout and back.

The 32bit ioctl definition was wrong for mips, as register_t is 64bit
for N32 abi.
 1.54  13-Jul-2016  jmcneill branches: 1.54.2;
Add netbsd32 support for drvctl(4)
 1.53  08-Dec-2015  christos Replace DIOCGPART -> DIOCGPARTINFO which returns the data needed instead of
pointers.
 1.52  01-Jun-2015  roy Add support for NPF ioctls.
 1.51  31-May-2015  roy Add support for PPPOEGETPARMS and PPPOESETPARMS.
 1.50  31-May-2015  roy Support SPPPGETAUTHCFG and SPPPSETAUTHCFG.
 1.49  27-May-2015  matt Add missing SIOCGDRVSPEC32
Fix SIOCGETSGCNT32
 1.48  20-May-2015  matt Use Elf_Sym
 1.47  20-May-2015  matt Only define the KIOC netbsd32 stuff if the KIOC ioctls have been defined.
 1.46  20-May-2015  matt Change the ksyms ioctls to more compat_netbsd32 friendly. Use _IOWR ioctls
to avoid extra copyouts. With these changes, netstat and vmstat work on
mips64eb with the normal N32 userland and a N64 kernel.
 1.45  18-May-2015  martin Implement SIOCIFGCLONERS for netbsd32, so ifconfig -C works.
 1.44  24-Jan-2014  manu branches: 1.44.6;
Add ATAIOCCOMMAND ioctl form COMPAT_NETBSD32

This enables SMART monitoring by a netbsd32 binary.
 1.43  28-May-2012  christos branches: 1.43.2; 1.43.4;
compat for 80211 ioctls from jmcneill
 1.42  11-May-2012  christos provide clockctl ioctl emulation
 1.41  28-Sep-2011  macallan branches: 1.41.2; 1.41.6; 1.41.8;
support WSDISPLAYIO_GCURSOR and WSDISPLAYIO_SCURSOR
 1.40  07-Sep-2011  macallan support ioctl(POWER_EVENT_RECVDICT) - now powerd turns my gdium's backlight
off when the lid is closed
 1.39  30-Aug-2011  bouyer Provide netbsd32 compat for bpf. Beside the ioctls, the structure
returned to userland by read(2) also needs to be converted.
For this, the bpf descriptor is flagged as compat32 (or not) in the
open and ioctl functions (where the user process's pid is also updated
in the descriptor). When the bpf buffer is filled in, the 32bits or native
header is used depending on the information stored in the descriptor.

This won't work if a 64bit binary does the open and ioctls, and then
exec a 32bit program which will do the read. But this is very
unlikely to happen in real life ...

Tested on i386 and loongson; with these changes my loongson can run
dhclient and tcpdump with a n32 userland.
 1.38  30-Aug-2011  macallan support SIOCG80211NWKEY
 1.37  30-Aug-2011  macallan add WSDISPLAYIO_ADDSCREEN
 1.36  27-Aug-2011  bouyer translate WDOGIOC_GWDOGS
 1.35  04-Apr-2011  ahoka remove FLASH_GET_INFO compat as it is no longer using size_t
 1.34  04-Apr-2011  ahoka flash_addr_t -> flash_off_t
 1.33  19-Mar-2011  cliff include flashio.h
 1.32  19-Mar-2011  cliff compat/netbsd32 ioctl support for FLASH_GET_INFO
 1.31  06-Mar-2011  bouyer merge the bouyer-quota2 branch. This adds a new on-disk format
to store disk quota usage and limits, integrated with ffs
metadata. Usage is checked by fsck_ffs (no more quotacheck)
and is covered by the WAPBL journal. Enabled with kernel
option QUOTA2 (added where QUOTA was enabled in kernel config files),
turned on with tunefs(8) on a per-filesystem
basis. mount_mfs(8) can also turn quotas on.

See http://mail-index.netbsd.org/tech-kern/2011/02/19/msg010025.html
for details.
 1.30  01-Feb-2011  matt Define 32bit version of SIOC[GS]IFADDRPREF32. We wouldn't need this to
if i386 actually aligned a uint64_t on a 64bit boundary but it doesn't.
So all that work in sockaddr_storage goes for naught.
 1.29  24-Sep-2010  njoly branches: 1.29.2; 1.29.4;
Add support for envsys(4) version 2 ioctls.
 1.28  19-Sep-2010  mrg add (runtime untested) support for AUDIO_WSEEK.
 1.27  19-Sep-2010  mrg add support for the netbsd 5.0 versions of the VND* ioctls.
 1.26  19-Sep-2010  mrg support VND* ioctls.
 1.25  09-Dec-2009  christos branches: 1.25.2; 1.25.4;
Add netbsd32_oifreq and fix issue in copying the interface name. With this
patch OSIOC{G,S}IFFLAGS is supposed to work, but unfortunately getifaddrs
seems to be the next problem getting the 4.99.x i386 ifconfig working on an
amd64 current machine.
 1.24  23-Jun-2008  njoly branches: 1.24.10;
Update compat netbsd32 SIOCGIFCONF ioctls definitions to follow native
ones.
 1.23  22-Jun-2008  njoly netbsd32_ifreq_tp_t should be of type netbsd32_pointer_t, not int32_t.
 1.22  29-May-2008  mrg branches: 1.22.2;
remove clause #3 from my license where there are no other
copyright holders involved.
 1.21  21-Mar-2008  ad branches: 1.21.2; 1.21.4; 1.21.6;
Catch up with descriptor handling changes. See kern_descrip.c revision
1.173 for details.
 1.20  16-Mar-2007  dsl branches: 1.20.30;
remove all the double (and triple) casts used to convert 32bit userspace
pointers to and from 64bit kernel pointers. Instead use the defines
NETBSD32PTR64(p32) to read a 32bit pointer and (the new) NETBSD32PTR32(p32,p64)
to write a 32bit pointer throughout.
The 32bit pointer is now a struct to enforce the above.
amd64 (with linux emul) and sparc64 will both compile (when the arch stuff
goes in soon), and amd64 still runs some i386 binaries.
 1.19  04-Mar-2007  christos branches: 1.19.2; 1.19.4; 1.19.6;
fix fallout from caddr_t changes.
 1.18  04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.17  11-Dec-2005  christos branches: 1.17.26;
merge ktrace-lwp.
 1.16  26-Feb-2005  perry branches: 1.16.4;
nuke trailing whitespace
 1.15  15-Jan-2004  mrg branches: 1.15.8; 1.15.10;
begin to implement some ifreq ioctls... long long way to go.
 1.14  29-Jun-2003  fvdl branches: 1.14.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.13  29-Jun-2003  martin struct proc * -> struct lwp *
 1.12  12-Apr-2003  christos get rid of the ASYNCMAP ioctls
 1.11  24-Jan-2003  fvdl Bump daddr_t to 64 bits. Replace it with int32_t in all places where
it was used on-disk, so that on-disk formats remain the same.
Remove ufs_daddr_t and ufs_lbn_t for the time being.
 1.10  23-Oct-2002  scw In preparation for COMPAT_NETBSD32 on SH-5:

- The MD netbsd32_machdep.h header now defines the 32-bit pointer type
instead of using u_int32_t everywhere,
- The MD netbsd32_machdep.h header now defines a macro (at least on
current implementations) which converts a 32-bit pointer to its 64-bit
equivalent,
- Change the MI code to utilise the above two items in all the right places,
- Implement netbsd32___sigaction_sigtramp().

Tested on Sparc64 by Matt Green.
 1.9  03-Jan-2002  mrg fix error in previous; pointed out by andrew brown.
 1.8  03-Jan-2002  mrg clean up
 1.7  03-Jan-2002  mrg move sparc specific ioctl handling (fb & openprom) into arch/sparc64.
 1.6  25-Aug-2001  mrg update copyright notices.
 1.5  19-Jun-2001  fvdl branches: 1.5.2;
Some of this was sparc-specific, so ifdef __sparc__ it (XXX). Also,
change the alignment of one structure with an MD ifdef. Should
be moved into the netbsd32_machdep parts.
 1.4  19-Aug-2000  eeh branches: 1.4.2;
Fix netbsd32_ioctls.
 1.3  25-Mar-1999  mrg branches: 1.3.8; 1.3.18;
move sparc32 to netbsd32; split out MD part (signal handling) (mostly via repository copy, rename and perl -pi :-)
 1.2  24-Nov-1998  mrg add some missing comment ends.
 1.1  26-Aug-1998  mrg add a 32-bit compatibility module for the sparc64 port, so it can run NetBSD/sparc binaries with a LP64 kernel.
 1.3.18.1  26-Aug-2000  mrg pull up 1.4. approved by thorpej:
>Fix netbsd32_ioctls.
 1.3.8.1  20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.4.2.5  11-Nov-2002  nathanw Catch up to -current
 1.4.2.4  28-Feb-2002  nathanw Catch up to -current.
 1.4.2.3  11-Jan-2002  nathanw More catchup.
 1.4.2.2  21-Sep-2001  nathanw Catch up to -current.
 1.4.2.1  21-Jun-2001  nathanw Catch up to -current.
 1.5.2.2  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.5.2.1  13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.14.2.5  04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.14.2.4  21-Sep-2004  skrll Fix the sync with head I botched.
 1.14.2.3  18-Sep-2004  skrll Sync with HEAD.
 1.14.2.2  26-Aug-2004  skrll Adapt to branch.

sparc64 GENERIC compiles.
 1.14.2.1  03-Aug-2004  skrll Sync with HEAD
 1.15.10.1  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.15.8.1  29-Apr-2005  kent sync with -current
 1.16.4.3  24-Mar-2008  yamt sync with head.
 1.16.4.2  03-Sep-2007  yamt sync with head.
 1.16.4.1  21-Jun-2006  yamt sync with head.
 1.17.26.2  24-Mar-2007  yamt sync with head.
 1.17.26.1  12-Mar-2007  rmind Sync with HEAD.
 1.19.6.1  18-Mar-2007  reinoud First attempt to bring branch in sync with HEAD
 1.19.4.1  11-Jul-2007  mjf Sync with head.
 1.19.2.1  10-Apr-2007  ad Sync with head.
 1.20.30.3  29-Jun-2008  mjf Sync with HEAD.
 1.20.30.2  02-Jun-2008  mjf Sync with HEAD.
 1.20.30.1  03-Apr-2008  mjf Sync with HEAD.
 1.21.6.2  18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.21.6.1  23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.21.4.3  09-Oct-2010  yamt sync with head
 1.21.4.2  11-Mar-2010  yamt sync with head
 1.21.4.1  04-May-2009  yamt sync with head.
 1.21.2.1  04-Jun-2008  yamt sync with head
 1.22.2.1  27-Jun-2008  simonb Sync with head.
 1.24.10.2  23-Jun-2008  njoly Update compat netbsd32 SIOCGIFCONF ioctls definitions to follow native
ones.
 1.24.10.1  23-Jun-2008  njoly file netbsd32_ioctl.h was added on branch christos-time_t on 2008-06-23 23:14:43 +0000
 1.25.4.2  21-Apr-2011  rmind sync with head
 1.25.4.1  05-Mar-2011  rmind sync with head
 1.25.2.1  22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.29.4.2  15-Feb-2011  bouyer implement COMPAT_NETBSD32 quotactl syscalls (both new and COMPAT_50)
 1.29.4.1  08-Feb-2011  bouyer Sync with HEAD
 1.29.2.1  06-Jun-2011  jruoho Sync with HEAD.
 1.41.8.1  18-Mar-2014  msaitoh Pull up following revision(s) (requested by manu in ticket #1022):
sys/compat/netbsd32/netbsd32_ioctl.h: revision 1.44
sys/compat/netbsd32/netbsd32_ioctl.c: revision 1.68
Add ATAIOCCOMMAND ioctl form COMPAT_NETBSD32
This enables SMART monitoring by a netbsd32 binary.
 1.41.6.1  02-Jun-2012  mrg sync to latest -current.
 1.41.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.41.2.2  30-Oct-2012  yamt sync with head
 1.41.2.1  23-May-2012  yamt sync with head.
 1.43.4.1  18-May-2014  rmind sync with head
 1.43.2.2  03-Dec-2017  jdolecek update from HEAD
 1.43.2.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.44.6.5  05-Feb-2017  skrll Sync with HEAD
 1.44.6.4  05-Dec-2016  skrll Sync with HEAD
 1.44.6.3  05-Oct-2016  skrll Sync with HEAD
 1.44.6.2  27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.44.6.1  06-Jun-2015  skrll Sync with HEAD
 1.54.2.1  07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.56.8.2  22-Jul-2019  martin Pull up following revision(s) (requested by rin in ticket #1054):

sys/compat/netbsd32/netbsd32_ioctl.h: revision 1.65
sys/compat/netbsd32/netbsd32_ioctl.c: revision 1.98
sys/compat/netbsd32/netbsd32_ioctl.c: revision 1.99

PR/53666: Rin Okuyama: tcpdump for i386 does not work with COMPAT_NETBSD32
on amd64. Add BIOCSRTIMEOUT32.

-

Correct misleading names of dummy variables. No binary changes intended.
 1.56.8.1  27-Nov-2017  martin Pull up following revision(s) (requested by jmcneill in ticket #396):
sys/compat/netbsd32/netbsd32_ioctl.h: revision 1.57
sys/compat/netbsd32/netbsd32_ioctl.c: revision 1.90
Add support for SIOCGIFGENERIC and SIOCSIFGENERIC ioctls.
 1.58.2.5  26-Nov-2018  pgoyette Sync with HEAD, resolve a couple of conflicts
 1.58.2.4  20-Oct-2018  pgoyette Sync with head
 1.58.2.3  30-Sep-2018  pgoyette Ssync with HEAD
 1.58.2.2  06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.58.2.1  15-Mar-2018  pgoyette Synch with HEAD
 1.59.2.2  13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.59.2.1  10-Jun-2019  christos Sync with HEAD
 1.73.2.1  03-Apr-2021  thorpej Sync with HEAD.
 1.77.2.1  17-Apr-2021  thorpej Sync with HEAD.

RSS XML Feed