Commit Graph

179 Commits

Author SHA1 Message Date
jdolecek 6626f506b3 LKMify 2000-11-30 19:05:26 +00:00
jdolecek 73f3cd8c7e LKMify 2000-11-29 21:51:49 +00:00
tsutsui 6c33654882 Add declarations of hpux_setregs() and struct emul emul_hpux. 2000-11-27 15:26:17 +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
simonb f2df695c3b Update extern declarations of {hpux,ultrix}_syscallnames for change
to e_syscallnames in struct emul.  Untested on HP, but should be ok.
2000-11-19 12:47:51 +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
thorpej b4dc5fb0b7 splhigh() -> splsched() 2000-08-21 02:31:59 +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
thorpej c55e09bd44 Add a comment about the hzto() return value. 2000-07-13 17:32:06 +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
mrg 89d0a3e519 remove redundant vm includes. 2000-06-26 14:38:50 +00:00
sommerfeld 40339b39f9 Reduce use of curproc in several places:
- Change ktrace interface to pass in the current process, rather than
p->p_tracep, since the various ktr* function need curproc anyway.

 - Add curproc as a parameter to mi_switch() since all callers had it
handy anyway.

 - Add a second proc argument for inferior() since callers all had
curproc handy.

Also, miscellaneous cleanups in ktrace:

 - ktrace now always uses file-based, rather than vnode-based I/O
(simplifies, increases type safety); eliminate KTRFLAG_FD & KTRFAC_FD.
Do non-blocking I/O, and yield a finite number of times when receiving
EWOULDBLOCK before giving up.

 - move code duplicated between sys_fktrace and sys_ktrace into ktrace_common.

 - simplify interface to ktrwrite()
2000-05-27 00:40:29 +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
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
frueauf 253924ee60 Fix typo: hxto -> hzto. 2000-03-25 20:23:05 +00:00
thorpej 7b918b4088 New callout mechanism with two major improvements over the old
timeout()/untimeout() API:
- Clients supply callout handle storage, thus eliminating problems of
  resource allocation.
- Insertion and removal of callouts is constant time, important as
  this facility is used quite a lot in the kernel.

The old timeout()/untimeout() API has been removed from the kernel.
2000-03-23 06:40:33 +00:00
thorpej 03a42efc4b Regen. 1999-08-25 04:51:06 +00:00
thorpej 0dc5bd44d5 Update for new SVID IPC calls, and also update the list of syscalls
to include the complete set as of 9.x.
1999-08-25 04:50:53 +00:00
thorpej 0d32655143 Completely rewrite the HP-UX SVID IPC compat calls. 1999-08-25 04:50:08 +00:00
thorpej d30f8c710b Erg, fix a typo that snuck in there. 1999-08-23 20:59:33 +00:00
thorpej 0693721b59 A more-or-less complete list of the types used in HP-UX 9.x hp9000s300. 1999-08-23 18:40:43 +00:00
oster f4628e2fda FILE_UNUSE needs two args, not one. 1999-06-13 21:34:32 +00:00
thorpej e3669c3393 Add "use counting" to file entries. When closing a file, and it's reference
count is 0, wait for use count to drain before finishing the close.

This is necessary in order for multiple processes to safely share file
descriptor tables.
1999-05-05 20:01:01 +00:00
christos f3be801e5c Regen 1999-02-09 20:26:55 +00:00
christos 415ae8f732 const poisoning 1999-02-09 20:21:18 +00:00
christos f0c7751046 Regen 1998-12-10 17:13:06 +00:00
christos b0b86b5b7f Defopt COMPAT_43 1998-12-10 17:03:19 +00:00
frueauf b6576d4d72 fix typo: nativ_to_hpux_errno -> native_to_hpux_errno. 1998-11-09 15:35:16 +00:00
frueauf 03c64513e6 hpux_error.c got removed, add hpux_errno.c instead. 1998-11-05 12:42:46 +00:00
christos e5d2a186e0 Finish Eric's changes. 1998-10-24 19:04:19 +00:00
tron 3c8085dd6e Regen. 1998-10-19 22:32:51 +00:00
tron e8603a0b66 Defopt SYSVMSG, SYSVSEM and SYSVSHM. 1998-10-19 22:31:50 +00:00
christos c2339a1799 Make error array look like ibcs2, svr4, and linux 1998-10-18 17:00:32 +00:00
eeh 0a89614e93 Fixup big-endian syscall args. 1998-10-03 19:45:37 +00:00
eeh fc6c67ff5d Fixup big-endian syscall args. 1998-10-03 19:33:32 +00:00
thorpej 6a7b0ca257 Adapt to signal changes. 1998-10-01 06:35:09 +00:00
thorpej 370d14060a Adapt to signal changes. 1998-10-01 03:26:18 +00:00
christos 8fb507a3b7 Assign copyright to TNF. 1998-09-05 14:50:25 +00:00
perry e1601dc2ca bzero->memset, bcopy->memcpy, bcmp->memcmp 1998-08-09 20:36:58 +00:00
thorpej 971b8956ef defopt KTRACE 1998-06-25 21:18:11 +00:00
thorpej dc4fe3d32d Regen: makesyscalls.sh changed. 1998-02-19 03:34:15 +00:00
thorpej 98193ef4fd makesyscalls.sh changed; regen. 1998-02-19 00:39:25 +00:00
thorpej a4db5a6784 Update a comment to reflect new makesyscalls.sh behavior. 1998-02-19 00:37:43 +00:00
kleink 8defdfc372 Regen: sys_fchown() -> sys___posix_fchown(). 1998-02-14 21:19:37 +00:00
kleink ab93fc5e02 Use sys___posix_fchown() instead of sys_fchown(). 1998-02-14 21:16:35 +00:00
kleink 9cda9b2393 * chown(): use sys___posix_chown().
* rename():  change reference to sys___posix_rename().
1998-02-14 21:13:52 +00:00
kleink ed9f037214 Fix EDQUOT and EIDRM, add ENOMSG. 1998-02-10 17:45:06 +00:00
thorpej 80fff795f9 Regen. 1998-01-09 06:19:02 +00:00
thorpej 585f0dec73 Regen: back out RCD ID related changes. 1998-01-08 00:17:11 +00:00
perry 36bd5a5407 regened with RCSIDs in place 1998-01-05 18:23:00 +00:00
thorpej 14cd99880c Fix the shared library versioning snafu caused by the recent changes
to the stat(2) family and msync(2).  This uses a primitive function
versioning scheme.

