Commit Graph

5270 Commits

Author SHA1 Message Date
manu a0b6b9a1c4 Fix cases where count <= 0 (thanks to Maxime Villard for raising this) 2014-05-15 18:25:35 +00:00
njoly 79943851d1 Regen for setcontext signature. 2014-05-15 09:55:11 +00:00
njoly 9e6b53cfb2 Fix setcontext signature, which has a single argument not three. 2014-05-15 09:54:06 +00:00
njoly 45d75a98a6 Fix c&p error for the length argument in fadvise64_64. 2014-05-06 18:17:22 +00:00
njoly e942f57595 Regen for mknod device argument type change. 2014-05-06 17:34:39 +00:00
njoly c908bf86c3 Reduce diffs between archs; make mknod device argument unsigned. 2014-05-06 17:33:35 +00:00
njoly 3388ddd03d linux_off_t -> off_t in pwrite() syscall args comment. 2014-05-06 13:21:50 +00:00
njoly 7d21c20716 Regen for pread/pwrite 64bit offset argument. 2014-05-04 10:10:39 +00:00
njoly d63cac9fa8 Fix pread/pwrite syscalls which need a 64bit offset argument. 2014-05-04 10:08:53 +00:00
njoly dc2a049782 Remove now unneeded bsd.kinc.mk. 2014-05-04 10:03:55 +00:00
njoly 963ddf84b8 Regen for netbsd32_off_t. 2014-04-30 17:24:20 +00:00
njoly 99b30bf4fc Do not use native off_t type under compat netbsd32, but a new
netbsd32_off_t that provide the expected alignment for 64bit types.
2014-04-30 17:23:45 +00:00
maxv 8d404a3e9c There are two times the same branches.
} else if (addr == LUSR_OFF(__signal)) {
 			error = ENOTSUP;
		} else if (addr == LUSR_OFF(__signal)) {
			error = ENOTSUP;
		}

Just delete one of them. Spotted by my code scanner.

ok christos@
2014-04-15 17:53:09 +00:00
maxv c1cf2f47fb A specially-crafted binary could easily control a kernel array index.
Add some checks to ensure that nothing will be read outside the allocated
area. Rewrite the code so that we don't need to allocate the whole section.

Spotted by several developers, patch from chs@/enami@
2014-04-15 17:29:00 +00:00
maxv 77641d7c26 'error' is not set on failure. Which means that if copyout() fails, 0
will be returned while the stack is not ready. This is a bug.
2014-04-09 11:40:03 +00:00
njoly 2dbac6d46c Regen. 2014-04-08 16:49:25 +00:00
njoly 903adfd827 Adjust read/write/readv/writev signature to match native versions. 2014-04-08 16:48:01 +00:00
njoly 52eb735051 Do not include bsd.kinc.mk in each arch Makefile, it's already pulled
by bsd.syscall.mk (from Makefile.inc).
2014-04-08 11:39:57 +00:00
njoly 4eb3dbc504 Move a few compat 50 syscalls, not applicable to rump kernels, out of
kern_time_50.c to a new source module.
2014-04-04 18:17:36 +00:00
christos 3270bbc973 kill {v,}sprintf 2014-03-26 18:11:26 +00:00
christos 268d7559ce kill sprintf 2014-03-25 16:19:13 +00:00
christos dbe9c08e6d use cpu_getmodel() to get the model name 2014-03-24 20:08:08 +00:00
christos 0f18888b15 fix unused 2014-03-23 09:30:59 +00:00
dholland 39aea57337 typos in comments 2014-03-23 06:03:38 +00:00
christos 72ee2848d6 remove unused 2014-03-23 02:54:12 +00:00
maxv 2632b9d940 Fix a potential - but very unlikely - NULL pointer dereference.
(it does not introduce a new error code for open(), since
 pathbuf_copyin() is already there and can return ENOMEM)

Found by my code scanner.
2014-03-22 08:15:25 +00:00
riastradh 6cb10275d0 Merge riastradh-drm2 to HEAD. 2014-03-18 18:20:35 +00:00
dholland a68f9396b6 Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
2014-03-16 05:20:22 +00:00
nakayama 33d3876a9f Redo previous. 2014-03-08 01:51:58 +00:00
martin b8d03c50d4 Fix typo 2014-03-07 08:40:59 +00:00
christos 16d5017a4b fix typo 2014-03-07 02:03:32 +00:00
christos e8fac1316b fix typos 2014-03-07 02:02:16 +00:00
christos 54b7adb159 c99 initializers for struct execsw 2014-03-07 01:33:43 +00:00
pooka 4f6fb3bf35 Ensure that the top level sysctl nodes (kern, vfs, net, ...) exist before
the sysctl link sets are processed, and remove redundancy.

