Commit Graph

170 Commits

Author SHA1 Message Date
christos 97c9d7a9dd rename elf32_read_from to exec_read_from since it is used in many places
now.
2001-07-14 02:05:05 +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
kristerw 7ae7504033 Added a 'break' on the last line in a switch statement, since the ISO
C standard do not permit labels at the end of compound statements.
2001-05-24 10:49:31 +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
thorpej 1b6a66420e Regen; add sy_flags. 2001-01-27 07:23:06 +00:00
jdolecek 13ca559d39 Use CHECK_ALT_SYMLINK() instead CHECK_ALT_EXISTS() where appropriate.
This addresses kern/11757.
2001-01-22 20:08:03 +00:00
jdolecek 34c8ae80da constify 2001-01-18 20:28:15 +00:00
jdolecek e9e91a0fb5 split off thread specific stuff from struct sigacts to struct sigctx, leaving
only signal handler array sharable between threads
move other random signal stuff from struct proc to struct sigctx

This addresses kern/10981 by Matthew Orgass.
2000-12-22 22:58:52 +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
mycroft f0689d5505 Regen. 2000-12-11 03:07:06 +00:00
mycroft 23babc12e5 Round up sysent table size. 2000-12-11 03:06:49 +00:00
jdolecek 87a6bee3a9 prototype ibcs2_syscall() in compat/ibcs2/ibcs2_exec.c 2000-12-09 12:45:44 +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 65203b4ec6 if IBCS2_MACHDEP_HAS_SEPARATED_SYSCALL is defined, put ibcs2_syscall to
emul_ibcs2
define IBCS2_MACHDEP_HAS_SEPARATED_SYSCALL in i386 ibcs2_machdep.h
2000-12-02 16:09:44 +00:00
jdolecek f1badb80a7 put executable format specific code from ibcs2_exec.c to separate
files ibcs2_exec_coff.c, ibcs2_exec_elf32.c, ibcs2_exec_xout.c as
appropriate
2000-12-01 19:17:41 +00:00
jdolecek 01040d97a2 add e_path (emulation path) to struct emul, which replaces emulation-specific
*_emul_path variables

change macros CHECK_ALT_{CREAT|EXIST} to use that, 'root' doesn't need
to be passed explicitly any more and *_CHECK_ALT_{CREAT|EXIST} are removed
change explicit emul_find() calls in probe functions to get the emulation
path from the checked exec switch entry's emulation

remove no longer needed header files

add e_flags and e_syscall to struct emul; these are unsed and empty for now
2000-12-01 12:28:30 +00:00
jdolecek 6626f506b3 LKMify 2000-11-30 19:05:26 +00:00
jdolecek 73f3cd8c7e LKMify 2000-11-29 21:51:49 +00:00
jdolecek baae0324b9 restructure struct emul and execsw, in preparation to make emulations LKMable:
* move all exec-type specific information from struct emul to execsw[] and
  provide single struct emul per emulation
* elf:
  - kern/exec_elf32.c:probe_funcs[] is gone, execsw[] how has one entry
    per emulation and contains pointer to respective probe function
  - interp is allocated via MALLOC() rather than on stack
  - elf_args structure is allocated via MALLOC() rather than malloc()
* ecoff: the per-emulation hooks moved from alpha and mips specific code
  to OSF1 and Ultrix compat code as appropriate, execsw[] has one entry per
  emulation supporting ecoff with appropriate probe function
* the makecmds/probe functions don't set emulation, pointer to emulation is
  part of appropriate execsw[] entry
* constify couple of structures
2000-11-21 00:37:49 +00:00
jdolecek 78b866e95a change the type of *syscallnames[] array to 'const char * const foo[]' 2000-11-13 21:32:15 +00:00
sommerfeld 6b88a0fc51 Emulation stackgap sanity checks, based partly on fixes from
FreeBSD-SA00:42.

