Commit Graph

919 Commits

Author SHA1 Message Date
jdolecek 3e8efcdd61 use generic ELF AuxInfo, no need to define a 'linux' variant here
simplify LINUX_ELF_AUX_ARGSIZ definition, LINUX_SP_WRAP is always defined here
2002-11-13 13:37:22 +00:00
jdolecek 081a94b01c linux_sys_times(): if tms is NULL, just return the number of ticks since
boot, don't error out; this matches what Linux does

Fixes problem reported in kern/19027
2002-11-13 08:27:10 +00:00
jdolecek 8bf8260072 regen: nsysent set to 256 2002-11-01 20:24:23 +00:00
jdolecek 11422af13d nsysent set to 256, and use linux_sys_nosys() 2002-11-01 20:23:23 +00:00
jdolecek d53c88616f add appropriate nsysent, and use linux_sys_nosys as sys_nosys 2002-11-01 20:20:52 +00:00
jdolecek faf637ce78 add appropriate nsysent 2002-11-01 20:20:10 +00:00
jdolecek de9c76a3b0 add appropriate sys_nosys and nsysent (not that it matters here too much) 2002-11-01 20:19:29 +00:00
jdolecek 1524c4bf08 set struct emul's nsysent to compat SYS_NSYSENT, not SYS_MAXSYSCALL 2002-11-01 19:26:21 +00:00
christos ea0cda2cda remove XXX should die comment from the define; otherwise traditional cpp
screws up the elf name formation.
2002-10-22 23:31:24 +00:00
simonb 8465b6a98d Don't call cdevsw_lookup() with an uninitialised variable in
linux_sys_ioctl().
2002-10-22 11:55:10 +00:00
thorpej d47fd44e41 Avoid collision with __unused in sys/cdefs.h. 2002-10-10 07:25:21 +00:00
junyoung 33ecb0af91 Get rid of pcb_flags which is no longer existent. 2002-10-09 05:07:55 +00:00
chs 993948e989 count executable image pages as executable for vm-usage purposes.
also, always do the VTEXT vs. v_writecount mutual exclusion
(which we previously skipped if the text or data segment was empty).
2002-10-05 22:34:02 +00:00
provos 0f09ed48a5 remove trailing \n in panic(). approved perry. 2002-09-27 15:35:29 +00:00
thorpej 71404bb533 Don't include <sys/map.h>. 2002-09-25 22:21:01 +00:00
simonb 6ddc09dab1 Put storage class first in "static const" declaration. 2002-09-23 05:03:03 +00:00
manu 80ee637534 - Introduce a e_fault field in struct proc to provide emulation specific
memory fault handler. IRIX uses irix_vm_fault, and all other emulation
use NULL, which means to use uvm_fault.

- While we are there, explicitely set to NULL the uninitialized fields in
struct emul: e_fault and e_sysctl on most ports

- e_fault is used by the trap handler, for now only on mips. In order to avoid
intrusive modifications in UVM, the function pointed by e_fault does not
has exactly the same protoype as uvm_fault:
int uvm_fault __P((struct vm_map *, vaddr_t, vm_fault_t, vm_prot_t));
int e_fault __P((struct proc *, vaddr_t, vm_fault_t, vm_prot_t));

- In IRIX share groups, all the VM space is shared, except one page.
This bounds us to have different VM spaces and synchronize modifications
to the VM space accross share group members. We need an IRIX specific hook
to the page fault handler in order to propagate VM space modifications
caused by page faults.
2002-09-21 21:14:54 +00:00
gehenna 77a6b82b27 Merge the gehenna-devsw branch into the trunk.
This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

	device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
  by using this grammer.

- Added the new naming convention.
  The name of the device switch must be <prefix>_[bc]devsw for auto-generation
  of device switch tables.

- The backward compatibility of loading block/character device
  switch by LKM framework is broken. This is necessary to convert
  from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
  We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
  the LKM framework will refer it to assign device major number dynamically.
