Commit Graph

64 Commits

Author SHA1 Message Date
macallan 3d6ab01ea4 fix pasto, now SIOCS80211NWKEY and SIOCG80211NWKEY actually work 2011-10-06 03:19:32 +00:00
macallan b788a760c4 forgot SIOCG80211NWKEY32 when adding SIOCS80211NWKEY32 2011-10-05 14:17:41 +00:00
macallan f73964743d support WSDISPLAYIO_GCURSOR and WSDISPLAYIO_SCURSOR 2011-09-28 01:46:39 +00:00
macallan fccabba939 support ioctl(POWER_EVENT_RECVDICT) - now powerd turns my gdium's backlight
off when the lid is closed
2011-09-07 02:35:00 +00:00
bouyer ccc8030189 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.
2011-08-30 14:22:22 +00:00
macallan d9554c19b2 support SIOCG80211NWKEY 2011-08-30 07:54:15 +00:00
macallan daaec637e7 add WSDISPLAYIO_ADDSCREEN 2011-08-30 07:06:39 +00:00
bouyer 166893d482 translate WDOGIOC_GWDOGS 2011-08-27 19:25:35 +00:00
ahoka 7a9de7239e remove FLASH_GET_INFO compat as it is no longer using size_t 2011-04-04 18:24:56 +00:00
cliff 0d7e06e2aa compat/netbsd32 ioctl support for FLASH_GET_INFO 2011-03-19 04:07:35 +00:00
matt 0f0d22769a 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.
2011-02-01 00:53:22 +00:00
matt fc2c6c78f2 Fix c&p error. 2011-01-22 20:51:21 +00:00
matt ad396e28d0 Make struct disklabel 8 byte aligned. This increases its size by 4 bytes
on IPL32 platforms so add code in sys_ioctl (and netbsd32_ioctl) to deal
with the older/smaller diskabel size.  This change makes disklabel the
same for both IPL32 and LP64 platforms.
2011-01-18 19:52:23 +00:00
njoly 6795d62e0d Add support for envsys(4) version 2 ioctls. 2010-09-24 13:12:53 +00:00
mrg bb1c68152f add (runtime untested) support for AUDIO_WSEEK. 2010-09-19 10:33:31 +00:00
mrg c97f9c82aa add support for the netbsd 5.0 versions of the VND* ioctls. 2010-09-19 09:46:59 +00:00
mrg 9e2edd2b4d support VND* ioctls. 2010-09-19 09:09:30 +00:00
rmind d00df28408 Replace M_IOV and some malloc(9)s with kmem(9), and while there:
- Fix invalid free (M_TEMP vs M_IOV) in do_sys_recvmsg(), spotted by jakllsch@.
  Also, same fix in osf1_sys_sendmsg_xopen().
- Fix attempt to free non-allocated memory in error path in netbsd32___getfh30().
- Plug a memory leak in compat_43_netbsd32_orecvmsg().
2010-04-23 15:19:19 +00:00
njoly c3217052b6 In netbsd32_from_{ifreq,oifreq}(), use the compat structure size for
memcpy.

From mrg.
2009-12-11 11:14:34 +00:00
njoly 4f273f66ed Kill debug printf. 2009-12-10 15:47:23 +00:00
njoly 86051746c6 Make netbsd32_from_{ifreq,oifreq}() copy the whole structure, not only
the interface name. Finally fix my own PR/39424.

ok by christos.
2009-12-10 14:58:28 +00:00
christos 67de10fc57 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.
2009-12-09 04:50:47 +00:00
ad d991fcb3b6 More changes to improve kern_descrip.c.
- Avoid atomics in more places.
- Remove the per-descriptor mutex, and just use filedesc_t::fd_lock.
  It was only being used to synchronize close, and in any case we needed
  to take fd_lock to free the descriptor slot.
- Optimize certain paths for the <NDFDFILE case.
- Sprinkle more comments and assertions.
- Cache more stuff in filedesc_t.
- Fix numerous minor bugs spotted along the way.
- Restructure how the open files array is maintained, for clarity and so
  that we can eliminate the membar_consumer() call in fd_getfile().  This is
  mostly syntactic sugar; the main functional change is that fd_nfiles now
  lives alongside the open file array.

Some measurements with libmicro:

- simple file syscalls are like close() are between 1 to 10% faster.
- some nice improvements, e.g. poll(1000) which is ~50% faster.
2009-05-24 21:41:25 +00:00
matt 7408df1239 Change {ff,fd}_exclose and ff_allocated to bool. Change exclose arg to
fd_dup to bool.  Switch assignments from 1/0 to true/false.