Shaves >13kB off of an amd64 GENERIC, not to mention >1k duplicate
lines of code.
2014-02-25 18:30:08 +00:00
njoly 229908f488 Use Aux32Info not AuxInfo. Noticed by Maxime Villard. 2014-02-23 16:07:40 +00:00
njoly a310936659 Use cprng_strong32 for LINUX_AT_RANDOM on amd64 too. 2014-02-23 12:01:51 +00:00
njoly 6e5d6d35f1 Fix wrong KASSERTs. Do not compare size vs. entries count. 2014-02-23 11:09:42 +00:00
maxv c23f93773f Increase LINUX32_ELF_AUX_ENTRIES to avoid overrun in linux32/. Also,
add comments and KASSERTs to make sure people don't forget to increase
XX_AUX_ENTRIES's when adding vectors.

Reported by martin@ (CV), with suggestions from chs@.

ok martin@ chs@
2014-02-21 07:53:53 +00:00
dsl fd7c41b40d Explicitly include x86/fpu.h instead of relying in x86/frame.h including it. 2014-02-19 21:45:01 +00:00
dsl 480bf53618 Add explicit #include <x86/fpu.h> instead of relying on pcb.h including it. 2014-02-19 21:23:01 +00:00
dsl f122cefa4e Don't rely on pcb.h including x86/include/sysarch.h 2014-02-19 20:50:56 +00:00
njoly f14253ab28 Regen. 2014-02-15 22:36:26 +00:00
njoly 40b4c3c92a Reduce diffs between archs, add mincore/madvise to m68k. 2014-02-15 22:35:08 +00:00
dsl b9df3e93ac Remove all references to MDL_USEDFPU and deferred fpu initialisation.
The cost of zeroing the save area on exec is minimal.
This stops the FP registers of a random process being used the first
  time an lwp uses the fpu.
sendsig_siginfo() and get_mcontext() now unconditionally copy the FP
registers.
I'll remove the double-copy for signal handlers soon.
get_mcontext() might have been leaking kernel memory to userspace - and
  may still do so if i386_use_fxsave is false (short copies).
2014-02-15 10:11:14 +00:00
dsl 742d777c6d Move sys/arch/amd64/amd64/fpu.c and sys/arch/amd64/include/fpu.h
into sys/arch/x86 in preparation for using the same code for i386.
2014-02-11 20:17:16 +00:00
maxv f945d6d845 Fix uninitialized variable. Harmless: it does not change the behavior
at all.

ok rmind@ christos@
2014-02-11 16:00:13 +00:00
chs e5a75de98e account for the 16 bytes of AT_RANDOM data in the stack setup. fixes PR 48518.
use cprng_strong32() instead of random().  add AT_RANDOM support for linux32.
2014-02-09 16:41:42 +00:00
dsl 519a61193d Convert the amd64 build to use x86/cpu_extended_state.h so that the fpu
definitions match those of i386.
Mostly just structure and field renames, in addition:
1) process_xmm_to_s87() and process_s87_to_xmm() moved into
   x86/convert_xmm_s87.c so they can be used by amd64's netbsd32 code.
2) The linux signal code simplified to use a structure copy for ths fxsave
   data - it matches the hardware definition and won't change.
2014-02-07 22:40:22 +00:00
manu f59b4d840e Properly translate struct swapent for COMPAT_NETBSD32 (missing commit) 2014-02-03 17:03:16 +00:00
manu d7670a176d Properly translate struct swapent for COMPAT_NETBSD32 2014-02-03 13:20:20 +00:00
martin 2934fa70dc Limit the amount of kernel memory a posix_spawn syscall can use (for handling
the file action list) by limiting the maximum number of file actions to
twice the current file descriptor limit.
Fix a few bugs in the support functions and document the new limit.
From Maxime Villard.
2014-02-02 14:48:57 +00:00
christos 57e38ac21c add a struct for the 4.3BSD struct direct 2014-01-28 01:29:35 +00:00
christos 59afdfa995 Fix the compat-4.3 getdirentries call (pre d_type). This is used in NetBSD-0.9. 2014-01-28 01:29:04 +00:00
njoly 5c3bf064f4 Add basic IPV6 level socket options support (IPV6_V6ONLY). 2014-01-27 19:19:15 +00:00
njoly fa8c423a19 Add SO_SNDLOWAT, SO_RCVLOWAT and SO_ACCEPTCONN support for socket
options.
2014-01-27 13:23:33 +00:00
dsl 51a0d6b173 Remove support for 'external' floating point units and the MS-DOS
compatible method of handling floating point exceptions.
Make kernel support for teh fpu non-optional (486SX should still work).
Only 386 cpus support external fpu, and i386 support was removed years ago.
This means that the npx code no longer uses port 0xf0 or interupt 13.
All the "npx at isa" lines go from the configs, arch/i386/isa/npx.c
  is now mandatory for all i386 kernels.