2002-09-06 13:18:43 +00:00
christos fad54bde7f Make this match reality [not used yet] 2002-09-05 22:28:10 +00:00
christos 2043e8b0c4 remove XXX: 2002-09-05 22:27:36 +00:00
christos 6cc149625b check out EI_OSABI and EI_ABIVERSION for linux signatures. This is what
http://upx.sourceforge.net/ binaries are like.
2002-09-05 14:32:49 +00:00
christos 830c5c171a Implement passing AT_{E,R}{U,G}ID in the elf aux vector, like solaris.
- pass struct proc to copyargs.
- eliminate svr4_copyargs, since it is the same as ours now.
2002-08-26 21:05:59 +00:00
enami bb4aeb0e05 Pull changes done in rev. 1.7 of sys/compat/linux/arch/powerpc/linux_exec.h
so that sysctl(8) compiles again.
2002-08-15 06:31:30 +00:00
mrg 19ad2640ac don't need systm.h here 2002-08-12 07:59:31 +00:00
chs 0724ffc87a restructure the FPU and AltiVEC code so that it works for MP. 2002-07-28 07:38:34 +00:00
scw bef00d4895 m68k syscall rototill:
- Switch all m68k-based ports over to __HAVE_SYSCALL_INTERN.
 - Add systrace glue.
 - Define struct mdproc in <m68k/proc.h> instead of <machine/proc.h>.
   (They were all defined exactly the same anyway, other than a couple
   of the MDP_* flags.)
2002-07-13 08:28:40 +00:00
matt 66eaa16742 Change fpuproc to curcpu()->ci_fpuproc. 2002-07-09 17:41:27 +00:00
thorpej 011d4d5f44 Add kernel support for having userland provide the signal trampoline:
* struct sigacts gets a new sigact_sigdesc structure, which has the
  sigaction and the trampoline/version.  Version 0 means "legacy kernel
  provided trampoline".  Other versions are coordinated with machine-
  dependent code in libc.
* sigaction1() grows two more arguments -- the trampoline pointer and
  the trampoline version.
* A new __sigaction_sigtramp() system call is provided to register a
  trampoline along with a signal handler.
* The handler is no longer passed to sensig() functions.  Instead,
  sendsig() looks up the handler by peeking in the sigacts for the
  process getting the signal (since it has to look in there for the
  trampoline anyway).
* Native sendsig() functions now select the appropriate trampoline and
  its arguments based on the trampoline version in the sigacts.

Changes to libc to use the new facility will be checked in later.  Kernel
version not bumped; we will ride the 1.6C bump made recently.
2002-07-04 23:32:02 +00:00
enami af1c533269 Don't copy from destination to destination. 2002-06-20 04:01:43 +00:00
jdolecek ee7012d13e linux_sys_getdents64(): remove the oldcall bug workaround cruft,
it's not needed for this call, and update comment accordingly
2002-05-20 06:45:11 +00:00
jdolecek c118cb14c0 linux_sys_getdents64(): make the d_off member point to next entry, rather
than current one; this is expected (even documented) behaviour of the
new system call
This fixes the endless loop when reading directories on NFS, though
applications won't see all directory entries due to different problem.
Fix by Matthias Scheler and Charles Hannum.
2002-05-20 06:40:37 +00:00
jdolecek aae43707d7 whitespace fixes 2002-05-20 06:26:46 +00:00
jdolecek def25b45fa Fix bug introduced in rev. 1.69 - linux_fakedev() returned always
zero for nontranslated raw devices.
This fixes recently discovered jdb /dev/dsp stdin problem, reported
on current-users by Mark Davies.
2002-05-20 06:22:43 +00:00
jdolecek bfbe50611b On archs with broken linux struct stat64 st_ino, rename linux_stat64's
lst_ino to __lst_ino and lst_ino64 to lst_ino, and define
LINUX_STAT64_HAS_BROKEN_ST_INO. Only assign __lst_ino if this define
is present.

This fixes compile on powerpc archs, and hence port-powerpc/16893.
2002-05-19 18:03:15 +00:00
jdolecek 98a5f2b671 hook in truncate64(2) and ftruncate64(2) 2002-05-19 17:55:42 +00:00
jdolecek 973744c531 add missing linux_file64.c, which is needed now 2002-05-19 17:55:08 +00:00
matt 6456f8fa92 Make COMPAT_LINUX compile again on Alpha. linux_getdents64 moved but
files.linux_alpha wasn't updated.  common/linux_file64.c contains a lot
of syscalls which aren't on Linux/alpha so #ifdef them for alpha.
2002-05-13 05:41:26 +00:00
simonb 75119b46c5 Remove an unreachable "return error;". 2002-05-13 05:37:58 +00:00
simonb 7a0dcaf565 Remove an unreachable "return 0;". 2002-05-13 05:35:47 +00:00
simonb f6efa04293 Remove an unreachable "break" after a return statement. 2002-05-13 05:31:42 +00:00
jschauma 839f90b6f7 Linux does not implement SO_REUSEPORT, but allows reuse of a
host:port pair through SO_REUSEADDR even if the address is not a
multicast-address.  Effectively, this means that we should use
SO_REUSEPORT when SO_REUSEADDR is set (from the linux process)
to allow Linux applications to not exit with EADDRINUSE.

