Commit Graph

4759 Commits

Author SHA1 Message Date
pooka 4ded7232b9 Put async i/o compat routines in a separate source module from the
ones related to clock and process management.
2011-01-17 15:57:04 +00:00
njoly fd24721ce5 In stat structure conversions, do set st_birthtimespec member values
if exists.
2011-01-16 23:21:16 +00:00
rmind 7146b2f61d Retire struct user, remove sys/user.h inclusions. Note sys/user.h header
as obsolete.  Remove USER_TO_UAREA/UAREA_TO_USER macros.

Various #include fixes and review by matt@.
2011-01-14 02:06:22 +00:00
pgoyette f54a432784 Fix the build breakage, at least on amd64 2011-01-04 20:23:40 +00:00
matt b99d2248b0 Need to deal with msg_iov in netbsd32_to_msghdr. 2011-01-04 11:00:31 +00:00
matt 701acb9073 Make the SA support as optional as is possible. 2011-01-04 10:59:28 +00:00
dholland 14402d0ff1 Abolish the SAVENAME and HASBUF flags. There is now always a buffer,
so the path in a struct componentname is now always valid during VOP
calls.
2010-11-30 10:43:01 +00:00
dholland d4eb05390d Abolish struct componentname's cn_pnbuf. Use the path buffer in the
pathbuf object passed to namei as work space instead. (For now a pnbuf
pointer appears in struct nameidata, to support certain unclean things
that haven't been fixed yet, but it will be going away in the future.)

This removes the need for the SAVENAME and HASBUF namei flags.
2010-11-30 10:29:57 +00:00
dholland 8f6ed30d57 Introduce struct pathbuf. This is an abstraction to hold a pathname
and the metadata required to interpret it. Callers of namei must now
create a pathbuf and pass it to NDINIT (instead of a string and a
uio_seg), then destroy the pathbuf after the namei session is
complete.

Update all namei call sites accordingly. Add a pathbuf(9) man page and
update namei(9).

The pathbuf interface also now appears in a couple of related
additional places that were passing string/uio_seg pairs that were
later fed into NDINIT. Update other call sites accordingly.
2010-11-19 06:44:33 +00:00
uebayasi 01fb76730e Include sys/ioccom.h directly because it's used. 2010-11-14 15:36:47 +00:00
pooka 6e72867f8d If someone wants to define COMPAT_OIFDATA / COMPAT_OIFREQ outside
of config, let them.
2010-11-07 19:45:06 +00:00
christos 988094ed68 can't map the old and the new SIO calls the way we did before because the
numbers have changed. Instead provide a switch. Keep the old code there,
to handle cases we did not handle in the first switch, but this is a hack
and should be removed.
2010-11-06 17:20:07 +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 3c3115da20 update linux_sys_socket() to understand the flags that are now
included in the "type" parameter.  in linux_sys_sendmsg(),
if we see an SCM_CREDENTIALS control message, just drop it
instead of giving an error.  the linux and native versions of
the cred-passing operation are very different and some apps
(eg. linux pulseaudio library talking to a native server)
will work without the control data.
2010-11-02 18:02:59 +00:00
chs 069ef5a4d0 define LINUX_O_CLOEXEC.
sort definitions by value.
consistently use hex instead of octal for the values.
2010-11-02 18:01:25 +00:00
tsutsui afeacd3b7c compat_aoutm68k doesn't require alternative emul path lookup. 2010-10-15 16:51:09 +00:00
njoly 6795d62e0d Add support for envsys(4) version 2 ioctls. 2010-09-24 13:12:53 +00:00
chs 38b9dc3505 implement O_DIRECTORY as standardized in POSIX-2008,
for both native and linux emulations.
this fixes the rest of PR 43695.
2010-09-21 19:26:18 +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
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
jym da702eb93d Add PAE to ALL kernel, so that most paddr_t format string errors get caught
during compilation.

While here, fix the compilation for ALL.
2010-07-26 22:33:23 +00:00
jym c0cbdbdca3 Add reference to mach_syscallnames. Spotted by compiling ALL. 2010-07-25 11:25:57 +00:00
christos 14feab4408 document more unimplemented syscalls 2010-07-23 02:46:12 +00:00
christos a03437fae7 Add more debugging printfs 2010-07-22 03:19:02 +00:00
christos 7ec5588a25 fix wrong preprocessor symbol. 2010-07-22 03:18:30 +00:00
pooka c99c5d9840 Don't leak kernel stack into userspace. 2010-07-13 15:38:15 +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
rmind 3c507045e2 Remove pfind() and pgfind(), fix locking in various broken uses of these.
Rename real routines to proc_find() and pgrp_find(), remove PFIND_* flags
and have consistent behaviour.  Provide proc_find_raw() for special cases.
Fix memory leak in sysctl_proc_corename().

COMPAT_LINUX: rework ptrace() locking, minimise differences between
different versions per-arch.

Note: while this change adds some formal cosmetics for COMPAT_DARWIN and
COMPAT_IRIX - locking there is utterly broken (for ages).

Fixes PR/43176.
2010-07-01 02:38:26 +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
yamt d5dec378f9 increment p_nrlwps in lwp_create rather than letting callers do so
as it's always decremented by lwp_exit.  this fixes error recovery of
eg. aio_procinit.
2010-06-13 04:13:31 +00:00
yamt 136da85472 remove an unnecessary check of PK_MARKER 2010-06-13 04:08:49 +00:00
drochner 690a7f09c9 -fix internal use of sigwaitinfo(2) by sigwait(3): The former returns
the signal number now, as required by POSIX. The latter should just
 return 0 on success. Fixes a mysql problem reported by Kurt Schreiner.
-document the new behavior of sigwaitinfo and sigtimedwait
-retain non-POSIX behavior for NetBSD-5 binary compatibility -- the fix
 would likely not be polled into the .0-branches, and having 5.0.x and
 5.x behave differently would be confusing. Besides that, it was
 documented in the manpage all the time.
2010-05-30 19:31:39 +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
dholland 54f6c52ba9 Remove the nameidata from struct exec_package. It was used only for two
things: passing an argument to check_exec, which is better done explicitly,
and handing back the resolved pathname generated by namei, which we can
make an explicit slot for in struct exec_package instead. While here,
perform some related tidyup, and store the kernel-side copy of the path
to the executable as well as the pointer into userspace. (But the latter
should probably be removed in the future.)
2010-05-02 05:30:20 +00:00
dyoung 30b2d68d20 On x86, change the bus_space_tag_t to a pointer to a struct
bus_space_tag.  For now, bus_space_tag's only member is
bst_type, the type of space, which is either X86_BUS_SPACE_IO
or X86_BUS_SPACE_MEM.  In the future, new bus_space_tag members
will refer to override-functions installed by a new function,
bus_space_tag_create(9).

Add pointers to constant struct bus_space_tag, x86_bus_space_io and
x86_bus_space_mem.  Use them to replace most uses of X86_BUS_SPACE_IO
and X86_BUS_SPACE_MEM.

Add an x86-specific bus_space_is_equal(9) implementation that compares
the two tags' bst_type.
2010-04-28 19:17:03 +00:00
joerg 9c5268bcde Fix compilation. 2010-04-23 23:05:40 +00:00
joerg f5b7f56dbd Use struct segment_descriptor for pcb_fsd and pcb_gsd instead of int[2]. 2010-04-23 16:07:33 +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
chs e59be4800f regen 2010-04-23 03:03:03 +00:00
chs 822c314290 add missing argument to clone(). the symptom of this was that pthread_join()
would sometimes get stuck, such as in our "mutex2" regression test.
2010-04-23 03:02:16 +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