I've renamed npxinit() to fpuinit() and npxinit_cpu() to fpuinit_cpu()
  to match the very similar amd64 functions.
The fpu of the boot cpu is now initialised by a direct call from
  cpu_configure(), this enables FP emulation for a 486SX.
  (for amd64 the cr0 values are set in locore.S and similar).
This fixes a long-standing bug in linux_setregs() - which did not
  save the fpu regsiters if they were active.
I've test booted a single cpu i386 kernel (using anita).
amd64 builds - none of teh changes should affect it.
The i386 XEN kernels build, but I'm not sure where they set cr0, and
  it might have got lost!
2014-01-26 19:16:16 +00:00
christos be0eaa5707 Clear the VM_TOPDOWN flag only when we succeed. 2014-01-25 23:58:10 +00:00
christos 104023f58d regen 2014-01-25 16:43:03 +00:00
njoly d71dfbd73b Update linux socket socket options (SO_*). Add common version to its
own file (linux_socket_generic.h); use it for all but alpha and mips.
2014-01-25 13:49:27 +00:00
skrll 2d1abfdfec More alignment spellos 2014-01-25 10:14:29 +00:00
christos c6c122e4e1 a.out binaries can't handle topdown.
Now 1.0 binaries work correctly on NetBSD-current.
2014-01-25 05:15:43 +00:00
christos 48b47bd889 ifdef debug printf 2014-01-25 03:31:12 +00:00
christos 32ac70a7c0 compat_10 fix: open(NULL) == open("."); 2014-01-25 02:27:41 +00:00
christos 7c188f0050 remove useless flag mangling. It is done already. 2014-01-24 23:20:33 +00:00
christos 7fd72dacf4 need to lock the process. 2014-01-24 22:44:00 +00:00
christos dab0adecf2 It is wishful thinking that vn_readdir will return dirent12 structures. 2014-01-24 22:11:46 +00:00
christos e0277e0438 sigaction until 1.4 had an int sigmask, don't trash the stack. 2014-01-24 22:10:47 +00:00
christos 76f776f138 Fix locking botch, and ...
Yes, we want to be careful because the sizes are different.
2014-01-24 22:10:09 +00:00
bouyer 09a234bd9b Support WSDISPLAYIO_GETCMAP/WSDISPLAYIO_PUTCMAP. Tested on evbmips/loongson 2014-01-24 12:16:10 +00:00
manu 32ccd9f248 Add ATAIOCCOMMAND ioctl form COMPAT_NETBSD32
This enables SMART monitoring by a netbsd32 binary.
2014-01-24 10:41:07 +00:00
njoly bd88ba8ba1 Fix inverted pid/lid arguments in do_sched_{get,set}param calls. 2014-01-23 19:18:08 +00:00
manu 4d40320e92 Fix netbsd32 compatibility bug in kevent()
The keo_put_events() callback copies the events from kernel to userland.
It is called for sets of up to 8 events (constant chosen in kevbuf
definitition in kevent1()). The callback is called with pointer to userland
buffer, count of events to copy, and an index parameter which tracks where
we are in userland buffer when called multiple time.

COMPAT_NETBSD32's flavor of keo_put_events() is netbsd32_kevent_put_events().
It did not honour the index parameter, which caused invalid event data to
be returned when userland requested more that 8 events. This caused many
reliability problems, and the obvious startup crash of dovecot log process
when it accessed udata in the nineth event in its buffer, which was NULL.
2014-01-23 10:50:14 +00:00
dsl 751a051f72 Flatten the floating point register structures bu moving the
'environment' registers into the main strcuture.
There are x87 instructions that only affect the environment, but that
  is no real excuse for all the sub-structures.
