Commit Graph

5159 Commits

Author SHA1 Message Date
christos
d2e2a457fe add the futex PI commands (not implemented yet)
PI = Priotity Inheritance
2013-01-11 02:49:09 +00:00
dsl
e3bc48d8f4 Put the kernel function prototypes inside #ifdef _KERNEL 2013-01-02 18:50:07 +00:00
dsl
d208828f20 These files don't need compat/osf1/osf1_cvt.h 2013-01-02 18:48:22 +00:00
matt
449a824898 Fix inverted error check. 2012-12-13 15:16:57 +00:00
chs
e0ade4fb6d fix these *stat routines: don't pass a kernel stack buffer
to a function that will try to copyout() to it.
just do both layers of compat translation here.
2012-12-10 02:21:58 +00:00
njoly
1ebbf7b605 Move rusage computation to a new getrusage1() function. Adjust all
compat/emulations to make use of it.
2012-11-03 23:22:21 +00:00
apb
4502ad7c73 Also copy the sfd element of struct ptmget. This somehow
got lost between testing and commit.
2012-10-19 19:44:06 +00:00
apb
a4201c34b6 This file getscompiled even if COMPAT_60 is not defined, so
protect most of the contents with #ifdef COMPAT_60
2012-10-19 17:32:20 +00:00
apb
81fe99fc5d Fix NetBSD version number in a comment 2012-10-19 17:16:55 +00:00
apb
f6297d7676 Add COMPAT_60 versions of the TIOCPTMGET and TIOCPTSNAME ioctls. 2012-10-19 16:55:22 +00:00
christos
e7a665c4ec fix pre-5 stat system call structure which should have used the pre-64-time_t
timestamps!
2012-10-12 19:45:47 +00:00
christos
96cec820de compat hook. 2012-10-10 22:51:12 +00:00
christos
8e4cb02016 regen 2012-10-02 01:46:20 +00:00
christos
1ec743232e kernel portion of clock_nanosleep() 2012-10-02 01:44:27 +00:00
chs
2ccc2d5e7f remove a debug printf. 2012-09-23 01:14:40 +00:00
joerg
511ffdeb22 LINUX_RLIM_INFINITY doesn't fit into the value range for linux32, so
introduce a variant with correct value.
2012-09-22 22:34:02 +00:00
pooka
cc9292b397 regen for ppoll (and, apparently, SYCALL_ARG_PTR) 2012-09-19 21:24:36 +00:00
bouyer
f2b31f39d0 Add a pass-through ioctl for mfi(4), allowing userland to send raw commands
to the controller. This is compatible with the linux and FreeBSD
implementations.
Add the needed conversion for mfi ioctls in COMPAT_LINUX
Allocate a character major number, and create /dev/mfi0 by default
on amd64 and i386.
This allows (along with a hand-created /emul/linux/proc/devices file)
to run the MegaCLI linux binary provided by LSI.
2012-09-19 21:24:28 +00:00
pooka
c44c9c4953 emulate ppoll which is essentially our pollts 2012-09-19 21:19:14 +00:00
pooka
97fc939fe6 Rename structure members to make the code compile in environments
where "linux" is #defined.
2012-09-13 13:59:33 +00:00
matt
d31df9582e Add missing <machine/pcb.h> include 2012-09-04 00:08:59 +00:00
drochner
312c339026 Extend the CPU microcode update framework to support Intel x86 CPUs.
Contrary to the AMD implementation, it doesn't use xcalls to distribute
the update to all CPUs but relies on cpuctl(8) to bind itself to the
right CPU -- to keep it simple and avoid possible problems with
hyperthreading.
Also, it doesn't parse the vendor supplied file to pick the right
part for the present CPU model but relies on userland to prepare
files with specific filenames. I'll commit a pkg for this in a minute
(pkgsrc/sysutils/intel-microcode).
The ioctl interface changed; compatibility is provided (should be
limited to COMPAT_NETBSD6 as soon as this is available).
2012-08-29 17:13:21 +00:00
martin
53ae4e4337 Do not use a userland pointer, but the copied-in kernel version instead.
While there, reorder loop end condition for efficency.
Fixes net/fdpass tests on all archs with separate kernel/userland VA.
2012-08-18 15:25:15 +00:00
matt
f622e63a0c Rename process_frame to lwp_trapframe 2012-08-16 16:41:53 +00:00
skrll
3677c27bea Ensure correct alignment for stack buffers when long != 64-bit, e.g.
arm.
2012-08-06 08:27:49 +00:00
matt
0745a95c9d Only do COMPAT_NETBSD32 stuff if _LP64 2012-08-03 07:51:21 +00:00
matt
7a84f3ad29 Only set EXEC_32 if on LP64 platform. 2012-08-03 07:49:18 +00:00
matt
130ede3ac2 Make SCM_RIGHTS work correctly. (make sure to advance m if we've completely
dealt with, the next mbuf (if any) comes into play).
2012-07-30 07:31:16 +00:00
matt
b1afbb311c Fix -fno-common found by building i386/conf/ALL 2012-07-28 00:43:22 +00:00
christos
8c79b0cd87 always allocate a full ucontext structure so that we don't corrupt memory.
XXX: needs pullup to 6?
2012-07-20 02:27:36 +00:00
dsl
c578e8d211 Rename MDP_IRET to MDL_IRET since it is an lwp flag, not a proc one.
Add an MDL_COMPAT32 flag to the lwp's md_flags, set it for 32bit lwps
  and use it to force 'return to user' with iret (as is done when
  MDL_IRET is set).
