Commit Graph

5092 Commits

Author SHA1 Message Date
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