Commit Graph

294 Commits

Author SHA1 Message Date
thorpej 24ab4adb9c Use PAGE_SIZE rather than NBPG. 2003-04-01 01:53:40 +00:00
dsl 60418b39b7 Change 'data' argument to fo_ioctl and fo_fcntl from 'caddr_t' to 'void *'.
Avoids a lot of casting and removes the need for some line breaks.
Removed a load of (caddr_t) casts from calls to copyin/copyout as well.
(approved by christos - he has a plan to remove caddr_t...)
2003-03-21 21:13:50 +00:00
pk 2931081a79 Make updating a file's reference and use count MP-safe. 2003-02-23 14:37:32 +00:00
atatat bede65472d Cull unused variables. Sigh.
PS - Cross compilers are cool.
2003-01-29 07:00:35 +00:00
atatat 59b8237f5e No need to pick a "default address" for mmap in compat code, since we
merely call sys_mmap() at the end anyway, and that will pick the
address for us, if it's needed.

Likewise for checking if /dev/zero is being mapped.
2003-01-28 21:57:42 +00:00
fvdl a3ff3a3038 Bump daddr_t to 64 bits. Replace it with int32_t in all places where
it was used on-disk, so that on-disk formats remain the same.
Remove ufs_daddr_t and ufs_lbn_t for the time being.
2003-01-24 21:55:02 +00:00
thorpej d88bc9c3a2 Regen for correct RCS ID. 2003-01-18 23:36:48 +00:00
thorpej afdb47f3fb Regen: Merge the nathanw_sa branch. 2003-01-18 08:36:45 +00:00
thorpej fc54d21534 Merge the nathanw_sa branch. 2003-01-18 08:36:15 +00:00
wiz 617b132aac Spell output with two ts. 2003-01-04 23:43:02 +00:00
jdolecek f50246965e handle __HAVE_MINIMAL_EMUL 2002-11-10 20:59:03 +00:00
jdolecek 2cfacee0a0 set nsysent to 256 2002-11-01 20:44:43 +00:00
jdolecek 1524c4bf08 set struct emul's nsysent to compat SYS_NSYSENT, not SYS_MAXSYSCALL 2002-11-01 19:26:21 +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
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
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
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
thorpej 8bf2751b15 Statements must follow labels. 2002-05-30 18:44:30 +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
mrg d3b3f3e560 move the COMPAT_SUNOS TIOCGPGRP handling in the compat sunos code proper.
this is the final fix needed for it to run properly as an LKM.  no more
COMPAT_SUNOS hacks around the tree!
2002-03-02 12:30:43 +00:00
mrg af640de164 move the COMPAT_SUNOS SO_BROADCAST hack out of uipc_socket.c into the
compat/sunos code.  besides being cleaner this allows the sunos LKM
to properly work without any special kernel hacks.
2002-01-03 00:59:00 +00:00
tsutsui 1011f9fbcc Don't define COMPAT_SUNOS here. It is defined in opt_compat_sunos.h
and <sys/ioctl.h> and <sys/tty.h> include it properly.

XXX Is this needed for LKM?
2001-12-02 00:35:25 +00:00
fredette 7eac246b74 Added support for running 68010 SunOS executables. 2001-11-26 18:15:16 +00:00
lukem dab6ef8b56 add RCSIDs (including regeneration of files as appropriate) 2001-11-13 02:07:52 +00:00
thorpej e8ee04475d - Add a new vnode flag VEXECMAP, which indicates that a vnode has
executable mappings.  Stop overloading VTEXT for this purpose (VTEXT
  also has another meaning).
- Rename vn_marktext() to vn_markexec(), and use it when executable
  mappings of a vnode are established.
- In places where we want to set VTEXT, set it in v_flag directly, rather
  than making a function call to do this (it no longer makes sense to
  use a function call, since we no longer overload VTEXT with VEXECMAP's
  meaning).

VEXECMAP suggested by Chuq Silvers.
2001-10-30 15:32:01 +00:00
jdolecek ef8abe0767 Make the setregs hook emulation-specific, rather than executable
format specific.
Struct emul has a e_setregs hook back, which points to emulation-specific
setregs function. es_setregs of struct execsw now only points to
optional executable-specific setup function (this is only used for
ECOFF).
2001-09-18 19:36:32 +00:00
christos 0f380fac15 Add an e_trapsignal member to struct emul, so that emulated processes can
send the appropriate signal depending on the trap type.
2001-06-18 02:00:48 +00:00
manu a7cdf998ec Removed obsoletes EMUL_NO_BSD_ASYNCIO_PIPE and EMUL_NO_SIGIO_ON_READ flags.
Async I/O OS specifities should now handled in OS specific code. Linux
has been done, but other emulation should be handled. See case LINUX_F_SETFL
in sys/compat/linux/common/linux_file.c:linux_sys_fcntl() for more details.

The data that has been collected yet:

                                  Net Free Open Linux SunOS AIX OSF1 Darwin
