Commit Graph

3755 Commits

Author SHA1 Message Date
christos c3ae1990ca Regen 2005-11-17 17:09:05 +00:00
christos 7faedc67d3 need the non-compat version of shm.h too. 2005-11-17 17:07:03 +00:00
simonb 772f8208fc Copyright maintenance - only include the copyrights from the original
sys/*.h files that were in the files at the time the old structures
were present.
2005-11-12 00:39:22 +00:00
chs 001ec1422b include additional headers that are now needed. 2005-11-11 23:22:08 +00:00
jdolecek 95d0b66d28 undo the linux_sys_exit_group() change for now - complete CLONE_THREAD support
is necessary for this to work properly
2005-11-11 22:45:41 +00:00
christos 88056ee1bd Move more compat stuff from sys. 2005-11-11 17:10:42 +00:00
tron 19c262ce51 Include "sys/ipc.h" to get definition of "ipc_perm14" structure.
This fixes the build of "pecoff_exec" LKM.
2005-11-11 11:59:53 +00:00
simonb a21c456e2e Call nanotime() directly, instead of doing the
microtime()/TIMEVAL_TO_TIMESPEC() dance.
2005-11-11 07:07:42 +00:00
christos 82eba32c06 need compat/sys/shm.h 2005-11-10 18:47:53 +00:00
christos 306385b2a5 regen. 2005-11-10 18:47:31 +00:00
christos e2f2b17e31 add the new compat header. 2005-11-10 18:47:16 +00:00
christos 75fdf989ea These two really don't need the new header. 2005-11-10 18:43:32 +00:00
christos 2a4a5534b4 Include new compat header. 2005-11-10 18:39:30 +00:00
christos 0b0496e3d5 move the compat code out of the sys file. 2005-11-10 18:36:20 +00:00
christos 65de380a95 More ipc support for linux; makes oracle work. From chuq and
jlrodriguez at terra dot es
2005-11-10 18:33:37 +00:00
manu e75bcb9ebf Fix build problem 2005-11-09 21:56:11 +00:00
manu f98d5d856e Improve Linux exit_group emulation by sending a SIGKILL to all other
processes in the group instead of letting them live. It would be better
to properly terminate them.
2005-11-09 14:56:50 +00:00
manu f53c4d1d1e Prevent integer overflow in timout calculation.
changed DEBUG_LINUX to DEBUG_LINUX_FUTEX so that we have less debug
messages on the console
2005-11-09 14:52:18 +00:00
manu 26222780eb Correctly computes futex timeout. 2005-11-08 21:28:49 +00:00
manu d72135b371 Include linux_machdep.h so that LINUX_UNAME_ARCH ges defined (fixes
uname emulation)
2005-11-07 14:17:45 +00:00
manu a5d2387dbb regen 2005-11-06 21:50:28 +00:00
manu 7505cb92a6 Back out sched_{set|get}affinity addition because it breaks the
build again on i386 now it is fixed for other archs (Tom's fix and
mine got in colision)
2005-11-06 18:16:31 +00:00
tron 0c24d80f02 Regen with correct RCS Ids. 2005-11-06 14:25:48 +00:00
manu 35f76b0ac2 ifdef out sched_{get|set}affinity for ports that don't use it yet. That
should fix build.
2005-11-05 23:44:25 +00:00
dogcow b3b0932a5d mirror manu's amd64 changes to implement linux sched_{seg,get}affinity;
the kernel and linux lkm now compile again.
2005-11-05 10:56:48 +00:00
manu 2ae48df4fc regen 2005-11-05 08:11:30 +00:00
manu 0cf4b35fe6 Implement more of Linux futex(2) 2005-11-05 08:07:44 +00:00
manu 41455b2ed0 Implement Linux sched_{set|get}affinity 2005-11-05 08:06:58 +00:00
manu 67fcd6abf5 Fix build when LINUX_NPTL is not defined 2005-11-05 07:26:45 +00:00
manu 2cac35470c Fix a messed up patch 2005-11-05 00:58:57 +00:00
manu 88a5eb33ed Instead of ifdef'ing __amd64__ all the Linux NPTL stuff, introduce an
ifdef LINUX_NPTL.
Also implement SETTLS flag to Linux clone()
2005-11-05 00:47:26 +00:00
chs df018c387b make this compile on m68k by including sys/device.h explicitly.
on other platforms it's apparently included implicitly, probably through cpu.h.
2005-11-04 17:00:43 +00:00
manu b72e0d5382 Fix machine name returned by uname on Linux 2005-11-04 16:58:14 +00:00
manu 78ad642708 regen 2005-11-04 16:57:03 +00:00
manu e7609e6478 Implement Linux futex ang gettid 2005-11-04 16:54:11 +00:00
manu 3b8100b96a register_t is not an int on amd64 2005-11-04 16:52:51 +00:00
manu e1c0c1c9dd Implement Linux futex and gettid system calls for amd64 2005-11-04 16:51:56 +00:00
manu 0a3dbc01d5 build fix 2005-11-04 16:49:55 +00:00
manu b7ba0ebc16 Fix pipe linux emulation on amd64 2005-10-31 18:00:30 +00:00
manu 5d2a593dcd build fix 2005-10-31 17:58:07 +00:00
chs d17f6e14bc add support for the linux PROT_GROWS{DOWN,UP} mprotect() flags.
fixes PR 30008.
2005-10-30 16:25:50 +00:00
cube 75d561e358 Move prototypes for siginfo32 to/from siginfo converters at the right
place.
2005-10-24 15:28:09 +00:00
christos 6f981830a9 PR/31905: Wolfgang Stukenbrock: Termios ioctls TIOCMBIC and TIOCMBIS missing
in linux emulation code
2005-10-24 12:58:34 +00:00
cube fc1218444f Regen (kqueue, kevent). 2005-10-23 01:34:33 +00:00
cube 97e4d77453 - Split sys_kevent into kevent1 so that it can be used by COMPAT_NETBSD32
code.

- To achieve COMPAT_NETBSD32 compatibility, introduce a parameter to
  kevent1 that points to functions that do the actual copyin/copyout
  operations.  This is similar to what was done in FreeBSD by Paul Saab.

- Add the COMPAT_NETBSD32 definitions and hooks.
2005-10-23 01:33:32 +00:00
cube 388b97e039 Implement a few changes needed to properly resolve PR#30924, as
discussed in the PR.

- introduce sys/timevar.h to hold kernel-specific stuff relevant to
  sys/time.h.  Ideally, timevar.h would contain all (or almost) of the
  #ifdef _KERNEL part of time.h, but that's a pretty big and tedious
  change to make.  For now, it will contain only the prototypes I
  introduced when working on COMPAT_NETBSD32.

- split copyinout_t into copyin_t and copyout_t, it makes prototypes more
  explicit about the meaning of a given argument.  Suggested by yamt@.

- move copyinout_t definition in sys/time.h to systm.h as copyin_t and
  copyout_t

- make everything uses the new types and include the proper headers at
  the proper places.
2005-10-23 00:09:14 +00:00
christos 78063c9188 regen. 2005-10-20 15:35:42 +00:00
christos 0270612ce7 Conditionalize the sigreturn syscall inclusion; from Patrick Welche 2005-10-20 15:35:25 +00:00
christos e780c5edaf regen 2005-10-18 19:52:07 +00:00
christos 8fc452caf8 add the missing %% that confused joerg and the parser. 2005-10-18 19:51:47 +00:00
joerg 5e74202601 Regen. 2005-10-18 19:08:51 +00:00
joerg 39fcee12fe sys_uselib is needed by COMPAT_LINUX for EXEC_AOUT. Since it doesn't get
build when EXEC_AOUT is not defined, the syscalls.master entry has to be
conditionalized. Alpha did so already, so let the other archs catch up
with it.

Go-on: christos
2005-10-18 18:37:44 +00:00
chs ffd3aa297e make the previous apply only to x86_64. 2005-10-07 14:46:04 +00:00
chs 26a2ca0397 add __attribute__((packed)) to struct netbsd32_stat13. the alignment of
64-bit values is annoying in the x86 world:  they require 64-bit alignment
in 64-bit mode but only 32-bit alignment in 32-bit mode.
2005-10-07 14:40:06 +00:00
manu bc210edac8 Fix COMPAT_DARWIN build. This closes PR#31336 2005-10-03 17:11:25 +00:00
he c6c2d9e696 Suddenly these need explicit inclusion of <sys/socket.h>; they use
the MSG_OOB and AF_LINK symbols (among others).  Fixes build problem.
2005-09-28 06:40:15 +00:00
chs 8a6025c821 this needs stuff from compat/sys/siginfo.h now, just include it here. 2005-09-27 15:09:04 +00:00
chs 1e20ffb8a1 regen 2005-09-27 15:07:54 +00:00
chs ad1b7e8d5c include "opt_compat_sunos.h", netbsd32_syscallargs.h wants it. 2005-09-27 15:07:40 +00:00
chs 94be8205d7 make this compile again. 2005-09-27 14:37:06 +00:00
martin 3faf969174 Adapt to struct vfsops changes during the NFS export rototill. 2005-09-27 13:26:03 +00:00
jmmv 20ac358c50 Instead of trying to clear ufs_args' export member, zero the whole
structure so that we don't rely on that (renamed) field.  Should fix
the build.  Found by he@.
2005-09-24 21:44:15 +00:00
christos a5d6ab9188 need compat/sys/socket.h 2005-09-24 21:34:35 +00:00
christos 91e84b20b0 make the siginfo converters static and comment out the one that is not used. 2005-09-24 21:34:18 +00:00
christos 6c8e87cff8 add struct forwards. 2005-09-24 21:33:48 +00:00
christos dd40a9f6f6 include new compat siginfo header. 2005-09-24 17:29:47 +00:00
christos 5c03cd2255 more header cleanup. 2005-09-24 17:27:44 +00:00
christos ca3a193432 factor out some of the osockaddr, omsghdr code. 2005-09-24 15:51:03 +00:00
chs 33359b3121 need to include sys/socket.h here now, sys/mount.h no longer does it for us. 2005-09-24 15:42:58 +00:00
christos 03ec972e58 maplen was uninitialized. 2005-09-19 02:47:15 +00:00
christos d359ae5c43 MINSIGSTKSZ on linux is different depending on the platform and usually
smaller than ours.
2005-09-19 02:46:49 +00:00
christos e20c28140a Add compat signal headers. 2005-09-18 14:30:15 +00:00
yamt a0bdf5ef81 irix_sys_swapctl: follow uvm_swap_stats changes. 2005-09-17 14:52:55 +00:00
yamt 209478cccf protect p_nrlwps by sched_lock. 2005-09-17 14:35:51 +00:00
christos 29f3692018 add <compat/sys/signal*.h> 2005-09-16 17:09:52 +00:00
christos c315b31f19 Fix a comment. 2005-09-15 03:00:16 +00:00
he 70fe9e01e8 This now needs <compat/sys/signal.h> to build. 2005-09-14 13:49:50 +00:00
he 87e3d67bce This file now needs <compat/sys/stat.h> to build. 2005-09-14 13:49:27 +00:00
christos ff66f5797e need linux_syscallargs.h to compile, and remove inline function. 2005-09-13 22:08:21 +00:00
christos c83d281198 Forgot to reverse the conditional test. 2005-09-13 16:35:24 +00:00
christos 58b392c018 make this compile again. 2005-09-13 03:23:09 +00:00
christos 6acf4b5ca8 add compat netbsd32 context. 2005-09-13 03:22:54 +00:00
christos 063b880cf0 compat code reorg. 2005-09-13 01:42:32 +00:00
christos 49110e63f0 Range checks are not optional. The omission of this one, allows the user
to corrupt the heap and/or crash the kernel (Christer Oeberg).
2005-09-12 22:17:49 +00:00
christos 6a2a989266 variable name mistake again. 2005-09-12 22:16:56 +00:00
christos d9f67be7fe - Avoid overflow by checking the count argument (Christer Oeberg).
- While I am here, don't leak fds either.
2005-09-12 20:54:38 +00:00
jmmv ec93365612 Initial addition of tmpfs, an efficient memory file-system. This project
was developed as part of Google's Summer of Code 2005 program.  This
change adds the kernel code, the mount_tmpfs utility, a regression test
suite and does all other related changes to integrate these.

The file-system is still *experimental*.  Therefore, it is disabled by
default in all kernels.  However, as typically done, a commented-out
entry is added in them to ease its setup.

Note that I haven't commited the required mountd(8) changes to be able
to export tmpfs file-systems because NFS support is still very unstable
and because, before enabling it, I'd like to do some other changes.

OK'ed by my project mentor, William Studenmund (wrstuden@).
2005-09-10 19:20:48 +00:00
rpaulo 257017665e Add a SYSCTL_SETUP_PROTO() so that it compiles fine in the lkm. 2005-09-02 14:34:00 +00:00
he eb89cd94e9 Now that <ufs/ufsmount.h> includes <ufs/extattr.h>, we also need
<sys/vnode.h> and <sys/vnode_if.h> to bring the definition of struct
vop_getextattr_args into scope.  Fixes build problem for arc.
2005-08-31 16:01:56 +00:00
he 54e6da6105 Change from using sys___{,f,l}stat13() to sys___{,f,l}stat30() and
associated data structures, following the change to 64-bit inodes.
2005-08-22 10:57:04 +00:00
yamt 0ed4057082 linux_machdepioctl: remove duplicated FILE_USE/UNUSE. 2005-08-21 13:13:50 +00:00
kent 868a42c866 fix a compilation problem on NetBSD/amd64 2005-08-20 15:02:36 +00:00
yamt e4ab81774d compat_30_sys_getdents: netbsd 1.2 -> 3.0 in comments/messages. 2005-08-19 13:17:37 +00:00
yamt 34dab5e58c compat_30_sys_getdents: don't leak kernel stack garbage to userland. 2005-08-19 13:16:56 +00:00
christos 4ce7529a64 change a hard-coded 0xf to _DIRENT_ALIGN (thanks yamt) 2005-08-19 06:01:00 +00:00
christos b041fac92d Fix lossage I created with the 64 bit ino_t change. 2005-08-19 04:24:38 +00:00
christos 758a209d23 64 bit inode changes. 2005-08-19 02:03:49 +00:00
christos c0ee8a4184 Fix systeminfo.
1. return length is the string length even if the string would not fit.
2. add SI_ISALIST
3. on 32 bit emulation, don't return sparc64 as the arch!
2005-07-28 03:50:52 +00:00
cube ae35d4a4e9 Regen (__sigtimedwait(2)). 2005-07-23 22:04:12 +00:00
cube 73fe747f11 Implement __sigtimedwait(2). 2005-07-23 22:03:45 +00:00
cube a6b803a79f Constify conversion functions. 2005-07-23 21:51:29 +00:00
cube 21472d491b Regen (timer_create(2) and friends). 2005-07-23 18:57:07 +00:00
cube 23a1110cbd Implement the timer_create(2) family of syscalls. 2005-07-23 18:56:15 +00:00
cube ee24060ae4 Remove duplication of code for netbsd32_wait4() by using stackgap(9). 2005-07-22 22:46:29 +00:00
cube 606552e84c Rework sunos32_execv{,e} after removal of netbsd32_execve2.
XXX COMPAT_SUNOS32 needs a SUNOS32PTR64() macro.
2005-07-13 12:49:32 +00:00
cube 86f97cc446 Do the CHECK_ALT_EXIST dance again in netbsd32_execve(). It was lost in
previous commit.
2005-07-13 11:55:19 +00:00
cube e13e6c14c7 netbsd32_execve2() doesn't exist anymore. 2005-07-13 11:53:57 +00:00
christos 00a78ed413 Delete define for sunos_syscall_intern. 2005-07-12 22:45:11 +00:00
martin e14ba58310 When returning 64bit values (from netbsd32_lseek) fix up the return
value vector (of 32bit values, most likely) via a MD macro.
2005-07-12 15:06:17 +00:00
cube e937141b42 Regen (*xattr(2)). 2005-07-12 07:46:19 +00:00
cube 728e5e01bd Add the *xattr(2) family of syscalls. Just like the *extattr(2) family,
they're waiting for an actual FS back-end to be tested, but are still
straightforward enough.
2005-07-12 07:45:34 +00:00
cube 0477abe883 Regen (rasctl(2)). 2005-07-11 20:18:52 +00:00
cube 241e7db4d5 Add rasctl(2). Thanks to the regression tests for that syscall, I was able
to discover the bugs in netbsd32_setitimer() and netbsd32_execve().
2005-07-11 20:18:05 +00:00
cube 355bcba766 Split sys_execve() and add execve1() that does most of the work, and takes
as an argument a function that will retrieve an element of the pointer
arrays in user space.  This allows COMPAT_NETBSD32 to share the code for
the emulated version of execve(2), and fixes various issues that came from
the slow drift between the two implementations.

Note:  when splitting up a syscall function, I'll use two different ways
       of naming the resulting helper function.  If it stills does
       copyin/out operations, it will be named <syscall>1().  If it does
       not (as it was the case for get/setitimer), it will be named
       do<syscall>.
2005-07-11 20:15:26 +00:00
cube 08fd92bac5 Split sys_getitimer and sys_setitimer to make it possible to share the
relevant code with the COMPAT_NETBSD32 version, and make the latter use
the new functions.

This fixes netbsd32_setitimer() which had drifted from the native syscall
and did not work properly anymore.
2005-07-11 19:50:42 +00:00
christos 25e2fae9e9 Add a sunos_machdep include file to deal with MD implementations of
sunos_syscall_intern.
2005-07-11 13:14:49 +00:00
christos dac018add9 More syscall_intern lossage. 2005-07-10 16:45:33 +00:00
christos 24d0f10c0f define sunos_syscall_intern now that sparc needs it. 2005-07-10 16:40:49 +00:00
cube 0057da6efa NOFOLLOW should be passed to NDINIT() instead of FOLLOW for lstat(2).
Reported by Martin Husemann.
2005-07-10 16:34:53 +00:00
cube 4a8942e74c Regen. 2005-07-10 14:32:35 +00:00
cube 7e3a28a419 Add support for fsync_range(2). 2005-07-10 14:32:16 +00:00
cube c6a5f27efa Regen. 2005-07-10 11:29:35 +00:00
cube b01a57e4ce Implement __clone(2). 2005-07-10 11:28:58 +00:00
cube 91598566dc Report changes from sys_wait4(). 2005-07-10 11:28:03 +00:00
christos ecc4f71237 define syscall again. 2005-07-10 04:23:30 +00:00
christos 4d0656f353 include the _32 flavor of the machdep file too. 2005-07-10 00:56:19 +00:00
christos 6667cfbdab We have syscall_intern now. 2005-07-10 00:56:01 +00:00
christos f1461c7e8a No point in declaring syscall_intern and syscall in a zillion places. 2005-07-10 00:45:52 +00:00
cube 16e20b37d6 Regen. 2005-07-09 22:40:34 +00:00
cube 57017881b4 Implement pselect(2) and pollts(2). 2005-07-09 22:40:13 +00:00
cube 0056ee71b1 Make netbsd32_select() use selcommon() instead of a gross copy/paste of
the old sys_select() code.
2005-07-09 21:58:09 +00:00
cube 0d4567cd91 Regen. 2005-07-08 22:22:19 +00:00
cube 01f1f7ce7d Add mlockall(2) and munlockall(2). 2005-07-08 22:21:43 +00:00
cube e1c5d71d3d Regen 2005-07-08 21:40:26 +00:00
cube dfc332d6df Implement the extattr(3) family of syscalls.
XXX However, those remain untested as there are currently no backend for
XXX extattr(9) in NetBSD.
2005-07-08 21:39:39 +00:00
cube a31209bb48 Regen 2005-07-04 00:27:15 +00:00
cube d500f440df Implement uuidgen(2). 2005-07-04 00:26:06 +00:00
cube 72f6b3a65c Constify machine32 and machine_arch32. 2005-07-03 17:18:02 +00:00
cube 6f082c10a9 Make COMPAT_NETBSD32 emulate hw.machine. While it might seem wrong to do
so, it introduces breakage because a lot of applications make assumptions
from its value.  It's especially bad in the sparc64 case, where 64-bits
instructions can be used in 32-bits addressing mode.  However, there are
other means to know the capabilities of the CPU.
2005-07-03 16:53:46 +00:00
christos 7a55962329 the exception numbers are MI. 2005-06-25 08:28:34 +00:00
christos f63c68071c minor refactoring; does not work on the i386 yet. 2005-06-25 06:30:19 +00:00
christos 5ae508513d - include <sys/wait.h> so that this compile
- use the code field directly, instead of redoing the logic.
- XXX: the status field must be wrong. I think that the _WSTATUS()
  should not be used directly.
2005-06-25 02:19:06 +00:00
manu d83c516040 More accurate SIGCHLD code and status for siginfo 2005-06-24 22:57:05 +00:00
manu c8b33aa328 report the right process status 2005-06-22 21:57:30 +00:00
manu 5e803980cd Fix siginfo to return the right child's status. 2005-06-22 20:20:30 +00:00
manu 6593739f61 Implent CLONE_PARENT_SETTID, CLONE_CHILD_CLEARTID, and CLONE_CHILD_SETTID
options to clone(). This makes fork() work on amd64.

clone() prototype has changed and the changes is probably revelant on some
other arches.
2005-06-22 15:10:51 +00:00
atatat fc1ed39348 Also fix (wrt the new const stuff) the one user of sysctl_locate()
outside of the main sysctl code.
2005-06-22 03:13:34 +00:00
atatat df13e3579e Change the rest of the sysctl subsystem to use const consistently.
The __UNCONST macro is now used only where necessary and the RW macros
are gone.  Most of the changes here are consumers of the
sysctl_createv(9) interface that now takes a pair of const pointers
which used not to be.
2005-06-20 02:49:18 +00:00
christos 6f86542bb2 remove duplicate declaration. 2005-06-19 23:46:32 +00:00
christos 4e330f1fbc We don't have sigcode if we are not in COMPAT_16. 2005-06-14 22:35:20 +00:00
matt e1245a3c46 Rework the coredump code to have no explicit knownledge of how coredump
i/o is done.  Instead, pass an opaque cookie which is then passed to a
new routine, coredump_write, which does the actual i/o.  This allows the
method of doing i/o to change without affecting any future MD code.
Also, make netbsd32_core.c [re]use core_netbsd.c (in a similar manner that
core_elf64.c uses core_elf32.c) and eliminate that code duplication.
cpu_coredump{,32} is now called twice, first with a NULL iocookie to fill
the core structure and a second to actually write md parts of the coredump.
All i/o is nolonger random access and is suitable for shipping over a stream.
2005-06-10 05:10:12 +00:00
tsutsui e392fd287f Remove __P() and parameter names from a prototype declaration. 2005-06-03 23:05:46 +00:00
tsutsui 38825830c7 Appease gcc -Wcast-qual. 2005-06-03 23:03:59 +00:00
martin 12771d0723 Consistently constify 2005-06-03 18:53:50 +00:00
martin 75cc390f62 Avoid shadow warnings. 2005-06-03 18:52:52 +00:00
martin a2a1dc8e7c Add extern declaration for "bufpages". 2005-06-02 20:14:55 +00:00
matt 25a0e29a75 When writing coredumps, don't write zero uninstantiated demand-zero pages.
Also, with ELF core dumps, trim trailing zeroes from sections.  These two
changes can shrink coredumps by over 50% in size.
2005-06-02 17:01:43 +00:00
tsutsui bce385b9f7 Add a const. 2005-06-02 16:54:52 +00:00
tsutsui 189e121846 Fix shadow warnings. 2005-06-02 15:22:03 +00:00
drochner c2a5fd0191 more cast-qual fallout 2005-06-02 13:03:27 +00:00
drochner bce73c1519 in siginfo conversion functions, declare the source operand as "const" 2005-06-02 10:27:43 +00:00
drochner 093f3bf058 remove (caddr_t) casts on "const" pointers, and use __UNCONST()
where arguments are copied to the stackgap
2005-06-01 15:34:15 +00:00
drochner 8aa146cea7 avoid shadow warnings 2005-06-01 15:29:41 +00:00
drochner 5a09c73a94 fix const'ification fallout 2005-06-01 15:28:56 +00:00
christos a7c4860a95 fix shadowed variable 2005-05-31 00:43:17 +00:00
christos 94984f467b - fix 32 -> 64 pointer casts properly.
- add const
- fix shadow
2005-05-31 00:42:37 +00:00
christos 805ebc54c2 - add const
- fix shadowed variables
2005-05-31 00:42:10 +00:00
christos d2dc83130f - add const
- avoid shadowed variables.
2005-05-31 00:41:09 +00:00
chs a38226d23a regen 2005-05-30 23:00:39 +00:00
chs 3f12eda6dc track change to swapctl args in kern/syscalls.master. 2005-05-30 22:59:55 +00:00
christos fb4b40b7e8 - sprinkle const.
- add XXXUNCONST to the emul_find() pbuf argument free'ing. XXX: this needs
  an api change.
- avoid variable shadowing.
2005-05-29 22:08:16 +00:00
christos 1473b3a0a1 XXX: Remove fishy volatile. 2005-05-29 22:07:02 +00:00
jmc 36b625d324 Regen 2005-05-23 23:22:27 +00:00
jmc 55c161e3ff Add clock_* POSIX functions. 2005-05-23 23:21:49 +00:00
fvdl 57409f3466 sigreturn doesn't take arguments. Instead, find out where the signal
frame is from the stack pointer in the frame frame.

Also, don't forget to copy %rip back in.
2005-05-22 19:31:15 +00:00
fvdl e83accc0f6 Regen after sigreturn argument change. 2005-05-22 19:29:40 +00:00
fvdl 8251c0b501 Change sigreturn to have no arguments. 2005-05-22 19:29:15 +00:00
fvdl beae305307 Use a modified buildcontext function for Linux signals. It doesn't set
the unused segment registers, it just uses the already used values.
2005-05-22 14:52:12 +00:00
fvdl 33e2d79f47 Define linux_usertrap function, and set it in struct emul. For all
but amd64, it just returns 0, doing nothing.

For amd64, it implements vsyscalls through cheating: if the faulting
address is in the vsyscall area (which is statically known on Linux/amd64),
and the intruction pointer is too, it must have been a vsyscall. In that
case, retrieve the return address from the user stack, fix up %rip and
%rsp, and just execute the normal system call. It will return as if
the vsyscall has been executed.
2005-05-20 12:48:26 +00:00
mrg f56c2db8b9 tramp and vers are used unconditionally, make them visible everywhere. 2005-05-20 01:06:50 +00:00
manu 53fb6703e5 Add support for Linux SA_RESTORER on amd64. 2005-05-19 21:16:29 +00:00
elad 5888b16eef Some changes in veriexec.
New features:

  - Add a veriexec_report() routine to make most reporting consistent and
    remove some common code.
  - Add 'strict' mode that controls how veriexec behaves.
  - Add sysctl knobs:
     o kern.veriexec.verbose controls verbosity levels. Value: 0, 1.
     o kern.veriexec.strict controls strict level. Values: 0, 1, 2. See
       documentation in sysctl(3) for details.
     o kern.veriexec.algorithms returns a string with a space separated
       list of supported hashing algorithms in veriexec.
  - Updated documentation in man pages for sysctl(3) and sysctl(8).

Bug fixes:

  - veriexec_removechk(): Code cleanup + handle FINGERPRINT_NOTEVAL
    correctly.
  - exec_script(): Don't pass 0 as flag when executing a script; use the
    defined VERIEXEC_INDIRECT - which is 1. Makes indirect execution
    enforcement work.
  - Fix some printing formats and types..
2005-05-19 20:16:19 +00:00
christos 362a4a0bd5 Yes, it was a cool trick >20 years ago to use "0123456789abcdef"[a] to
implement, xtoa(), but I think defining the samestring 50 times is a bit
too much. Defined HEXDIGITS and hexdigits in subr_prf.c and use it...
2005-05-17 04:14:57 +00:00
fvdl 046b9a57dc Implement clock_* POSIX functions. 2005-05-16 21:18:34 +00:00
fvdl 5acb6d8367 Regen. 2005-05-16 21:18:18 +00:00
fvdl fe3dd48a91 Add clock_* POSIX functions. 2005-05-16 21:17:11 +00:00
fvdl e18d1a8ee1 Regen. 2005-05-16 16:03:58 +00:00
fvdl 711b0df630 Add *xattr functions (they all return EOPNOTSUPP). 2005-05-16 16:02:19 +00:00
fvdl 2d668e070c Include linux_sigevent.h (to be used later). 2005-05-16 16:00:31 +00:00
fvdl 33e6ca90d5 Add Linux sigevent definitions. 2005-05-16 15:56:41 +00:00
fvdl 7d91366682 Fix up COMPAT_LINUX support for amd64. Still a work in progress, not
usable yet ("Hello World" runs, but many other things do not work).
2005-05-15 21:44:41 +00:00
fvdl 49395ac65e Make the arch_prctl system call use the saved %gs and %fs mechanism. 2005-05-15 21:43:08 +00:00
jmc 9962871387 #endif for LINUX_SS_ONSTACK needs to go after linux_sys_sigaltstack or builds
break on platforms that don't define it (alpha, sparc)
2005-05-09 19:04:50 +00:00
manu 89647c7ca6 First work on COMPAT_LINUX/amd64
Process startup and dynamiclinking work, but processes hang due to
Linux arch_prctl(2) not being really supported yet.
2005-05-03 16:26:27 +00:00
christos a5fb891bb9 PR/29696: Joel Carnat: NetBSD freezes when accessing smbfs mounted FS with
firefox/linux due to compat getdents() call assumption that all filesystems
support cookies.
2005-04-19 19:00:25 +00:00
yamt 6b2d8b66a4 merge yamt-km branch.
- don't use managed mappings/backing objects for wired memory allocations.
  save some resources like pv_entry.  also fix (most of) PR/27030.
- simplify kernel memory management API.
- simplify pmap bootstrap of some ports.
- some related cleanups.
2005-04-01 11:59:21 +00:00
drochner b3d10c788a regen 2005-03-31 16:36:03 +00:00
drochner 014fa21e82 emulate setreuid()/setregid(), from Eric Schnoebelen per PR
port-alpha/21870
2005-03-31 16:34:54 +00:00
christos 14685cd241 s/uvm_map_defaultaddr/uvm_default_mapaddr/ HI FRANK! 2005-03-26 17:10:43 +00:00
fvdl c487efe4a7 Fix some things regarding COMPAT_NETBSD32 and limits/VM addresses.
* For sparc64 and amd64, define *SIZ32 VM constants.
* Add a new function pointer to struct emul, pointing at a function
  that will return the default VM map address. The default function
  is uvm_map_defaultaddr, which just uses the VM_DEFAULT_ADDRESS
  macro. This gives emulations control over the default map address,
  and allows things to be mapped at the right address (in 32bit range)
  for COMPAT_NETBSD32.
* Add code to adjust the data and stack limits when a COMPAT_NETBSD32
  or COMPAT_SVR4_32 binary is executed.
* Don't use USRSTACK in kern_resource.c, use p_vmspace->vm_minsaddr
  instead (emulations might have set it differently)
* Since this changes struct emul, bump kernel version to 3.99.2

Tested on amd64, compile-tested on sparc64.
2005-03-26 05:12:34 +00:00
christos 37e322ddf6 revert part of previous commit (the block size type and the pad renumbering).
tron says it breaks compat mode.
2005-03-10 23:39:27 +00:00
christos 47e40fce3a Add nanosecond handling on the stat and stat64 code for the i386. 2005-03-10 14:12:27 +00:00
christos 7254715c73 add file locking. 2005-03-05 17:47:38 +00:00
christos 44f6417295 - someone must have been confused about how to use the stackgap.
- remove extra caddr_t
- cleanup unneeded syscalls.
- add locking.
2005-03-05 17:47:06 +00:00
jdolecek 07ad370ac0 const sptab[] 2005-03-05 17:31:07 +00:00
christos cfa16776df cleanup and fix locking. 2005-03-05 17:16:17 +00:00
christos 8eb274055a Some ibcs2 binaries need executable stacks. Thanks to J Chapman Flack
for determining this and coming up with a fix.
2005-03-03 04:39:37 +00:00
soren 18d6a3043f Emulate basic mtio ioctls. 2005-02-28 22:11:31 +00:00
soren 4f02ad16c6 Remove duplicate statement. 2005-02-28 22:10:46 +00:00
perry 77f2a006d0 regen 2005-02-26 23:58:19 +00:00
perry bcaf99655c remove trailing whitespace after the "created from: NetBSD..." line. 2005-02-26 23:55:49 +00:00
perry ed10d3c508 make this rebuild generated files by default 2005-02-26 23:50:14 +00:00
perry 44e692be50 make this rebuild generated files by default, also clean up and make
more like other similar Makefiles.
2005-02-26 23:49:20 +00:00
perry 84f4fbb117 make this rebuild generated files by default 2005-02-26 23:46:50 +00:00
perry afd17eee3b make this rebuild generated files by default
also, remove unneeded clean target
2005-02-26 23:46:05 +00:00
perry 5acf93db4e make this rebuild generated files by default 2005-02-26 23:44:37 +00:00
perry 6377fcfee3 make this rebuild generated files by default, and don't build .bak files 2005-02-26 23:43:15 +00:00
perry 834b86bb6d eliminate creation of .bak files -- we have source control 2005-02-26 23:42:13 +00:00
perry fa91538c32 make this rebuild generated files by default 2005-02-26 23:35:00 +00:00
perry a7f74206ba regen 2005-02-26 23:20:00 +00:00
perry 477853c351 nuke trailing whitespace 2005-02-26 22:58:54 +00:00
simonb c1530b6999 Remove an erroneous semicolon. 2005-02-26 12:03:15 +00:00
martin 6192fdeaf6 Fix number of elements calculation when converting socket options.
Fixes bugs 4 and 5 reported by Ted Unangst on tech-kern.
2005-02-24 08:15:53 +00:00
heas e8dfc3dc8e Re-gen for sysctl emulation 2005-02-22 16:16:48 +00:00
heas b8fe1f6779 Add FreeBSD sysctl emulation for their undocumented special OIDs rooted at
OID 0.  Only OID 0.3 is implemented for now, it 0.3 is the equivalent of
NetBSD's sysctlgetmibinfo().
This includes a new sysctl kern.osreldate with the value __NetBSD_Version__
for kernels with COMPAT_FREEBSD.

Both of these are used by 3ware's FreeBSD tw_cli, which seems to work now.
2005-02-22 16:14:50 +00:00
soren f4fa62bcd9 SG_GET_VERSION_NUM returns an int. Also make the version number patchable. 2005-02-13 12:53:54 +00:00
christos d59582c127 Don't zero out the linux request; we still need values from it.
Limit the sense len to the linux input buffer.
2005-02-13 09:05:31 +00:00
christos 47be3434ec We were zeroing out the wrong struct. 2005-02-13 09:01:25 +00:00
christos be3704c73f pass the flag to fdclone. 2005-02-12 23:14:03 +00:00
christos e042c0475e Add scsi-generic stuff. 2005-02-03 00:09:30 +00:00
christos d3b9209df0 Add linux scsi-generic to work for simple cases. Allows gendalia's change
to limp along. From soren with fixes from me.
2005-02-03 00:09:09 +00:00
christos 0b71a2d5de Don't try to map a 0 size bss. 2005-01-30 23:59:57 +00:00
drochner 613f1d9cdb Hmm - vax is different. sendsig_sigcontext() is for __mips only.
Should fix build error found by Havard Eidnes.
2005-01-25 14:56:09 +00:00
matt 027c11539b Add IFNET_FOREACH and IFADDR_FOREACH macros and start using them. 2005-01-24 21:25:09 +00:00
drochner 7c10815d09 use sendsig_sigcontext() directly instead of the generic sendsig() 2005-01-24 10:08:02 +00:00
oki 50d1aadd13 kill __P. 2005-01-22 01:36:59 +00:00
drochner 2eaf2fb804 Use sendsig_sigcontext() as signal delivery function instead
of the generic (NetBSD specific) sendsig().
We can only work with ...sigcontext for now anyway; the
versioning stuff in sendsig() isn't helpful for osf1 emul.
2005-01-16 20:01:48 +00:00
drochner 2fdf16521b Make osf1_sys_sigaction() use the internal sigaction1()
instead of the compat16_ thing.
This saves 2 pointless copyout/copyin cycles to/from
the "stackgap" buffer, and it gets us a step closer
to a COMPAT_OSF! which works w/o COMPAT_16.
This still doesn't support SA_SIGINFO because the old
COMPAT_16 signal trampoline is used.
2005-01-16 19:57:09 +00:00
thorpej 1c95472d01 Add the system call and VFS infrastructure for file system extended
attributes.

From FreeBSD.
2005-01-02 16:08:28 +00:00
christos 5fd3b99d04 check that signum is valid correctly. 2004-12-22 18:16:47 +00:00
abs 5958dd944e Fix comments slighly 2004-12-12 20:42:53 +00:00
christos 31c81b28f5 Cloning cleanup:
1. make fileops const
2. add 2 new negative errno's to `officially' support the cloning hack:
    - EDUPFD (used to overload ENODEV)
    - EMOVEFD (used to overload ENXIO)
3. Created an fdclone() function to encapsulate the operations needed for
   EMOVEFD, and made all cloners use it.
4. Centralize the local noop/badop fileops functions to:
   fnullop_fcntl, fnullop_poll, fnullop_kqfilter, fbadop_stat
2004-11-30 04:25:43 +00:00
kent b285c03873 getdevinfo():
If a mixer item does not match with AudioNsomething, check whether
it ends with '.' + AudioNsomething.  PR#15441
2004-11-18 14:02:42 +00:00
christos 4de5735102 off-by-one 2004-11-15 23:28:50 +00:00
atatat 612e86b46d Wrap TIMEVAL_TO_TIMESPEC and TIMESPEC_TO_TIMEVAL macros in
do { ... } while(/*CONSTCOND*/0)

