Commit Graph

4768 Commits

Author SHA1 Message Date
cegger
cb0f831638 use device_xname() 2009-05-11 21:34:55 +00:00
cegger
2dc0e43978 use device_xname() 2009-05-11 20:53:47 +00:00
ad
6977231a34 G/C reference to LK_CANRECURSE. 2009-05-06 22:38:31 +00:00
njoly
692b478fd5 Add IPC_64 support to all semctl(2) commands, following corresponding
compat linux change.
2009-04-27 13:24:18 +00:00
njoly
d3dabe1260 Add IPC_64 support for all semctl(2)/msgctl(2). Needed, at least on
i386 for Linux 2.6 emulation.
2009-04-23 17:40:57 +00:00
njoly
c4fb0248d2 Convert si_code value from native to linux. 2009-04-23 17:37:51 +00:00
ad
4d8f47ae2f cpuctl:
- Add interrupt shielding (direct hardware interrupts away from the
  specified CPUs). Not documented just yet but will be soon.

- Redo /dev/cpu time_t compat so no kernel changes are needed.

x86:

- Make intr_establish, intr_disestablish safe to use when !cold.

- Distribute hardware interrupts among the CPUs, instead of directing
  everything to the boot CPU.

- Add MD code for interrupt sheilding. This works in most cases but there is
  a bug where delivery is not accepted by an LAPIC after redistribution. It
  also needs re-balancing to make things fair after interrupts are turned
  back on for a CPU.
2009-04-19 14:11:36 +00:00
skrll
66aaa2e514 Typo in comment. 2009-04-16 07:42:28 +00:00
elad
2d1c968399 Remove a few KAUTH_GENERIC_ISSUSER in favor of more descriptive
alternatives.

Discussed on tech-kern:

	http://mail-index.netbsd.org/tech-kern/2009/04/11/msg004798.html

Input from ad@, christos@, dyoung@, tsutsui@.

Okay ad@.
2009-04-15 20:44:24 +00:00
ad
c6367674d6 Add fileops::fo_drain(), to be called from fd_close() when there is more
than one active reference to a file descriptor. It should dislodge threads
sleeping while holding a reference to the descriptor. Implemented only for
sockets but should be extended to pipes, fifos, etc.

Fixes the case of a multithreaded process doing something like the
following, which would have hung until the process got a signal.

