Commit Graph

4875 Commits

Author SHA1 Message Date
matt e2862cc1f2 Deal with mips trapframe changes. 2011-02-20 08:08:57 +00:00
matt 91200c4c26 Don't bother the iov in netbsd32_to_msghdr since it needs to handled specially. 2011-02-20 08:07:09 +00:00
rmind 9b6bd2d968 Remove clause 3 (UCB advertising clause) from the University of Utah
copyright.  Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
2011-02-08 20:20:06 +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
yamt 37bfe1821b netbsd32__lwp_create: add a comment and CTASSERT. 2011-02-05 13:46:44 +00:00
joerg 13011308e4 Explicitly initialize ucontext before calling getmcontext. 2011-02-03 21:45:31 +00:00
chuck afca0358a6 udpate license clauses on my code to match the new-style BSD licenses.
verified with Mike Hibler it is ok to remove clause 3 on utah copyright,
as per UCB.
based on diff that rmind@ sent me.

no functional change with this commit.
2011-02-02 20:07:25 +00:00
matt 4d5d6d9aa5 Add a new AF/PF_ROUTE which is 64-bit clean which makes the routing socket
interface (and its associated sysctls) act identically for both 32 and 64 bit
programs.  The old unclean one remains for backward compatibility.
2011-02-01 01:39:19 +00:00
matt 0f0d22769a Define 32bit version of SIOC[GS]IFADDRPREF32. We wouldn't need this to
if i386 actually aligned a uint64_t on a 64bit boundary but it doesn't.
So all that work in sockaddr_storage goes for naught.
2011-02-01 00:53:22 +00:00
matt 8e5809d382 Add the ability to mount NFS filesystems in COMPAT_NETBSD32
If in the kernel and NFS_ARGS_ONLY, just export struct nfs_args and its flags.
2011-01-22 22:26:10 +00:00
matt fc2c6c78f2 Fix c&p error. 2011-01-22 20:51:21 +00:00
tron e0e90b2355 Fix build of ndiscvt(8). Not sure what broke it in the first place. 2011-01-22 12:06:51 +00:00
he 68cb75d86c save_fpu_lwp() was renamed to fpu_save_lwp(), so follow suit. 2011-01-20 11:59:24 +00:00
tsutsui dcd10dc42d Remove includes <sys/mount.h> and <sys/sched.h> added for <sys/syscallargs.h>.
Now they are handled by $sysarghdrextra in sys/kern/syscalls.conf.
2011-01-19 10:21:16 +00:00
matt ad396e28d0 Make struct disklabel 8 byte aligned. This increases its size by 4 bytes
on IPL32 platforms so add code in sys_ioctl (and netbsd32_ioctl) to deal
with the older/smaller diskabel size.  This change makes disklabel the
same for both IPL32 and LP64 platforms.
2011-01-18 19:52:23 +00:00
matt 773e544e8c Deal with changes in the trapframe. 2011-01-18 01:13:03 +00:00
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
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
njoly 0f5235579c Make compat netbsd32 clock_getres copyout the netbsd32 timespec
structure, not the native one.
2010-03-29 11:39:45 +00:00
njoly 885ee1b247 Cleanup compat netbsd32 nanosleep syscalls to use the common
nanosleep1() call instead of their own stuff.
2010-03-28 22:03:51 +00:00
pooka 934159ae4a Reset sendsig_sigcontext_vec at fini to avoid having it point at
garbage and to allow re-init of the module (if DIAGNOSTIC).
2010-03-05 16:55:56 +00:00
pooka ec6664576e regen: ENOSYS nfssvc honestly 2010-03-03 11:08:00 +00:00
pooka 7cdfc0dfea One more overcomplex ENOSYS bites the dust. 2010-03-03 11:07:17 +00:00
pooka cd4f4c9856 Remove nfssvc non-emulations I missed yesterday. 2010-03-03 11:02:34 +00:00
martin 5b7db4a698 Add prototype and forward declarations to make the empty nfs stub compile. 2010-03-03 10:56:47 +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
pooka e4fb143734 regen:
- remove nfssvc / fs_nfs.h / #ifdef NFS
- make getfh unconditional
2010-03-02 21:14:43 +00:00
pooka 808ba2d476 remove nfssvc emulation (or non-emulation) 2010-03-02 21:09:21 +00:00
pooka c20692bba4 Kill fs_nfs.h and #ifdef NFS by making getfh() support unconditional
and nfssvc unsupport unconditional.  nfs server was just a fancy
NOP anyway for all except Ultrix.  I know I'm boring but I couldn't
imagine why someone would want to run an Ultrix nfs server (and I
also doubt that it would work anymore with all the changes to fs
exporting etc).
2010-03-02 21:07:21 +00:00
pooka cfd5efb415 regen for conditional lfs syscall removal 2010-03-02 16:09:10 +00:00
pooka f1d702e017 -fs_lfs.h 2010-03-02 16:08:15 +00:00
pooka 1254f2d59e remove unused lfs compat stubs 2010-03-02 16:03:59 +00:00
pooka faaaa3dedd -fs_lfs.h 2010-03-02 16:02:43 +00:00
pooka a47bbe896e Remove lfs syscall support from compat. I can't really imagine
anyone wanting to run lfs megamaid as a e.g. FreeBSD binary.
Besides, the real action has been in fcntl() for >5 years now.
The only place where the compat syscalls might have made the tiniest
bit of sense was netbsd32, but they were unimplemented there.
2010-03-02 16:00:03 +00:00
pooka a9b0264ca7 Nuke fs_lfs.h included for unknown reasons (if there was a reason
other than "accident", i hereby declare that reason invalid)
2010-03-02 15:46:19 +00:00
pooka 18c92f1166 fs_union.h is not used here anymore ... diudau 2010-03-02 14:23:39 +00:00
dyoung 9e575a840e Mark some suspicious ENODEV returns (should be ENXIO?) with comments. 2010-02-24 17:59:33 +00:00
dholland 62bdde038d typo in comment 2010-02-15 09:39:00 +00:00
drochner 3f900515e4 add missing glue file, otherwise the emulation will not work if
compiled into the kernel (and the module loader will load another
instance, causing symbol duplication)
2010-02-14 11:54:03 +00:00
njoly db6e663a4c Small typo in comment. 2010-02-09 16:46:07 +00:00
wiz cc199107ab Remove extra parenthesis. Found by cppcheck, reported by
Henning Petersen in PR 42732.
2010-02-03 13:48:53 +00:00
wiz 11b7e600cb Missing printf in sys/compat/linux/arch/powerpc/linux_machdep.c
found by cppcheck and reported by Henning Petersen in PR 42720.
2010-02-02 15:02:07 +00:00
pooka b25b016609 A few more instances of __sigtimedwait1 -> sigtimedwait1 2010-01-19 23:15:50 +00:00
pooka 654415b2b7 Get rid of last "easy" kernel symbols starting with __:
__assert -> kern_assert
__sigtimedwait1 -> sigtimedwait1
__wdstart -> wdstart1