so that they can be used unadorned in if/else blocks, etc.  This means
that you now *have* to put a ; at the end of the "call" to these
macros.
2004-11-14 03:30:08 +00:00
christos 040c934485 Remove setup stack function. It moved to linux_exec_machdep.c. 2004-11-13 08:58:23 +00:00
christos b7286f5ccd Add ptyfs pty device number translation. 2004-11-13 07:20:54 +00:00
christos 1265044e00 add LINUX_TIOCGPTN 2004-11-13 07:20:35 +00:00
christos 44264ea2a6 Add ptyfs magic number and entry. 2004-11-13 07:19:27 +00:00
christos d5b128a728 Add LINUX_TIOCGPTN for ptyfs pty emulation. 2004-11-13 07:18:34 +00:00
christos 7bd9648b13 Split out the setup stack function for the benefit of lkms.
XXX: Our lkm system sucks. We really need to be exporting symbols, but
that leads to symbol conflicts.
2004-11-13 06:01:34 +00:00
david bf4bf03db8 Refine bounds check code. 2004-11-07 04:08:37 +00:00
david d7d15131bb Bounds check syscall arguments where appropriate 2004-10-27 19:29:57 +00:00
david a710461910 Log Msg was corrected, Nov 6th, 2004. Whitespace cleanup 2004-10-27 19:29:56 +00:00
david 090b8be8f9 Bounds check syscall arguments where appropriate 2004-10-27 19:29:56 +00:00
skrll 3780f859c7 Only create a KTR_USER record if it's one of the tracepoints.
OK'd by manu.
2004-10-24 14:42:10 +00:00
thorpej 42b8fac3b8 Move boot device detection code from i386 and amd64 ports to x86_autoconf.c.
Rename i386_alldisks and x86_64_alldisks to x86_alldisks, adjust other
references to compensate.
2004-10-20 04:20:05 +00:00
christos 7e7288c064 Bounds check signal number. 2004-10-13 23:21:41 +00:00
erh f747989e34 PR kern/27184: Have linux_sys_waitpid() call linux_sys_wait4() so the
supported options can't get out of sync.  This add support for the
  linux __WCLONE and __WALL options (NetBSD version: WALTSIG and WALLSIG)