send SIGIO to write end of pipe		Y  N    N     N     N    N   Y     Y
send SIGIO to read end of pipe      Y  Y    N     N     N    ?   Y     ?
send SIGIO to write end of socket   Y  Y    Y     N     N    Y   Y     Y
send SIGIO to read end of socket    Y  Y    Y     Y     Y    ?   Y     ?
2001-06-16 21:44:27 +00:00
thorpej 80cc38a1af Fix a partial construction problem that can cause race conditions
between creation of a file descriptor and close(2) when using kernel
assisted threads.  What we do is stick descriptors in the table, but
mark them as "larval".  This causes essentially everything to treat
it as a non-existent descriptor, except for fdalloc(), which sees a
filled slot so that it won't (incorrectly) allocate it again.  When
a descriptor is fully constructed, the code that has constructed it
marks it as "mature" (which actually clears the "larval" flag), and
things continue to work as normal.

While here, gather all the code that gets a descriptor from the table
into a fd_getfile() function, and call it, rather than having the
same (sometimes incorrect) code copied all over the place.
2001-06-14 20:32:41 +00:00
mrg 6a89288a37 use _KERNEL_OPT. 2001-05-30 11:37:21 +00:00
manu 7e6929fe90 Changed EMUL_BSD_ASYNCIO_PIPE to EMUL_NO_BSD_ASYNCIO_PIPE, so that
the native emulation (NetBSD) does not have a flag.
2001-05-07 09:55:12 +00:00
manu 5a6b8191b5 Added two flags to emulation packages:
EMUL_BSD_ASYNCIO_PIPE notes that the emulated binaries expect the original
BSD pipe behavior for asynchronous I/O, which is to fire SIGIO on read() and
write(). OSes without this flag do not expect any SIGIO to be fired on
read() and write() for pipes, even when async I/O was requested. As far as
we know, the OSes that need EMUL_BSD_ASYNCIO_PIPE are NetBSD, OSF/1 and
Darwin.

EMUL_NO_SIGIO_ON_READ notes that the emulated binaries that requested
asynchrnous I/O expect the reader process to be notified by a SIGIO, but
not the writer process. OSes without this flag expect the reader and the
writer to be notified when some data has arrived or when some data have been
read. As far as we know, the OSes that need EMUL_NO_SIGIO_ON_READ are Linux
and SunOS.
2001-05-06 19:09:52 +00:00
fvdl 6b7a7448f5 Cast 32bit sunos_nfs_arg member to (char *)(long) to avoid warning
after sunos.h change (cast is safe; a SunOS binary will pas a 32 bit
pointer).
2001-02-12 19:49:20 +00:00
mrg bd15b74ffc add missing !LKM check, noted by <tih@kpnQwest.no> 2001-02-03 22:20:02 +00:00
mrg bdec681975 sunos_ioctl.c is included by sunos32_ioctl.c. include the sunos32 &
netbsd32 headers if we are in sunos32 mode.
2001-02-02 12:59:43 +00:00
mrg b67bcac710 don't build these files if we're doing compat_netbsd32 as well.
a different set are required.
2001-02-02 07:12:27 +00:00
mrg 157a31d7a1 make this useful when compiled on sparc64: two members in sunos_nfs_args
become typedefs.
2001-02-02 07:11:09 +00:00
thorpej 1b6a66420e Regen; add sy_flags. 2001-01-27 07:23:06 +00:00
mycroft f495cd9dc6 Introduce 2 new flags in types.h:
* __HAVE_SYSCALL_INTERN.  If this is defined, e_syscall is replaced by
  e_syscall_intern, which is called at key places in the kernel.  This can be
  used to set a MD syscall handler pointer.  This obsoletes and replaces the
  *_HAS_SEPARATED_SYSCALL flags.
* __HAVE_MINIMAL_EMUL.  If this is defined, certain (deprecated) elements in
  struct emul are omitted.
2000-12-11 05:28:59 +00:00
jdolecek a6ca890142 always fill in e_syscall in respective emul_*; if the emulation doesn't
have it's own separated *_syscall() function, use syscall()
2000-12-09 12:38:23 +00:00
mycroft dd92250590 Regen. 2000-12-09 07:11:17 +00:00
mycroft 9b7a9b2897 Get rid of the damn EMUL_GET* flags. 2000-12-09 07:10:34 +00:00
mycroft f348afacb9 Regen. 2000-12-09 05:37:01 +00:00
mycroft 9682cf0b09 Add the %% separators. 2000-12-09 05:27:28 +00:00
jdolecek dc7c57f299 make LKM safe 2000-12-01 19:25:10 +00:00
jdolecek 36e6e46132 put aout specific sunos code from sunos_exec.c to separate file
sunos_exec_aout.c
make LKM safe
add EMUL_GETPID_PASS_PPID|EMUL_GETID_PASS_EID to emul_sunos flags
2000-12-01 19:24:36 +00:00
jdolecek 43ac5f6b81 put aout specific sunos code from sunos_exec.c to separate file
sunos_exec_aout.c
2000-12-01 19:23:10 +00:00
jdolecek 81f0543ba6 fix the emulation path 2000-12-01 13:21:37 +00:00