Commit Graph

3937 Commits

Author SHA1 Message Date
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
yamt f03010953f merge yamt-idlelwp branch. asked by core@. some ports still needs work.
from doc/BRANCHES:

	idle lwp, and some changes depending on it.

	1. separate context switching and thread scheduling.
	   (cf. gmcgarry_ctxsw)
	2. implement idle lwp.
	3. clean up related MD/MI interfaces.
	4. make scheduler(s) modular.
2007-05-17 14:51:11 +00:00
dsl a163d15464 This is deja vu - I fixed this earlier....
No need to use stackgap for ioctl to get PTM name, directly call file's
ioctl function with kernel buffer.
2007-05-13 16:04:00 +00:00
dsl 10b01b226a There is no need to copy data out to userspace when its address is being
passed to the driver as the ioctl 'data' argument.
Change boths parts to expect a kernel memory buffer.
2007-05-13 15:57:39 +00:00
dsl 06b3498b98 Fix compilation 2007-05-13 15:56:17 +00:00
dsl dc41e5b5bd Change the way the irix 32bit signal mask request is done to avoid the
stackgap.  I'm actually susre this code is buggy, possibly slightly less
so than before.
2007-05-13 15:39:29 +00:00
dsl 959f589c73 This code is already set for directly calling a files ioctl fn with a
kernel buffer - so why not use it when getting the slave pty number.
2007-05-13 15:38:14 +00:00
dsl 9e2165cbd3 Time functions have had wrappers for ~ages, no need for the stackgap gere. 2007-05-13 14:47:54 +00:00
dsl b8cecbd5b3 Delete fom stackgap lines that seem to have got left in. 2007-05-13 11:06:41 +00:00
dsl 2cc0d0a9c4 Stop using the stackgap for time functions. 2007-05-13 11:04:11 +00:00
dsl 9a585a457d Stop using the stackgap for timer functions, fcntl locks and FIONREAD ioctl.
Add code for X_LK_RLCK - seemed to be absent!
2007-05-13 11:03:06 +00:00
dsl d4540f5b2a Call sigaltstack1() directly instead of using the stackgap to call
sys___sigaltstack14().
Prototype up some code under #if 0 to use sigaction1().
2007-05-13 09:07:25 +00:00
dsl 0a4e8a3014 Remove the stackgap from some more flockking code.
Note that I've removed the bug where this code 'forgot' to use copyin/out
for the stackgap buffers.
2007-05-13 08:38:34 +00:00
dsl e3b7b0151e Rework the svr4_32 fcntl support (again).
Make the same changes to the svr4 code.
Add some 'missing' simple_unlock(&fp->f_slock) to the svr4_32 version of this
code. These files now compare if feed the svr4_32 copy though:
	sed -e 's/4_32/4/g;s/_P32//g'
Note in passing that the code paths that call simple_unlock(&fp->f_slock)
are completely broken.
2007-05-13 08:14:06 +00:00
dsl 701496b5c6 Split the fcntl locking code out from its copyin/out.
Use to avoid all the stackgap stuff in compat code.
2007-05-12 23:02:49 +00:00
dsl 8beba9d093 There is no need to use the stackgap for get/setrlimit. 2007-05-12 21:07:02 +00:00
dsl ef3fdc4a07 Change interface to settimeofday1() so that it can also be used from
compat code in order to avoid the stackgap.
2007-05-12 20:27:13 +00:00
dsl dd490a6f18 Get rusage directly, not via 64bit linux call and stackgap. 2007-05-12 20:24:54 +00:00
dsl a08b772cae Fix comment and indent. 2007-05-12 20:23:36 +00:00
dsl c0ac33ed01 Remember to call calcru() before using the rusage values. 2007-05-12 18:10:20 +00:00
dsl c83f8a10ad Change the compat sys_[fl]utime code to not use the stackgap. 2007-05-12 17:28:19 +00:00
dsl 76bef02b3a Remove some more uses of the 'stackgap' - the code is a lot simpler if
we just access stuff like l->l_proc->p_stats->p_ru instead of copying it
to and from userspace.
2007-05-12 14:09:34 +00:00
rumble 18ae6034fe Make this compile again (untested). 2007-05-11 02:25:34 +00:00