Subject: PR port-i386/34186: diffs for amd64 4.99.4
To: None <port-i386@netbsd.org, port-amd64@netbsd.org,>
From: Blair Sadewitz <blair.sadewitz@gmail.com>
List: port-amd64
Date: 11/20/2006 17:50:02
------=_Part_69269_2894695.1164063002438
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
I have an Intel D945GTP motherboard, and have the problem with an
improper allocation of msgbuf that is described. The resulting dmesg
is totally corrupted and useless for viewing anything virtually all
the time. Using the submitter's code, I fixed my dmesg on amd64.
Everything seems to run fine so far ...
Could a developer please look at this and perhaps commit it (or a
similar fix)? I'm sure there are plenty of people who have this
problem.
Thank you for your time and effort,
--Blair
--
Support WFMU-FM: free-form radio for the masses!
<http://www.wfmu.org/>
91.1 FM Jersey City, NJ
90.1 FM Mt. Hope, NY
"The Reggae Schoolroom":
<http://www.wfmu.org/playlists/RS/>
------=_Part_69269_2894695.1164063002438
Content-Type: application/octet-stream; name="amd64_msgbuf_allocation_fix.diff"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="amd64_msgbuf_allocation_fix.diff"
SW5kZXg6IHNyYy9zeXMvYXJjaC9hbWQ2NC9hbWQ2NC9tYWNoZGVwLmMKPT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQpSQ1Mg
ZmlsZTogL2N2c3Jvb3Qvc3JjL3N5cy9hcmNoL2FtZDY0L2FtZDY0L21hY2hkZXAuYyx2CnJldHJp
ZXZpbmcgcmV2aXNpb24gMS40NApkaWZmIC11IC1yMS40NCBtYWNoZGVwLmMKLS0tIHNyYy9zeXMv
YXJjaC9hbWQ2NC9hbWQ2NC9tYWNoZGVwLmMJMjMgT2N0IDIwMDYgMTI6MTE6NDcgLTAwMDAJMS40
NAorKysgc3JjL3N5cy9hcmNoL2FtZDY0L2FtZDY0L21hY2hkZXAuYwkyMCBOb3YgMjAwNiAyMjoz
MzowNyAtMDAwMAp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