Commit Graph

255 Commits

Author SHA1 Message Date
alnsn
466d6e1aa9 Regenerate files to pick up correct RCS Ids. Suggested by Chris Badura. 2011-05-30 21:37:37 +00:00
alnsn
dab2e0b58e Add fadvise64 and fadvise64_64 syscalls to compat_linux and compat_linux32. 2011-05-30 17:50:31 +00:00
christos
632362bdbb implement pipe2 and dup3 2011-04-10 15:48:23 +00:00
christos
53dcc5263b Regen: XXX: produces errors because of rump changes! 2011-04-10 15:48:01 +00:00
christos
bd81400360 add pipe2 and dup3 2011-04-10 15:47:21 +00:00
joerg
48717cfc00 Refactor ps_strings access. Based on PK_32, write either the normal
version or the 32bit compat layout in execve1. Introduce a new function
copyin_psstrings for reading it back from userland and converting it to
the native layout. Refactor procfs to share most of the code with the
kern.proc_args sysctl handler.

This material is based upon work partially supported by
The NetBSD Foundation under a contract with Joerg Sonnenberger.
2011-03-04 22:25:24 +00:00
chs
1bb795ff6c move macros for validating fs/gs to segments.h and use them
in the linux32 code as well.
2011-02-07 03:54:45 +00:00
chs
6842940109 personality() now interprets its parameter as having
the base personality type in the low byte and
various flags in the upper bytes.  for now just mask off
the flags to make sure the base type is one we accept.
store the current personality in the emuldata so that
we can return the expected value for PER_QUERY.
2010-11-02 18:18:07 +00:00
chs
45bce0e50a regen 2010-11-02 18:15:39 +00:00
chs
fc7a196102 implement the following syscalls for linux32:
truncate64
  ftruncate64
  profil
  ioperm
  iopl
  setdomainname
  modify_ldt
  statfs64
  fstatfs64

note that iopl(), ioperm() and modify_ldt() just call
the respective 64-bit handlers, which don't do anything yet.
2010-11-02 18:14:05 +00:00
chs
e0ef945cee recent versions of linux (which we now claim to be) supply a BSD-style
d_type value in getdents() results, after the d_name field.
make our emulation do the same.  fixes part of PR 43695.
2010-09-11 20:53:04 +00:00
chs
590b90699b always supply an auxiliary vector for linux ELF processes.
static executables (such as newer versions of /sbin/ldconfig)
require this to work properly.  since static executables
also don't have a PT_PHDR entry, use the same heuristic as
linux does to provide a value for AT_PHDR in this case.
2010-09-11 20:49:28 +00:00
njoly
328f6885dc Add CLOCK_MONOTONIC support for compat linux/linux32
clock_nanosleep(2).
2010-07-12 12:01:53 +00:00
christos
e86c125420 fix debugging build. 2010-07-12 02:55:17 +00:00
jmmv
6f19690766 Add missing includes to bring the linux_semun type needed by
linux_syscallargs.h.
2010-07-07 12:43:18 +00:00
chs
d916122e7d regen 2010-07-07 01:31:51 +00:00
chs
33fa5ccbbf many changes for COMPAT_LINUX:
- update the linux syscall table for each platform.
 - support new-style (NPTL) linux pthreads on all platforms.
   clone() with CLONE_THREAD uses 1 process with many LWPs
   instead of separate processes.
 - move the contents of sys__lwp_setprivate() into a new
   lwp_setprivate() and use that everywhere.
 - update linux_release[] and linux32_release[] to "2.6.18".
 - adjust placement of emul fork/exec/exit hooks as needed
   and adjust other emul code to match.
 - convert all struct emul definitions to use named initializers.
 - change the pid allocator to allow multiple pids to refer to the same proc.
 - remove a few fields from struct proc that are no longer needed.
 - disable the non-functional "vdso" code in linux32/amd64,
   glibc works fine without it.
 - fix a race in the futex code where we could miss a wakeup after
   a requeue operation.
 - redo futex locking to be a little more efficient.
2010-07-07 01:30:32 +00:00
hannken
1423e65b26 Clean up vnode lock operations pass 2:
VOP_UNLOCK(vp, flags) -> VOP_UNLOCK(vp): Remove the unneeded flags argument.

Welcome to 5.99.32.

Discussed on tech-kern.
2010-06-24 12:58:48 +00:00
dholland
1e593d6111 Fix build without sysvipc configured, from Wolfgang Stukenbrock in PR 43376,
adjusted for current.
2010-05-29 18:55:34 +00:00
jym
bc0420413d This patch fixes the NX regression issue observed on amd64 kernels, where
per-page execution right was disabled (therefore leading to the inability
of the kernel to detect fraudulent use of memory mappings marked as not
being executable).

- replace cpu_feature and ci_feature_flags variables by cpu_feature and
ci_feat_val arrays. This makes it cleaner and brings kernel code closer
to the design of cpuctl(8). A warning will be raised for each CPU that
does not expose the same features as the Boot Processor (BP).

- the blacklist of CPU features is now a macro defined in the
specialreg.h header, instead of hardcoding it inside MD initialization
code; fix comments.

- replace checks against CPUID_TSC with the cpu_hascounter() function.

- clean up the code in init_x86_64(), as cpu_feature variables are set
inside cpu_probe().

- use cpu_init_msrs() for i386. It will be eventually used later for NX
feature under i386 PAE kernels.

- remove code that checks for CPUID_NOX in amd64 mptramp.S, this is already
performed by cpu_hatch() through cpu_init_msrs().