thr0	accept(fd, ...)
thr1	close(fd)
2009-04-04 10:12:51 +00:00
christos
802d07dbca cast segsz to int. 2009-04-01 21:15:23 +00:00
dogcow
36ffab86d9 fix what looks like a mechanical stuffup in the timeval -> timespec conversion. 2009-04-01 03:06:06 +00:00
cegger
456f7ba595 buildfix: NEW_VMCMD(2 -> NEW_VMCMD2( 2009-03-31 06:03:31 +00:00
christos
2b1b4bc6ef Move the internal poll/select related API's to use timespec instead
of timeval (rides the uvm bump).
2009-03-29 19:21:19 +00:00
mrg
fcc023545e - add new RLIMIT_AS (aka RLIMIT_VMEM) resource that limits the total
address space available to processes.  this limit exists in most other
modern unix variants, and like most of them, our defaults are unlimited.
remove the old mmap / rlimit.datasize hack.

- adds the VMCMD_STACK flag to all the stack-creation vmcmd callers.
it is currently unused, but was added a few years ago.

- add a pair of new process size values to kinfo_proc2{}. one is the
total size of the process memory map, and the other is the total size
adjusted for unused stack space (since most processes have a lot of
this...)

- patch sh, and csh to notice RLIMIT_AS.  (in some cases, the alias
RLIMIT_VMEM was already present and used if availble.)

- patch ps, top and systat to notice the new k_vm_vsize member of
kinfo_proc2{}.

- update irix, svr4, svr4_32, linux and osf1 emulations to support
this information.  (freebsd could be done, but that it's best left
as part of the full-update of compat/freebsd.)


this addresses PR 7897.  it also gives correct memory usage values,
which have never been entirely correct (since mmap), and have been
very incorrect since jemalloc() was enabled.

tested on i386 and sparc64, build tested on several other platforms.

thanks to many folks for feedback and testing but most espcially
chuq and yamt for critical suggestions that lead to this patch not
having a special ugliness i wasn't happy with anyway :-)
2009-03-29 01:02:48 +00:00
gmcgarry
65b9855fd5 Replace gcc initialisers with c99 designated initialisers. 2009-03-26 22:22:14 +00:00
ad
d16d704d62 PR port-i386/40143 Viewing an mpeg transport stream with mplayer causes crash
Fix numerous problems:

1. LDT updates are not atomic.

2. Number of processes running with private LDTs and/or I/O bitmaps
   is not capped. System with high maxprocs can be paniced.

3. LDTR can be leaked over context switch.

4. GDT slot allocations can race, giving the same LDT slot to two procs.

5. Incomplete interrupt/trap frames can be stacked.

6. In some rare cases segment faults are not handled correctly.
2009-03-21 14:41:29 +00:00
cegger
e2cb85904d bcopy -> memcpy 2009-03-18 17:06:41 +00:00
cegger
c363a9cb62 bzero -> memset 2009-03-18 16:00:08 +00:00
cegger
35fb64746b bcmp -> memcmp 2009-03-18 15:14:29 +00:00
cegger
df7f595ecd Ansify function definitions w/o arguments. Generated with sed. 2009-03-18 10:22:21 +00:00
dyoung
a3bde60951 #include "opt_compat_netbsd.h" for COMPAT_20. 2009-03-17 00:08:10 +00:00
dyoung
1290eea0cb Add #include "opt_compat_netbsd.h" for COMPAT_09. 2009-03-17 00:01:54 +00:00
dsl
7cc9af7d64 ANSIfy functions with function-pointer arguments 2009-03-16 23:11:09 +00:00
njoly
fd24f7c917 Regen for netbsd32_dev_t. 2009-03-16 20:49:16 +00:00
njoly
0f21bb4a22 Fix dev_t alignment, by not using the new 64bit value directly but
rather a 32bit aligned version (netbsd32_dev_t = netbsd32_uint64).

ok by cube@.
2009-03-16 20:48:13 +00:00
cegger
9fca5da616 ansify function definitions 2009-03-15 15:55:51 +00:00
cegger
7038d1e471 ansify function definition 2009-03-15 15:54:43 +00:00
dsl
82357f6d42 ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
2009-03-14 21:04:01 +00:00
christos
7fd1fc871c fix robust_list pointer mess! 2009-03-14 20:18:27 +00:00
dsl
454af1c0e8 Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
2009-03-14 15:35:58 +00:00
christos
7ef7e1b997 disable PTHREAD_CONCURRENCY until the bugs are fixed. 2009-03-06 14:00:40 +00:00
msaitoh
16ed711ed3 fix typo (s/stucture/structure/) 2009-03-05 01:21:57 +00:00
skrll
5ccc095a3e Fix the posix_fadvise return value... finally.
Tested martin on sparc64/m68k and me on hppa.
2009-03-04 18:11:24 +00:00
ad
dd1969c253 PR kern/40730 any user can crash the system with KERN_SA
Disable SA. It can be re-enabled with sysctl -w kern.no_sa_support=0.
2009-03-02 22:11:28 +00:00
christos
4538aa34ee Regen 2009-02-26 21:09:00 +00:00
christos
6d029d549a fix kernel build with no options NTP 2009-02-26 21:08:48 +00:00
rmind
f54234d142 Switch Linux futex emulation to native ucas_int(), remove unecessary
futex-specific assembler routines.

Fixes PR/40490.  Reviewed by <ad>.
2009-02-23 20:28:58 +00:00
nakayama
c99ea852e4 - fix copyout size in CLOCKCTL_O?ADJTIME.
- add missing break in CLOCKCTL_NTP_ADJTIME.
2009-02-22 13:06:58 +00:00
njoly
dc871322e1 Do not protect native_to_linux_si_code() under LINUX_NPTL anymore, now
that linux si_code definitions are MI.
2009-02-18 14:43:22 +00:00
njoly
65488d267e Add IPC_64 support for all shmctl(2) commands, and reduce diffs with
compat linux version.
2009-02-18 14:40:14 +00:00
njoly
a1cf1f2eab Add IPC_64 support for all shmctl(2) commands, not only for STAT/SET.
This make it work on i386 under 2.6 emulation.
2009-02-18 14:30:43 +00:00
apb
0cc72e51ac Use "defopt MODULAR" in sys/conf/files, and #include "opt_modular.h"
in all kernel sources that use the MODULAR option.
Proposed in tech-kern on 18 Jan 2009.
2009-02-13 22:41:00 +00:00
njoly
bc0bccb487 Regen for mincore(2). 2009-01-30 13:57:39 +00:00
njoly
8bbb521068 Add mincore syscall. 2009-01-30 13:55:51 +00:00
njoly
b5ae97a41a Cleanup. Kill a few netbsd32_caddr_t in syscalls argument types. 2009-01-30 13:01:36 +00:00
njoly
73abc6838e Revert the previous packed attribute fix. Instead make netbsd32_time_t
of type netbsd32_int64 which provides a 64-bit value with a 32-bit
alignment.

Suggested by dsl.
2009-01-28 00:43:04 +00:00
njoly
f01722c17f Make netbsd32_timespec/netbsd32_timeval structures packed. This fix an
alignment problem between 64-bit kernel and 32-bit userland versions,
which ended in different structure sizes.
2009-01-28 00:02:39 +00:00
njoly
3e5b27ff8e Make all fstat(2) compat syscalls consistently use do_sys_fstat(),
instead of fd_getfile()/fd_putfile() dance.

ok by christos.
2009-01-26 13:00:04 +00:00
christos
f7636e0eb3 fix casts. 2009-01-25 01:22:42 +00:00
cegger
e6ae80b89d buildfix: re-adapt to minor() returning a 32bit value again. 2009-01-22 16:10:19 +00:00
christos
d3baa5ffd2 compile into nothing if not compat 50. 2009-01-21 16:12:20 +00:00
tron
1c6c1db2da Revert accidental of some rogue changes which broke the build. 2009-01-21 10:01:42 +00:00
tron
31faff7381 Include "bsd.own.mk" to get the definition of "NETBSDSRCDIR" via
"/etc/mk.conf". This fixes manual use of "make cleandir".
2009-01-20 22:49:29 +00:00
christos
5bd9ba9f86 add some debugging. 2009-01-20 20:47:33 +00:00
njoly
8ed9e9eb51 Regen for personality(2) addition. 2009-01-20 12:02:09 +00:00
njoly
b22c955a54 Add basic support for linux32 personality(2) syscall. 2009-01-20 12:00:58 +00:00
njoly
31357439c7 Fix typo in compat ioctl name. 2009-01-19 23:01:42 +00:00
christos
143e6033a9 Provide compatibility for pre-christos-time_t sysv sysctls. 2009-01-19 19:39:41 +00:00
christos
d610baec20 provide compat_50 2009-01-19 17:39:02 +00:00
njoly
0ebed1143f Small personality(2) update.
- Allow querying current personality.
- Use symbolic names instead of magic values.
2009-01-19 13:31:40 +00:00
christos
14ba6c67a5 Provide compatibility to the old timeval SCM_TIMESTAMP messages. 2009-01-19 02:27:57 +00:00
njoly
77237e1c08 Regen for wait4 update. 2009-01-17 22:34:02 +00:00
njoly
25a76c08aa Convert linux/linux32 wait(4) to use a compat50 rusage structure. 2009-01-17 22:28:52 +00:00
he
994737a3f6 Regenerate files after updating syscalls.master for compat_ultrix:
Adapt to the state after the recent time_t change.
  Type changes:
    timeval -> timeval50
    itimerval -> itimerval50
    rusage -> rusage50
  and use of the compat_50 calls where appropriate.
  Untested, but at least it builds.

  Discussed with christos@
2009-01-17 15:50:12 +00:00
he
92c667768c Adapt to the state after the recent time_t change.
Type changes:
  timeval -> timeval50
  itimerval -> itimerval50
  rusage -> rusage50
and use of the compat_50 calls where appropriate.
Untested, but at least it builds.

Discussed with christos@
2009-01-17 15:48:06 +00:00
njoly
8ff5603c09 Regen for compat 50 update. 2009-01-16 13:12:35 +00:00
njoly
9554a2932f Update some syscalls that now needs compat50 timeval structure. 2009-01-16 13:10:47 +00:00
njoly
b615dfc4d8 Rengen for compat50 update. 2009-01-15 23:50:35 +00:00
njoly
7345858afe Update some syscalls/arguments to use the new compat50 equivalents. 2009-01-15 23:48:50 +00:00
christos
5a4537eb47 Emulate a couple more ioctls. Thanks to Matthias Drochner for pointing them out. 2009-01-15 20:32:59 +00:00
christos
ff90a0090a compat glue. 2009-01-15 18:19:23 +00:00
njoly
39f5db2b54 In rusage_to_rusage50() function, fix memcpy size to include last
struct member (ru_nivcsw) which was missing.

ok by christos.
2009-01-14 22:50:12 +00:00
pooka
09ba2d6689 Regen to prove I didn't screw up the conversion: purely RCSID changes. 2009-01-13 22:33:11 +00:00
pooka
5d19acad62 Regen to prove I didn't screw up the conversion: purely RCSID changes. 2009-01-13 22:33:08 +00:00
pooka
a9a2ce837b Convert the syscalls.master to a format from which it is easier
to parse and generate the compat name and basename (e.g. __stat50
and stat).  Use this to autogenerate __RENAME()'s to the rump_syscalls
header so that they can be called e.g. rump_sys_socket() instead
of rump_sys___socket30().
2009-01-13 22:27:43 +00:00
pooka
21eb48bd8e regen 2009-01-13 22:16:11 +00:00
pooka
b9e6895bec UNIMPL police (two mount syscalls with the same signature?!?) 2009-01-13 22:15:42 +00:00
pooka
5514331a78 regen after unimpl police to get comments right 2009-01-13 22:11:32 +00:00
pooka
7e02aa9486 UNIMPL 2009-01-13 22:10:58 +00:00
pooka
ef4e11410c regen 2009-01-13 22:08:59 +00:00
pooka
4180a41378 UNIMPL police 2009-01-13 22:08:30 +00:00
pooka
c2f114970c regen 2009-01-13 22:03:39 +00:00
pooka
70917e36da UNIMPL police 2009-01-13 22:03:12 +00:00
pooka
c3c68d936d regen: unimpl police 2009-01-13 22:00:48 +00:00
pooka
41d2f63e9a UNIMPL police 2009-01-13 21:57:55 +00:00
pooka
0b40ab56ee regen: UNIMPL police 2009-01-13 21:49:16 +00:00
pooka
c3a8bfb54e UNIMPL police: remove pseudo-prototypes 2009-01-13 21:48:35 +00:00
pooka
e0330adb61 regen 2009-01-13 21:20:29 +00:00
pooka
33883e2a6d Somehow i doubt linux_sys_recvmsg() returns size_t. Make it ssize_t.
(XXX: the actual implementation returns int)
2009-01-13 21:19:51 +00:00
pooka
0033abb5fc regen 2009-01-13 21:07:33 +00:00
pooka
a0ece03c2d Make one UNIMPL consistent with the rest: remove signature. 2009-01-13 21:06:47 +00:00
martin
90daabb504 Add a few missing includes, so the ifdefs work as expected. 2009-01-13 20:47:47 +00:00
pooka
bb5f9edebf regen for #include "opt_compat_netbsd.h" 2009-01-13 19:45:38 +00:00
rtr
f0916c9e83 use do_sys_mknod() instead of sys_mknod() to make this compile again.
ok'd by martin@
2009-01-13 11:35:24 +00:00
rtr
21e966491f actually commit syscalls.master this time
add back blank line between #include <sys/.. and #include <sys/compat/..
regen
2009-01-13 04:31:12 +00:00
rtr
b198a0fd79 regen for christos_time_t merge 2009-01-12 11:53:23 +00:00
mhitch
6ebe2c3a6d Compat a.out stat structures also need to use u_int32_t dev_t. 2009-01-11 22:54:16 +00:00
christos
91306aae6f fix lutimes. 2009-01-11 21:23:22 +00:00
tsutsui
9d90ca88ae Compat a.out stat structures should use compat struct timespec50.
Noticed by mhitch@.
2009-01-11 21:12:04 +00:00
christos
52ef6203ff *utimes should allow NULL tvp. 2009-01-11 20:46:53 +00:00
rumble
40019d9470 regen. 2009-01-11 20:00:14 +00:00
rumble
5e7d8a6495 Fix time_t change fallout. 2009-01-11 20:00:06 +00:00
nakayama
b964c01bff Regen for following christos-time_t merge. 2009-01-11 13:16:34 +00:00
nakayama
60d7add52e Follow christos-time_t merge. 2009-01-11 13:14:14 +00:00
tsutsui
8a2b8ba767 Regen from syscalls.master rev 1.64:
> Update for compat_50 stuff. (compile test only)
2009-01-11 13:00:25 +00:00
tsutsui
4f0ae35127 Update for compat_50 stuff. (compile test only) 2009-01-11 12:59:34 +00:00
tsutsui
a37c14b49c Regen from syscalls.master rev 1.72:
> Update for compat_50 stuff. (compile test only)
2009-01-11 12:45:46 +00:00
tsutsui
f318c9b526 Update for compat_50 stuff. (compile test only) 2009-01-11 12:44:47 +00:00
tsutsui
41e9d73c06 Regen from syscalls.master rev 1.31:
> Update for compat_50 stuff. (compile test only)
2009-01-11 12:27:23 +00:00
tsutsui
2f67cbfacc Update for compat_50 stuff. (compile test only) 2009-01-11 12:25:03 +00:00
tsutsui
348730301a <sys/syscallargs.h> requires <sys/sched.h> for cpuset_t. 2009-01-11 12:19:14 +00:00
cegger
378bd0b618 make this compile 2009-01-11 10:47:37 +00:00
christos
50728e7823 merge christos-time_t 2009-01-11 02:57:17 +00:00
christos
461a86f9bd merge christos-time_t 2009-01-11 02:45:45 +00:00
njoly
16cef148ad Restore expected FUTEX_WAIT behaviour with NULL timeout argument,
which was broken in my recent timespec cleanup/fix.
2009-01-08 12:46:23 +00:00
njoly
5affb2e50a Make sysctl(2) fails with ENOTDIR (instead of EINVAL) for invalid mib
vector length.
2009-01-05 09:33:19 +00:00
njoly
4f6a64a639 Restore struct sysctl padding member name, which was damaged during
__unused removal on arguments.
2009-01-05 09:18:27 +00:00
njoly
e85166daa8 Fix stime(2) inverted copyin arguments. 2008-12-29 22:21:49 +00:00
njoly
f22af7d53f s/syscallcarg/syscallarg/ in comments. 2008-12-29 14:33:40 +00:00
cegger
9b87d582bd kill MALLOC and FREE macros. 2008-12-17 20:51:31 +00:00
njoly
6b9fe0233d Regen for clock_nanosleep. 2008-12-12 23:38:13 +00:00
njoly
99688b74d2 Add clock_nanosleep syscall. 2008-12-12 23:36:18 +00:00
njoly
26a5edd122 Add some padding members to linux_msqid64_ds for 32-bit archs. This
fix msgctl(2) IPC_STAT|IPC_64 calls, at least, on i386.
2008-12-09 11:09:11 +00:00
njoly
bd398db254 Remove unused timeval_to_clock_t function, superseeded by CONVTCK
macro.
2008-12-08 11:52:35 +00:00
njoly
adf5b0a542 Regen for netbsd32_caddr_t removal. 2008-12-06 23:15:09 +00:00
njoly
e7377ec502 Cleanup; kill netbsd32_caddr_t use. 2008-12-06 23:14:03 +00:00
njoly
9321a67e19 Small setres{uid,gid} cleanup; there is no need to use a specific
handling for -1 uid values.
2008-12-06 23:01:32 +00:00
njoly
14e966b9e0 Regen for getres{uid,gid} syscalls. 2008-12-05 23:31:54 +00:00
njoly
533a52241a Add getres{uid,gid} syscalls. 2008-12-05 23:30:19 +00:00
ad
dc5f414733 PR port-amd64/40091 compat_linux32 module loading = panic due to missing syms 2008-12-03 12:51:11 +00:00
njoly
96d7b57e0f Regen for getdirentries fix. 2008-12-02 13:45:40 +00:00
njoly
488fb8373c Fix getdirentries(2) by not calling compat_43_sys_getdirentries, but
letting do its own job instead (native and osf1 dirent structure have
different member number and types).
2008-12-02 13:45:02 +00:00
njoly
d42a74a9ba Regen for sched_get_priority_{min,max}. 2008-12-01 14:19:45 +00:00
njoly
aba771042c Add sched_get_priority_{min,max} syscalls. 2008-12-01 14:18:44 +00:00
ad
1a85128fea COMPAT_ULTRIX does not work on vax because there are no hooks, but make
it compile anyway.
2008-11-24 11:19:53 +00:00
njoly
6d6fb02ffd Regen for getpgid. 2008-11-24 00:26:34 +00:00
njoly
010c8bc9c7 Add getpgid, needed for Tru64 4.0g ksh. 2008-11-24 00:25:30 +00:00
njoly
6709281d18 Move si_code definitions from MD to MI linux_siginfo.h, all archs
(except mips for 3 values) are identical.
While here, remove unused/unneeded LINUX__SI_CODE macro. Only the
lower 16-bits are used for userland si_code.
2008-11-23 23:48:48 +00:00
mrg
56585a9fd3 initialise a variable to avoid a GCC warning. 2008-11-23 00:15:13 +00:00
mrg
3b1d48844e regenerate 2008-11-22 23:14:01 +00:00
mrg
672c98ee5a implement netbsd32__sched_setparam(), netbsd32__sched_getparam(),
netbsd32__sched_setaffinity() and netbsd32__sched_getaffinity().
2008-11-22 23:13:38 +00:00
cegger
53d5928d58 make this compile 2008-11-21 20:53:28 +00:00
he
2df25715bb Need to include <sys/module.h> when using the MODULE() macro. 2008-11-21 19:55:38 +00:00
he
b9e9d5c919 Commit regenerated files after this change to syscalls.master:
sys_nfssvc() is actually only defined when NFSSERVER is defined,
not when only NFS is defined, according to sys/nfs/files.nfs.
Adapt accordingly.  Fixes build of amiga INSTALL kernel.
2008-11-21 15:15:31 +00:00
he
5ed8abf7d9 sys_nfssvc() is actually only defined when NFSSERVER is defined,
not when only NFS is defined, according to sys/nfs/files.nfs.
Adapt accordingly.  Fixes build of amiga INSTALL kernel.
2008-11-21 15:14:56 +00:00
tron
709a35c482 Make it possible to compile a kernel with COMPAT_NETBSD32 but without
COMPAT_40. This fixes PR port-amd64/39967.
2008-11-20 11:56:40 +00:00
ad
1ab7ca8fdc PR port-amd64/39964 modules/compat_linux: missing symbols on amd64 2008-11-20 09:26:06 +00:00
ad
11c98a4abf PR port-amd64 modules/compat missing symbols on amd64
Also, test for compat_??_machdep.c so we don't have to grow more ifdefs
in the makefile.
2008-11-20 09:22:57 +00:00
cegger
f20e076be5 take ecoff header for ecoff code. 2008-11-20 00:28:07 +00:00
cegger
89ba8d828a make this compile (for next68k) 2008-11-19 23:31:13 +00:00
cegger
20a167ec1c make this compile 2008-11-19 22:27:19 +00:00
cegger
3076d30653 make this compile for alpha 2008-11-19 22:02:21 +00:00
ad
c4d65a7c5e Additionally, set emul_netbsd_object=NULL after detaching it. 2008-11-19 21:29:25 +00:00
ad
5473327d60 compat_modcmd: emul_netbsd_object will be NULL if no exec has taken place
between load and unload of the compat module.
2008-11-19 21:27:54 +00:00
ad
e157b99c7c Regen. 2008-11-19 18:39:43 +00:00
ad
92ce8c6a3d Make the emulations, exec formats, coredump, NFS, and the NFS server
into modules. By and large this commit:

- shuffles header files and ifdefs
- splits code out where necessary to be modular
- adds module glue for each of the components
- adds/replaces hooks for things that can be installed at runtime
2008-11-19 18:35:57 +00:00
njoly
2b470c165e Regen for futex timeout argument cleanup/fix. 2008-11-19 13:11:15 +00:00
njoly
377975c175 futex(2) timeout argument cleanup/fix.
- Use `struct linux_timespec', converted to native structure.
- Ensure that provided values are correct.
- Replace timeval+tvtohz by tstohz.
2008-11-19 13:09:19 +00:00
njoly
d64736c6b8 noisy printf. 2008-11-18 15:25:13 +00:00
ad
7369e64e54 LINUX_GCC_SIGNATURE also matches NetBSD/i386 ELF binaries, so disable it. 2008-11-17 13:03:42 +00:00
martin
42cab0447c Make it compile 2008-11-16 15:17:05 +00:00
njoly
ef05808702 Do not call namei anymore, but use the result from the previous
emul_find_interp call instead. This make dynamic executables work
again under compat OSF1 (fix PR/39255).

ok by christos.
2008-11-15 00:49:53 +00:00
ad
57de28fac5 - Move some more compat code into sys/compat.
- Split 4.3BSD ifioctl stuff into its own file.
- Remove some ifdefs that include small fragments of vfs compat code
  which are difficult to relocate elsewhere.
2008-11-14 23:10:57 +00:00
ad
7dbfda5cca Unneeded ifdef 2008-11-14 15:56:17 +00:00
ad
7bd1ee08d6 Regen. 2008-11-14 15:50:01 +00:00
ad
18e73e1ebe Replace semid_t with intptr_t. No function change. This is a libc/kernel
private interface and so the name change should not affect any third
party code.
2008-11-14 15:49:20 +00:00
ad
c5122072aa _KERNEL_OPT 2008-11-14 13:10:33 +00:00
ad
a682ddf568 Make it build again. 2008-11-13 12:09:52 +00:00
ad
b11cbdbb9d compat_ossaudio module, so others can depend on it. 2008-11-13 10:05:52 +00:00
njoly
7712a0fc6c Regen for nanosleep(2) fix. 2008-11-12 18:09:22 +00:00
njoly
cf19223289 Fix nanosleep(2) on 64-bit archs. Do not call native nanosleep
syscall, but rather a modified version the will take care of `struct
timespec' conversions.
2008-11-12 18:07:40 +00:00
njoly
1eff3fc2c0 Add missing sys/syscall.h include for SYS_ptrace definition. 2008-11-12 15:22:18 +00:00
ad
0efea177e3 Remove LKMs and switch to the module framework, pass 1.
Proposed on tech-kern@.
2008-11-12 12:35:50 +00:00
wrstuden
ab61b53b27 Adjust the sleeps in lwpcache and lwpublk. Make them uninterruptable
for now. This will prevent signals from waking them. Adjust
exit_lwps() to explicitly add LW_SINTR to all of them, so that
the process exit code can wake them up.

This is needed as threads in both of these wait channels die once
they are woken. So they aren't interruptable in the typical sense.

I am now able to suspend & resume firefox successfully now.
2008-11-01 05:59:33 +00:00
wrstuden
04ca26c586 Tweak change to move SA support from userret() to lwp_userret().
1) Since we want to check for upcalls only once, take LW_SA_UPCALL
out of the while(l->l_flags & LW_USERRET) loop.

2) since the goal is to keep SA code out of userret() (and especially
all the emulations that include userret() but will never do SA),
ALWAYS set LW_SA_UPCALL when we set SAVP_FLAG_NOUPCALLS. Drop the
test for it in lwp_userret() since it will never be set bare.