Split the iret/sysret code paths much later.
Remove all the replicated code for 32bit system calls - which was only
  needed so that iret was always used.
frameasm.h for XEN contains '#define swapgs', while XEN probable never
  needs swapgs, this is likely to be confusing.
Add a SWAPGS which is a nop on XEN and swapgs otherwise.
(I've not yet checked all the swapgs in files that include frameasm.h)
Simple x86 programs still work.
Hijack 6.99.9 kernel bump (needed for compat32 modules)
2012-07-15 15:17:56 +00:00
christos
c35446cdef regen 2012-07-13 18:21:45 +00:00
christos
643208810c add xattr stubs 2012-07-13 18:21:33 +00:00
dsl
d222864098 The MDP_USEDFPU (amd64 and sh3) and MDP_SSTEP (sh3) are lwp flags not
process ones, rename to MDL_xxx.
2012-07-08 20:14:11 +00:00
martin
de489d0684 From the "parse errors that you just do not see as a human" department:
build fix.
2012-06-22 08:47:47 +00:00
christos
23ccd40d8e fix token pasting. 2012-06-21 17:55:15 +00:00
christos
9c85d0acc9 print proper ktruser names depending on the emulation. 2012-06-20 15:03:18 +00:00
christos
82e21017c8 compat for 80211 ioctls from jmcneill 2012-05-28 14:19:10 +00:00
martin
6c3cc552c2 Calling _lwp_create() with a bogus ucontext could trigger a kernel
assertion failure (and thus a crash in DIAGNOSTIC kernels). Independently
discovered by YAMAMOTO Takashi and Joel Sing.

To avoid this, introduce a cpu_mcontext_validate() function and move all
sanity checks from cpu_setmcontext() there. Also untangle the netbsd32
compat mess slightly and add a cpu_mcontext32_validate() cousin there.

Add an exhaustive atf test case, based partly on code from Joel Sing.

Should finally fix the remaining open part of PR kern/43903.
2012-05-21 14:15:16 +00:00
christos
254cd91895 provide clockctl ioctl emulation 2012-05-11 19:00:36 +00:00
christos
15c591f469 regen 2012-05-10 19:41:52 +00:00
christos
de41ffce81 Fix rt_sigtimedwait():
It is wishful thinking that:
    1. declaring a 32 bit syscall with 64 bit pointers
    2. passing a struct with 32 bit pointers to a 64 bit function
is going to work.
2012-05-10 19:40:46 +00:00
christos
d1109b6273 prefix message with linux32 2012-05-10 19:38:23 +00:00
rmind
b10bf4690c Revert posix_spawn() clean up for now, there are some bugs. 2012-05-02 23:33:11 +00:00
rmind
0c217aec3a posix_spawn:
- Remove copy-pasting in error paths, use execve_free_{vmspace,data}().
- Move some code (both in the init and exit paths) out of the locks.
- Slightly simplify do_posix_spawn() callers.
- Add few asserts and comments.
2012-04-30 21:19:58 +00:00
martin
e6f332c7b3 Regen (posix_spawn) 2012-04-08 11:28:12 +00:00
martin
94b761b6aa Rework posix_spawn locking and memory management:
- always provide a vmspace for the new proc, initially borrowing from proc0
   (this part fixes PR 46286)
 - increase parallelism between parent and child if arguments allow this,
   avoiding a potential deadlock on exec_lock
 - add a new flag for userland to request old (lockstepped) behaviour for
   better error reporting
 - adapt test cases to the previous two and add a new variant to test the
   diagnostics flag
 - fix a few memory (and lock) leaks
 - provide netbsd32 compat
2012-04-08 11:27:44 +00:00
chs
cf43d4681a define LINUX_DEBUGLINK_SIGNATURE for i386 too.
this allows linux ldd to work.
2012-03-21 03:20:22 +00:00
martin
3e9dfcff83 Remove spurious bsd.kinc.mk include, which seems to not be needed here
and does not work at all (missing bsd.own.mk for ACTIVE_CC) anyway.
2012-03-20 09:18:00 +00:00
njoly
eda28ff705 Add missing semi-colon. 2012-03-18 21:48:47 +00:00
bouyer
44cd46846c Do not read past end of array. Found by gcc -03 2012-03-15 16:17:48 +00:00
elad
0c9d8d15c9 Replace the remaining KAUTH_GENERIC_ISSUSER authorization calls with
something meaningful. All relevant documentation has been updated or
written.

Most of these changes were brought up in the following messages:

    http://mail-index.netbsd.org/tech-kern/2012/01/18/msg012490.html
    http://mail-index.netbsd.org/tech-kern/2012/01/19/msg012502.html
    http://mail-index.netbsd.org/tech-kern/2012/02/17/msg012728.html

Thanks to christos, manu, njoly, and jmmv for input.

Huge thanks to pgoyette for spinning these changes through some build
cycles and ATF.
2012-03-13 18:40:26 +00:00
joerg
99c3eea80c P1003_1B_SEMAPHORE is no longer optional. 2012-03-10 21:51:48 +00:00
joerg
4acff4c01b Implement sem_timedwait. 2012-03-08 21:59:24 +00:00
joerg
3bd1fd2afe Add entry for _ksem_timedwait. 2012-03-08 21:55:45 +00:00
macallan
c4a8ce45f6 allow mounting ext2fs and msdosfs
while there also enable lfs but that's untested
2012-03-06 07:37:05 +00:00
rjs
bbf374d1d6 Switch to ANSI style declaration. 2012-02-21 18:10:00 +00:00
rmind
ad12c77015 Remove COMPAT_SA / KERN_SA. Welcome to 6.99.3!
Approved by core@.
2012-02-19 21:05:51 +00:00
matt
d24466683b Add compat_60 stub for the SA syscall (all which just call sys_nosys). 2012-02-19 17:40:46 +00:00
rmind
510eed8079 Make SA calls obsolete (use stubs in kern case, as libc needs them for now). 2012-02-19 17:08:02 +00:00
matt
1d7f24ead8 Change old-style function defintions to C89 prototypes.
Approved by releng.
2012-02-12 16:34:06 +00:00
christos
ff4d8f4f03 ansi prototypes 2012-02-03 23:39:59 +00:00
christos
e2d86e914d Kill of messy ifdefs, and use an ansi prototype. 2012-02-03 23:38:07 +00:00
matt
2210079e9b Add a hook for freeing an ep_emul_arg. Add a wrapper routine
(exec_free_emul_arg) to call the hook and then clear the ep_emul_arg
and ep_emul_arg_free members in the exec_package.
Change users/accessors to use these routines.
Approved by releng.
2012-02-03 20:11:53 +00:00
christos
e135d08485 elf_args needs to be freed with kmem_free() since it is now allocated with
kmem_alloc(). Should fix running 32 bit elf binaries.
2012-02-03 03:54:35 +00:00
dholland
832d4ca72b Be consistent about whether idtype and objtype codes are signed or
unsigned. They are signed. (While unsigned might have been a better
choice, it doesn't really matter and the majority of preexisting uses
were signed. And consistency is good.)
2012-02-01 05:46:45 +00:00
dholland
d2d6fa0ae1 Improve the names of some members of struct quotactl_args. These are
effectively function parameter names, but since they need to be
described with the same names in the man page the choices do matter.
Some.
2012-02-01 05:43:53 +00:00
dholland
56cf2d9a90 Regen syscalls with proper id info. 2012-02-01 05:42:17 +00:00
dholland
6d90c35d73 Update compat_netbsd32 for new quotactl. 2012-02-01 05:40:00 +00:00
dholland
59b296daa7 Change the syscall API for quotas over to the new non-proplib one.
- struct vfs_quotactl_args -> struct quotactl_args
   - add sys/stdint.h to sys/quotactl.h for clean userland build
   - install sys/quotactl.h in /usr/include
   - update set lists for same
   - add new marshalling code in libquota
   - add new unmarshalling code in vfs_syscalls.c
   - discard proplib interpreter code in vfs_quotactl.c
   - add dispatching code for the 14 quotactl ops in vfs_quotactl.c
   - mark the proplib quotactl syscall obsolete
   - add a new syscall number for the new quotactl syscall
   - change the name of the syscall to __quotactl()
   - remove the decl of the old quotactl from quota/quotaprop.h
   - add a decl of the new quotactl to sys/quotactl.h
   - update the libc build
   - update ktruss
   - remove proplib marshalling code from libquota
   - update copy of syscall table in gdb ppc sources
   - hack rumphijack to accomodate new quotactl name (as I recall,
     pooka wanted such a name change to simplify something, but I
     don't really see what/how)

This change appears to require a kernel version bump for rumpish
reasons.
2012-02-01 05:34:38 +00:00
matt
f7a1e1f692 Add missing *at syscalls among others 2012-01-31 22:53:56 +00:00
matt
1c72d69ada Regen. 2012-01-31 22:53:28 +00:00
matt
886e1e0fe1 Add the *at syscalls and other missing syscalls. 2012-01-31 22:52:19 +00:00
matt
f79a630ee2 Add netbsd32_socklenp_t 2012-01-31 22:51:41 +00:00
dholland
27eb63df33 Some further tidying for the COMPAT_50 quotactl code. Mostly cosmetic,
but also use PNBUF_GET() and PNBUF_PUT() for a path buffer instead of
malloc with M_TEMP.
2012-01-29 07:19:48 +00:00
dholland
306e2450d7 Remove the proplib goop from the COMPAT_50 code for the old quotactl;
use the new VFS_QUOTACTL instead.
2012-01-29 07:19:04 +00:00
dholland
f0f8fe3be2 Rename static inline "helper" functions:
ufsclass2qtype -> quota_idtype_to_ufs
   qtype2ufsclass -> quota_idtype_from_ufs

The reason for the direction of "ufs" changing is that the old names
were among the symbols using "ufs" to mean "fs-independent". So the
old names were for translating "ufsclass" (fs-independent quota id
type) to "qtype" (ufs-specific quota id type) and vice versa.

These functions are used in only two places, both of which are
inappropriate, so at some point they should probably be removed.
They're also identity transformations so not particularly helpful,
unless one were to make a careful and concerted effort to distinguish
the ufs quota code numbers from the fs-independent ones. This has not
been done and is probably impossible without support from a program
verifier, and maybe not even then.

They are static inline, so no compat concerns arise.

Also adjust the symbols they use to avoid <quota/quotaprop.h>.
2012-01-29 07:16:00 +00:00
dholland
b0d7bab70f Add vfs_quotactl() in between the syscall and VFS_QUOTACTL. Call it
from the COMPAT_50 code as well as the current sys_quotactl instead
of going directly to VFS_QUOTACTL. Doesn't actually do anything yet.
2012-01-29 06:29:04 +00:00
dholland
7950da9e90 Change dqblk_to_quotaval() from quota1_subr.c to dqblk_to_quotavals(),
and pass in two single quotaval structs (for blocks and inodes)
instead of an array of (implicitly) QUOTA_NLIMITS quotaval structs
indexed by constants from quotaprop.h.

Note: because this code is used by COMPAT_50 as well as ufs, this
change requires a kernel version bump. (The code is also used by
edquota, but via .PATH so it's not ABI-sensitive there.)
2012-01-29 06:23:20 +00:00
christos
4cdc612f05 Add FNOSIGPIPE for compat32; noted by yamt. 2012-01-25 14:06:07 +00:00
joerg
e8bec33be1 Change CMSG_SPACE and CMSG_LEN to provide Integer Constant Expressions
again. This was changed in sys/socket.h r1.51 to work around fallout
from the IPv6 aux data migration. It broke the historic ABI on some
platforms. This commit restores compatibility for netbsd32 code on such
platforms and provides a template for future changes to the CMSG_*
alignment. Revert PCC/Clang workarounds in postfix and tmux.
2012-01-20 14:08:04 +00:00
joerg
ccdd230122 Reduce difference between recvfrom/recvmsg for netbsd32 and the native
version. This fixes the bug of lost file descriptors when the control
space is not large enough.
2012-01-13 21:02:03 +00:00
apb
0f20d9487a Instead of calling clockctl_ioctl directly, lookup the cdevsw and
call its d_ioctl function.  This should fix an undefined reference to
`clockctlioctl' when you build a kernel that has COMPAT_50 but does not
have pseudo-device clockctl.
2012-01-04 14:31:17 +00:00
apb
989df4c71f Provide a COMPAT_50 version of the CLOCKCTL_NTP_ADJTIME ioctl.
When time_t was changed from 32 to 64 bits, this ioctl's number
was changed from _IOWR('C', 0x4, struct clockctl_ntp_adjtime)
to _IOWR('C', 0x8, struct clockctl_ntp_adjtime), but the data
structure did not change, so all the compat code has to do is
change the number and try again.
2012-01-04 13:45:55 +00:00
christos
87d8a6fadb - Eliminate so_nbio and turn it into a bit SS_NBIO in so_state.
- Introduce MSG_NBIO so that we can turn non blocking i/o on a per call basis
- Use MSG_NBIO to fix the XXX: multi-threaded issues on the fifo sockets.
- Don't set SO_CANTRCVMORE, if we were interrupted (perhaps do it for all
  errors?).
2011-12-20 23:56:28 +00:00
drochner
5cc2549c59 allow kernels w/o COMPAT_50 to build 2011-12-20 16:38:06 +00:00
apb
381a814261 Add COMPAT_50 and COMPAT_NETBSD32 compatibility code for rnd(4)
ioctl commands.

Tested with "rndctl -ls" using an old 32-bit version of rndctl(8)
(built for NetBSD-5.99.56/i386) and a new 64-bit kernel
(NetBSD-5.99.59/amd64).
2011-12-19 21:53:52 +00:00
dholland
51d1d7e7c4 Rename struct ufs_quota_entry -> struct quotaval. 2011-11-25 16:55:05 +00:00
njoly
63da447932 Adjust setup_linux_rt_sigframe/setup_linux_sigframe prototypes. 2011-11-21 22:00:42 +00:00
dholland
c60360c18d Reshuffle decls among the quota headers so everything is in the place
it should be:
   - stuff for the proplib interface goes in <quota/quotaprop.h>
   - stuff for userlevel only goes in <quota/quota.h>
   - stuff shared between user and kernel goes in <sys/quota.h>

Note that <quota/quota.h> and <quota/quotaprop.h> are expected to be
moved or removed later on... one thing at a time.

Update include directives in other files as needed.
2011-11-20 21:43:34 +00:00
christos
fb060436c8 remove one more kassert 2011-11-18 17:36:06 +00:00
christos
d356aedea4 remove incorrect assertions (the len passed is the size of the bsd structure
not the linux one)
2011-11-18 15:45:47 +00:00
martin
590ed99f9d Provide linux_siginfo_t for all archs, to unbreak kdump build. 2011-11-18 09:17:09 +00:00
christos
6f5d4fe4a7 regen 2011-11-18 04:20:16 +00:00
christos
30d1f33e42 add sigtimedwait support 2011-11-18 04:08:56 +00:00
christos
f72d02ff70 - add sigtimedwait support.
- merge the siginfo population code.
2011-11-18 04:07:43 +00:00
christos
4a806ef735 add sigtimedwait 2011-11-18 04:03:50 +00:00
christos
d8bca0f24f add a copyin function for sigset so that we can use sigtimedwait1 from
emulations.
2011-11-18 03:34:13 +00:00
njoly
1a2bbb9e17 Fix pipe2 return value. 2011-11-15 14:13:17 +00:00
njoly
1787cd2761 Regen for kqueue1. 2011-11-08 10:59:44 +00:00
njoly
c7617a5386 Add kqueue1(2) support. 2011-11-08 10:59:12 +00:00
hannken
2cc7a01f10 Change the vnode locking protocol of VOP_GETATTR() to request at least
a shared lock.  Make all calls outside of file systems respect it.

The calls from file systems need review.

No objections from tech-kern.
2011-10-14 09:23:28 +00:00
dholland
f89ffda9f6 As a precaution, add sys/param.h explicitly to some headers that will
no longer get it via sys/ucred.h and don't already include it
explicitly. These should in turn be removed when it can be confirmed
that it's safe to do so. (Because sys/param.h is full of things that
are often tested with #if, it's not in general safe to remove it
without checking, as such tests fail silently if the symbol goes
missing.)
2011-10-12 23:04:22 +00:00
macallan
3d6ab01ea4 fix pasto, now SIOCS80211NWKEY and SIOCG80211NWKEY actually work 2011-10-06 03:19:32 +00:00
macallan
b788a760c4 forgot SIOCG80211NWKEY32 when adding SIOCS80211NWKEY32 2011-10-05 14:17:41 +00:00
macallan
f73964743d support WSDISPLAYIO_GCURSOR and WSDISPLAYIO_SCURSOR 2011-09-28 01:46:39 +00:00
christos
1c4884ad71 use the filesystem specific namemax not a hard-coded MAXNAMLEN 2011-09-27 00:56:14 +00:00
christos
ac55ba72e3 return the namemax from the bsd statvfs which is filesystem dependent, not
a random value.
2011-09-27 00:52:55 +00:00
chs
11c35aee5c linux_termio c_cc array should be indexed by LINUX_OLD_V* rather than LINUX_V*.
fixes array overrun on alpha noticed by gcc 4.5.
2011-09-25 13:40:07 +00:00
christos
747c11eab6 Can't use RUN_ONCE here to initialize the futex_lock, otherwise we cannot
unload the module.
2011-09-14 12:28:08 +00:00
macallan
fccabba939 support ioctl(POWER_EVENT_RECVDICT) - now powerd turns my gdium's backlight
off when the lid is closed
2011-09-07 02:35:00 +00:00
jmcneill
5fc89c79bc Add support for AFMT_AC3 2011-09-06 01:19:34 +00:00
njoly
e6b8e35e92 Make linux_sys_getdents64 fails with ENOTDIR instead of EINVAL, when fd
does not refer to a directory.
2011-09-01 12:44:10 +00:00
plunky
7f3d4048d7 NULL does not need a cast 2011-08-31 18:31:02 +00:00
njoly
f589e415e2 Regen for dup3. 2011-08-31 16:51:05 +00:00
njoly
f1367b80df Add dup3 syscall support. 2011-08-31 16:50:32 +00:00
bouyer
ccc8030189 Provide netbsd32 compat for bpf. Beside the ioctls, the structure
returned to userland by read(2) also needs to be converted.
For this, the bpf descriptor is flagged as compat32 (or not) in the
open and ioctl functions (where the user process's pid is also updated
in the descriptor). When the bpf buffer is filled in, the 32bits or native
header is used depending on the information stored in the descriptor.

This won't work if a 64bit binary does the open and ioctls, and then
exec a 32bit program which will do the read. But this is very
unlikely to happen in real life ...

Tested on i386 and loongson; with these changes my loongson can run
dhclient and tcpdump with a n32 userland.
2011-08-30 14:22:22 +00:00
macallan
d9554c19b2 support SIOCG80211NWKEY 2011-08-30 07:54:15 +00:00
macallan
daaec637e7 add WSDISPLAYIO_ADDSCREEN 2011-08-30 07:06:39 +00:00
bouyer
166893d482 translate WDOGIOC_GWDOGS 2011-08-27 19:25:35 +00:00
christos
c439220508 Better debugging. 2011-08-18 02:26:38 +00:00
christos
c2480dc377 sizeof type -> sizeof *var 2011-08-18 02:21:02 +00:00
jmcneill
e7968ac3c4 add libcompat.o/.po targets for COMPAT_AS=obj 2011-08-11 21:23:09 +00:00
jakllsch
88e3a4403f COMPAT_16 code only exists on amd64 in the presence of COMPAT_NETBSD32. 2011-08-08 23:44:06 +00:00
njoly
598b81ec2e Fix SYSCALL_DEBUG build. 2011-07-22 10:02:08 +00:00
christos
1360a27d17 fail early on socket domain+type combinations we don't support 2011-07-17 23:59:54 +00:00
joerg
3eb244d801 Retire varargs.h support. Move machine/stdarg.h logic into MI
sys/stdarg.h and expect compiler to provide proper builtins, defaulting
to the GCC interface. lint still has a special fallback.
Reduce abuse of _BSD_VA_LIST_ by defining __va_list by default and
derive va_list as required by standards.
2011-07-17 20:54:30 +00:00
christos
2284e7a4b7 revert accidental commit from unrelated change. no custom linux fork. 2011-07-09 23:46:32 +00:00
christos
6fd4657362 the first argument of {g,s}etitimer() is int not u_int. 2011-07-09 14:49:40 +00:00
njoly
4127bcdacf Regen for pipe2. 2011-07-05 14:23:26 +00:00
njoly
f85e6e86e8 Add pipe2 syscall now needed for popen(3). 2011-07-05 14:21:46 +00:00
mrg
97796e3e22 avoid array bounds violation on netbsd/mips when dealing with termio
structures.  (did linux/mips ever support termio?).

the effect of this is that termio linux apps won't have VEOF support.
i can't tell what it should be since that code isn't in linux going
back quite some years.
2011-07-04 12:39:36 +00:00
wiz
4cbd24b23f dependant -> dependent 2011-06-30 20:09:15 +00:00
christos
e2bebf7172 * Arrange for interfaces that create new file descriptors to be able to
set close-on-exec on creation (http://udrepper.livejournal.com/20407.html).

    - Add F_DUPFD_CLOEXEC to fcntl(2).
    - Add MSG_CMSG_CLOEXEC to recvmsg(2) for unix file descriptor passing.
    - Add dup3(2) syscall with a flags argument for O_CLOEXEC, O_NONBLOCK.
    - Add pipe2(2) syscall with a flags argument for O_CLOEXEC, O_NONBLOCK.
    - Add flags SOCK_CLOEXEC, SOCK_NONBLOCK to the socket type parameter
      for socket(2) and socketpair(2).
    - Add new paccept(2) syscall that takes an additional sigset_t to alter
      the sigmask temporarily and a flags argument to set SOCK_CLOEXEC,
      SOCK_NONBLOCK.
    - Add new mode character 'e' to fopen(3) and popen(3) to open pipes
      and file descriptors for close on exec.
    - Add new kqueue1(2) syscall with a new flags argument to open the
      kqueue file descriptor with O_CLOEXEC, O_NONBLOCK.

* Fix the system calls that take socklen_t arguments to actually do so.

* Don't include userland header files (signal.h) from system header files
  (rump_syscallargs.h).

* Bump libc version for the new syscalls.
2011-06-26 16:42:39 +00:00
matt
dcd3c68619 Adapt to change to PCU. 2011-06-09 13:41:40 +00:00
dsl
6e1d30d402 Use 'curlwp' here insteald of the 'l' - which isn't passsed as an arg
to the #define, but will always be curlwp.
2011-06-05 09:37:10 +00:00
dsl
57cfea60ab Delete some splurious commas and very unexpected trailing space 2011-06-05 08:42:59 +00:00
njoly
9ff7ba5b5a Fix path for fadvise64 files. 2011-05-31 22:35:22 +00:00
njoly
9c8dbddec0 Regen for fadvise64_64 typo fix. 2011-05-31 21:39:00 +00:00
njoly
1cfc88e038 Small typo in fadvise64_64 args (advise -> advice). 2011-05-31 21:38:00 +00:00
njoly
7ee3c495f9 Add needed linux_fadvise64.c 2011-05-31 20:53:13 +00:00
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
alnsn
1ff2a8d080 Fix typo in a comment. 2011-05-28 23:24:58 +00:00
joerg
165a8de9ef Give the body the same static inline treatment as the definition 2011-05-24 18:29:23 +00:00
joerg
4d037bbbc9 Update from GNU extension to C99 syntax for designated initializer 2011-05-23 21:34:47 +00:00
joerg
8e5ceb1134 Use __UNCONST to get rid of const 2011-05-23 21:34:01 +00:00
rmind
356c1e108a Replace simple_lock(9) with mutex(9), clean up. 2011-05-14 12:44:15 +00:00
matt
cf77a76b75 Adapt to new PCU based FPU code. 2011-05-05 16:20:55 +00:00
rmind
8d15642306 Catch up with lim_privatise() change (missed in previous commit). 2011-05-01 02:08:15 +00:00
joerg
787e55aa29 Remove PECOFF/Win32 emulation. 2011-04-26 16:57:38 +00:00
joerg
e958063324 Remove IRIX emulation 2011-04-26 16:36:40 +00:00
joerg
5aca2679d7 Remove Darwin, MACH and Mach-O support. 2011-04-26 15:51:22 +00:00
he
bb979087ff Regenerate these files after adding pipe2() and dup3(). 2011-04-15 13:07:37 +00:00
he
0e4429dc30 Add dup3() and pipe2() for these archs as well. 2011-04-15 13:04:52 +00:00
he
d6f2b33ab3 Fix this so that it builds (missing "struct" keyword). 2011-04-14 11:17:47 +00:00
christos
caa78eadaf add the "special" pipe2. 2011-04-14 01:03:23 +00:00
christos
239691fffa move dup3 to a more appropriate place because pipe is "special". Gotta love
linux.
2011-04-14 00:59:06 +00:00
christos
c1bc70d6fb - implement dup3 and pipe2
- eliminate amd64 ifdef
2011-04-10 15:50:34 +00:00
christos
0d7e057e6b We have O_CLOEXEC now 2011-04-10 15:49:56 +00:00
christos
a5071c95ef Regen: Argh:
cat: rumphdr.types: No such file or directory
rm: rumphdr.types: No such file or directory
*** Error code 1
2011-04-10 15:49:23 +00:00
christos
dd9e944ede add pipe2 and dup3 2011-04-10 15:48:46 +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
ahoka
7a9de7239e remove FLASH_GET_INFO compat as it is no longer using size_t 2011-04-04 18:24:56 +00:00
ahoka
3f1a2799ca flash_addr_t -> flash_off_t 2011-04-04 17:46:22 +00:00
plunky
1a7622f6a7 tidy up include pathname to exclude undefined behaviour
"If the characters ', \, ", //, or /* occur in the sequence between
  the < and > delimiters, the behavior is undefined."
2011-03-29 20:10:31 +00:00
bouyer
d9210c2405 Add a new libquota library, which contains some blocks to build and/or
parse quota plists; as well as a getfsquota() function to retrieve quotas
for a single id from a single filesystem (whatever filesystem this is:
a local quota-enabled fs or NFS). This is build on functions getufsquota()
(for local filesystems with UFS-like quotas) and getnfsquota();
which are also available to userland programs.
move functions from quota2_subr.c to libquota or libprop as appropriate,
and ajust in-tree quota tools.
move some declarations from kernel headers to either sys/quota.h or
quota/quota.h as appropriate. ufs/ufs/quota.h still installed because
it's needed by other installed ufs headers.
ufs/ufs/quota1.h still installed as a quick&dirty way to get a code
using the old quotactl() to compile (just include ufs/ufs/quota1.h instead of
ufs/ufs/quota.h - old code won't compile without this change and this is
on purpose).
Discussed on tech-kern@ and tech-net@ (long thread, but not much about
libquota itself ...)
2011-03-24 17:05:39 +00:00
cliff
8c2354cc52 include flashio.h 2011-03-19 13:47:43 +00:00
cliff
0d7e06e2aa compat/netbsd32 ioctl support for FLASH_GET_INFO 2011-03-19 04:07:35 +00:00
bouyer
6e3787a787 Regen: use COMPAT_50 quotactl, not the native one 2011-03-07 19:27:27 +00:00
bouyer
f5e8243c9d Use the COMPAT_50 quotactl, not the native one.
Should fix build of COMPAT_AOUT_M68K
2011-03-07 19:26:35 +00:00
joerg
5c3ccd6eba Pass down ELF Auxillary Vectors for static NetBSD binaries too.
Rename __libc_init to _libc_init and call it explicitly from CSU code.
This enforces the constructor run order for newly linked programs.
Keep it as constructor with run-once semantic for binary compatibility.
Implement dl_iterate_phdr for statically linked programs.

This material is based upon work partially supported by
The NetBSD Foundation under a contract with Joerg Sonnenberger.
2011-03-07 05:09:09 +00:00
bouyer
063f96f3c2 merge the bouyer-quota2 branch. This adds a new on-disk format
to store disk quota usage and limits, integrated with ffs
metadata. Usage is checked by fsck_ffs (no more quotacheck)
and is covered by the WAPBL journal. Enabled with kernel
option QUOTA2 (added where QUOTA was enabled in kernel config files),
turned on with tunefs(8) on a per-filesystem
basis. mount_mfs(8) can also turn quotas on.

See http://mail-index.netbsd.org/tech-kern/2011/02/19/msg010025.html
for details.
2011-03-06 17:08:10 +00:00
joerg
3fb7a604bd Fix compilation 2011-03-05 23:51:47 +00:00
joerg
557eb4273a Forward define of ps_strings. 2011-03-05 19:08:40 +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
christos
af8f930405 PR/44674: Taylor R Campbell: Fix compat copyin and copyout routines which
were obviously broken.
2011-03-04 01:36:56 +00:00
kiyohara
5fda4e37f1 Fix build failed.
Need separator `,'.
2011-02-25 09:54:23 +00:00
joerg
13d02bb5bf Fix ucontext32_t on AMD64. Add optional compile time assertions for
ucontext_t and ucontext32_t to ensure that they don't change.
Provide the constants for AMD64, ARM, i386, and M68K.
2011-02-23 02:58:38 +00:00
matt
aa306c700f Deal with differences in signal delivery between o32/n32/n64. 2011-02-20 08:14:10 +00:00
matt
6a385f43c2 Regen. 2011-02-20 08:13:29 +00:00
matt
6ab83fddf5 Change some ints to longs (for LP64). 2011-02-20 08:09:46 +00:00
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