The rest are MD and/or shared with userspace, so they will require
a little more involvement than what is available for this quick
"ride the 5.99.24 bump" action.
2010-01-19 22:28:30 +00:00
pooka c3183f3251 The VATTR_NULL/VREF/VHOLD/HOLDRELE() macros lost their will to live
years ago when the kernel was modified to not alter ABI based on
DIAGNOSTIC, and now just call the respective function interfaces
(in lowercase).  Plenty of mix'n match upper/lowercase has creeped
into the tree since then.  Nuke the macros and convert all callsites
to lowercase.

no functional change
2010-01-08 11:35:07 +00:00
mbalmer 93f06d875c Remove extra semicolon. 2010-01-05 13:22:40 +00:00
njoly 5d50e994de Do not include fs_lfs.h unless _KERNEL_OPT is defined. 2009-12-21 16:18:17 +00:00
njoly a82811a116 Remove SYS_compat_50_mq_timedreceive/SYS_compat_50_mq_timedsend
duplicate entries.

Fix a KASSERT when unloading the compat kernel module.
2009-12-21 15:13:13 +00:00
dsl 2a54322c7b If a multithreaded app closes an fd while another thread is blocked in
read/write/accept, then the expectation is that the blocked thread will
exit and the close complete.
Since only one fd is affected, but many fd can refer to the same file,
the close code can only request the fs code unblock with ERESTART.
Fixed for pipes and sockets, ERESTART will only be generated after such
a close - so there should be no change for other programs.
Also rename fo_abort() to fo_restart() (this used to be fo_drain()).
Fixes PR/26567
2009-12-20 09:36:05 +00:00
mrg 97c80e8ff0 replace mips:elf_check_itp() and ELFNAME2(netbsd32,probe_noteless) that
it's based upon with a common compat_elf_check_interp().

tested on MALTA64 and sparc64.
2009-12-14 04:09:38 +00:00
matt 15aa4c53c9 Regen (new makesyscalls.sh) 2009-12-14 00:53:32 +00:00
matt e110dba586 Merge from matt-nb5-mips64 2009-12-14 00:47:10 +00:00
njoly f6cb14208d Remove semicolon from NETBSD32TOx_UAP macro definitions. 2009-12-12 10:32:26 +00:00
njoly 9e96206789 Add missing semicolons after NETBSD32TOx_UAP macro calls. 2009-12-12 10:30:09 +00:00
njoly c3217052b6 In netbsd32_from_{ifreq,oifreq}(), use the compat structure size for
memcpy.

From mrg.
2009-12-11 11:14:34 +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
njoly 4f273f66ed Kill debug printf. 2009-12-10 15:47:23 +00:00
njoly 86051746c6 Make netbsd32_from_{ifreq,oifreq}() copy the whole structure, not only
the interface name. Finally fix my own PR/39424.