(Previously erraneously applied to 1.5 branch; approved for
proper location by thorpej)
2002-05-12 18:30:32 +00:00
jdolecek 9e0898063f regen - hook linux_sys_fcntl64() 2002-05-12 15:05:56 +00:00
jdolecek b6168e0ca7 regen - 64 fs syscalls 2002-05-12 15:04:59 +00:00
jdolecek 0197718567 hook in remaining 64bit fs syscalls
make most of stuff in linux_file64.c available unconditionally,
  with exception of fcntl64, which is not present on Linux m68k
2002-05-12 15:04:27 +00:00
jdolecek a757d39f99 regen 2002-05-12 13:57:08 +00:00
jdolecek 187c2394f1 update for newer syscalls (from 2.5.15)
Linux m68k doesn't seem to have fcntl64 syscall - oversight?
2002-05-12 13:55:54 +00:00
tron 1e891c870b Add missing bracket arround macro argument reference. 2002-05-10 17:27:23 +00:00
tron d45825cf63 Remove check for size of field "d_off" in Linux "dirent" structure because
this problem cannot happen with the 64Bit version of the getdents().
2002-05-10 14:51:26 +00:00
tron 352c1fa967 Fix off by one error in check for size of field "d_off" in Linux
"dirent" structure.
2002-05-10 14:49:38 +00:00
tron add83289ca Move implementation of linux_sys_getdents64() to source file for
Linux 64bit filesystem calls.
2002-05-10 14:38:08 +00:00
manu 28a3cfe032 Do not restore SR on sigreturn: this could enable the user process to gain
unpropre privileges.
2002-04-15 20:48:12 +00:00
christos 10ecebd46a implement getdents64; my full java tree builds now. 2002-04-10 18:19:34 +00:00
christos 7e9e73a53c regen 2002-04-10 18:19:04 +00:00
christos db952e86f3 add getdents64 2002-04-10 18:18:26 +00:00
itojun 9998fd3a57 revert previous 2002-04-10 09:53:01 +00:00
itojun 7aef2b4e07 make it compile (missing includes) 2002-04-10 09:37:51 +00:00
christos bd432c1642 PR/16236: Joachim Koenig-Baltes: Linux emulation connect requires IPV6.
Apparently the sockaddr len fix was only compiled when IPV6 was enabled.
2002-04-08 14:00:31 +00:00
christos 866ad0f73f PR/16231: Ben Harris: m68k does not compile. 2002-04-08 13:27:37 +00:00
christos e9c4f70b2f use lsi_ like all other linux emulations. 2002-04-04 22:17:29 +00:00
tron d09c25ca9a Set default kernel version of Linux emulation to 2.4.18 on the i386 port.
It has been successfully tested using SuSE 7.3 libraries and binaries with
many applications.
2002-04-04 09:32:11 +00:00
christos cb483bd247 make this compile on archs that don't define linux signals. 2002-04-03 17:18:21 +00:00
christos f28b55d327 provide missing types for arch's that don't have specific linux_types.h 2002-04-03 17:13:32 +00:00
christos aa3369abe2 don't bail out if we don't have an arch/siginfo.h because we are being used
from userland.
2002-04-03 17:02:12 +00:00
tron 9121bc2ec4 Fix a cut and paste error in the emulation of getresgid(2): it returned
the effective user id as effective group id.
2002-04-03 14:28:36 +00:00
fvdl 221107a13b Use shmat1(), and tell it to find removed segments. 2002-04-03 11:54:37 +00:00
fvdl 7fc44e13a8 Allocate the right size for the native gid_t array in setgroups16. 2002-04-03 10:17:01 +00:00
christos fa33d13de9 Don't blow up if we don't have a machine dependend linux_signal.h.
kdump includes linux_signo.c
2002-04-02 23:25:07 +00:00
christos eda21311fd save/restore fs and gs; this should be pulled up. 2002-04-02 22:32:16 +00:00
jdolecek ee37f0c738 rename sysctl_linux() to linux_sysctl() and hook it into emul_linux 2002-04-02 20:23:43 +00:00
christos 840887afee bring the reverse signal mapping array into linux_signo.c 2002-03-31 22:40:16 +00:00
christos ac29fb3782 make signal array handling uniform, and put signal arrays in a separate
file. This is simular to errno array handling.
2002-03-31 22:22:43 +00:00
christos 018a4082cc - #undef DPRINTF for files that are included from other files.
- more debugging for socketcalls
- fix sa_len if AF_INET; somehow we get passed 28 instead of 16?
2002-03-29 20:49:40 +00:00
christos c9e808f0ee 1. fill in the ldt.sd_xx field, for total compat with linux.
2. in setregs, use gdt's instead of ldt's because linux wants to play with
   all the ldts. Apparently linuxthreads uses ldt's to allocate space for
   pthread_t's.
