Commit Graph

107 Commits

Author SHA1 Message Date
dsl a065e51621 remove all the double (and triple) casts used to convert 32bit userspace
pointers to and from 64bit kernel pointers.  Instead use the defines
NETBSD32PTR64(p32) to read a 32bit pointer and (the new) NETBSD32PTR32(p32,p64)
to write a 32bit pointer throughout.
The 32bit pointer is now a struct to enforce the above.
amd64 (with linux emul) and sparc64 will both compile (when the arch stuff
goes in soon), and amd64 still runs some i386 binaries.
2007-03-16 22:21:40 +00:00
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
christos fffc9c66c9 fix fallout from caddr_t changes. 2007-03-04 07:54:07 +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
cube 632ece3eaf Introduce a new member to struct emul, e_startlwp, to be used by
sys__lwp_create.  It allows using the said syscall under COMPAT_NETBSD32.

The libpthread regression tests now pass on amd64 and sparc64.
2007-02-19 15:10:02 +00:00
ad b07ec3fc38 Merge newlock2 to head. 2007-02-09 21:55:00 +00:00
elad 68f43d80fe Clean some KAUTH_GENERIC_ISSUSER usage in compat code. 2006-11-14 13:34:29 +00:00
martin a4f14b9dd0 Missing initializers 2006-10-15 21:12:08 +00:00
matt 2e04559304 When calling PTRACE from an LKM, use sysent[SYS_ptrace].sy_call in case
the sys_ptrace symbol isn't present.
2006-09-01 21:20:46 +00:00
mrg 356f83eb40 clean up ptrace changes: #include "opt_ptrace.h" 2006-09-01 05:27:15 +00:00
ad f474dceb13 Use the LWP cached credentials where sane. 2006-07-23 22:06:03 +00:00
pavel b15a1164c7 regen 2006-07-13 23:40:55 +00:00
pavel 6ac5157e79 request the COMPAT_30 getfh in the master files. (Changes to the generated
ones would be lost.)
2006-07-13 23:38:57 +00:00
martin 9adca95023 COMPAT_SUNOS* uses COMPAT_30 getfh too 2006-07-13 17:39:47 +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
elad 874fef3711 integrate kauth. 2006-05-14 21:19:33 +00:00
yamt ec5a93183a merge yamt-uio_vmspace branch.
- use vmspace rather than proc or lwp where appropriate.
  the latter is more natural to specify an address space.
  (and less likely to be abused for random purposes.)
- fix a swdmover race.
2006-03-01 12:38:10 +00:00
perry 3d4ed1fbc7 __inline__ -> inline 2005-12-24 23:41:33 +00:00
perry 0f0296d88a Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete. 2005-12-24 20:45:08 +00:00
christos 95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
chs 1e20ffb8a1 regen 2005-09-27 15:07:54 +00:00
chs ad1b7e8d5c include "opt_compat_sunos.h", netbsd32_syscallargs.h wants it. 2005-09-27 15:07:40 +00:00
cube 606552e84c Rework sunos32_execv{,e} after removal of netbsd32_execve2.
XXX COMPAT_SUNOS32 needs a SUNOS32PTR64() macro.
2005-07-13 12:49:32 +00:00
christos 25e2fae9e9 Add a sunos_machdep include file to deal with MD implementations of
sunos_syscall_intern.
2005-07-11 13:14:49 +00:00
christos ecc4f71237 define syscall again. 2005-07-10 04:23:30 +00:00
christos 6667cfbdab We have syscall_intern now. 2005-07-10 00:56:01 +00:00
christos 94984f467b - fix 32 -> 64 pointer casts properly.
- add const
- fix shadow
2005-05-31 00:42:37 +00:00
christos 805ebc54c2 - add const
- fix shadowed variables
2005-05-31 00:42:10 +00:00
christos a5fb891bb9 PR/29696: Joel Carnat: NetBSD freezes when accessing smbfs mounted FS with
firefox/linux due to compat getdents() call assumption that all filesystems
support cookies.
2005-04-19 19:00:25 +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 44e692be50 make this rebuild generated files by default, also clean up and make
more like other similar Makefiles.
2005-02-26 23:49:20 +00:00
perry a7f74206ba regen 2005-02-26 23:20:00 +00:00
perry 477853c351 nuke trailing whitespace 2005-02-26 22:58:54 +00:00
skrll f7155e40f6 There's no need to pass a proc value when using UIO_SYSSPACE with
vn_rdwr(9) and uiomove(9).

OK'd by Jason Thorpe
2004-09-17 14:11:20 +00:00
matt 22120ad628 Constify the speedtab arrays 2004-04-25 06:23:40 +00:00
matt 48011c94e7 Constify a few read-only arrays/variables. 2004-04-25 06:02:20 +00:00
hannken fcd7f3df90 Fix statfs->statvfs fallout. 2004-04-22 14:32:09 +00:00
christos 6bd1d6d4db Replace the statfs() family of system calls with statvfs().
Retain binary compatibility.
2004-04-21 01:05:31 +00:00
drochner 4f5b1431f9 all ports define __HAVE_SIGINFO now, so remove the CPP conditionals 2004-03-26 15:01:16 +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
christos 94c11938c1 Regen 2003-10-26 08:11:17 +00:00
christos 099d2ea44d Add __HAVE_SIGINFO 2003-10-26 08:11:01 +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
kleink 004922cd70 Don't use NULL in integer-type assignments/comparisons. 2003-10-21 12:08:11 +00:00
martin a498dbd6b4 constify 2003-09-28 10:24:47 +00:00