Add a diagnostic check to see if the one unhandled option (__WNOTHREAD) is
  specified.
This should prevent linux processes from losing their children and creating
  tons of zombie processes.
2004-10-07 19:30:28 +00:00
jdolecek 6513aa8291 regen: generate struct linux_sys_shmget_args for linux_sys_shmget(2) 2004-10-05 06:02:36 +00:00
jdolecek 361bf102b8 mark linux_sys_shmget() STD, so that appropriate struct linux_sys_shmget_args
would be defined for use by alpha linux_sysent.c
2004-10-05 06:01:20 +00:00
yamt 0994e6acb8 introduce a function, proclist_foreach_call, to iterate all procs on
a proclist and call the specified function for each of them.
primarily to fix a procfs locking problem, but i think that it's useful for
others as well.

while i'm here, introduce PROCLIST_FOREACH macro, which is similar to
LIST_FOREACH but skips marker entries which are used by proclist_foreach_call.
2004-10-01 16:30:52 +00:00
jdolecek decdc3f95c regen - now using wrapper for shmget(2) 2004-09-28 19:05:58 +00:00
jdolecek f64366a240 add flag for shmget(2) to specify that later shmat(2) for the shared memory
segment should succeed even if the segment would be marked removed; use this
to implement the Linux-compatible semantics of shmat(2)