2002-03-29 17:01:49 +00:00
bjh21 99ba40c188 arm26->acorn26 transition. 2002-03-24 15:49:38 +00:00
jdolecek 3089d90eeb add explicit comment a FILE_USE() is not needed here 2002-03-24 15:12:45 +00:00
jdolecek 0b5e2aba9a Fix problem with assumption non-socket == vnode in F_{G,S}ETOWN different way
(revisions 1.47 & 1.48 effectively backed off):
* for all but vnodes, just fallback to sys_fcntl(); assumming
  state of support for F_SETOWN/F_GETOWN and even hardcoding it here is
  not right (e.g. rev. 1.47 had this incorrect for DTYPE_PIPE)
* fallback to sys_fcntl() also for vnodes which don't represent tty
* don't need to use FILE_{,UN}USE() here, the code won't block while
  using the pointer
* add/fix some comments
2002-03-24 00:32:34 +00:00
christos 3c2d0dbff9 correct placement for FILE_UNUSE [from Izumi Tsutsui] 2002-03-23 15:36:15 +00:00
chs 60b5cc6ac2 make this compile again (PS_STRINGS is gone). 2002-03-23 05:00:04 +00:00
christos 0a4f1c3d8f sync with current reality and fix debugging. 2002-03-22 18:39:23 +00:00
christos 65fc8539e4 gc debugging printfs. 2002-03-22 17:14:18 +00:00
christos 8b2467a1e9 nuke mmap2, cleanup mmap, add mprotect 2002-03-22 15:21:28 +00:00
christos 5681411206 regen 2002-03-22 15:19:53 +00:00
christos b3c32e7e6d nuke mmap2, add mprotect 2002-03-22 15:19:43 +00:00
christos 99ff14c9f3 regen 2002-03-22 15:18:48 +00:00
christos 45af46eb53 add mprotect, nuke mmap2 2002-03-22 15:18:13 +00:00
christos b9a0007d1d regen 2002-03-22 15:17:17 +00:00
christos 190ffecb97 add mprotect, nuke mmap2 2002-03-22 15:17:04 +00:00
christos 7359db6620 regen 2002-03-22 15:16:14 +00:00
christos 24e38ed8f3 nuke mmap2 add mprotect 2002-03-22 15:16:02 +00:00
christos f7f4206314 regen. 2002-03-22 15:15:08 +00:00
christos 2b9a2aabe8 nuke mmap2, add mprotect 2002-03-22 15:14:55 +00:00
christos 92945f57fe regen 2002-03-22 15:11:23 +00:00
christos 22111899d0 1. make sure lines don't wrap
2. fix mmap and call it mmap like other ports do, not mmap2
3. implement fcntl64
4. implement mprotect because linux treats args slightly differently.
2002-03-22 15:10:38 +00:00
christos b02cb6b16f implement the locking calls for linux_file64. 2002-03-22 14:54:49 +00:00
christos 3b57c6607c - obey FILE_USE and FILE_UNUSE
- don't assume that non sockets point to vnodes.
2002-03-22 14:53:26 +00:00
christos d9ada7eabf Don't bitch if we don't have support for a particular arch. This makes it
easier to include this header from userland binaries [sysctl] on archs that
don't support compat-linux without incurring ifdef hell.
2002-03-21 13:23:48 +00:00
christos 50981e06bc emulation specific sysctls. Also change the kernel date to nov 11 as requested
by bad.
2002-03-20 00:27:58 +00:00
christos bda4b15e05 - Now that RT-signals fit, fix the array to deliver them. [i386 only].
- jdk-1.4 works perfectly now. :-)
2002-03-19 20:51:59 +00:00
christos 381e6a7764 make the stackgap_{init,alloc} functions MP friendly (i.e. pass struct proc *
in, instead of using curproc). While there add an optional size argument to
stackgap_init.
2002-03-16 20:43:48 +00:00
pooka 28a03499e8 Replace unused padding in struct linux_stat64 by lst_ino64 as found in
linux's m68k struct stat64.

makes linux compat compile again
2002-03-16 14:49:29 +00:00