From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 15 07:43:17 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BC1F016A4DD for ; Tue, 15 Aug 2006 07:43:17 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from fw.zoral.com.ua (fw.zoral.com.ua [213.186.206.134]) by mx1.FreeBSD.org (Postfix) with ESMTP id C482943D45 for ; Tue, 15 Aug 2006 07:43:16 +0000 (GMT) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by fw.zoral.com.ua (8.13.4/8.13.4) with ESMTP id k7F7h9Nh001494 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 15 Aug 2006 10:43:09 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.13.6/8.13.6) with ESMTP id k7F7h9tO041687; Tue, 15 Aug 2006 10:43:09 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.13.6/8.13.6/Submit) id k7F7h8q7041686; Tue, 15 Aug 2006 10:43:08 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 15 Aug 2006 10:43:08 +0300 From: Kostik Belousov To: Stanislav Sedov Message-ID: <20060815074308.GN25753@deviant.kiev.zoral.com.ua> References: <20060814124658.1d416cbe@localhost> <200608140932.57875.jhb@freebsd.org> <20060814194729.436fc453@localhost> <20060814181521.GQ99774@funkthat.com> <20060814231223.3c7f1930@localhost> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="3rMDlCEgcaHQQFB+" Content-Disposition: inline In-Reply-To: <20060814231223.3c7f1930@localhost> User-Agent: Mutt/1.4.2.2i X-Virus-Scanned: ClamAV version 0.88.4, clamav-milter version 0.88.4 on fw.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=1.9 required=5.0 tests=DNS_FROM_RFC_ABUSE, SPF_NEUTRAL,UNPARSEABLE_RELAY autolearn=no version=3.1.4 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.1.4 (2006-07-25) on fw.zoral.com.ua Cc: freebsd-hackers@freebsd.org, John-Mark Gurney Subject: Re: exception handling in kernel code X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Aug 2006 07:43:17 -0000 --3rMDlCEgcaHQQFB+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Aug 14, 2006 at 11:12:23PM +0600, Stanislav Sedov wrote: > On Mon, 14 Aug 2006 11:15:22 -0700 > John-Mark Gurney mentioned: > >=20 > > You should make a MD API for reading these out (if one doesn't already > > exist) that handle the faulting for you, and then have your driver hook > > into this api... > >=20 > > I had to do something similar for accessing PCI config registers > > that don't exist and cause a fault... > > > =20 > Do you know some examples to look at? The problem is that i can't make > modifications in trap.c or anywhere else in src tree as such driver > isn't likely to become a part of FreeBSD kernel. Hmm, I think that jhb@ somewhat misguided your. For kernel-mode faults on i386, GPF and Segment not Present faults both results in calling of pcb_onfault handler. This is true for both STABLE and CURRENT. And this is true for amd64 as well. Look at the code at the //trap.c, for arch in i386, amd64. --3rMDlCEgcaHQQFB+ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (FreeBSD) iD8DBQFE4XsLC3+MBN1Mb4gRAmWOAJ0fpyVyGPaOVIfh+Pa0BC0JoaieXwCgiOB1 5EOq4yCIeWhmYoydu5LgqeQ= =T3aO -----END PGP SIGNATURE----- --3rMDlCEgcaHQQFB+--