3) Adapt sa_upcall_userret() to clear LW_SA_UPCALL if it's no longer
needed. If we have gained upcalls since sa_yield(), we will deliver
them next time around.

Tested by skrll at.
2008-10-28 22:11:36 +00:00
christos
e4b18f1168 populate init_thread_area. 2008-10-28 18:37:41 +00:00
jmcneill
af9ee6c291 Only call release_futexes if LINUX_NPTL 2008-10-28 11:42:30 +00:00
wrstuden
1698883b6a Ok. Some calls to sa_upcall() pass in an 'l' that is not the current
lwp. Our "no-upcall" flagging however accesses l_pflag, and so we
can't access l->l_pflag. So access curlwp for the no-upcall-blocking
part.
2008-10-27 16:52:04 +00:00
jmcneill
1b69e667f6 Need opt_multiprocessor.h for MULTIPROCESSOR definition. 2008-10-26 22:33:03 +00:00
christos
fbc6c6a8e6 changes from pengo that make initializing skype more reliable. 2008-10-26 20:46:05 +00:00
christos
3ce1cee82d regen. 2008-10-26 20:26:53 +00:00
christos
b5a45a5fad catch up with i386 changes. 2008-10-26 20:25:49 +00:00
christos
1b9e833438 multiprocessor fixes, from rmind 2008-10-26 20:22:01 +00:00
jmcneill
e143becdb6 linux_sys_get_robust_list: copyout the entire struct, not the size of the
pointer to it.
2008-10-26 19:13:16 +00:00
christos
1b618d0f6e use a symbolic constant instead of 6. 2008-10-26 17:57:49 +00:00
christos
60485d403e use GUGS_SEL instead of 3. 2008-10-26 17:42:37 +00:00
christos
68a065aac1 regen 2008-10-26 16:38:41 +00:00
christos
5dfa1e6b4a futex support fixes from FreeBSD via cube+pengo. 2008-10-26 16:38:22 +00:00
ad
49169f6211 Assert that the segment descriptors we generate for TLS will not allow
privilege elevation.
2008-10-26 11:02:14 +00:00
mrg
27498ba7bc if the interpreter is literally "/usr/libexec/ld.elf_so" or
"/libexec/ld.elf_so", try <path>-<machine32arch>.
2008-10-26 07:07:35 +00:00
christos
a893abf3f5 regen 2008-10-26 03:44:04 +00:00
christos
86f314b4bf don't forget the percpu stuff and load gs immediately. 2008-10-26 03:43:42 +00:00
christos
47ab401cc8 fix include order; machdep needs to be first for LINUX_NPTL to be defined. 2008-10-26 02:00:57 +00:00
christos
f6382710ee Add preliminary tls support for i386. Does not work yet. From FreeBSD. 2008-10-25 23:38:28 +00:00
apb
f46c1de7cb Use ${TOOL_SED} instead if plain sed in Makefiles. 2008-10-25 22:27:34 +00:00
njoly
d05df800a8 Do not use native_to_linux_si_code() outside LINUX_NPTL; until i
figure a better way to handle it.
2008-10-21 21:52:29 +00:00
njoly
beff3f7516 Remove LINUX_SI_xxx from MI siginfo.h, that should not have been
committed. Rather add them to amd64 MD header.
Fix compilation failures on non x86 archs.
2008-10-21 20:24:15 +00:00
njoly
db06152637 tkill/tgkill syscalls cleanup.
- Make both syscalls set si_code to SI_LWP (which will be converted to
  Linux SI_TKILL value). Fix thread some cancellation under NPTL
  emulation.