This reverts the libc shared library major version from 13 to 12, and
adds a few new interfaces to bring us to libc version 12.20.

From Frank van der Linden <fvdl@NetBSD.ORG>.
1997-10-20 22:05:06 +00:00
carrel c2418895f6 Add some more sysconf() types. (Mostly stolen from other compat_* s) 1997-10-19 19:25:07 +00:00
mycroft 762d77e123 Fix bogosity in mknod(2) translation. 1997-10-19 18:35:09 +00:00
carrel 052d2ca080 variable is sb not st 1997-10-18 16:39:46 +00:00
scottr 961e600c5c Don't compile hpux_sys_ptrace(), as it uses a deprecated interface
(and didn't really work, anyway).  Suggested by Dave Carrel.
1997-10-17 18:43:48 +00:00
scottr 0ea4e1111a Regen. 1997-10-17 18:40:53 +00:00
scottr 519862a03a ptrace() emulation is no longer supported, and probably hasn't worked
for some time anyway.
1997-10-17 18:39:14 +00:00
christos 766ded363c check for st_link overflow. 1997-10-16 23:52:03 +00:00
carrel 2d7d2e019a include vm/vm.h 1997-10-16 18:27:40 +00:00
mycroft 91302e62ef Regen. 1997-10-16 03:36:14 +00:00
mycroft 68fb837229 Fix a typo inherited from kern/syscalls.master. 1997-10-15 17:18:17 +00:00
thorpej 616e0b7e33 Copyright assigned to The NetBSD Foundation. 1997-10-05 18:26:38 +00:00
pk e3680b0e26 config.new => config 1997-07-20 20:33:08 +00:00
mycroft e3f99a9397 Pass the vnode type to vaccess(), and use it when checking VEXEC. Make sure
that the mode bits passed to vaccess() and returned by foo_getattr() contain
only permission bits.
1997-05-08 16:19:43 +00:00
mycroft 837a72363d VEXEC -> VLOOKUP, as appropriate. 1997-05-08 10:57:17 +00:00
mycroft aaf3b59589 Remove outdated comment. 1997-05-05 06:56:20 +00:00
thorpej 70ce55d5d7 Update for changes in machine-dependent COMPAT_HPUX code. 1997-04-27 21:40:47 +00:00
scottr 703bcd151c Add prototypes, and make this compile with -Wall. Remove register
modifier from all declarations.
1997-04-01 19:58:58 +00:00
thorpej f956bd54d3 Clean up some slighyly overzealous use of `_'. 1997-03-16 10:16:02 +00:00
thorpej ae8392d8b1 - COMPAT_HPUX only works on machine with a 4k _hardware_ page size.
- Remove a slightly misguided hack.
1997-03-16 10:14:44 +00:00
thorpej abe496a1c9 Remove a new-obsolete comment. 1997-03-16 10:13:12 +00:00
thorpej b11751e729 Use hpux_setregs(). 1997-03-16 09:16:11 +00:00
thorpej b132875e6e Use hpux_sendsig() and hpux_sys_sigreturn(). 1997-03-16 03:48:00 +00:00
mycroft 695fbc60e2 Use splclock() to block time updates, not splhigh(). 1997-02-28 05:01:21 +00:00
perry b89a3425b7 Eliminate obsolete TIMEZONE and DST options.
Eliminate obsolete global kernel variable "struct timezone tz"
Add RTC_OFFSET option
Add global kernel variable rtc_offset, which is initialized by
RTC_OFFSET at kernel compile time.
on i386, x68k, mac68k, pc532 and arm32, RTC_OFFSET indicates how many
minutes west (east) of GMT the hardware RTC runs. Defaults to 0.
Places where tz variable was used to indicate this in the past have
been replaced with rtc_offset.
Add sysctl interface to rtc_offset.
Kill obsolete DST_* macros in sys/time.h
gettimeofday now always returns zeroed timezone if zone is requested.
settimeofday now ignores and logs attempts to set non-existant kernel
timezone.
1997-01-15 01:28:28 +00:00
thorpej 8f8abcd69c Regen; makesyscalls.sh emits comments now. 1997-01-13 18:49:02 +00:00
thorpej 04f65ff081 Need to include <sys/exec.h> 1996-10-14 06:53:23 +00:00
christos 53e42f3487 Backout previous kprintf change. 1996-10-13 00:46:49 +00:00
christos 5476886e52 printf -> kprintf, sprintf -> ksprintf 1996-10-10 17:47:29 +00:00
ws 2da166f660 Fix p_nice vs. NZERO code.
Change NZERO to 20 to always make p_nice positive.
On Christos' suggestion make p_nice explicitly u_char.
1996-10-02 18:04:56 +00:00
mycroft 826fb76b6f Regen. 1996-09-07 14:24:17 +00:00
mycroft 1449e67e30 Modify poll(2) prototype. 1996-09-07 14:20:09 +00:00
mycroft c9663d2cad Regen. 1996-09-07 13:24:34 +00:00
mycroft 17b9974c5a Implement poll(2). 1996-09-07 13:23:39 +00:00
mycroft e9e01a4d00 Regen. 1996-09-03 03:19:46 +00:00
mycroft 5de9f548a2 Give every emulation its own Makefile for the syscall table. 1996-09-03 03:18:04 +00:00
mycroft a8fd25767d Define execv() and execve() consistently across emulations.
Do path name translation.
1996-09-03 03:12:17 +00:00
mycroft 3bbb29fe03 Catch up with setre[ug]id() changes. 1996-06-23 11:10:01 +00:00
cgd d73abf41aa avoid unnecessary checks of m_get/MGET/etc.'s return values. When
they're called with M_WAIT, they are defined to never return NULL.
1996-06-14 22:21:12 +00:00
jtc e19bfae4f9 Rename struct timespec fields to conform to POSIX.1b 1996-02-01 00:18:04 +00:00
thorpej d9bce7422e Move the obviously machine-dependent HP-UX compat code to hpux_machdep.{c,h}.
A fair bit of this, the m68k core dump and exec goo, can probably be
made into a generic m68k hpux module, eventually.

More to be placed in hpux_machdep.c - keep your eyes peeled...
1996-01-06 12:44:06 +00:00
thorpej 3bf97cdb69 Fix a type-size glitch caught by gcc 2.7.2. 1995-12-11 16:32:46 +00:00
mycroft 018fa71167 Eliminate bogus casts. 1995-12-09 04:05:52 +00:00
thorpej d7cef923ac Centralize the HP-UX file flags translation stuff. 1995-12-08 07:54:43 +00:00
thorpej b0ca4831ea Check in two changes I apparently overlooked the last time. "oops" 1995-12-08 07:45:31 +00:00
thorpej 0d02785d6c Re-ran makesyscalls.sh; syscalls.conf and syscalls.master chagned. 1995-11-28 08:43:58 +00:00
thorpej 0ec193c9b2 Get COMPAT_HPUX partially working on the hp300. Notable improvements:
* It compiles (and links).
	* Make use of "/emul/hpux" where applicable.
	* Untangle a bit, pulling some funtions from the monolithic
	  hpux_compat.c into hpux_file.c, hpux_exec.c, etc.
	* Fix a couple of bugs.
Yet to do:
	* Move hp300-specific functions into hp300/hp300/hpux_machdep.c.
	* Make everything work properly (you laugh...)

These changes are sufficient to run some simple HP-UX 9.x executables,
including ls(1) (which will read password and group information from the
YP server correctly, albeit slowly), a simple "hello world", uname(1),
and a few other odds and ends.  Dynamically linked executables work, and
demand-paging _seems_ to work properly.  Major problems:
	* socket and/or signal handling appears to need some work yet.
	* 99% sure I didn't do exactly the right thing adjusting for the
	  fact that "kstack" is gone now.
	* ktrace(1)'ing some executables (HP-UX telnet(1) is what I tried)
	  causes the HP-UX executable to dump core with a SIGSEGV for an
	  as of yet unknown reason.

This is mostly meant as a checkpoint/snapshot, to make it easier for others
to track progress on this code, and hack on it themselves.  It's certainly
better off now than before.
1995-11-28 08:39:45 +00:00
mycroft 55c46e9514 Reran makesyscalls.sh. 1995-10-07 06:41:34 +00:00