Change stackgap_alloc to bounds-check the allocation vs. the stack
gap, returning NULL if there isn't room for the allocation.

Change emul_find() to check for a NULL return from stackgap_alloc()
and convert that into ENAMETOOLONG.

Reorder various emulation syscalls so that all *_CHECK_ALT_{EXIST,CREAT}
calls (which turn into emul_find() under the covers come *after* small,
fixed-size stackgap_alloc() calls.

Clean up ibcs2 {get,set}groups.
2000-08-29 14:33:25 +00:00
matt 4e1f5ebf66 When reading dir entry by dir entry, we need to pad out the receive buffer
to at least a block to make ufs_readdir happy.
2000-08-23 21:11:47 +00:00
cgd 0199b04bef update for changed makesyscalls.master 2000-08-18 19:35:15 +00:00
cgd 3af42e5211 update for changed makesyscalls.sh 2000-08-18 19:26:56 +00:00
matt 8666ad87ba Fix read problem on directories on UFS. 2000-08-18 17:38:33 +00:00
matt 693b01e5da Fix IBCS2_S_IFWGRP 2000-08-17 15:16:01 +00:00
matt 52a3078697 fix some size_t/int confusion. 2000-08-11 22:21:41 +00:00
matt 66617b2137 Add ibcs2_sys_gtty. 2000-08-11 22:20:10 +00:00
matt ef5099c8d8 Use size_t appropriately. 2000-08-11 22:19:29 +00:00
matt e4dc804075 Regen. 2000-08-11 22:17:58 +00:00
matt 4153441571 add ibcs2_sys_gtty 2000-08-11 22:14:07 +00:00
mrg 13f211c52e remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h> 2000-06-28 15:39:24 +00:00
matt 3c173d4927 If we loaded an nmagic on a subpage boundary, adjust epp->ep_d{addr,size} so
that they start on a page boundary.  This is needed so that obreak(2) works
properly.
2000-06-28 00:14:44 +00:00
mrg 89d0a3e519 remove redundant vm includes. 2000-06-26 14:38:50 +00:00
matt 3a447126e3 simply the abutting text/data case. 2000-06-23 22:03:22 +00:00
matt a0cf752d0c For omagic & nmagic, add bss size into data magic (needed for brk to work
right).  Deal with the case that the data segment might fit into all the
trailing part of last text page.
2000-06-21 06:40:04 +00:00
matt 15511d1dcc Move COFF_LDPGSZ to ibcs2_machdep.h. Fix nmagic loader to deal with
subpage mappings.
2000-06-21 05:45:15 +00:00
matt aef5a7aa9a Allow dynamic twiddling of debug messages.
Fix printf problem when printing debug messages.
fix coff shlib loading.  Add a few sanity checks.
2000-06-16 01:56:36 +00:00
mycroft e9deffe0bf Move a bunch of the COFF definitions into exec_coff.h, so they can be used by
other code.   XXX Not tested on SH3 yet.
2000-06-04 16:23:59 +00:00
chs a6d33cc1f2 add a new function vn_marktext() for exec code to let others know
that the vnode is now being used as process text.
2000-04-11 04:37:47 +00:00
augustss a82aeb5508 Kill register declarations. 2000-03-30 11:24:16 +00:00
simonb 2f1fef39b3 Centralise the declarations of cpu_model, machine, machine_arch,
osrelease, and ostype and remove "extern char foo[];" (for hostname
and domainname too).

Also delete redunctant decl of boottime in kern_info_43.c.
2000-03-28 23:57:24 +00:00
kleink 230876cf26 Merge parts of chs-ubc2 into the trunk:
* Remove the casts to vaddr_t from the round_page() and trunc_page() macros to
  make them type-generic, which is necessary i.e. to operate on file offsets
  without truncating them.
* In due course, cast pointer arguments to these macros to an appropriate
  integral type (paddr_t, vaddr_t).

Originally done by Chuck Silvers, updated by myself.
2000-03-26 20:42:21 +00:00