- Merge code in a new linux_do_tkill() function that will do its own
  job, instead of calling linux_sys_kill().
- Do only alter single tasks, by rejecting non positive tid/tgid
  values.
2008-10-21 13:36:28 +00:00
njoly
d7732b5cc7 Add native to linux siginfo si_code translation, mostly for negative
values. Adjust amd64 and i386 accordingly, not sure about aother archs
i can't test.
2008-10-19 09:44:31 +00:00
njoly
ea7b260958 g/c amd64 ifndef/endif. 2008-10-17 20:21:34 +00:00
njoly
d0b5229aea Remove unneeded linux_sigaction.c 2008-10-17 20:17:19 +00:00
wrstuden
27724c38ae Adjust locking on the sadata::sa_vps list. The main time we
walk the list, we're looking for a vp to do something with. We do
this in the signal code and in the timer code. The signal code already
runs with proc::p_lock held, so it's a very natural lock to use. The
timer code, however, calls into the sa timer code with a spinlock held.
Since proc::p_lock is an adaptable mutex, we can sleep to get it. Sleeping
with a spinlock is BAD. So proc::p_lock is _not_ the right lock there,
and something like sadata::sa_mutex would be best.

Address this difficulty by noting that both uses actually just read
the list. Changing the list of VPs is rare - once one's added, it stays
until the process ends. So make the locking protocol that to write the
list you have to hold both proc::p_lock and sadata::sa_mutex (taken
in that order). Thus holding either one individually grants read access.

