Commit Graph

234 Commits

Author SHA1 Message Date
dsl
893faeae9e Update all the compat stuff to not use the 'stackgap' for processing
sys_stat() and friends, instead use do_sys_stat() and do_sys_fstat()
that write the answer into a kernel buffer (on stack) that can be
converted to the correct form and written the userspace.
I've test compiled a few kernels, and tested i386 netbsd1.6 ls.
Given I think I've fixed some bugs, it might be 50-50 with new ones.
2007-03-10 21:40:23 +00:00
ad
c147748d84 - Make the proclist_lock a mutex. The write:read ratio is unfavourable,
and mutexes are cheaper use than RW locks.
- LOCK_ASSERT -> KASSERT in some places.
- Hold proclist_lock/kernel_lock longer in a couple of places.
2007-03-09 14:11:22 +00:00
christos
53524e44ef Kill caddr_t; there will be some MI fallout, but it will be fixed shortly. 2007-03-04 05:59:00 +00:00
he
96f8f675f8 Complete the ANSI conversion by completing the conversion of hpux_sys_rtprio(). 2007-02-19 18:43:17 +00:00
dsl
923424a8c0 Keep proclist_lock held across p_find and use of result proc. 2007-02-18 11:45:35 +00:00
dsl
1564fa5d82 ANSI prototypes 2007-02-18 11:38:15 +00:00
pavel
934634a18c Change the process/lwp flags seen by userland via sysctl back to the
P_*/L_* naming convention, and rename the in-kernel flags to avoid
conflict. (P_ -> PK_, L_ -> LW_ ). Add back the (now unused) LSDEAD
constant.

Restores source compatibility with pre-newlock2 tools like ps or top.

Reviewed by Andrew Doran.
2007-02-17 22:31:36 +00:00
ad
6faf4c1b76 Sprinkle some more locks. 2007-02-10 10:12:34 +00:00
ad
8cfae44a35 Sprinkle a couple more locks. 2007-02-10 10:09:01 +00:00
tsutsui
18f2cde2bd Make COMPAT_HPUX compile by mechanical replacements.
XXX1: not sure if it still works even before newlock2 merge
XXX2: some more mutex locks might be required
2007-02-10 02:42:30 +00:00
ad
b07ec3fc38 Merge newlock2 to head. 2007-02-09 21:55:00 +00:00
elad
8d28e56e22 Remove KAUTH_GENERIC_ISSUSER. 2007-01-04 15:21:09 +00:00
elad
68f43d80fe Clean some KAUTH_GENERIC_ISSUSER usage in compat code. 2006-11-14 13:34:29 +00:00
pavel
3cdb79bdae Replace homegrown tests for FIFO (... & S_IFIFO) by S_ISFIFO. The old code
was "correct" by luck - we don't have any other file type whose S_IF* bits
in sys/stat.h overlap with S_IFIFO.

Originally discovered by Paul Stoeber in OpenBSD.
2006-09-25 16:16:18 +00:00
tsutsui
c1ba1fb63b Try to make this timecounter ready.
XXX untested since I have no HP-UX binary to test these syscalls
2006-09-09 11:27:19 +00:00
bjh21
e9b4035b9a Correct last commit to use correct variable name in hpux_sys_getpgrp2(). 2006-07-31 20:39:34 +00:00
ad
f474dceb13 Use the LWP cached credentials where sane. 2006-07-23 22:06:03 +00:00
he
68f1dc24e6 Convert from using the no-longer-existing sys_socket to using the
recently introduced compat_30_sys_socket.
2006-06-30 09:06:32 +00:00
mrg
1b7ff51599 regenerate. 2006-06-26 21:30:50 +00:00
mrg
e2eb31d3a3 version the socket(2) syscall. for compat30 socket, we use
EPROTONOSUPPORT instead of EAFNOSUPPORT.

from pavel@ with a little bit of clean up from myself.