This make alpha kernels compile.  Bump kern to 4.99.69 since structure
changed.
2008-07-02 16:45:19 +00:00
njoly 0237fe6def Update compat netbsd32 SIOCGIFCONF ioctls definitions to follow native
ones.
2008-06-23 23:14:42 +00:00
mrg c2b95373bf remove clause #3 from my license where there are no other
copyright holders involved.
2008-05-29 14:51:25 +00:00
ad a9ca7a3734 Catch up with descriptor handling changes. See kern_descrip.c revision
1.173 for details.
2008-03-21 21:54:58 +00:00
dsl 7e2790cf6f 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.
2007-12-20 23:02:38 +00:00
dsl 28bae79b27 ANSIfy most of the function definitions in sys/compat (but not ndis).
All by the magic of sed ...
2007-12-08 18:35:53 +00:00
ad 63c4506184 Changes to make ktrace LKM friendly and reduce ifdef KTRACE. Proposed
on tech-kern.
2007-08-15 12:07:23 +00:00
christos 9bf57b1f3a make this compile again
XXX: The ioctls will need to be fixed.
2007-05-30 00:00:59 +00:00
njoly 226b6c843f Add ktrace I/O support to netbsd32_ioctl() syscall.
Reviewed by cube.
2007-03-20 11:02:18 +00:00
dsl d364d308c7 Change all the NETBSD32PTR64(SCARG(uap, xxx))) to SCARG_P32(uap, xxx). 2007-03-18 21:38:32 +00:00
dsl a065e51621 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.
2007-03-16 22:21:40 +00:00
christos fffc9c66c9 fix fallout from caddr_t changes. 2007-03-04 07:54:07 +00:00
christos 53524e44ef Kill caddr_t; there will be some MI fallout, but it will be fixed shortly. 2007-03-04 05:59:00 +00:00
ad b07ec3fc38 Merge newlock2 to head. 2007-02-09 21:55:00 +00:00
hubertf eda05c6413 Remove more duplicate headers.
Patch by Slava Semushin <slava.semushin@gmail.com>

Again, this was tested by comparing obj files from a pristine and a patched
source tree against an i386/ALL kernel, and also for src/sbin/fsck_ffs,
src/sbin/fsdb and src/usr.sbin/makefs. Only changes in assert() line numbers
were detected in 'objdump -d' output.
2007-01-29 01:52:43 +00:00
fvdl fc06b6e99a EPASSTHROUGH from lower layers is returned as ENOTTY to the (system) caller.
Make it so.
2006-09-24 10:20:16 +00:00
perry 0f0296d88a Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete. 2005-12-24 20:45:08 +00:00
christos 95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
perry 477853c351 nuke trailing whitespace 2005-02-26 22:58:54 +00:00
mrg 1d9c8161a0 begin to implement some ifreq ioctls... long long way to go. 2004-01-15 14:36:28 +00:00
jdolecek 7cea8a1389 cleanup & uniform descriptor owner handling:
* introduce fsetown(), fgetown(), fownsignal() - this sets/retrieves/signals
  the owner of descriptor, according to appropriate sematics
  of TIOCSPGRP/FIOSETOWN/SIOCSPGRP/TIOCGPGRP/FIOGETOWN/SIOCGPGRP ioctl; use
  these routines instead of custom code where appropriate
* make every place handling TIOCSPGRP/TIOCGPGRP handle also FIOSETOWN/FIOGETOWN
  properly, and remove the translation of FIO[SG]OWN to TIOC[SG]PGRP
  in sys_ioctl() & sys_fcntl()
* also remove the socket-specific hack in sys_ioctl()/sys_fcntl() and
  pass the ioctls down to soo_ioctl() as any other ioctl

change discussed on tech-kern@
2003-09-21 19:16:48 +00:00
fvdl d5aece61d6 Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
2003-06-29 22:28:00 +00:00
martin 69cd0c4a54 struct proc * -> struct lwp * 2003-06-29 13:33:51 +00:00
christos c56f7f428b get rid of the ASYNCMAP ioctls 2003-04-12 05:00:38 +00:00
fvdl a3ff3a3038 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.
2003-01-24 21:55:02 +00:00
thorpej 6acc60d22d Merge the nathanw_sa branch. 2003-01-18 08:28:25 +00:00
scw cb52115837 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.
2002-10-23 13:16:38 +00:00