Date: Tue, 2 Dec 2008 17:01:14 -0800 From: "Maksim Yevmenkin" <maksim.yevmenkin@gmail.com> To: "current@freebsd.org" <current@freebsd.org> Subject: RFC: small syscons and kbd patch Message-ID: <bb4a86c70812021701i621fdcfjb6a58a7f5cf781d5@mail.gmail.com>
next in thread | raw e-mail | index | archive | help
------=_Part_103561_30556547.1228266074197 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Dear Hackers, can someone please review the attached small patch for syscons and kbd? it should be a no-op mostly. the patch basically does 1) removes bogus layering in syscons, i.e. basically removes sccngetch(); 2) implements advisory lock for kbd (based on atomic(9)); 3) implements new POLLED flag for kbd; this is a part of a plan to fix keyboard access races in syscons. thanks, max ------=_Part_103561_30556547.1228266074197 Content-Type: text/plain; name=syscons.kbd.patch.txt Content-Transfer-Encoding: base64 X-Attachment-Id: f_fo99mbnb0 Content-Disposition: attachment; filename=syscons.kbd.patch.txt SW5kZXg6IHN5cy9kZXYvc3lzY29ucy9zeXNjb25zLmMKPT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gc3lzL2Rldi9z eXNjb25zL3N5c2NvbnMuYwkocmV2aXNpb24gMTg1MzE5KQorKysgc3lzL2Rldi9zeXNjb25zL3N5 c2NvbnMuYwkod29ya2luZyBjb3B5KQpAQCAtMTc5LDcgKzE3OSw2IEBACiBzdGF0aWMgdV9pbnQg c2NnZXRjKHNjX3NvZnRjX3QgKnNjLCB1X2ludCBmbGFncyk7CiAjZGVmaW5lIFNDR0VUQ19DTgkx CiAjZGVmaW5lIFNDR0VUQ19OT05CTE9DSwkyCi1zdGF0aWMgaW50IHNjY25nZXRjaChpbnQgZmxh Z3MpOwogc3RhdGljIHZvaWQgc2NjbnVwZGF0ZShzY3Jfc3RhdCAqc2NwKTsKIHN0YXRpYyBzY3Jf c3RhdCAqYWxsb2Nfc2NwKHNjX3NvZnRjX3QgKnN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sxOTksNyBAQAogCSgqa2Jkc3dbKGtiZCktPmtiX2luZGV4 XS0+Z2V0X3N0YXRlKSgoa2JkKSwgKGJ1ZiksIChsZW4pKQogI2RlZmluZSBrYmRkX3NldF9zdGF0 ZShrYmQsIGJ1ZiwgbGVuKQkJCQkJXAogCSgqa2Jkc3dbKGtiZCktPmtiX2luZGV4XS0+c2V0X3N0 YXRlKSgoa2JkKSwgKGJ1ZiksIChsZW4pKQotI2RlZmluZSBrYmRkX2dldF9ma2V5c3RyKGtiZCwg ZmtleSwgbGVuKQkJCQkJXAorI2RlZmluZSBrYmRkX2dldF9ma2V5c3RyKGtiZCwgZmtleSwgbGVu KQkJCQlcCiAJKCprYmRzd1soa2JkKS0+a2JfaW5kZXhdLT5nZXRfZmtleXN0cikoKGtiZCksIChm a2V5KSwgKGxlbikpCiAjZGVmaW5lIGtiZGRfcG9sbChrYmQsIG9uKQkJCQkJCVwKIAkoKmtiZHN3 WyhrYmQpLT5rYl9pbmRleF0tPnBvbGwpKChrYmQpLCAob24pKQpAQCAtMjkzLDYgKzI5OCw3IEBA CiAKIGtiZF9nZXRfZmtleXN0cl90CWdlbmtiZF9nZXRfZmtleXN0cjsKIGtiZF9kaWFnX3QJCWdl bmtiZF9kaWFnOwora2JkX2xvY2tfdAkJZ2Vua2JkX2xvY2s7CiAKIGludCAJZ2Vua2JkX2NvbW1v bmlvY3RsKGtleWJvYXJkX3QgKmtiZCwgdV9sb25nIGNtZCwgY2FkZHJfdCBhcmcpOwogaW50IAln ZW5rYmRfa2V5YWN0aW9uKGtleWJvYXJkX3QgKmtiZCwgaW50IGtleWNvZGUsIGludCB1cCwK ------=_Part_103561_30556547.1228266074197--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bb4a86c70812021701i621fdcfjb6a58a7f5cf781d5>