this fixes the old Linux VMware3 graphics problem with local display,
and possibly other local Linux X clients using MIT-SHM
2004-09-28 19:05:19 +00:00
jdolecek 68ee548306 fold shmat1() back into sys_shmat(), the change in rev 1.64 is not sufficient
for Linux-compatible shmat() behaviour - shmat() for the removed shared memory
segment must work from all callers, the shared memory id could be passed e.g.
to native X server via MIT-SHM

temporarily remove the functionality, the Linux-compatible semantics
will be reimplemented differently
2004-09-28 17:26:25 +00:00
he 9f596d4761 Since the implementation of bsd_to_linux_statfs64() is conditional,
also make the forward declaration conditional.  Fixes compile
problem for m68k ports.
2004-09-24 13:10:46 +00:00
jdolecek 81ed8f7972 move definition of linux_fsid_t to common/linux_types.h - it's identical
across all Linux archs
2004-09-20 18:51:55 +00:00
jdolecek 43b3feff28 regen:
implement support for Linux statfs64() syscall - 64bit variant of statfs()
2004-09-20 18:42:23 +00:00
jdolecek 110cc1cc61 implement support for Linux statfs64() syscall - 64bit variant of statfs() 2004-09-20 18:41:07 +00:00
christos dbac2396e8 Add a linux_fsid_t typedef for the ports that don't have architecture dependent
linux_types.h. Fixes sparc build.
2004-09-20 03:21:40 +00:00
jdolecek 48373456d4 Adjust struct statfs content to flag that the newer Linux kernel do
provide f_frsize. It cannot be actually used to GNU C statvfs() bug
in f_frsize != f_bsize case, so just keep pretending we don't support it.
Update comments and explain the situation in detail there.
2004-09-19 16:50:11 +00:00
jdolecek 2580579147 move definition of struct linux_stafs to common/linux_types.h, and use
explicit size types - the structure definition is actually identical
on currently support COMPAT_LINUX archs, so no point to have 6 copies of it
in the tree
2004-09-19 15:06:32 +00:00
skrll f7155e40f6 There's no need to pass a proc value when using UIO_SYSSPACE with
vn_rdwr(9) and uiomove(9).

