Commit Graph

104 Commits

Author SHA1 Message Date
njoly
99688b74d2 Add clock_nanosleep syscall. 2008-12-12 23:36:18 +00:00
njoly
bd398db254 Remove unused timeval_to_clock_t function, superseeded by CONVTCK
macro.
2008-12-08 11:52:35 +00:00
njoly
e7377ec502 Cleanup; kill netbsd32_caddr_t use. 2008-12-06 23:14:03 +00:00
njoly
9321a67e19 Small setres{uid,gid} cleanup; there is no need to use a specific
handling for -1 uid values.
2008-12-06 23:01:32 +00:00
njoly
533a52241a Add getres{uid,gid} syscalls. 2008-12-05 23:30:19 +00:00
ad
dc5f414733 PR port-amd64/40091 compat_linux32 module loading = panic due to missing syms 2008-12-03 12:51:11 +00:00
njoly
aba771042c Add sched_get_priority_{min,max} syscalls. 2008-12-01 14:18:44 +00:00
ad
92ce8c6a3d Make the emulations, exec formats, coredump, NFS, and the NFS server
into modules. By and large this commit:

- shuffles header files and ifdefs
- splits code out where necessary to be modular
- adds module glue for each of the components
- adds/replaces hooks for things that can be installed at runtime
2008-11-19 18:35:57 +00:00
njoly
cf19223289 Fix nanosleep(2) on 64-bit archs. Do not call native nanosleep
syscall, but rather a modified version the will take care of `struct
timespec' conversions.
2008-11-12 18:07:40 +00:00
njoly
1eff3fc2c0 Add missing sys/syscall.h include for SYS_ptrace definition. 2008-11-12 15:22:18 +00:00
ad
0efea177e3 Remove LKMs and switch to the module framework, pass 1.
Proposed on tech-kern@.
2008-11-12 12:35:50 +00:00
wrstuden
fc7511b00e Merge wrstuden-revivesa into HEAD. 2008-10-15 06:51:17 +00:00
njoly
1b1270d3b5 Compat linux/linux32 nice(2) fix. The syscall argument is an increment
to be added to the current nice value, not an absolute value to be
set.
2008-10-03 22:39:36 +00:00
njoly
2fedf4a0fb Kill a few linux32 syscalls identical to netbsd32 ones.
No functional changes expected.
2008-09-22 13:07:46 +00:00
scw
5a856ae120 In linux32_shmat() don't try to copyout a 64-bit pointer where userspace
is expecting a 32-bit result.

Fixes nspluginwrapper on amd64.
2008-09-17 20:11:51 +00:00
christos
96bd7a0192 make this compile again. 2008-09-08 15:31:19 +00:00
christos
ae6357afe4 fix broken linux32_sys_times, copied from linux_sys_times. 2008-09-08 11:29:42 +00:00
tron
0f256b9d59 Compile NetBSD/amd64 kernels with "-Wextra". Patches contributed by
Juan RP in PR port-amd64/39266.
2008-09-05 13:37:24 +00:00
njoly
46da4ade28 Make linux32 getdents(2) do its own job instead of calling the
corresponding compat linux function, where struct dirent members types
differs.
2008-09-04 17:45:00 +00:00
njoly
efde75ae99 Add rt_sigpending syscall. 2008-07-24 12:09:56 +00:00
njoly
066b9aabb5 Add linux32_getifconf, following recent linux_getifconf addition. 2008-07-23 12:32:09 +00:00
matthias
1797e3b14b make LINUX_TCSBRK work. The code is mostly copied from
sys/compat/ibcs2/ibcs2_ioctl.c.
2008-07-04 11:06:31 +00:00
njoly
9084eed1a8 Add SIOCGIFHWADDR support.
Tested by Cem Kayali.
2008-06-27 12:38:25 +00:00
njoly
0fe964b56f Fix SIOCGIFCONF ioctl under compat linux32. 2008-06-24 09:00:04 +00:00
christos
d83ff0cd7b an attempt at linux32_ioctl_socket(). 2008-06-19 16:09:25 +00:00
njoly
9cbea9441c linux32_sys_ptrace() fixes.
- Add opt_ptrace.h include to activate syscall.
- Convert to use sys_ptrace() instead of netbsd32_ptrace().
- Do not use arch specific call for now.
2008-06-18 22:58:21 +00:00
christos
5f09cf30c9 an attempt at ptrace32 2008-06-16 19:57:43 +00:00
njoly
84db622836 Add compat linux32 ipc(2) syscall support, for shared memory and
semaphores.
2008-05-20 17:31:56 +00:00
martin
ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
njoly
659effb31a Remove a duplicate mutex_enter call in linux32_e_proc_init().
Fix a kernel panic for processes created with FORK_SHAREVM.
2008-04-26 22:55:10 +00:00
ad
284c2b9aef Merge proc::p_mutex and proc::p_smutex into a single adaptive mutex, since
we no longer need to guard against access from hardware interrupt handlers.

Additionally, if cloning a process with CLONE_SIGHAND, arrange to have the
child process share the parent's lock so that signal state may be kept in
sync. Partially addresses PR kern/37437.
2008-04-24 18:39:20 +00:00
ad
6d70f903e6 Network protocol interrupts can now block on locks, so merge the globals
proclist_mutex and proclist_lock into a single adaptive mutex (proc_lock).
Implications:

- Inspecting process state requires thread context, so signals can no longer
  be sent from a hardware interrupt handler. Signal activity must be
  deferred to a soft interrupt or kthread.

- As the proc state locking is simplified, it's now safe to take exit()
  and wait() out from under kernel_lock.

- The system spends less time at IPL_SCHED, and there is less lock activity.
2008-04-24 15:35:27 +00:00
ad
6bf00a454d Catch up with linux. 2008-04-23 13:30:41 +00:00
njoly
c007e33a3a Add compat linux32 sys_clock_{getres,gettime,settime} syscalls. 2008-04-17 17:47:23 +00:00
njoly
a73122f64e Make linux32_sys_nice call sys_setpriority directly instead of
netbsd32_setpriority.
2008-04-15 21:13:34 +00:00
ad
be04ac4896 Make rusage collection per-LWP and collate in the appropriate places.
cloned threads need a little bit more work but the locking needs to
be fixed first.
2008-03-27 19:06:51 +00:00
njoly
2467d28cba Be sure to not include linux_mmap.h before linux_syscallargs.h.
Otherwise wrong syscallarg macro may used for linux_sys_mmap_args
definition.
This makes mmap2 works again (at least to launch oo2 binary).
2008-03-27 14:14:06 +00:00
bjs
3b2cc68264 fdputfile -> fd_putfile 2008-03-22 01:24:23 +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
njoly
fc9f8f74de pread/pwrite fixes: use SCARG_P32 to access pointers, and update
syscalls definitions.
2008-02-17 21:49:17 +00:00
dsl
174ee4c867 Use the same function to implement linux32_sys_fcntl() and linux_sys_fcntl64().
A rather excessive amount of 'appending 64' to names seems to have happened
when linux won support for files > 4G.
technically the linux32_sys_fcntl() function should error the 64bit file
locking requests - but life is too short.
2008-02-04 22:23:43 +00:00
dsl
543ce18e89 Impletemt pread() and pwrite(). 2008-02-02 22:57:05 +00:00
dsl
22774d7c0d Fix the linux32 emulations of fcntl() locking.
The 64bit linux emulation versions can't be used because the lock structure
alignment and field sizes all differ.
Since there need to be 4 different versions of the linux struct flock, and
amd64 kernel needs 3 of them compiled in, rather than replicating the same
code block twice more, move the body of the code into a few #defines
that can be expanded with the correct types in the linux[32]_sys_fcntl[64]()
functions.
Should fix problems running progams like skype running under linux32
emulation on amd64.
2008-02-02 21:54:01 +00:00
jmcneill
c0e43ab0d6 Add ossaudio support for COMPAT_LINUX32, with help from mrg. With this
change, audio now works on amd64 with native firefox, nspluginwrapper, and
the 32-bit linux flash binaries.
2008-01-22 01:05:05 +00:00
njoly
5cec0f492f compat linux (and linux32) uid16 functions cleanup and fixes.
- Move uid16 functions to their own file linux_uid16.c, included by
  needed archs (arm, i386 and m68k).
- Add new MI types linux_{u,g}id16_t.
- Add macros to handle linux_uid16_t and uid_t conversions.
- Add linux_sys_getres{uid,gid}16 syscalls, to fix an overflow with
  bad sizes given to copyout when linux_sys_getres{uid,gid} are used.
- Update arm syscall table to use more uid16 functions.
2008-01-15 22:38:34 +00:00
ad
77e0b2120f Patch up sysctl locking:
- Lock processes, credentials, filehead etc correctly.
- Acquire a read hold on sysctl_treelock if only doing a query.
- Don't wire down the output buffer. It doesn't work correctly and the code
  regularly does long term sleeps with it held - it's not worth it.
- Don't hold locks other than sysctl_lock while doing copyout().
- Drop sysctl_lock while doing copyout / allocating memory in a few places.
- Don't take kernel_lock for sysctl.
- Fix a number of bugs spotted along the way
2008-01-07 16:12:52 +00:00
njoly
3a6c84afbc Add readdir syscall. 2007-12-26 13:50:48 +00:00
njoly
1fe07a25dd Add old_uname syscall. 2007-12-24 15:56:20 +00:00
njoly
035a2e040b - Fix setfsuid to return uid on success.
- Replace getfsuid, which never existed on Linux, by correct setfsgid
  syscall.

ok by christos and dsl.
2007-12-21 22:26:20 +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