Rename fields so that there are far fewer collisions between the two
  sets of field names.
2014-01-19 14:30:37 +00:00
dsl 5d0abe175a No longer used. 2014-01-19 13:36:40 +00:00
dsl 06a21d98cb Rip out the code that might once have supported the freebsd ptrace
system calls.
Removes some very dodgy conversions of FP register layouts.
Most of it has been disabled since 2007 when I removed the stackgap.
2014-01-19 13:35:58 +00:00
christos 3b438d6a5c use new bsd.syscall.mk 2014-01-14 18:51:24 +00:00
njoly 917429fe1b Regen. 2014-01-13 10:33:23 +00:00
njoly 283688165b Cleanup, and reduce diffs between arches. Make alpha use
linux_sys_{get,set}timeofday like others.
2014-01-13 10:33:03 +00:00
dsl 95739e63cd Remove __HAVE_PROCESS_XFPREGS and add the extra parameter for the size
of the fp save area to all the process_read_fpregs() and
  process_write_fpregs() functions.
None of the functions have been modified to use the new parameters.
The size is set for all the writes, but some of the arch-specific reads
  just pass NULL.
The amd64 (and i386) need variable sized fp register save areas in order
  to support AVX and other enhanced register areas.
These functions are rarely called - so the extra argument won't matter.
2014-01-04 00:10:02 +00:00
dsl be74e0a9c9 Change the type of the 'cookie' that holds the state of the core dump file
from 'void *' to the actual type 'struct coredump_iostate *'.
In most of the code the contents of the structure are still unknown.
This just stops the wrong type of pointer being passed to the 'void *'
parameter.
I hope I've found everything, amd64 GENERIC and i386 GENERIC & ALL compile.
2014-01-01 18:57:15 +00:00
njoly 465ae6432a Add easy parts (TCOOFF/TCOON) of the TCXONC linux termios ioctl. 2013-12-27 16:58:50 +00:00
njoly 27180d99da Rename ipcall/socketcall specific defines to avoid conflict with
syscalls definitions. No functional changes.
2013-12-27 15:10:53 +00:00
njoly 825f0d0c2c Regen. 2013-12-27 14:17:32 +00:00
njoly 87ffdd525a Add struct linux_stat64 definition for alpha, and enable syscalls that
use it.
2013-12-27 14:17:11 +00:00
njoly 32701b7213 Regen for fcntl64(). 2013-12-24 13:41:55 +00:00
njoly 71c7929bf4 Reduce diffs between arches, add fcntl64() to m68k. 2013-12-24 13:41:25 +00:00
njoly b50661d98e CTASSERT that native to compat errno translation tables are kept in
sync with native errno list.

