Subject: delivering faulted-upon address in trap frame to userland
To: None <port-i386@netbsd.org>
From: Travis H. <solinym@gmail.com>
List: port-i386
Date: 08/25/2006 19:32:55
Heya,

A long time ago someone hacked up the signal delivery mechanisms so
that one of the registers in x86 (I think CR2) was passed as part of a
stack frame to signal handlers, and eventually delivered to the signal
handler so that you could mprotect pages, and trap signals, so that
later when the page was accessed the signal handler could figure out
what page generated the trap.  Is this in NetBSD still?

IIRC, OpenBSD did a better job of it, seperating the signal handler's
frame into a machine-independent and machine-dependent part.

This allows you to profile what pages an application accesses.
-- 
"If you're not part of the solution, you're part of the precipitate."
Unix "guru" for rent or hire -><- http://www.lightconsulting.com/~travis/
GPG fingerprint: 9D3F 395A DAC5 5CCC 9066  151D 0A6B 4098 0C55 1484