Commit Graph

3269 Commits

Author SHA1 Message Date
christos b970e18139 Regen 2004-07-07 22:04:27 +00:00
christos 63c19634d0 no #ifdef __powerpc__ here. 2004-07-07 22:03:38 +00:00
manu 67cf1bc043 MacOS X.3 introduces a new sigreturn for PowerPC, with a usercontext
versionning argument. For now we only implement the X.2 flavor.
2004-07-04 21:03:55 +00:00
manu aab7e2ab6f Useful debug since ktrace doesn't show sysctl arg array. 2004-07-04 20:30:14 +00:00
christos 439d1da971 #ifdef the altivec option, because only powerpc has it. To be fixed in
a better way later.
2004-07-04 15:27:26 +00:00
manu 7fef082024 Move all the MD bits of commpage to a new file.
Map the comm page as RW in kernel (we want to modify it but not to execute it),
and RX in userland (no need to modify it but we want to execute it
2004-07-03 22:17:18 +00:00
manu 318748a9d0 Wrong argument to memset for bzero in commpage. 2004-07-03 17:29:17 +00:00
manu 5d33c4b91c 2^53 does not compute 2 power 53... 2004-07-03 16:47:13 +00:00
manu 4d933c5be0 Mark the thread id as clean in cthread_set_self 2004-07-03 09:44:04 +00:00
manu 26200ee754 In MacOS X.3, the kernel maps tw opages of memory in every user process.
This areas is called the comm pages. It is used to provide fast access to
several data and functions.

The comm pages are mapped starting at 0xffff800 (address chosed so that
absolute branch can be used, so it can be accessed even when dynamic linking
is not ready). NetBSD has the user stack here, so we need to provide a
Darwin-specific stack setup routine which sets the top of the stack at
0xbfff0000.

This implementation is not complete but it does enough to get MacOS X.3
starting again (static binaries run, dynamic binaries still have an issue).
in the comm pages functions, we only implement bcopy, pthread_self and
memcpy.

TODO:
- clean up the powerpc specific code from MD parts
- for now we map only one page to avoid a crash, we want two pages.
- write all the comm functions.
2004-07-03 00:14:30 +00:00
drochner 6f8b4c1216 There is no point in mapping a NetBSD signal trampoline
(which doesn't exist unless COMPAT_16 anyway)
into a Darwin emulation process' address space.
2004-06-24 17:02:06 +00:00
manu 31f25e173c Fix a reversed errno issue for Linux binaries on mips. While we are there,
fix broken includes for alpha and m68k.
2004-06-19 22:59:40 +00:00
manu b2563527a8 Build COMPAT_LINUX again on mips after the siginfo change. 2004-06-19 18:45:30 +00:00
manu 0d510f3e7e include <sys/resourcevar.h>. It is not required for building -current,
but it is for -netbsd-2-0. Next step is to pull up the change...
2004-06-18 17:06:15 +00:00
cube 4277a3964f Regen. 2004-06-17 18:30:54 +00:00
cube 4b2667d3ec o Add support for the statvfs family of syscalls (statvfs1, fstatvfs1,
fhstatvfs1 and getvfsstat)
o Move the statfs family out of netbsd32_fs.c and netbsd32_netbsd.c to
  netbsd_compat_20.c, compiled with COMPAT_20

Reviewed by christos@.
2004-06-17 18:29:40 +00:00
manu 6b1a152604 COMPAT_LINUX/powerpc used the native stack setup routine, but now the
native version does non executable mappings on the stack. This is a
showstopper for Linux binaries.

To fix that we supply a copy f the native stack setup function for Linux
binaries, with the executable bit set.
2004-06-16 00:03:25 +00:00
yamt 6c4915e34d linux_sys_ioctl: map EPASSTHROUGH to EINVAL as sys_ioctl does.
otherwise, linux_syscall() returns garbage, at least on i386.
(it returns native_to_linux_errno[EPASSTHROUGH] where EPASSTHROUGH == -4.)

i choose EINVAL rather than ENOTTY, because linux's pipe returns it
and i think that it's a common case.
2004-06-03 01:53:28 +00:00
pk c245462cb8 hpux_ioctl(): acquire a reference to the file. 2004-06-01 11:05:40 +00:00
pk f0f0f16529 svr4_sys_ioctl(): acquire a reference to the file. 2004-06-01 10:38:39 +00:00
pk c6c77837c9 sunos_ioctl(): acquire a reference to the file.
This also fixes a locking botch reported in PR#25738.
2004-06-01 10:27:39 +00:00
hannken 8c21bc6224 Add ffs internal snapshots. Written by Marshall Kirk McKusick for FreeBSD.
- Not enabled by default. Needs kernel option FFS_SNAPSHOT.
- Change parameters of ffs_blkfree.
- Let the copy-on-write functions return an error so spec_strategy
    may fail if the copy-on-write fails.
- Change genfs_*lock*() to use vp->v_vnlock instead of &vp->v_lock.
- Add flag B_METAONLY to VOP_BALLOC to return indirect block buffer.
- Add a function ffs_checkfreefile needed for snapshot creation.
- Add special handling of snapshot files:
    Snapshots may not be opened for writing and the attributes are read-only.
    Use the mtime as the time this snapshot was taken.
    Deny mtime updates for snapshot files.
- Add function transferlockers to transfer any waiting processes from
  one lock to another.
- Add vfsop VFS_SNAPSHOT to take a snapshot and make it accessible through
  a vnode.
- Add snapshot support to ls, fsck_ffs and dump.

Welcome to 2.0F.

Approved by: Jason R. Thorpe <thorpej@netbsd.org>
2004-05-25 14:54:55 +00:00
atatat 190adb15c3 Sysctl descriptions under emul subtree. 2004-05-25 04:29:08 +00:00
jonathan 230fb9b8ab Eliminate several uses of `curproc' from the socket-layer code and from NFS.
Add a new explicit `struct proc *p' argument to socreate(), sosend().
Use that argument instead of curproc. Follow-on changes to pass that
argument to socreate(), sosend(), and (*so->so_send)() calls.
These changes reviewed and independently recoded  by Matt Thomas.

Changes to soreceive() and (*dom->dom_exernalize() from Matt Thomas:
pass soreceive()'s struct uio* uio->uio_procp to unp_externalize().
Eliminate curproc from unp_externalize.   Also, now soreceive() uses
its uio->uio_procp value, pass that same value downward to
((pr->pru_usrreq)() calls for consistency, instead of (struct proc * )0.

Similar changes in sys/nfs to eliminate (most) uses of curproc,
either via the req-> r_procp field of a struct nfsreq *req argument,
or by passing down new explicit struct proc * arguments.

Reviewed by: Matt Thomas, posted to tech-kern.
NB: The (*pr->pru_usrreq)() change should be tested on more (all!) protocols.
2004-05-22 22:52:13 +00:00
christos 85699649e2 grr, forgot to take out the & 2004-05-22 20:53:26 +00:00
christos 9a0b176050 allocate memory for statvfs instead of using the stack. 2004-05-22 20:46:53 +00:00
atatat 10a7ba9ef6 Tweak sysctl setup functions (the macros, actually) for use in lkms,
and tweak lkminit_*.c (where applicable) to call them, and to call
sysctl_teardown() when being unloaded.

This consists of (1) making setup functions not be static when being
compiled as lkms (change to sys/sysctl.h), (2) making prototypes
visible for the various setup functions in header files (changes to
various header files), and (3) making simple "load" and "unload"
functions in the actual lkminit stuff.

linux_sysctl.c also needs its root exposed (ie, made not static) for
this (when built as an lkm).
2004-05-20 06:34:24 +00:00
drochner 644e697b54 regen 2004-05-11 10:55:29 +00:00
drochner c736283f11 FreeBSD emulation should not depend on NetBSD binary compatibility
options. Include compat_20_sys_*statfs* unconditionally.
2004-05-11 10:54:51 +00:00
jonathan d2dde9d018 Regen src/sys/compat/freebsd_sys{call.h,callargs.h,calls.c,ent.c} from
syscalls.master rev 1.45, with COMPAT_2.0 fix.
2004-05-10 20:47:14 +00:00
christos cec7684b79 Add opt_compat_netbsd.h because we need it for COMPAT_20; pointed out
by Jonathan Stone.
2004-05-10 20:27:42 +00:00
kent e3f4d77dda regenerate for fsync_range, uuidgen, getvfsstat, statvfs1, fstatvfs1, and fhstatvfs1 2004-05-08 14:33:12 +00:00
kent af38d21dbd add fsync_range, uuidgen, getvfsstat, statvfs1, fstatvfs1, and fhstatvfs1. 2004-05-08 14:31:59 +00:00
pk 4a04452106 Use crdup(), instead of crget()+memcpy(). 2004-05-02 12:32:22 +00:00
fair 5b3531cc87 Line 175 VFS_STAVTFS -> STATVFS (tyop) 2004-04-27 21:37:49 +00:00
atatat e5004170aa Be consistent about using sysc_init_field() 2004-04-27 03:49:03 +00:00
christos f987d253b9 PR/25335: Erik E. Fair: statvfs lossage in sys/lkm/compat/osf1 2004-04-26 20:33:50 +00:00
matt b1fee09f27 Constify sreq2breq 2004-04-25 06:25:52 +00:00
matt 22120ad628 Constify the speedtab arrays 2004-04-25 06:23:40 +00:00
matt c768d54573 Constify an array. 2004-04-25 06:04:54 +00:00
matt 48011c94e7 Constify a few read-only arrays/variables. 2004-04-25 06:02:20 +00:00
atatat 3f800573aa Be consistent about using sysc_init_field() 2004-04-25 05:54:38 +00:00
christos dede52abd3 PR/25288: Erik E. Fair: convert this file to statvfs 2004-04-23 12:02:39 +00:00
hannken fcd7f3df90 Fix statfs->statvfs fallout. 2004-04-22 14:32:09 +00:00
christos 924e775ac7 fix statvfs->statvfs1 fallout 2004-04-22 14:06:31 +00:00
christos e6f05cd289 Add the missing 'v' to fhstatvfs1 2004-04-22 12:04:03 +00:00
hannken 754675a0e1 Make it compile again after statvfs import. 2004-04-22 10:18:03 +00:00
matt 633d902c65 Regen for statvfs changes. 2004-04-22 05:44:30 +00:00
christos 22df5bb240 try to make this compile. XXX: this will not work yet (hi simon) 2004-04-21 11:50:26 +00:00
simonb b81e6f2ef6 ANSIfy, some KNF. 2004-04-21 07:05:07 +00:00
simonb 0495170a7a Fix some statfs->statvfs fallout. Compile tested only... 2004-04-21 05:20:27 +00:00
christos 34728fd71f more statvfs1 fallout. 2004-04-21 02:40:05 +00:00
christos 36d3802e0f fix more statvfs1 fallout 2004-04-21 02:37:20 +00:00
christos 5ccca4a99a s/statvfs/statvfs1/ 2004-04-21 02:27:34 +00:00
christos 6bd1d6d4db Replace the statfs() family of system calls with statvfs().
Retain binary compatibility.
2004-04-21 01:05:31 +00:00
dmcmahill 888e67edcc Fix the sysinfo(SI_HW_SERIAL, emulation so that we actually get the
hostid of the machine rather than always getting "0".  Tested with
hostid(1) from solaris-2.8 and with lmhostid (part of FlexLM) for solaris.
Approved by atatat@.
2004-04-19 02:55:40 +00:00
matt a6b639c3a5 Switch to using PSL_USEROK_P()
Use new save_fpu_lwp sematics to save or discard the fpu state appropriately.
2004-04-17 08:47:15 +00:00
christos a97d60211a fix undefined variable. 2004-03-29 21:43:28 +00:00
drochner 60cbbd8f70 use netbsd32_sigcode with COMPAT_16 only 2004-03-26 18:38:55 +00:00
drochner d19f706361 all ports define __HAVE_SIGINFO now, so remove the CPP conditionals 2004-03-26 17:34:18 +00:00
drochner 4f4ec7e627 regen after __HAVE_SIGINFO removal 2004-03-26 15:29:28 +00:00
drochner 9fd8e8983b all ports define __HAVE_SIGINFO now, so remove the CPP conditionals 2004-03-26 15:18:54 +00:00
drochner 4f5b1431f9 all ports define __HAVE_SIGINFO now, so remove the CPP conditionals 2004-03-26 15:01:16 +00:00
drochner 20c83a3f1e while this is dead code appearently, define e_sigobject only
if sigcode/esigcode are useful, otherwise bad things will
happen in kern_exec.c:exec_sigcode_map()
(from code inspection, untested)
2004-03-25 16:54:10 +00:00
pooka 8b2eb5b87e Use PR_WAITOK instead of M_WAITOK for pool_get(). This is polite,
since M_WAITOK happens to be PR_NOWAIT.
2004-03-24 16:55:07 +00:00
atatat 19af35fd0d Tango on sysctl_createv() and flags. The flags have all been renamed,
and sysctl_createv() now uses more arguments.
2004-03-24 15:34:46 +00:00
mrg 0275cc80b8 fix a (syscall args) comment. 2004-03-21 13:26:44 +00:00
he 545d50632e Remove local declaration of 'sg', since it is no longer used. 2004-03-11 10:14:10 +00:00
atatat c2309bcca6 *Don't* call sys___sysctl() from within the kernel. Use old_sysctl()
instead.
2004-03-09 03:18:03 +00:00
atatat 0d4caad924 Remove useless comment about stuff that never happened. 2004-03-09 03:13:07 +00:00
atatat bb33b98bad I obviously put this (__SYSCTL_PRIVATE) here, but I have no
recollection of what it was for and it's now just useless, so it goes.
2004-03-09 03:11:39 +00:00
drochner aaececd2f4 allow to start other emulations (eg native code)
from here: set p_execsw to the new thing, and call
the new emulation's syscall_intern()

XXX there are more differences to kern_exec.c, sa/ras
related afaics, this is harmliss for now since
netbsd32 doesn't support multithreaded programs yet --
one day one execve() implementation should be shared
by native and netbsd32 code.
2004-02-25 18:15:45 +00:00
drochner b07c616019 did this ever work? The EXEC_32 flag must be set _before_
exec_aout_prep_*magic(), otherwise setup_stack() fails.
2004-02-20 17:04:27 +00:00
drochner f0423dfad5 -MID_SPARC->NETBSD32_MID_MACHINE
-check for zero BSS size, as in kern/exec_aout.c rev. 1.23
2004-02-20 16:14:38 +00:00
wiz d20841bb64 Uppercase CPU, plural is CPUs. 2004-02-13 11:36:08 +00:00
junyoung 9a410f9ed0 Rename es_check in struct execsw to es_makecmds. 2004-02-06 08:02:58 +00:00
tsarna 72489e1ea0 uuidgen(2) syscall. Originally from FreeBSD, ported by John Franklin in
PR#23470, with minor updates by me. This is only the syscall support
from that PR, for now.

Changes: port over fix from FreeBSD for multicast address generation.
Changed bcopy to memcpy.  For now, #ifdef notyet the portions of
kern_uuid.c that are meant to be used by (currently nonexistent) other
things in the kernel.  Added syscall to COMPAT_FREEBSD as well, though
that's currently not useful, as any program new enough to use this call
also uses other syscalls we don't (yet) emulate.
2004-01-29 02:00:02 +00:00
yamt 2a93afdfd5 rename i386 mdlwp flags from MDP_ to MDL_
to avoid confusion with mdproc flags which also have MDP_ prefixes.
2004-01-28 10:48:55 +00:00
mrg 6f15ac16fc delete ktrsyscall32() prototype 2004-01-21 11:28:30 +00:00
atatat 4604fb0abe Remove useless comment 2004-01-17 03:30:14 +00:00
mrg 23884e8622 clean up a little:
- delete ktrsyscall32()
- add a check #ifdef _LP64 to do the conversion if P_32 is set to the
standard ktrsyscall()
- add a couple of similar _LP64/P_32 checks to the systrace code.

this should get systrace working for 32 bit apps as well as complete
ktrace support for "trace_enter/trace_exit" using platforms such as amd64.

XXX: systrace isn't supported on sparc64 currently... (it doesn't use
trace_enter/trace_exit, or have it's own calls to systrace_xxx()...)
2004-01-16 05:03:02 +00:00
mrg 1d9c8161a0 begin to implement some ifreq ioctls... long long way to go. 2004-01-15 14:36:28 +00:00
mrg 28a83c2d9f add a copy of the ktrsyscall() entry point for 32 bit emulated calls.
the main purpose of this function is to adjust the "argsize" value of
the ktrace syscall record, otherwise userland will see N/2 (rounded
down) arguments instead of N.
2004-01-15 14:34:38 +00:00
manu 29638672ea off-by-one error in ary subscript. 2004-01-02 02:09:52 +00:00
manu 996e659ce6 Try to do a better job at Mach port refcount. That's not perfect, though. 2004-01-01 22:48:54 +00:00
manu 0dc13ccc05 Added the getattrlist system call. That was annoying. 2003-12-31 02:55:04 +00:00
manu d1845c906c - Rework the Mach semaphore code to handle threads instead of processes
- Add 2 system calls: semaphore_signal_thread and sempaphore_signal_all (the
latter being untested)
- semaphore_signal_thread arguments list was wrong
2003-12-30 00:15:46 +00:00
manu 1a96ea0da6 In DPRINTF? replace uprintf, so that we get debug output for daemons too. 2003-12-30 00:14:20 +00:00
manu 5c83b03a81 Added DARWIN_IOFBSETGAMMATABLE
In DARWIN_IOFBSETCLUTWITHENTRIES, split big tables into 128 items chunks
so that they fit in the stackgap (currently 512 bytes)
2003-12-29 01:34:02 +00:00
manu 7ab97b2c76 Added Mach services (no real implementation, just empty shells to make
userland happy)
processor_set_default, host_processor_set_priv, and thread_set_policy
2003-12-29 01:30:27 +00:00
manu 31b3c2a056 Added the semaphore_wait_signal_trap Mach system call (untested) 2003-12-28 23:00:36 +00:00
manu 2c772b20d9 When the catcher of an exception dies before releasing the thread that
raised the exception, don't release the lock, this causes a crash (the lock
shall be released by the process that took it). Wakeup the thread instead,
it will release the lock itself.
2003-12-28 13:28:39 +00:00
manu 48d72491a9 The VRAM offset seems to be the offset of the framebuffer within the VRAM.
Until we really map the whole VRAM, this is 0.
Two missing files in the last commit
2003-12-27 22:06:19 +00:00
manu afc357e66b Correctly return the VRAM offset in IOFBGETVRAMMAPOFFSET connect method.
With this, WindowServer blanks hals of my screen before crashing the kernel.
That's sweet.
2003-12-26 20:34:34 +00:00
manu d0de7398af union without a name does not build on i386... 2003-12-26 16:31:29 +00:00
manu 219b24a068 Chand emul.darwin MIB to fit best current practice.
emul.darwin.init.pid instead of emul.darwin.init_pid, and so on.

This breaks backward compatibility with the pre-dynamic sysctl(8) for
emul.darwin, but it has never been available in a formal release, so
it should be alright.
2003-12-26 16:00:53 +00:00
manu 834aafd284 Rework Mach exception and Darwin's ptrace. gdb is now able to attach a
remote process. This new implementation also passes all the test programs
I've written so far.

- When exceptions come from traps, no UNIX signal should evet be sent.
- Add a lock to ensure a debugger handles only one exception at a time
- Use a structure to hold flavor and behavior in exception ports, instead
  of stuffing the two argument into an int.
- Implement new Mach services: thread_suspend, thread_resume and thread_abort
- Implement Darwin's ptrace PT_ATTACHEXC and PT_THUPDATE commands
- Handle NULL second argument correctly in sigprocmask.
- One mistake in the last commit (darwin_tracesig prototype)
2003-12-24 23:22:22 +00:00
manu 3bc6a59873 Small prototype mistake (I'm juggling with too much uncommitted files) 2003-12-24 22:57:22 +00:00
manu ffb3de5522 Move the sigfilter hook to a more adequate location, and rename it to better
fit what it does.

The softsignal feature is used in Darwin to trace processes. When the
traced process gets a signal, this raises an exception. The debugger will
receive the exception message, use ptrace with PT_THUPDATE to pass the
signal to the child or discard it, and then it will send a reply to the
exception message, to resume the child.

With the hook at the beginnng of kpsignal2, we are in the context of the
signal sender, which can be the kill(1) command, for instance. We cannot
afford to sleep until the debugger tells us if the signal should be
delivered or not.

Therefore, the hook to generate the Mach exception must be in the traced
process context. That was we can sleep awaiting for the debugger opinion
about the signal, this is not a problem. The hook is hence located into
issignal, at the place where normally SIGCHILD is sent to the debugger,
whereas the traced process is stopped. If the hook returns 0, we bypass
thoses operations, the Mach exception mecanism will take care of notifying
the debugger (through a Mach exception), and stop the faulting thread.
2003-12-24 22:53:59 +00:00
manu ebbd46991b clock_sleep was 10 times too fast because of a wrong constant. 2003-12-21 14:44:43 +00:00
simonb 740725d725 Fix usage of fifth argument to pool_init(). 2003-12-21 07:53:58 +00:00
manu 066436a916 Provide a kernel port for each thread. This makes the emulation of
Mach threads much more accurate: we do not confuse threads and tasks
anymore.
2003-12-20 19:43:17 +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
grant 44ed233ab5 KNF, spelling and english fixes to some comments. remove trailing
whitespace.
2003-12-18 01:10:20 +00:00
manu 966a0ee30b Darwin's sigprocmask is an hybrid between or modern sigprocmak (old set
argument, large sigset), and the older sigprocset (no old set argument,
small sigset). It feature old set argument and small sigset.

We now emulates this correctly.
2003-12-16 16:13:59 +00:00
manu d2b4a2c0fa Enable SA_SIGINFO for COMPAT_DARWIN 2003-12-16 13:38:25 +00:00
manu 780bd92b51 Catch signals in clock_sleep, so that sleeping processes can be interupted. 2003-12-09 22:04:25 +00:00
manu d34fcf6a3b One more property needed by WindowServer 2003-12-09 19:51:51 +00:00
manu 10f0bf745b Fix various broken sanity checks in iokit emulation.
Add some methods to IOFramebuffer (DARWIN_IOFBSETBOUNDS,
DARWIN_IOFBSETCURSORVISIBLE) and to IOHIDSystem (DARWIN_IOHIDPOSTEVENT),
all are unimplemented empty shells.
2003-12-09 17:13:18 +00:00
manu 98c34875d4 In mach_msg_error, don't display error message when the error
is 0 (no error). This function is often used as a shortcut to
return a short message with retval = 0.

Add error codes to the debug display
2003-12-09 17:10:02 +00:00
manu b50934fc19 Move exception related code to a dedicated file 2003-12-09 12:13:44 +00:00
manu 99ee466dbb Move most of the code involved into message header, trailer, and descriptor
construction to inline functions. This removes a lot of redundent code
from Mach services
2003-12-09 11:29:01 +00:00
christos 9c81f1b787 make this compile again. 2003-12-09 00:48:54 +00:00
manu 98f233296d Factor the code for OOL data movement into mach_ool_copyin and
mach_ool_copyout.

Handle port namespace and address space translations when OOL
data moves between different processes (untested)
2003-12-08 19:27:38 +00:00
christos 5c9b8df403 remove error(1) comment. 2003-12-08 17:51:53 +00:00
manu 9046478856 Use appropriate macro definitions when filling complex messages
descriptor. This changes nothing but it removes a lot of XXX
2003-12-08 12:03:16 +00:00
manu df54a7fcc7 When handling complex messages, uses mach_msg_type_descriptor_t until we
know what type a descriptor really is.
2003-12-08 12:02:24 +00:00
manu 4e9539e452 When a task to task message carries ports, translate the port names into the
receiver namespace.

While we are there, refactor mach_msg_overwrite by splitting it into
several smaller functions. It had grown too big to be easily maintainable.
2003-12-07 23:44:14 +00:00
manu bb9ea468f8 Remove useless and verbose debug message 2003-12-07 10:25:38 +00:00
manu c29e7d5f16 Added SCHED_INFO flavor in host_info 2003-12-07 10:17:09 +00:00
dmcmahill 3bff1bb631 fix style. Thanks Simon! 2003-12-07 02:01:25 +00:00
dmcmahill a243add09b regen after schedctl addition. 2003-12-07 01:50:10 +00:00
dmcmahill 82d69cf8b8 Add a dummy entry for syscall #206, schedctl, that simply returns zero.
This lets FlexLM clients run under compat_svr4_32 on sparc64.  Patch
checked by Matt Green.
2003-12-07 01:36:58 +00:00
manu dc728f311c Don't allow mappings at address zero in vm_allocate: first page is a
red zone in Darwin, and nothing should be mapped there.
While we are here, ifdef DEBUG_MACH_VM all the VM-related debug messages
2003-12-06 19:34:21 +00:00
manu 0951833f2e Remove the reference to struct proc in kernel and host port once the
process terminate, so that no stale pointer can be used if the port is
still referenced
2003-12-06 17:04:50 +00:00
manu 0105d58e0a Don't send Mach exceptions to dying processes 2003-12-06 15:16:38 +00:00
manu 174b751317 In task_terminate, unstop the process so that we can really terminate it now 2003-12-06 15:16:10 +00:00
manu 8f3ee36470 Fix some panics caused by incorrect Mach exceptions reference counts 2003-12-06 15:15:19 +00:00
manu 8019168c34 Remove a useless debug printf 2003-12-06 11:43:56 +00:00
christos 0cc29b2a89 darwin_sysctl is no more. 2003-12-05 22:17:47 +00:00
jdolecek 0e253cf5f5 back the sigfilter emulation hook change off 2003-12-05 21:12:42 +00:00
manu c79cdf6650 struct darwin_slock is not undefined, it's just machine dependent. 2003-12-05 19:57:44 +00:00
christos 91fec5ebba Make this compile.
- does darwin_sysctl() need to be gc'ed?
- does the darwin root node need to be in struct emul?
- does struct emul need a root sysctl node?
2003-12-05 17:34:56 +00:00
manu 6d6c56a0dc Add the kdebug_trace system call. It does nothing but dumping anything it
gets. dyd uses that feature when DYLD_TRACE is set.
2003-12-04 23:59:50 +00:00
manu 632ce64965 When wakeing up a process that was sleeping for a signal when we have a Mach
exception, don't temper with ps_sigwaited.
2003-12-04 22:00:03 +00:00
manu 8a670a0018 Fix newer compiler warning 2003-12-04 21:48:15 +00:00
atatat 13f8d2ce5f Dynamic sysctl.
Gone are the old kern_sysctl(), cpu_sysctl(), hw_sysctl(),
vfs_sysctl(), etc, routines, along with sysctl_int() et al.  Now all
nodes are registered with the tree, and nodes can be added (or
removed) easily, and I/O to and from the tree is handled generically.

Since the nodes are registered with the tree, the mapping from name to
number (and back again) can now be discovered, instead of having to be
hard coded.  Adding new nodes to the tree is likewise much simpler --
the new infrastructure handles almost all the work for simple types,
and just about anything else can be done with a small helper function.

All existing nodes are where they were before (numerically speaking),
so all existing consumers of sysctl information should notice no
difference.

PS - I'm sorry, but there's a distinct lack of documentation at the
moment.  I'm working on sysctl(3/8/9) right now, and I promise to
watch out for buses.
2003-12-04 19:38:21 +00:00
manu ac7838e90f In the basic thread info, suspend count is the suspend sempahore. Just return
0 for now. This is plain wrong, but at least it allows gdb to startup a
program.
2003-12-03 22:25:46 +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
manu 7973f2217b Rework Mach exceptions and softignals
Exceptions coming from a trap are generated from darwin_trapsignal()
softsignals are from darwin_sigfilter(), a function that is called
from darwin_trapsignal() and from kpsignal2() [the latter from a
emulation specific hook which is not yet committed]

Make some sanity checks to avoid sending data to a port with no receiver.

See http://mail-index.netbsd.org/tech-kern/2003/12/01/0008.html and
follow-ups for details.
2003-12-03 18:40:07 +00:00
manu 057381d1b4 Move machine dependent definitions to machine dependent headers. 2003-12-03 18:25:44 +00:00
manu 20fbf8c756 Trace data movement with vm_read and vm_write 2003-12-03 18:19:12 +00:00
manu eff089cdc0 More santity checks when sending data to a port: is there someone listening
on the receive end?
2003-12-03 18:18:43 +00:00
manu 437424d5f6 I forgot to commit this file for vm_machine_attribute to build correctly 2003-11-30 20:42:55 +00:00
manu ab8a1b7902 Add task_terminate 2003-11-30 20:42:03 +00:00
manu 540ad6ee85 Fix minor bug in the script that generate Mach services files (the master
fie tag was not copied)
2003-11-30 00:09:59 +00:00
manu 097771219f Implement vm_read, vm_write, and a framework for vm_machine_attribute.
THe machine dependent bit nees to be written.
2003-11-29 23:56:08 +00:00
manu 23a18da8cd To lookup a map entry in vm_map, use uvm_map_lookup, and not uvm_map_findspace,
which will not work on already mapped objects.
2003-11-28 08:03:14 +00:00
manu 8aa5d7b0f3 In Mach_task_suspend, stop the process without awaking its parent, this is
wrong on the semantic front; the spurious wakeup confuses Darwin's gdb.

Allow vm, task and thread operations on remote processes. The code to pick up
the remote process is in mach_sys_msg_trap(), so that any Mach service can
use it.
2003-11-27 23:44:49 +00:00