Commit Graph

15 Commits

Author SHA1 Message Date
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
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
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
0105d58e0a Don't send Mach exceptions to dying processes 2003-12-06 15:16:38 +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
9f69fbc7dc When sending exception with identity, include right names in the
receiver name space, not the sender one.
2003-11-25 23:17:40 +00:00
manu
c5006e8c0c Outch, uninitialized variable. How could that work before? 2003-11-25 17:09:24 +00:00
manu
3c00d1aad5 Start to implement another strange feature: signals as Mach software
exceptions. This can be requested with ptrace, and cause signals to
be transformed into a particular kind of exception.
2003-11-20 07:12:34 +00:00
manu
2079e3b2b5 SIGTRAP is used for breakpoints 2003-11-18 11:20:34 +00:00
manu
e04d06c9bb More work on exceptions. Once a task has raised an exception, it remains
blocked in the kernel. The task that catched the exception may unblock
it by sending a reply to the exception message (Of course it will have
to change something so that the exception is not immediatly raised again).

Handling of this reply is a bit complicated, as the kernel acts as the
client instead of the server. In this situation, we receive a message
but we will not send any reply (the message we receive is already a reply).
I have not found anything better than a special case in
mach_msg_overwrite_trap() to handle this.

A surprise: exceptions ports are preserved accross forks.

While we are there, use appropriate 64 bit types for make_memory_entry_64.
2003-11-18 01:40:18 +00:00
manu
d4b49d8b97 Illegal instruction exceptions
Warning on non-supported exception in task_set_exception_ports
Implementation of task_get_exception_ports
2003-11-17 13:20:06 +00:00
manu
144bfac97b First work on Mach exceptions. Things that can turn into signals on UNIX
may turn into exceptions on Mach: a small message sent by the kernel to
the task that requested the exception.
On Darwin, when an exception is sent, no signal can be delivered.

TODO: more exceptions: arithmetic, bad instructions, emulation, s
software, and syscalls (plain and Mach). There is also RPC alert, but
I have no idea about what it is.

While we are there, remove some user ktrace in notification code, and add
a NODEF qualifier in mach_services.master: it will be used for notifications
and exceptions, where the kernel is always client and never server: we
don't want the message to be displayed as "unimplemented xxx" in kdump (thus
UNIMPL is not good), but we don't want to generate the server prototype
(therefore, STD is not good either). NODEF will declare it normally in the
name tables without creating the prototype.
2003-11-17 01:52:14 +00:00
manu
acab734a9e Fix a few bugs and get a better notification support (A sample program
actually works)
2003-04-05 19:27:51 +00:00
manu
fd94bf9486 First work on notifications. Not really working for now. 2003-03-29 11:04:08 +00:00