Remove extra entries (linux) which resulted in bad translated values,
and add missing ones (ibcs2, osf1 and svr4) which made some out of
bounds accesses.
2013-12-22 17:14:22 +00:00
njoly b647d3d5d8 Cleanup compat linux errnos by adding generic errnos in a single file.
Use it for all arches except alpha and mips.
Add a few missing native to linux errno conversions.
2013-12-17 22:14:24 +00:00
martin 4d03a889b8 Free pathbuf in an error path.
From Maxime Villard.
2013-12-17 20:45:22 +00:00
njoly b5db486fb6 Regen. 2013-12-10 14:55:07 +00:00
njoly 2882c93e6b Add *at() syscalls like other arches. 2013-12-10 14:54:36 +00:00
dsl 8acb81ad2b Missing change to the fxsave structure rename 2013-12-09 08:33:48 +00:00
njoly 4aa28cc3f1 Regen. 2013-12-08 15:56:12 +00:00
njoly 7baf52cd9a Sprinkle a few more linux_umode_t where appropriate.
Reduce diffs between archs.
2013-12-08 15:55:10 +00:00
njoly d16d72eb65 Add missing syscall argument fd in comment. 2013-12-08 14:59:43 +00:00
christos f0ceb57840 revert fpu/pcu changes until we figure out what's wrong; they cause random
freezes
2013-12-01 01:05:16 +00:00
christos 9d605174d9 Change the queue.3 *_END(&head) macros to NULL. Since we don't have CIRCLEQ
anymore, all the macros expand to NULL anyway, so this improves readability.
Requested by rmind@
2013-11-27 17:24:43 +00:00
christos 2ff9a720d1 fix previous, list ends in NULL, and don't open-code 2013-11-23 23:34:04 +00:00
christos d2c05345c3 fix previous the end of the list is NULL, and don't open-code. 2013-11-23 23:30:39 +00:00
christos 7813233f96 fix open-coded mountlist scan 2013-11-23 20:53:46 +00:00
riz 4d884f3fb4 Since mountlist is now a TAILQ, convert some missed usages
so things build again.
2013-11-23 16:15:24 +00:00
christos 0b725b63c7 change the mountlist CIRCLEQ into a TAILQ 2013-11-23 13:35:36 +00:00
chs 6aed52509c regen 2013-11-19 03:53:09 +00:00
chs e3ea522918 add the *at() syscalls. 2013-11-19 03:52:07 +00:00
christos ae496e1598 Regen 2013-11-18 19:23:35 +00:00
christos 35ec66cc18 Fix extended attribute syscalls to use the proper types and call their netbsd32
counterparts for now.
2013-11-18 19:23:27 +00:00
chs 42fa7e34f4 claim to be linux 3.11.6 (opensuse 13.1). 2013-11-18 01:36:49 +00:00
chs c1e3376b22 regen 2013-11-18 01:36:35 +00:00
chs 29a841b371 implement the *at() syscalls.
bring the unimplemented syscall list up to date.
2013-11-18 01:32:52 +00:00
chs 9b4603f5cc initialize %ds to something valid to help ptrace(). 2013-11-18 01:32:32 +00:00
chs 2084516c98 implement AT_RANDOM. 2013-11-18 01:32:22 +00:00
slp 69abcb6960 On linux_sys_getdents, insert d_type at the end of each record.
Fixes PR kern/47806.
2013-11-10 12:07:52 +00:00
njoly c0dc7e32cd Regen for dup/dup2/dup3 argument types fix. 2013-11-07 19:39:57 +00:00
njoly dffea6ad6b Fix dup/dup2/dup3 argument types (u_int -> int). 2013-11-07 19:37:18 +00:00
christos 50d0979a7a fix incorrect sizes to memset 2013-11-04 16:52:08 +00:00
martin 5252413f60 Remove a variable 2013-10-25 14:46:35 +00:00
drochner 23780ff8df Use the MI "pcu" framework for bookkeeping of npx/fpu states on x86.
This reduces the amount of MD code enormously, and makes it easier
to implement support for newer CPU features which require more fpu
state, or for fpu usage by the kernel.
For access to FPU state across CPUs, an xcall kthread is used now
rather than a dedicated IPI.
No user visible changes intended.
2013-10-23 20:18:50 +00:00
christos c829de6452 remove unused variable 2013-10-17 21:08:16 +00:00
njoly 4a806b5236 Regen for mknodat(2) device argument type change. 2013-10-17 18:04:40 +00:00
njoly 349036b521 Change mknodat(2) device argument type from uint32_t to dev_t.
Adds needed extra PAD argument for 64bit alignment, and libc wrapper.
2013-10-17 18:01:11 +00:00
christos fda5f877e5 prefix compat with __ in case __dso_hidden is not available 2013-10-04 21:07:37 +00:00
christos ca2d95d15f avoid linker warning for compat symbols that are used internally in libc,
by introducing a hidden compat_foo() function, using that internally in
libc, and exposing foo as a strong alias to compat_foo(). I am open for
better ideas.
2013-10-04 20:49:16 +00:00
njoly a4d690b0d1 Regen for utimensat(2). 2013-09-24 13:28:50 +00:00
njoly eb2a213af4 Add utimensat(2) for compat linux. 2013-09-24 13:27:49 +00:00
christos 721e82b55a exec modules need to be of the exec kind 2013-09-19 18:50:35 +00:00
njoly 1b3ff581a5 Regen. 2013-09-15 12:59:17 +00:00
njoly 9692d5cd1c Make alpha use linux_sys_utimes() just like other archs. 2013-09-15 12:58:34 +00:00
matt db7576897d Use <arm/locore.h> 2013-08-18 07:01:45 +00:00
pooka 2ad17e87e5 regen 2013-08-11 18:35:19 +00:00
pooka a8850c1ec8 Linux treats the data parameter as a pointer/long too. The comments
in the sys/ptrace.h on Linux say it should be an int, but the code
glibc/musl/kernel disagrees.
2013-08-11 18:34:43 +00:00
pooka aa1a50a32f regen 2013-08-11 12:23:46 +00:00
pooka 4f2d6acaba Use long instead of int for ptrace addr. This makes things compile
better on powerpc64 with a compiler which warns about int-to-pointer
casts.
XXX: sys/ptrace.h on Linux says that the addr parameter is a "void *".
2013-08-11 12:23:02 +00:00
pooka 220050f663 Allow to build in envs without USRSTACK (namely, rump kernels on powerpc).
TODO: all of the m*() calls are by definition incompatible with rump
kernels; including them is no great damage, but they're not useful either.
2013-08-11 09:07:15 +00:00
njoly 1ba7494cb0 Add a new get_utimens32() helper function that fetch struct timespec
data if not NULL, to be used by netbsd32_utimensat() and
netbsd32_futimens().
2013-07-30 17:22:31 +00:00
njoly 0cb3d6b752 Initialise destination before performing stat structure conversion.
Avoid getting garbage for structure members not set explicitely.
2013-07-20 13:13:33 +00:00
njoly 00693d7bfc Do not make FUTEX_WAIT wait indefinitely for an invalid timeout
(tv_nsec = -1).
2013-07-18 17:31:02 +00:00
matt 3dff691c04 futimens uses two timespec as well. 2013-07-18 14:14:00 +00:00
matt 8985a1ce88 Deal with timespecs properly in futimens and utimensat.
PR/48060
2013-07-18 14:07:43 +00:00
matt b66091785f Move *at syscall handlers to netbsd32_fs.c from netbsd32_netbsd.c
Fix netbsd32_fstatat to emit a 32bit stat structure.
2013-07-18 13:43:32 +00:00
christos 074b003f13 regen 2013-06-26 16:29:50 +00:00
christos edba8af487 remove dups document more. From FreeBSD. Still there is disagreement as
to where sigreturn is.
2013-06-26 16:29:41 +00:00
riz d68d012c39 UNIMP->UNIMPL 2013-06-25 04:10:17 +00:00
stacktic a69c3c1394 Typo 2013-06-08 12:50:32 +00:00
christos 16ccb1669c handle timeouts like before. 2013-04-17 14:39:40 +00:00
christos 3d6e1ab522 Add some more futex gunk and explain why it does not work (yet).
Now skype aborts with a futex timeout, instead of a stack smash leading
to a SEGV.
2013-04-16 23:03:05 +00:00
christos 890d27ce13 alpha uses standard utimes. 2013-04-15 19:24:04 +00:00
pooka 801602f013 Fix COMPAT_LINUX32. 2013-04-09 08:00:20 +00:00
pooka b84b9e7d01 regen for utimes 2013-04-08 20:58:21 +00:00
pooka a2e804b2bc support utimes on non-alpha linux platforms 2013-04-08 20:54:47 +00:00
christos 3335fd3b29 regen 2013-03-29 01:14:09 +00:00
christos 52c1f729ca lwp park glue 2013-03-29 01:13:54 +00:00
christos 14184f73a9 compat glue for new lwp_park 2013-03-29 01:04:30 +00:00
christos ab470567c6 compat glue for new lwp_park() 2013-03-29 01:02:49 +00:00
pooka de7fce08a0 Fix stat64 by making it match i386. Other archs might still be broken,
but this is the one I could test.
2013-03-21 15:03:47 +00:00
christos 6b28c645f3 remove empty #if 2013-02-21 14:13:01 +00:00
skrll a0267f89e6 Wrap sysctl_teardown(&compat_clog) with the appropriate #if defined()s 2013-02-21 10:22:04 +00:00
pgoyette e8ac3e27f9 Move boottime50 and its associated sysctl into the compat module. As
noted on tech-kern.  Should fix PR/47579.

OK christos@

Will request pull-up to 6.0 in a few days.
2013-02-21 01:39:54 +00:00
mbalmer c826b564cf exitting -> exiting. 2013-01-27 14:47:37 +00:00
christos 8a8a278a1c Simplify the ifdef mess. No functional context. 2013-01-22 01:47:20 +00:00
hannken 33458e7a0a netbsd32_posix_spawn_fa_alloc: use the right length for path allocation.
This error lead to memory pool corruption when freeing kmem with wrong size.
2013-01-15 17:14:11 +00:00
christos dcd6f42793 Use copyin/copyout and linux-specific ifreq structures (they are the same
as the netbsd ones, but this disconnects them)
2013-01-11 19:01:36 +00:00
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