ok by christos.
2009-12-10 14:58:28 +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
matt a3e1558eec Move saemul_netbsd32 to netbsd32_sa.c and allow the KERN_SA bits to be omitted. 2009-12-10 14:10:35 +00:00
dsl 7a42c833db Rename fo_drain() to fo_abort(), 'drain' is used to mean 'wait for output
do drain' in many places, whereas fo_drain() was called in order to force
blocking read()/write() etc calls to return to userspace so that a close()
call from a different thread can complete.
In the sockets code comment out the broken code in the inner function,
it was being called from compat code.
2009-12-09 21:32:58 +00:00
christos 67de10fc57 Add netbsd32_oifreq and fix issue in copying the interface name. With this
patch OSIOC{G,S}IFFLAGS is supposed to work, but unfortunately getifaddrs
seems to be the next problem getting the 4.99.x i386 ifconfig working on an
amd64 current machine.
2009-12-09 04:50:47 +00:00
pooka 70d4493c77 Remove the portalfs kernel file system driver. Replace mount_portal(8)
with a version based on puffs.  User functionality remains the same.
2009-12-05 20:11:01 +00:00
dsl ea4ea02d98 Add LINUX_SIOCGIFMTU and LINUX_IP_HDRINCL support.
Fixes part of PR/31358
The other parts are rather too intrusive to be fixed as in the PR.
2009-11-28 22:11:42 +00:00
dsl ba620e0c2b Set irm->bufmem = uvmexp.filepages;
as suggested in PR/30408
2009-11-28 20:09:56 +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
mbalmer 0ae57f90dd more s/the the/the/ 2009-11-22 19:09:15 +00:00
njoly db5a8f38f0 Kill redundant assignment. 2009-11-21 11:54:54 +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 bf54b26c0c Make sure to never leak padding space before copyout or copyin
uninitialized fields by explicitly using memset in the conversion
routines.
2009-11-16 08:44:19 +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
rafal 0c8283fe12 Fix fallout from do_sys_wait changes (hi, rmind!) 2009-11-05 18:39:38 +00:00
pooka 93db2986fd Fling portion of time.h dealing strictly with types to a separate
time_types.h file.  Include latter from former.
2009-11-05 16:59:01 +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
njoly a135bd0847 Regen for struct linux_stat64 fix. 2009-10-30 10:58:15 +00:00
njoly e8df95dcb7 stat64 syscalls require struct linux_stat64. 2009-10-30 10:57:40 +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
rmind 40cf6f3659 Remove uarea swap-out functionality:
- Addresses the issue described in PR/38828.
- Some simplification in threading and sleepq subsystems.
- Eliminates pmap_collect() and, as a side note, allows pmap optimisations.
- Eliminates XS_CTL_DATA_ONSTACK in scsipi code.
- Avoids few scans on LWP list and thus potentially long holds of proc_lock.
- Cuts ~1.5k lines of code.  Reduces amd64 kernel size by ~4k.
- Removes __SWAP_BROKEN cases.

Tested on x86, mips, acorn32 (thanks <mpumford>) and partly tested on
acorn26 (thanks to <bjh21>).

Discussed on <tech-kern>, reviewed by <ad>.
2009-10-21 21:11:57 +00:00
yamt bb529e553e compat_50_sys_aio_suspend:
- fix the buffer size.
	- use kmem_alloc instead of kmem_zalloc for buffers which we will
	  overwrite soon.
2009-10-12 23:41:51 +00:00
rmind c9a5a18df3 mq_timedsend/mq_timedreceive: timeout value is absolute, not relative.
While here, drop unecessary (since fdesc API changes) lwp_t arguments.

Bug reported by Stathis Kamperis, thanks!
2009-10-05 23:49:46 +00:00
taca 5a6dad0a4b Trying to fix build problem. Thanks to joerg's advise. 2009-09-20 10:29:30 +00:00
pooka fbd53556dc Wipe out the last vestiges of POOL_INIT with one swift stroke. In
most cases, use a proper constructor.  For proplib, give a local
equivalent of POOL_INIT for the kernel object implementation.  This
way the code structure can be preserved, and a local link set is
not hazardous anyway (unless proplib is split to several modules,
but that'll be the day).

tested by booting a kernel in qemu and compile-testing i386/ALL
2009-09-13 18:45:10 +00:00
njoly 1e0366323b Use correct sched_setscheduler syscall 3rd argument type. 2009-09-03 17:15:17 +00:00
dholland 869e0ec654 Use uintptr_t instead of uint32_t as an intermediate stage when
casting from off_t to a pointer. This way it compiles in a 64-bit
world. Dunno if it'll work though with 64-bit mips kernel addresses,
which are in the negative range of 64-bit off_t.
2009-08-31 05:36:23 +00:00
dholland 97d7a71b45 Use uintptr_t instead of int when munging fcntl flags, which are
pointer-sized integers. Now builds in a 64-bit world, might even work :-)
2009-08-31 05:34:16 +00:00
dholland dbb9a41442 Another one that needs <sys/exec_aout.h>. 2009-08-28 01:39:03 +00:00
christos 84ec419140 add a lot more debugging and error checking. Alas, skype seems to be happy
getting back our values, but still does not work.
2009-08-22 23:31:16 +00:00
drochner eec7391fde remove some "inline" from functions which are defined in a .c file
but used elsewhere -- gcc-4.4.1 doesn't like it and I doubt it
had any effect
2009-08-18 11:22:09 +00:00