- remove cpu_signature and feature_flags members from struct mpbios_proc
(they were never used).

This patch was tested with i386 MONOLITHIC, XEN3PAE_DOM0 and XEN3_DOM0 under
a native i386 host, and amd64 GENERIC, XEN3_DOM0 via QEMU virtual machines.

XXX Should kernel rev be bumped?

XXX A similar patch should be pulled-up for NetBSD-5, hopefully tomorrow.
2010-04-18 23:47:50 +00:00
njoly
e05f3d58b2 Do not use 0 for pointers, but NULL. 2010-04-08 15:59:37 +00:00
njoly
4f2ea8f3c9 Add a new clock_gettime1() function that holds most of the
clock_gettime syscall code (except for the copyout). Adjust all
corresponding syscalls to make use of it.
2010-04-08 11:51:13 +00:00
njoly
0876f873dd Move most clock_getres syscall code, except for coypout call, to a new
clock_getres1() function which can be used by emulations. Adjust all
clock_getres syscalls to now make of use it.
2010-04-03 17:20:05 +00:00
njoly
6d63d66929 Convert linux/linux32/netbsd32 clock_settime syscalls, to use the
common clock_settime1() function.
2010-03-29 15:34:07 +00:00
he
7a30544200 When implementing "read directory", when there are too many empty entries
in a row, and we need to try to read the next block, and have passed a
non-NULL cookie pointer to VOP_READDIR, ensure that we free the cookie
buffer before re-doing VOP_READDIR, so that we don't leak memory.
This fix is similar to nfs_serv.c revisions 1.115 + 1.124.

This should fix the long-standing problem observed by e.g. using Linux-
emulated programs to take backup of servers, which is one of the problems
which were reported in PR#42661.

Thanks to pooka@ for the hints for traversing the VOP* layer.
2010-03-03 08:20:38 +00:00
mbalmer
93f06d875c Remove extra semicolon. 2010-01-05 13:22:40 +00:00
njoly
9e96206789 Add missing semicolons after NETBSD32TOx_UAP macro calls. 2009-12-12 10:30:09 +00:00
njoly
5e38c900e9 Add SIOCGIFMTU support. 2009-12-10 17:07:26 +00:00
njoly
ed22c0665f Do not give native requests to netbsd32_ioctl(), use the compat
netbsd32 equivalent instead.
2009-12-10 16:55:17 +00:00
matt
6a9e4e8eeb Change u_long to vaddr_t/vsize_t in exec code where appropriate (mostly
involves setregs and vmcmds).  Should result in no code differences.
2009-12-10 14:13:48 +00:00
njoly
4898628cc1 Regen for personality(2) update. 2009-11-24 10:44:41 +00:00
njoly
675b20da1b Update personality(2) to match Linux definition where the argument is an
unsigned long.
2009-11-24 10:42:43 +00:00
rmind
eaddd78061 Use lwp_getpcb() in compat code, clean from struct user. 2009-11-23 00:46:06 +00:00
njoly
6afff4b463 Make linux32_msqid_ds l_msg_[src]time members use the right type,
linux32_time_t.
2009-11-20 11:54:08 +00:00
njoly
87483a8bda Make compat linux/linux32 msgrcv_msgarg type member of type
long/netbsd32_long to match linux definition.
2009-11-18 15:19:24 +00:00
njoly
bde1dd1459 Make linux32 msgsnd/msgrcv use the netbsd32 syscalls instead of native
ones, to ensure that msgbuf mtype member will be of the right type.
2009-11-18 12:27:58 +00:00
njoly
f08f03b58d Kill noisy debug printf. 2009-11-18 12:01:25 +00:00
joerg
5685d06220 Follow up commit to fix breakage that somehow passed by the compiler. 2009-11-16 13:32:40 +00:00
joerg
cbdff4a667 Add SYSVMSG support for linux32. 2009-11-16 08:49:32 +00:00
joerg
e7123f329a Return the result of copyout. Reminded by Niolas Joly. 2009-11-13 22:39:35 +00:00
joerg
8277e92195 Provide SIOCGIFNAME. 2009-11-13 21:45:03 +00:00
rmind
1283950019 - selcommon/pollcommon: drop redundant l argument.
- Use cached curlwp->l_fd, instead of p->p_fd.
- Inline selscan/pollscan.
2009-11-11 09:48:50 +00:00
rmind
4c1098f541 do_sys_wait(): fix previous by checking for ru != NULL. Noticed by
Onno van der Linden.  Also, remove redundant arguments (seems that
was_zombie was not used since rev 1.177 ?).
2009-11-04 21:23:02 +00:00
rmind
554a0142dc Initialise struct emul members by name (it is readable now and one can search
them in the tree).
2009-10-25 01:14:03 +00:00
christos
fc0d883cc1 add the video ioctls so that the 32 bit skype works with video
more commits to come
2009-08-18 02:02:58 +00:00
njoly
3d5d2c8f61 Make compat linux/linux32 getdents(2) fail with ENOTDIR instead of
EINVAL when file descriptor does not refer to a directory.
2009-07-22 15:49:29 +00:00
njoly
7d645a3ea4 Kill unreachable return statement. 2009-07-21 18:50:43 +00:00
njoly
add168f4d8 Fix defines against multiple inclusion protection (s/I386/AMD64). 2009-06-08 14:42:10 +00:00
njoly
e1a778e452 Regen for rt_queueinfo addition. 2009-06-08 13:41:17 +00:00
njoly
9c8407cd8f Add rt_queueinfo(2) support. 2009-06-08 13:34:23 +00:00