This removes a case where we could sleep with timer_lock, a spinlock at
IPL_SCHED (!!), while trying to get p_lock. If that ever happened, we'd
pretty much be dead. So don't do that!

This fixes a merge botch from how I handled our gaining p_lock - p_lock
should not have simply replaced p_smutex.

While here, tweak the sa_unblock_userret() code for the case
when the blessed vp is actually running (on another CPU). Make its
resched RESCHED_IMMED so we whack the CPU. Addresses a hang I've
observed in starting firefox on occasion when I see one thread running
in userland and another thread sitting in lwpublk, which means it's on
the list of threads for which we need an unblocked upcall. This list is
one on which things should NOT linger.
2008-10-16 18:21:45 +00:00
cegger
968d25010f build fix: get prototype for membar_producer() 2008-10-15 10:05:07 +00:00
wrstuden
4fb41e761e Merge wrstuden-revivesa into HEAD. Catch some files that I forgot
to revive on HEAD in previous commit.
2008-10-15 06:52:38 +00:00
wrstuden
fc7511b00e Merge wrstuden-revivesa into HEAD. 2008-10-15 06:51:17 +00:00
njoly
2c98237db9 Fix linux32 siginfo si_signo value. Do not convert ksi_signo twice. 2008-10-09 23:03:45 +00:00
njoly
249f1f85c5 Regen. 2008-10-06 14:53:58 +00:00
njoly
33b4e768ba Cleanup. Reduce diffs against netbsd32 syscalls.master.
- Remove const keyword for pointer types.
- Update some argument types.
2008-10-06 14:53:01 +00:00
njoly
1b1270d3b5 Compat linux/linux32 nice(2) fix. The syscall argument is an increment
to be added to the current nice value, not an absolute value to be
set.
2008-10-03 22:39:36 +00:00
njoly
b6ef5a15fb Regen after cleanup. 2008-09-22 13:08:50 +00:00
njoly
2fedf4a0fb Kill a few linux32 syscalls identical to netbsd32 ones.
No functional changes expected.
2008-09-22 13:07:46 +00:00
christos
95ffbb8bc9 Define a PSL_CLEARSIG macro for the psl flags to be cleared on signal delivery
and use it everywhere.
2008-09-18 15:57:04 +00:00
scw
5a856ae120 In linux32_shmat() don't try to copyout a 64-bit pointer where userspace
is expecting a 32-bit result.

