Commit Graph

4159 Commits

Author SHA1 Message Date
he
0bfa260fce Remove a now-unused variable. 2007-11-26 23:16:15 +00:00
pooka
61e8303e9d 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
2007-11-26 19:01:26 +00:00
elad
abb7851f4d Refactor time modification checks and place them in the secmodel code.
okay christos@
2007-11-25 00:35:26 +00:00
christos
3714528495 - move the save context before the signal reset (Arto Huusko)
- set the sigcontext cr2
2007-11-24 23:52:56 +00:00
elad
1d139a3075 Modify hpux_sys_stime_6x() to call settime(), like everyone else do.
okay christos@.
2007-11-24 20:43:34 +00:00
njoly
204ebc94bf Regen. 2007-11-16 12:58:12 +00:00
njoly
601a0e5173 Update, for linux_sys_readlink() removal. 2007-11-16 12:56:50 +00:00
njoly
cb572617af Regen, for syscalls cleanup. 2007-11-16 12:53:56 +00:00
njoly
6412bda281 Cleanup. Remove a few linux syscalls definitions, now identical to
native ones (with stackgap and ALT_CHECK_xxx removal). No functional
changes expected.
2007-11-16 12:51:54 +00:00
dsl
300078900a regen 2007-11-12 22:23:29 +00:00
dsl
9bb5de8a76 syscall() needs to be 'NOARGS INDIR'.
Actually I wonder if this code could use the standard syscall table ?
2007-11-12 22:23:01 +00:00
christos
2e3ee66dc7 regen 2007-11-11 18:28:18 +00:00
dsl
f36a9ec28b Fix builds for ports that don't define __HAVE_MINIMAL_EMUL (eg sparc64).
Fallout from a change that made #define names for syscalls (etc) start
NETBSD32 (not netbsd32).
2007-11-10 18:55:42 +00:00
dsl
ddd89ca02b regen 2007-11-10 13:24:27 +00:00
dsl
b6b07a31fd Mark 'syscall' as 'NOARGS INDIR" 2007-11-10 13:23:18 +00:00
dsl
2cabf5c1f0 Remove the pecoff system table defines, they aren't needed since the
emulation uses a user-space library and normal netbsd calls.
2007-11-10 09:41:01 +00:00
njoly
d16de24e5a Make linux32_sys_oldolduname use LINUX_UNAME_ARCH instead of machine,
like other uname syscalls. While here, remove unneeded
LINUX_UNAME_ARCH #ifdef/#endif checks.
2007-11-09 17:43:17 +00:00
dsl
ee077208d9 Regen 2007-11-09 15:10:27 +00:00
dsl
3107f9cd42 Add arguments to sys_syscall and sys___syscall.
Use MI wrappers for them in netbsd32.
Change prefix for constants from netbsd32 to NETBSD32 (used in #defines etc).
2007-11-09 15:05:33 +00:00
njoly
23e9f9fa6f Replace strncpy with strlcpy in compat linux and linux32 uname,
old_uname and oldold_uname syscalls to ensure that all *utsname fields
are always NUL terminated.
2007-11-08 21:07:23 +00:00
njoly
577cb10855 Regen for 64-bit linux syscalls removal. 2007-11-07 00:25:39 +00:00
njoly
b32d95bfbf Remove remaining 64-bit compat linux syscalls linux_sys_xxx() (except
for ones without arguments), and replace them by their 32-bit
equivalent linux32_sys_xxxx().
2007-11-07 00:24:29 +00:00
ad
d831186d55 Merge scheduler changes from the vmlocking branch. All discussed on
tech-kern:

- Invert priority space so that zero is the lowest priority. Rearrange
  number and type of priority levels into bands. Add new bands like
  'kernel real time'.
- Ignore the priority level passed to tsleep. Compute priority for
  sleep dynamically.
- For SCHED_4BSD, make priority adjustment per-LWP, not per-process.
2007-11-06 00:42:39 +00:00
rmind
6364fdeba5 - Replace lockmgr with mutex;
- Use condvars instead of tsleep/wakeup;
- Replace malloc with kmem;
- Use itimespecfix/tstohz;

Reviewed by <ad>.
2007-11-04 11:10:34 +00:00
oster
77002eb972 This should be a mutex_enter() instead of a mutex_exit().
Fixes:
Mutex error: mutex_vector_exit: assertion failed: MUTEX_OWNER(mtx->mtx_owner) == curthread
...
mutex_abort(c0aba23c,c07bf8b0,c09c9164,bfbfee34,10) at netbsd:mutex_abort+0x36
mutex_vector_exit(c0aba23c,10,c0aba23c,ca8efc6c,ca8f8540) at netbsd:mutex_vector_exit+0xe2
compat_20_sys_getfsstat(ca8f8540,cb243c48,cb243c68,805eb24,805e000) at netbsd:compat_20_sys_getfsstat+0x1bf
...
2007-11-01 03:49:52 +00:00
dsl
36acfb90ed regen 2007-10-31 22:39:17 +00:00
dsl
16c3c9c541 This file must use the netbsd32_xxx() system calls, not the sys_xxx() ones.
The latter actually function (due to luck) for calls with one argument,
but will fail badly if more than one is required.
Noticed as an error in the ktrace outut by Nicolas Joly, reported on
tech-kern.
2007-10-31 22:35:34 +00:00
njoly
beab9df119 Regen for syscalls cleanup. 2007-10-31 21:06:19 +00:00
njoly
6f36d09e87 compat linux32 syscalls cleanup.
With stackgap and CHECK_ALT_xxx removal, some linux32 and netbsd32
syscalls are now identical.
To avoid code duplication, remove the linux32 definition and use the
netbsd32 one (no functional change).
2007-10-31 21:04:02 +00:00
njoly
99e027abbb Remove extra return 2007-10-31 09:16:55 +00:00
njoly
d57ae6a62d Regen for chown additions. 2007-10-27 09:17:50 +00:00
njoly
97151f15f1 Add missing chown's syscalls family members.
This makes chown(1)/chgrp(1) works under compat linux32.

Problem reported and fix tested by Arto Huusko. Thanks.
2007-10-27 09:16:24 +00:00
pooka
ea84bd1c76 vfs_getopsbyname("ngs") -> vfs_getopsbyname("nfs"). 'nuff said 2007-10-23 15:21:31 +00:00
njoly
a478f23b9e 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.
2007-10-19 18:52:09 +00:00
ad
a2a3828545 machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h 2007-10-19 11:59:34 +00:00
he
167a62205a Follow up the removal of the lwp_t* argument to do_filereadv() and
do_filewritev().
2007-10-11 13:51:12 +00:00
ad
53b26d467e mountlist_slock is now a mutex. 2007-10-10 22:00:53 +00:00
ad
99b0354fb8 v_flag -> v_iflag 2007-10-10 21:59:11 +00:00
ad
7dad9f7391 Merge from vmlocking:
- Split vnode::v_flag into three fields, depending on field locking.
- simple_lock -> kmutex in a few places.
- Fix some simple locking problems.
2007-10-10 20:42:20 +00:00
ad
62fdbc4b9a LOCK_ASSERT -> KASSERT 2007-10-08 18:07:24 +00:00
ad
451aacda90 Merge file descriptor locking, cwdi locking and cross-call changes
from the vmlocking branch.
2007-10-08 15:12:05 +00:00
ad
74dc12ed8b fxsave() is a function, don't re-use the name. 2007-10-03 10:54:16 +00:00
he
525420f3c8 Remove a now-unused local variable. 2007-09-30 10:35:16 +00:00
dsl
2e20a70dbf Change the way p->p_limit (and hence p->p_rlimit) is locked.
Should fix PR/36939 and make the rlimit code MP safe.
Posted for comment to tech-kern (non received!)

The p_limit field (for a process) is only be changed once (on the first
  write), and a reference to the old structure is kept (for code paths
  that have cached the pointer).
Only p->p_limit is now locked by p->p_mutex, and since the referenced memory
  will not go away, is only needed if the pointer is to be changed.
The contents of 'struct plimit' are all locked by pl_mutex, except that the
  code doesn't bother to acquire it for reads (which are basically atomic).
Add FORK_SHARELIMIT that causes fork1() to share the limits between parent
  and child, use it for the IRIX_PR_SULIMIT.
Fix borked test for both IRIX_PR_SUMASK and IRIX_PR_SDIR being set.
2007-09-29 12:22:30 +00:00
dsl
2b7c33c183 Use netbsd32_uint64 instead of fsblkcnt_t and fsfilcnt_t in order to get
the correct alignment (4 bytes for i386) for the whole structure.
2007-09-29 10:47:45 +00:00
dsl
4bacff8183 Rename members of 'struct plimit' so that the fields are 'pl_xxx' and
no longer have the same names as members of 'struct proc'.
2007-09-21 19:19:20 +00:00
mlelstv
4bb7dae272 Implement OSS_SNDCTL_DSP_GETODELAY and provide a no-op function
for OSS_SNDCTL_DSP_PROFILE.
2007-09-18 19:49:53 +00:00
dsl
06b0a1bdab Define netbsd32_uint64 for 64bit integers with the alignment requirement
of the corresponding 32bit architecture.
Use it for the 64bit items in netbsd32_statvfs so that the structure
doesn't collect 8byte alignment (and 4 bytes of trailing padding).
This replaces the 'packed' attribute which wasn't architecture specific
and would cause massive overheads accessing every member of sparc64.
Should allow the MIPS64 port do DTRT.
2007-09-16 22:35:01 +00:00
gdt
9768560fd7 remove SIOCSIFALIFETIME_IN6 (should have been part of previous commit) 2007-09-11 19:59:18 +00:00
cube
7a185660d8 Some more licence clean up. 2007-09-10 10:54:20 +00:00
cube
c725329722 Remove 3rd clause and my name from all the licences which were only in my
name.
2007-09-10 10:35:51 +00:00
dyoung
f59a11881a Constify: LLADDR() -> CLLADDR(). 2007-08-29 22:33:42 +00:00
dyoung
f004b71d98 Constify. 2007-08-26 22:36:35 +00:00
dyoung
e6fc91327f Use satosdl(). 2007-08-26 22:33:25 +00:00
martin
4418b58c3f Remove all ioctls from the conversion list that are explicitly defined
to use struct oifreq - the magic size changing makes them fail.
2007-08-20 19:19:33 +00:00
martin
2adca4d368 Sigh - revert previous. Seems we can't avoid the big list, so fill it.
Now both "ifconfig ... create" and "pppoectl -d" work again with old
userland.
2007-08-20 17:48:17 +00:00
martin
1bcc2150d3 Put back the previous hack to make compat_cvtcmd() work for all the ioctls
that use struct ifreq which have not been explicitly versioned.
If someone feels like fixing it with a list aproach, I think below is
a complete list - the one used in the previous version missed a lot of them.

BIOCGETIF
BIOCSETIF
GREDSOCK
GREGADDRD
GREGADDRS
GREGPROTO
GRESADDRD
GRESADDRS
GRESPROTO
GRESSOCK
SIOCADDMULTI
SIOCDELMULTI
SIOCDIFADDR
SIOCDIFADDR_IN6
SIOCDIFPHYADDR
SIOCGDEFIFACE_IN6
SIOCGIFADDR
SIOCGIFADDR_IN6
SIOCGIFAFLAG_IN6
SIOCGIFALIFETIME_IN6
SIOCGIFBRDADDR
SIOCGIFDLT
SIOCGIFDSTADDR
SIOCGIFDSTADDR_IN6
SIOCGIFFLAGS
SIOCGIFGENERIC
SIOCGIFMETRIC
SIOCGIFMTU
SIOCGIFNETMASK
SIOCGIFNETMASK_IN6
SIOCGIFPDSTADDR
SIOCGIFPDSTADDR_IN6
SIOCGIFPSRCADDR
SIOCGIFPSRCADDR_IN6
SIOCGIFSTAT_ICMP6
SIOCGIFSTAT_IN6
SIOCGPVCSIF
SIOCGVH
SIOCIFCREATE
SIOCIFDESTROY
SIOCSDEFIFACE_IN6
SIOCSIFADDR
SIOCSIFADDR_IN6
SIOCSIFALIFETIME_IN6
SIOCSIFBRDADDR
SIOCSIFDSTADDR
SIOCSIFDSTADDR_IN6
SIOCSIFFLAGS
SIOCSIFGENERIC
SIOCSIFMEDIA
SIOCSIFMETRIC
SIOCSIFMTU
SIOCSIFNETMASK
SIOCSIFNETMASK_IN6
SIOCSNDFLUSH_IN6
SIOCSPFXFLUSH_IN6
SIOCSPVCSIF
SIOCSRTRFLUSH_IN6
SIOCSVH
TAPGIFNAME
2007-08-20 16:52:59 +00:00
skd
d4509b0376 Clean up net compat ioctls, and clean up handling of wireless ioctls. 2007-08-20 04:49:40 +00:00
ad
d3675885a8 Regen. 2007-08-15 12:09:12 +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
ad
06f7ccf01d Regen. 2007-08-07 19:01:23 +00:00
ad
830ab6bb3c - Fix a bug with _lwp_park() where if the computed wakeup time was under
1 microsecond into the future, the thread could enter an untimed sleep.
- Change the signature of _lwp_park() to accept an lwpid_t and second
  hint pointer, but do so in a way that remains compatible with older
  pthread libraries. This can be used to wake another thread before the
  calling thread goes asleep, saving at least one syscall + involuntary
  context switch. This turns out to be a fairly large win on the condvar
  benchmarks that I have tried.
- Mark some more syscalls MP safe.
2007-08-07 19:00:42 +00:00
xtraeme
bd0460e614 <sys/proc.h> is needed to get nprocs... fixes the build on amd64. 2007-07-21 23:39:46 +00:00
he
2eb0397ad6 Fix three identical typos in the previous (fs_fstypename -> f_fstypename). 2007-07-20 13:48:24 +00:00
dsl
f3ade04dc0 include sys/cdefs.h 2007-07-19 22:17:23 +00:00
briggs
883152ac0b Fix typo: mnfromname -> mntfromname. 2007-07-18 13:53:34 +00:00
christos
f25f73fe50 include <compat/sys/mount.h> for MFSNAMELEN 2007-07-17 20:54:45 +00:00
christos
9558d8b2f1 include <compat/sys/mount.h> for MFSNAMELEN. 2007-07-17 20:53:49 +00:00
christos
289334c878 include <compat/sys/mount.h> for MFSNAMELEN 2007-07-17 20:51:15 +00:00
christos
35cb28e6eb kill MFSNAMELEN 2007-07-17 20:41:23 +00:00
christos
18754a7640 kill silly constants. 2007-07-17 20:39:42 +00:00
christos
ecb7144e3a include <compat/sys/mount.h> MFSNAMELEN 2007-07-17 20:36:11 +00:00
christos
66c05241ca include compat/sys/mount.h for MFSNAMELEN, although not used yet. 2007-07-17 20:34:40 +00:00
christos
1b3668b8ef use the compat MFSNAMELEN 2007-07-17 20:33:17 +00:00
christos
515c243672 MFSNAMELEN only belongs in compat. 2007-07-17 20:31:03 +00:00
joerg
e4fc1154a4 Add native mremap system call based on the UVM implementation for
Linux compat. Add code to enforce alignment of the new location.
Special thanks to wizd for helping with the man page.
2007-07-17 17:42:07 +00:00
ad
3fc1741f68 <dsl> I suspect my set of test build kernels is longer than ad's :-)
tsk!
2007-07-14 17:11:28 +00:00
dsl
0bfa8b4ee7 Adapt for sys_mount() becoming compat_40_sys_mount(), 2007-07-14 15:47:26 +00:00
dsl
df57a27c09 Change calls from sys_mount() to compat_40_sys_mount() 2007-07-14 15:45:48 +00:00
dsl
6b182ed9a7 Put the stackgap code under OPT_SYSTRACE. 2007-07-13 21:04:29 +00:00
dsl
12da34644a Update generated files. 2007-07-13 20:49:07 +00:00
dsl
f02523fb6e Remove all the syscall stubs that were only there to get files lookup
up in the alternate path.
2007-07-13 20:48:39 +00:00
dsl
cfc71184cd Make thsi compile again after the recent changes to select/poll.
It really should be doing things properly though.
2007-07-13 20:46:04 +00:00
dsl
758f9f5cde Change compat mount code to pass do_sys_mount() kernel resident buffers.
Possibly the standard nfs code needs teaching how to set the length and
address family in order to support non-netbsd sockaddr.
There are now no active stackgap() calls in the compat tree.
2007-07-12 19:41:57 +00:00
ad
88ab7da936 Merge some of the less invasive changes from the vmlocking branch:
- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
2007-07-09 20:51:58 +00:00
pooka
b6caa3be1b fix pasto: sigframe.sf_sc is of type linux_sigcontext 2007-07-08 09:41:00 +00:00
dsl
1cb4e9208d Rip out the support for /dev/ptmx, the netbsd ptm driver will now DTRT.
It probably ought to have minor 2 (ie do the chown/chmod/revoke on open)
because the SVR4 programs dont know anything about revoke.
2007-07-05 19:19:24 +00:00
dsl
513b927545 It seems that min(16,16) isn't a compile time constant.
So don't bother limiting the local arrays to NGROUPS, just use 16.
2007-07-04 21:59:16 +00:00
dsl
8d3eb2476f Comment out the code that uses the stackgap to issue the WSDISPLAYIO_PUTCMAP
ioctl in order to change the display colours.
Changing the code to not need the stackgap is rather pervasive, and it isn't
at all clear this is useful effort given the suspected bitrottedness
of compat darwin.
2007-07-01 20:14:17 +00:00
dsl
813e1c7584 Fix long-term breakage in the definition of 'control' data for linux.
cmsg->cmsg_len is 'size_t' not 'socklen_t' - so it is 8 bytes on 64bit
platforms instead of 4.  There is also never padding after the header.
Redo linux sendmsg() so that it stands a chance of getting it right.
Redo linux recvmsg() so that it process control data directly from the mbuf
  list.  Allowing it to hack the data without using the stackgap.
2007-07-01 18:45:36 +00:00
dsl
bf215415ab Fix LINUX_HDIO_GET_IDENTITY so that it returns the entire 512 byte buffer.
Rely on the code in dev/ata/wd.c doing a relay for the short read needed
for LINUX_HDIO_OBSOLETE_IDENTITY.
2007-07-01 09:54:16 +00:00
dsl
168c1071b4 Call fp->f_ops->fo_ioctl() directly (not by sys_ioctl() for LINUX_VT_GETMODE
and LINUX_VT_SETMODE.  One fewer use of the stackgap.
2007-06-30 22:54:33 +00:00
dsl
a1188737bf Use the new CDIOCREADSUBCHANNEL_BUF and CDIOREADTOCENTRIES_BUF ioctls to
avoid copying into the stackgap.
2007-06-30 22:18:17 +00:00
dsl
53e0243f27 Changes to sompat socket function to avoid the dreaded stackgap. 2007-06-30 15:31:49 +00:00
dsl
4be2514b94 Match updates to kauth_cred_set/getgroups. 2007-06-30 13:34:19 +00:00
dsl
a9e905f23c Refactor this to use the new do_sys_xxx() functions from uipc_syscalls.c
so that it isn't necessary to copy data to/from the stackgap.
Given the nature of the code in this file, it is now probably slightly
  more broken than previously. but nothing serious should be worse!
2007-06-24 18:09:52 +00:00
dsl
a150e6e4f5 Use do_sys_recvmsg(), so_sys_accept(), do_sys_getsockname() and do_sys_senmsg()
in order to avoid the stackgap (etc).
Note that since changing the darwin socket address is simply a matter of
  translating the address family and adding sa_len, it can easily be done
  on the mbuf resident address before/after copying to/from userspace.
Simplify the convertion of AF_LOCAL addresses by usingthe user-supplied
  buffer length instead of dowing an unbounded strlen().
Untested - did this work before?
2007-06-24 18:07:34 +00:00
dsl
0bb6928543 Update to call do_sys_recv() instead of recvit(). 2007-06-24 18:01:48 +00:00
dsl
6d0a5fcf1a Simplify code to get/set 16bit group lists.
Cloned from ibcs2 copy (maybe I should have worked out somewhere to put this
as common code...)
2007-06-23 15:27:23 +00:00
dsl
a5b4569076 Read and write the ldt without using the stackgap. 2007-06-23 15:26:16 +00:00
dsl
e773713d08 Comment out support for FREEBSD_PT_READ_U and FREEBSD_PT_WRITE_U.
It all looks like a rather broken hack.
If nothing else it accesses userspace without copyin/out.
2007-06-23 15:24:26 +00:00
dsl
23ec3e8012 Use the functions in kern_auth.c for setting/getting group lists.
All we have to do here is copy the 16bit to 32bit group numbers across.
2007-06-23 09:11:12 +00:00
dsl
049a22a9db These now need sys/prot.h 2007-06-23 09:09:56 +00:00
dsl
4147586696 There is no need for the stackgap in sys_bind() and sys_connect().
If sa_len is zero, believing the size passed to bind/connect seems
better than trying to strlen somthing that might run off the mapped kma.
Verify the address family against the array size before indexing.
2007-06-17 21:30:11 +00:00
dsl
cf80941288 Kill that stackgap...
Use vn_stat() and dostatvfs() on the vnode the code always has got - even
though it used compat versions of the other syscalls.
2007-06-17 20:43:10 +00:00
dsl
95206f19b1 No need for stackgap for darwin_sys_sigaction and sigprocmask.
XXX: it doesn't look right that the new and old 'sigaction' parameters
have different types.
2007-06-17 20:15:19 +00:00
dsl
6111df536a Remove stackgap use:
osf1_sys_select() calls selcommon().
osf1_sys_readv() and writev() read the iov into kernel memory then call
  do_filereadv/writev().
KNF.
2007-06-17 19:50:01 +00:00
dsl
4f7a91fae3 Do the sysv ipc calls without the stackgap.
Only the SET and STAT operations have a buffer arg - so don't xlat
the buffer for the other commands.
2007-06-17 18:54:20 +00:00
dsl
c99470165c Do the sysv ipc calls without the stackgap.
Only the SET and STAT operations have a buffer arg - so don't xlat
onbe for teh other commands.
2007-06-17 18:32:14 +00:00
dsl
c271f319e5 Do the sysv ipc calls without the stackgap. 2007-06-17 18:17:46 +00:00
dsl
8ef23ff995 Directly call the relevant system support routines instead of going via
the compat_10 and compat_14 functions - makes the code neater and, removes
many data copies and also removes the stackgap use.
Also (indirectly) fixes some code paths that fotgot to do copyin/out.
2007-06-17 16:32:51 +00:00
dsl
353f1bdbac Call semctl1() directly, not via stackgap and compat_14_sys___semctl(). 2007-06-17 10:24:21 +00:00
dsl
82cfad02f8 Expose semid_ds14_to_native() to otherparts of the system.
Don't leak kernel stack back to userspace.
2007-06-17 10:23:27 +00:00
dsl
879c84a74d The code to directly call sigaction1() and sigaltstack1() is much shorter
than the mess required to call the compat_43_xxx functions.
2007-06-16 22:31:08 +00:00
dsl
ec918d6dc6 Modify the (recently added) compat_sigaltstack() #define to take the
values of the SS_ONSTACK and SS_DISABLE constants.
Use it to shorten the source files when this action is replicated.
Actually, given the monstrous complexity of sigaltstack1() there is
probably a much better way to do this...
2007-06-16 20:04:27 +00:00
dsl
5977ce1bd5 Remove a spare 'timeval' structure - makes this version of this function
match some of the other copies lurking in the world of compat.
2007-06-16 19:55:26 +00:00
dsl
8e418a4b13 Delete stuff in comment about use of stackgap. 2007-06-16 19:54:02 +00:00
christos
46502fd059 regen 2007-06-13 20:57:56 +00:00
christos
89e2b251a2 Get ready for NPTL but don't turn it on as of yet. 2007-06-13 20:57:33 +00:00
christos
344a5bd80c regen. 2007-06-13 14:31:30 +00:00
christos
76af51a354 Add futex. 2007-06-13 14:31:07 +00:00
christos
564f9b3b2f cleanup some bitrot; from Matthew Orgass 2007-06-13 02:11:40 +00:00
joerg
5ccf1c578a Add a new ioctl AUDIO_GETBUFINFO. It works like AUDIO_GETINFO, but
doesn't obtain the ports, gain and balance related parameters.
Those generally require reading from the hardware and therefore are much
more expensive to obtain. Modify OSS emulation to use the new ioctl
where possible.

This reduces CPU usage of mplayer during mp3 playback with my Thinkpad
from 20% to < 1% and from 50% to 20% during Xvid playback.

Review and comments from jmcneill@
2007-06-11 13:05:46 +00:00
ad
c741f88d56 Acquire proclist_mutex before sending signals. XXX irix emul needs a bit
of work.
2007-06-09 21:25:49 +00:00
rjs
ef2a6ab865 Wrap ktrace calls with #ifdef KTRACE. 2007-06-06 17:08:27 +00:00
dsl
3e4175ccc9 Fix select() without a timeout parameter. 2007-06-04 21:02:22 +00:00
dsl
938cde68e5 Add a #define that expands to the compat wrapper for sigaltstack1().
Use it for the netbsd32_compat_13.c version of the code.
2007-06-03 14:59:46 +00:00
dsl
671dc7790c sendmsg() shouldn't modify the 'msg' parameter, and recvmsg() doesn't have
to modify the 'iov' array - it isn't updated.
2007-06-03 11:30:59 +00:00
dsl
97d93705e5 Calling sigaltstack1() directly is so much easier than going via
compat_13_sys_sigaltstack().
2007-06-03 11:09:35 +00:00
dsl
ed63ffe787 Split netbsd32___semctl14() so that it is callable from
compat_10_netbsd32_sys_semsys() (where the one parameter is already in
kernel space).
Note that the code in compat_10_netbsd32_sys_semsys() has always been wrong,
since it called compat_14_sys___semctl() - which would read 64bit values!
2007-06-03 10:55:10 +00:00
dsl
7ba299c5d4 Split sys__lwp_park() so that the compat/netbsd32 code can copyin and convert
its timeout then call the standard function.
2007-06-03 09:50:12 +00:00
dsl
44250a9038 Add some 'magic' defines so that we can build the svr4_32 version of this
code from the same source file as the svr4 copy.
I suspect this cpuld be done in other places....
2007-06-02 21:39:27 +00:00
yamt
a15e4b5b1b wrap #include "opt_ktrace.h" by #ifdef _KERNEL_OPT. 2007-06-02 13:16:19 +00:00
dsl
3d0e15d3b2 Call selcommon() directly instead of using the stackgap... 2007-06-02 11:51:42 +00:00
dsl
e12ac31b52 Remove an unsed call to stackgap_init() 2007-06-02 10:09:05 +00:00
enami
0c8f6382c6 Reduce difference between compat_ifconf() and ifconf():
- exit on error rather than proceeding to next interface.
- make code simpler.
2007-06-02 01:29:25 +00:00
dsl
d7f93c5c67 Split sys_bind() and sys_connect() so that compat code can use common code
once the 'address' has been copied into an mbuf.
Add extra flags for 'struct msghdr.msg_flags' to indicate that the address
  and control are already in mbufs, and that the uio structure is in userspace
  for sending data, rename sendit() to do_sys_sendmsg() to ensure no old code
  passes in random flags.
Changes to compat code to use new functions - removing some stackgap use.
Fix a 'use after free' in compat_43_sys_recvmsg.
I ***THINK*** the code that converts 'cmsg' formatted data is borked!
svr4_stream.c ought to be generated from svr4_32_stream.c during the build.
2007-06-01 22:53:52 +00:00
dsl
d95fed7315 (Ab)use a KTR_USER trace entry for the linux socket command and arguments. 2007-06-01 22:42:47 +00:00
dsl
79b4d16759 KNF and layout changes to match (my copy of) svr4/svr4_stream.c 2007-06-01 22:15:38 +00:00
he
8f77cc1c43 Fallout from the interface ioctl changes:
OSIOCGIFADDR -> OOSIOCGIFADDR
OSIOCGIFDSTADDR -> OOSIOCGIFDSTADDR
OSIOCGIFNETMASK -> OOSIOCGIFNETMASK

Also, one instance of needing to include <net/if.h> before
<compat/sys/sockio.h> due to use of IFNAMSIZ in the latter.

Discussed with christos.
2007-06-01 11:36:35 +00:00
hannken
b110563f3a Fallout from last commit:
OSIOCGIFADDR -> OOSIOCGIFADDR
OSIOCGIFDSTADDR -> OOSIOCGIFDSTADDR
OSIOCGIFNETMASK -> OOSIOCGIFNETMASK

Sparc64 compiles again.
2007-06-01 10:21:22 +00:00
christos
ab89ea8ca6 message size == 0 is valid. From Markus Mayer 2007-05-31 23:34:42 +00:00
christos
d81aadc176 Move the nasty ifdefs in one place. Requested by ad and dyoung. 2007-05-30 21:02:02 +00:00
xtraeme
e09d1dbb48 Fix for SIOGIFCAP provided by christos, test successful. 2007-05-30 17:03:30 +00:00
christos
9bf57b1f3a make this compile again
XXX: The ioctls will need to be fixed.
2007-05-30 00:00:59 +00:00
christos
d5dcfde7aa wrap the whole function in COMPAT_40 2007-05-29 23:57:33 +00:00
christos
20bfd9898e Add a sockaddr_storage member to "struct ifreq" maintaining backwards
compatibility with the older ioctls. This avoids stack smashing and
abuse of "struct sockaddr" when ioctls placed "struct sockaddr_foo's" that
were longer than "struct sockaddr".
XXX: Some of the emulations might be broken; I tried to add code for
them but I did not test them.
2007-05-29 21:32:27 +00:00
njoly
f70cd37804 Fix restart of interrupted system calls.
- Make linux_sys_rt_sigreturn() return EJUSTRETURN on success.
- Add missing rax to linux_sigcontext structure; and save/restore
  its value like other members in linux_sendsig()/linux_sys_rt_sigreturn().

With valuable help from manu.
2007-05-24 11:21:52 +00:00
cube
03744d91f8 Rename si_sigval -> si_value to match POSIX RTS. [hi christos!] 2007-05-22 03:51:54 +00:00
christos
c61eed39a8 rename si_sigval -> si_value to match POSIX RTS. 2007-05-21 15:35:47 +00:00