OK'd by Jason Thorpe
2004-09-17 14:11:20 +00:00
jdolecek 52c9439e95 regen:
remove all alternative path check code, and (empty) ioctl wrapper
2004-09-14 17:40:59 +00:00
jdolecek c2e4e13382 remove all alternative path check code, and (empty) ioctl wrapper 2004-09-14 17:39:18 +00:00
jdolecek 120bb37404 remove COMPAT_AOUT 2004-09-14 16:57:31 +00:00
jdolecek f16bab2269 bsd_to_linux_statfs():
- filesystem size is expressed in number of fragments, not blocks;
  this fixes computed filesystem sizes for Linux df(1) and other Linux
  binaries using statfs(2) for filesystems, which use different value
  for frament and block, such as FFS
- use FS f_namemax instead of always using MAXNAMLEN
2004-09-13 20:09:44 +00:00
jdolecek 9cc50db4c5 if passed sockaddr has family AF_UNSPEC, use socket family of the socket
the sockaddr is used for

this fixes bind() problem in Linux version of Theocracy, testing
by Thomas Klausner
2004-09-12 15:32:55 +00:00
jdolecek f7ec3be35d use native syscallnames[] for SYSCALL_DEBUG 2004-09-12 11:09:32 +00:00
jdolecek f83c14f534 only include emulation syscallnames with SYSCALL_DEBUG, it's not used otherwise 2004-09-12 10:38:25 +00:00
he 936dfb04a0 More removal of references to aoutm68k_syscalls.c, following that file's
removal.  Allows our m68k ports to build again.
2004-09-12 08:04:50 +00:00
wiz be98c25ecf Fix typo in comment. 2004-09-10 22:22:20 +00:00
jdolecek 725814cc94 garbage-collect aoutm68k_syscalls.c, it's just taking up space (it's not used) 2004-09-10 07:11:26 +00:00
tron e5f111e223 Next attempt to fix the RCS Id. *sigh* 2004-09-09 10:45:52 +00:00
tron e22003b771 Finish linux_sys_exit_group() with a (never reached) "return" statement so
that GCC will actually compile this.
2004-09-09 07:02:50 +00:00
jdolecek 3b18315bb9 regen: add exit_group(2) 2004-09-08 19:46:17 +00:00
jdolecek 78569d6650 implement basic exit_group(2), which just terminates calling thread;
apparently not many apps use thread groups yet, at least not with default
SuSE 9.1 libraries, so this is enough for now
2004-09-08 19:45:21 +00:00
jdolecek 6b3117d804 do more strict flag checking in clone(2) (matches what Linux does) 2004-09-08 19:41:24 +00:00
jdolecek ec083dc43c linux_sa_get: g/c curproc use, we get the process as one of arguments 2004-09-05 09:38:17 +00:00
jdolecek 4032a79979 improve the (#ifdef DEBUG_LINUX) socketcall argument dump code:
- print the socketcall type
- special case socket(2) call, it's also the only one with first argument
  not being a socket descriptor
- only dump the relevant part of linux_socketcall_dummy_args, instead
  of always the whole structure
2004-09-05 09:09:02 +00:00
jdolecek bae3c8fbb8 add some newer clone flags 2004-09-05 07:22:20 +00:00
jdolecek 6cfdd8bdbf dump socketcall data #ifdef DEBUG_LINUX 2004-08-29 20:45:18 +00:00
jdolecek 0659b2b55e in debug log, data dump is more useful unsigned 2004-08-29 20:10:42 +00:00
jdolecek 466a837559 handle mmap() request with MAP_GROWSDOWN flag (request for stack-like
grow-down auto extend segment) by allocating segment sized at
current stack size limit, and offsetting requested/returned address
as required

due to how normal virtual memory management work, allocating the
full sized stack memory segment up-front actually requires exactly same
amount of VA space and physical memory as the Linux 'grow' scheme and the
'grow' scheme is quite a lot more difficult to use in applications correctly,
so it's not very apparent why Linux introduced this feature at all

this fixes Thomas Klausner's Heroes3 crash, and might also
fix PR 26687 by Jan Schaumann
2004-08-29 14:08:06 +00:00
jdolecek a95e4d7c87 g/c LINUX_MAP_IGNMASK define - it's not used anywhere 2004-08-28 18:58:57 +00:00
jdolecek b63de69b76 fix debug printf - lm_addr is not pointer anumore 2004-08-24 17:41:54 +00:00
jdolecek c341a3a03a make struct linux_oldmmap members explicitly unsigned (with exception
of lm_fd, which can be -1), rename lm_pos to lm_offset, g/c some unneeded casts

no functional change
2004-08-22 15:40:41 +00:00
cgd 61d7e536bd Fix my license notice. Back when hpux_exec.c was cloned from
sys/kern/exec_aout.c back in *1995*, apparently the line from my
license notice:
 *    must display the following acknowledgement:
was accidentally dropped.  This mistake was propagated into
hpux_exec_aout.c when it was split out of hpux_exec.c.
(Thanks to hubertf for noticing!)
2004-08-21 22:27:04 +00:00
hubertf 4592bf2278 Fix copyright notice - OK'd by the copyright holder. 2004-08-21 18:58:31 +00:00
mycroft 45a21b76f0 Fixing age old cruft:
* Rather than using mnt_maxsymlinklen to indicate that a file systems returns
  d_type fields(!), add a new internal flag, IMNT_DTYPE.

Add 3 new elements to ufsmount:
* um_maxsymlinklen, replaces mnt_maxsymlinklen (which never should have existed
  in the first place).
* um_dirblksiz, which tracks the current directory block size, eliminating the
  FS-specific checks littered throughout the code.  This may be used later to
  make the block size variable.
* um_maxfilesize, which is the maximum file size, possibly adjusted lower due
  to implementation issues.

Sync some bug fixes from FFS into ext2fs, particularly:
* ffs_lookup.c 1.21, 1.28, 1.33, 1.48
* ffs_inode.c 1.43, 1.44, 1.45, 1.66, 1.67
* ffs_vnops.c 1.84, 1.85, 1.86

Clean up some crappy pointer frobnication.
2004-08-15 07:19:54 +00:00