Fixes nspluginwrapper on amd64.
2008-09-17 20:11:51 +00:00
christos
96bd7a0192 make this compile again. 2008-09-08 15:31:19 +00:00
christos
ae6357afe4 fix broken linux32_sys_times, copied from linux_sys_times. 2008-09-08 11:29:42 +00:00
tron
0f256b9d59 Compile NetBSD/amd64 kernels with "-Wextra". Patches contributed by
Juan RP in PR port-amd64/39266.
2008-09-05 13:37:24 +00:00
njoly
46da4ade28 Make linux32 getdents(2) do its own job instead of calling the
corresponding compat linux function, where struct dirent members types
differs.
2008-09-04 17:45:00 +00:00
bjs
91b72f6613 'if (error = 0)' -> 'if (error == 0)' 2008-08-08 16:21:44 +00:00
plunky
772d60cfb9 convert some [left behind] compat code to use new sockopt API 2008-08-07 20:15:32 +00:00
plunky
fd7356a917 Convert socket options code to use a sockopt structure
instead of laying everything into an mbuf.

approved by core
2008-08-06 15:01:23 +00:00
jmcneill
551b501a8f linux_sys_rt_sigreturn: properly restore stack flags, pointed out by
Juan RP and modified by myself. ok christos@
2008-08-01 18:49:28 +00:00
njoly
a3adeaa5f9 Fix linux_sigismember/linux_sigaddset to work on amd64 (and other
64bits archs), by ensuring that bit shifts are done on correct type.
2008-07-30 16:05:26 +00:00
njoly
c1c4ce8861 Regen for rt_sigpending. 2008-07-24 12:11:14 +00:00
njoly
efde75ae99 Add rt_sigpending syscall. 2008-07-24 12:09:56 +00:00
njoly
066b9aabb5 Add linux32_getifconf, following recent linux_getifconf addition. 2008-07-23 12:32:09 +00:00
jmcneill
a9b5dcaa70 ioctl compatibility for v4l2 and drm 2008-07-19 23:01:52 +00:00
cegger
1ca90441b2 use device_xname 2008-07-17 13:39:50 +00:00
cegger
f2b690d08e remove redundant declaration of tvtohz(). It's declared in <sys/timevar.h>.
Makes i386 ALL kernel build again.
2008-07-17 13:35:07 +00:00
christos
aa389c698d Use more timespecs internally. From Alexander Shishkin and me.
Welcome to 4.99.70, 30 more to go for 100.
2008-07-15 16:18:08 +00:00
matthias
1797e3b14b make LINUX_TCSBRK work. The code is mostly copied from
sys/compat/ibcs2/ibcs2_ioctl.c.
2008-07-04 11:06:31 +00:00
matthias
1b4ed9ea4e make LINUX_TCSBRK work. The code is mostly copied from
sys/compat/ibcs2/ibcs2_ioctl.c.
2008-07-04 10:13:52 +00:00
njoly
153124ee21 Fix SIOCGIFCONF ioctl for 64bit platforms. Add a new linux_ifreq
structure and linux_getifconf function (cleaned up version from
compat_ifconf).