XXX: netbsd32 (and perhaps other emulations) should be able
XXX: to call the standard socket calls for this i think, but
XXX: revisit this at another time.
2006-06-26 21:23:56 +00:00
yamt
576f2b4ce7 fix another kauth mistake. 2006-05-15 13:06:40 +00:00
yamt
7395572139 - don't try to use nonexistent variable.
- while i'm here, remove unnecessary casts.
2006-05-15 13:01:39 +00:00
yamt
fb7becdc2d include kauth.h for kauth_authorize_generic, etc. 2006-05-15 12:48:09 +00:00
elad
874fef3711 integrate kauth. 2006-05-14 21:19:33 +00:00
christos
95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
he
70fe9e01e8 This now needs <compat/sys/signal.h> to build. 2005-09-14 13:49:50 +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
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
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
perry
77f2a006d0 regen 2005-02-26 23:58:19 +00:00
perry
fa91538c32 make this rebuild generated files by default 2005-02-26 23:35:00 +00:00
perry
477853c351 nuke trailing whitespace 2005-02-26 22:58:54 +00:00
david
bf4bf03db8 Refine bounds check code. 2004-11-07 04:08:37 +00:00
david
090b8be8f9 Bounds check syscall arguments where appropriate 2004-10-27 19:29:56 +00:00
jdolecek
f83c14f534 only include emulation syscallnames with SYSCALL_DEBUG, it's not used otherwise 2004-09-12 10:38:25 +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
pk
c245462cb8 hpux_ioctl(): acquire a reference to the file. 2004-06-01 11:05:40 +00:00
matt
c768d54573 Constify an array. 2004-04-25 06:04:54 +00:00
fvdl
d99705e941 Put back Emmanuel's sigfilter hooks, as decided by Core. 2003-12-20 19:01:29 +00:00
manu
b23b73b953 Introduce lwp_emuldata and the associated hooks. No hook is provided for the
exec case, as the emulation already has the ability to intercept that
with the e_proc_exec hook. It is the responsability of the emulation to
take appropriaye action about lwp_emuldata in e_proc_exec.

Patch reviewed by Christos.
2003-12-20 18:22:16 +00:00
jdolecek
0e253cf5f5 back the sigfilter emulation hook change off 2003-12-05 21:12:42 +00:00
manu
18e13eee35 Add a sigfilter emulation hook. It is used at the beginning of kpsignal2()
so that a specific emulation has the oportunity to filter out some signals.

if sigfilter returns 0, then no signal is sent by kpsignal2().

There is another place where signals can be generated: trapsignal. Since this
function is already an emulation hook, no call to the sigfilter hook was
introduced in trapsignal.

This is needed to emulate the softsignal feature in COMPAT_DARWIN (signals
sent as Mach exception messages)
2003-12-03 20:24:51 +00:00
thorpej
052ba0ec50 We have CVS; there is no reason to make .bak files when generating the
syscall tables.
2003-11-15 20:30:59 +00:00
tsutsui
518c5a2e6a Fix an uninitialized warning. 2003-11-01 17:48:20 +00:00
lukem
f85d2d1c14 Use ${HOST_SH} instead of `sh'.
If necessary, pull in <bsd.sys.mk> to get the definition of HOST_SH;
Makefiles that pull in one of (most of) <bsd.*.mk> will get this anyway.
2003-10-26 07:25:33 +00:00
chs
939df36e55 add support for non-executable mappings (where the hardware allows this)
and make the stack and heap non-executable by default.  the changes
fall into two basic catagories:

 - pmap and trap-handler changes.  these are all MD:
   = alpha: we already track per-page execute permission with the (software)
	PG_EXEC bit, so just have the trap handler pay attention to it.
   = i386: use a new GDT segment for %cs for processes that have no
	executable mappings above a certain threshold (currently the
	bottom of the stack).  track per-page execute permission with
	the last unused PTE bit.
   = powerpc/ibm4xx: just use the hardware exec bit.
   = powerpc/oea: we already track per-page exec bits, but the hardware only
	implements non-exec mappings at the segment level.  so track the
	number of executable mappings in each segment and turn on the no-exec
	segment bit iff the count is 0.  adjust the trap handler to deal.
   = sparc (sun4m): fix our use of the hardware protection bits.
	fix the trap handler to recognize text faults.
   = sparc64: split the existing unified TSB into data and instruction TSBs,
	and only load TTEs into the appropriate TSB(s) for the permissions.
	fix the trap handler to check for execute permission.
   = not yet implemented: amd64, hppa, sh5

 - changes in all the emulations that put a signal trampoline on the stack.
   instead, we now put the trampoline into a uvm_aobj and map that into
   the process separately.

originally from openbsd, adapted for netbsd by me.
2003-08-24 17:52:28 +00:00
he
6d211e7dbf Re-balance parens. 2003-08-18 20:34:18 +00:00
christos
3b9c3c5aab - GC all the setup_stack functions
- add one for linux/i386
2003-08-08 18:57:01 +00:00