From owner-freebsd-hackers@FreeBSD.ORG Sun Oct 24 02:56:07 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BABC11065672; Sun, 24 Oct 2010 02:56:07 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 2032A8FC08; Sun, 24 Oct 2010 02:56:06 +0000 (UTC) Received: by wyb42 with SMTP id 42so2224330wyb.13 for ; Sat, 23 Oct 2010 19:56:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type; bh=G3Xs5qzA+ZWQ81R2YdYV7eUlj7cro1PxlQfheq8XuD8=; b=EhO3IW9cm5Zf4zn0oOaX25aMwH4UkGT/xOck6ZSjigzFZ1GbBct0RmteFSdtpGWQ5q P2/kfNRrTy96A5+Rd6z5YAlPMaMtuqmPdL1ICbdIhMjq+rAmAH4AkHtPxP1bwBOsl4Jv j+lBC0PS6tL2j6LxQetAF5YO3Iqgu2q33ymrs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=oMvbrievGvcyS1s+4z8UZdzeCACveVCBHFpXFIULoYFROtoP5sn/MMysQRgNfgLJ60 BGBc3NSG9qO0Uy4npoCS1+H0oN9ppAwtLy1Jzt446/YzIp6XlhhMW/bF9IVU1w9wmQ4a etm9BFX0RsOM/dwRTTHW7lGnVPf1kyH29OfHY= MIME-Version: 1.0 Received: by 10.216.11.205 with SMTP id 55mr4549122wex.51.1287888966024; Sat, 23 Oct 2010 19:56:06 -0700 (PDT) Sender: yanegomi@gmail.com Received: by 10.216.10.198 with HTTP; Sat, 23 Oct 2010 19:56:05 -0700 (PDT) In-Reply-To: <20101024002248.GA73346@freebsd.org> References: <20101024002248.GA73346@freebsd.org> Date: Sat, 23 Oct 2010 19:56:05 -0700 X-Google-Sender-Auth: UR207EQFSRmaeOnIoXGXItHwZ7U Message-ID: From: Garrett Cooper To: Alexander Best Content-Type: multipart/mixed; boundary=0016364d2cbd547e8804935404dc Cc: freebsd-hackers@freebsd.org Subject: Re: fix pnpinfo on arch=amd64 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: Sun, 24 Oct 2010 02:56:07 -0000 --0016364d2cbd547e8804935404dc Content-Type: text/plain; charset=ISO-8859-1 On Sat, Oct 23, 2010 at 5:22 PM, Alexander Best wrote: > this tiny patch will fix pnpinfo so it doesn't core dump (bus error) any > longer on arch=amd64. 1. I had to modify the Makefile to get it to work. 2. FWIW, I don't there's really much point in adding a check for only x86 architectures, if the tool is capable of more than that. 3. Might as well close the file descriptor after opening it. SIGBUS occurs because it doesn't have permission to write via outb. It's a shame that there isn't a more proper way to catch this SIGBUS fault minus adding a SIGBUS handler (but that might have other undesired side effects). Thanks, -Garrett --0016364d2cbd547e8804935404dc Content-Type: text/x-patch; charset=US-ASCII; name="pnpinfo-improvements.patch" Content-Disposition: attachment; filename="pnpinfo-improvements.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gfnbm9bi1 SW5kZXg6IGNvbnRyaWIvcG5waW5mby9wbnBpbmZvLmMKPT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gY29udHJpYi9w bnBpbmZvL3BucGluZm8uYwkocmV2aXNpb24gMjE0MTY5KQorKysgY29udHJpYi9wbnBpbmZvL3Bu cGluZm8uYwkod29ya2luZyBjb3B5KQpAQCAtNTA2LDcgKzUwNiw3IEBACiAJfSBlbHNlIHsKIAkg ICAgLyogSGFuZGxlIGxhcmdlIHJlc291Y2UgZGF0YSB0eXBlcyAqLwogCSAgICB1X2NoYXIgYnVm WzJdOwotCSAgICBpZiAoIWdldF9yZXNvdXJjZV9pbmZvKChjaGFyICopYnVmLCAyKSkKKwkgICAg aWYgKCFnZXRfcmVzb3VyY2VfaW5mbyhidWYsIDIpKQogCQlicmVhazsKIAkgICAgbGFyZ2VfbGVu ID0gKGJ1ZlsxXSA8PCA4KSArIGJ1ZlswXTsKIApAQCAtNTg2LDEzICs1ODYsMTMgQEAKIGludAog bWFpbihpbnQgYXJnYywgY2hhciAqKmFyZ3YpCiB7CisgICAgaW50IGZkOwogICAgIGludCBudW1f cG5wX2RldnM7CiAKLSNpZmRlZiBfX2kzODZfXwogICAgIC8qIEhleSB3aGF0IGFib3V0IGEgaTM4 Nl9pb3BsKCkgY2FsbCA6KSAqLwotICAgIGlmIChvcGVuKCIvZGV2L2lvIiwgT19SRE9OTFkpIDwg MCkKLQllcnJ4KDEsICJjYW4ndCBnZXQgSS9PIHByaXZpbGVnZSIpOwotI2VuZGlmCisgICAgaWYg KChmZCA9IG9wZW4oIi9kZXYvaW8iLCBPX1JET05MWSkpIDwgMCkKKwllcnIoMSwgImNhbid0IGdl dCBJL08gcHJpdmlsZWdlcyIpOworICAgICh2b2lkKSBjbG9zZShmZCk7CiAKICAgICBwcmludGYo IkNoZWNraW5nIGZvciBQbHVnLW4tUGxheSBkZXZpY2VzLi4uXG4iKTsKIApJbmRleDogY29udHJp Yi9wbnBpbmZvL01ha2VmaWxlCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIGNvbnRyaWIvcG5waW5mby9NYWtlZmls ZQkocmV2aXNpb24gMjE0MTY5KQorKysgY29udHJpYi9wbnBpbmZvL01ha2VmaWxlCSh3b3JraW5n IGNvcHkpCkBAIC0yLDYgKzIsNiBAQAogCiBQUk9HPQlwbnBpbmZvCiBNQU44PQlwbnBpbmZvLjgK LUNGTEFHUz0gLVdhbGwKK0NGTEFHUz0gLVdhbGwgLUkkey5DVVJESVJ9Ly4uLy4uL3N5cwogCiAu aW5jbHVkZSA8YnNkLnByb2cubWs+Cg== --0016364d2cbd547e8804935404dc--