While here, update linux_getifhwaddr to use the new structure.

Ok by christos.
2008-07-03 14:07:09 +00:00
rmind
160268aca6 Remove proc_representative_lwp(), use a simple LIST_FIRST() instead.
OK by <ad>.
2008-07-02 19:49:58 +00:00
matt
7408df1239 Change {ff,fd}_exclose and ff_allocated to bool. Change exclose arg to
fd_dup to bool.  Switch assignments from 1/0 to true/false.

This make alpha kernels compile.  Bump kern to 4.99.69 since structure
changed.
2008-07-02 16:45:19 +00:00
njoly
06e75299f3 Move amd64 MD termois types definitions from linux_termios.h to linux_types.h
following other archs.
2008-06-29 08:50:09 +00:00
chris
d890fb22e6 Fix warnings about type conversions by using linux_speed_t type on
linux_speeds[] rather than speed_t.

On Arm (and others) linux uses unsigned long, however, NetBSD uses
unsigned int.
2008-06-28 21:34:32 +00:00
njoly
9084eed1a8 Add SIOCGIFHWADDR support.
Tested by Cem Kayali.
2008-06-27 12:38:25 +00:00
ad
a00bd89dab Replace references to getsock/getvnode. 2008-06-24 11:18:14 +00:00
gmcgarry
035e707304 ioctl commands are defined unsigned long, so cast cmd to unsigned long before comparison. 2008-06-24 10:03:17 +00:00
njoly
0fe964b56f Fix SIOCGIFCONF ioctl under compat linux32. 2008-06-24 09:00:04 +00:00
njoly
0237fe6def Update compat netbsd32 SIOCGIFCONF ioctls definitions to follow native
ones.
2008-06-23 23:14:42 +00:00
njoly
8cb9e382ae netbsd32_ifreq_tp_t should be of type netbsd32_pointer_t, not int32_t. 2008-06-22 22:40:15 +00:00
he
acba26b8f9 Commit regenerated files after adding include of <sys/sched.h>. 2008-06-21 19:59:09 +00:00
he
3824f75f83 <sys/sycallargs.h> needs <sys/sched.h> now. 2008-06-21 19:58:27 +00:00
tsutsui
cda67469e5 Regen from syscalls.master rev 1.69:
> Include <sys/sched.h> before <sys/syscallargs.h> for cpuset_t.
2008-06-21 13:22:04 +00:00
tsutsui
f1d9471407 Include <sys/sched.h> before <sys/syscallargs.h> for cpuset_t. 2008-06-21 13:20:46 +00:00
njoly
72a97d4bed Do not return 0 for unsupported/unknown futex operations, but ENOSYS
instead. From Roman Divacky in private email.
2008-06-20 11:38:26 +00:00
njoly
d1a60f16f0 Fix futex locking. Move all locking to linux_sys_futex function, and
KASSERT that futex_{get,put,sleep,wake} are now called with lock held.
2008-06-20 11:31:40 +00:00
christos
d83ff0cd7b an attempt at linux32_ioctl_socket(). 2008-06-19 16:09:25 +00:00