About KDKBDREP

Sergey Tursanov (__gsr@mail.ru)
Thu, 14 Jun 2001 23:19:30 +0400


------------AB1311D6E2A7BD0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Some days ago I posted patch to introduce KDKBDREP ioctl
to i386 keyboard routines. KDKBDREP is defined in linux/kd.h
but now he is used only on m68k. In sparc architectures is used
KIOCSRATE, on i386 -- user-space utility kbdrate and I know
nothing about others. It seems to be better to use one ioctl on
all of archs because:
- it unifies keyboard rate setting;
- it will be done in kernel context avoiding cases of simultaneous
access same I/O ports by different programs. (see A.Cox msg).
In previous patch I had tried to change i386 kbd files in order
to inmplement KDKBDREP. Now I changed sparc files in such a fashion.
But I haven't sparc box and cannot test my changes so I'll be
very glad if someone test my patch. Thanks advance.

PS: please CC replies to my email because I'm not subscribed
on linux-kernel.

-- 
Sergey Tursanov         mailto:__gsr@mail.ru
------------AB1311D6E2A7BD0
Content-Type: application/octet-stream; name="patch-kbdrate-2.4.5"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="patch-kbdrate-2.4.5"

ZGlmZiAtdXJYIGRvbnRkaWZmIHYyLjQuNS9saW51eC9kcml2ZXJzL2NoYXIvcGNfa2V5Yi5jIGxp bnV4L2RyaXZlcnMvY2hhci9wY19rZXliLmMKLS0tIHYyLjQuNS9saW51eC9kcml2ZXJzL2NoYXIv cGNfa2V5Yi5jCUZyaSBBcHIgIDYgMjI6NDI6NTUgMjAwMQorKysgbGludXgvZHJpdmVycy9jaGFy L3BjX2tleWIuYwlUdWUgSnVuIDEyIDE3OjMzOjAwIDIwMDEKQEAgLTUzMyw2ICs1MzMsODYgQEAK IAl9CiB9CiAKKyNkZWZpbmUgREVGQVVMVF9LRVlCX1JFUF9ERUxBWQkyNTAKKyNkZWZpbmUgREVG QVVMVF9LRVlCX1JFUF9SQVRFCTMwCS8qIGNwcyAqLworCitzdGF0aWMgc3RydWN0IGtiZF9yZXBl YXQga2JkcmF0ZT17CisJREVGQVVMVF9LRVlCX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RzKHVuc2lnbmVkIGNoYXIgbGVkcyk7 CitleHRlcm4gaW50IHBjaWtiZF9yYXRlKHN0cnVjdCBrYmRfcmVwZWF0ICpyZXApOwogZXh0ZXJu IHZvaWQgcGNpa2JkX2luaXRfaHcodm9pZCk7CiBleHRlcm4gdW5zaWduZWQgY2hhciBwY2lrYmRf c3lzcnFfeGxhdGVbMTI4XTsKIApAQCAtMzMsNiArMzUsNyBAQAogI2RlZmluZSBrYmRfdHJhbnNs YXRlCQkJcGNpa2JkX3RyYW5zbGF0ZQogI2RlZmluZSBrYmRfdW5leHBlY3RlZF91cAkJcGNpa2Jk X3VuZXhwZWN0ZWRfdXAKICNkZWZpbmUga2JkX2xlZHMJCQlwY2lrYmRfbGVkcworI2RlZmluZSBr YmRfcmF0ZQkJCXBjaWtiZF9yYXRlCiAjZGVmaW5lIGtiZF9pbml0X2h3CQkJcGNpa2JkX2luaXRf aHcKICNkZWZpbmUga2JkX3N5c3JxX3hsYXRlCQkJcGNpa2JkX3N5c3JxX3hsYXRlCiAjZGVmaW5l IGtiZF9pbml0CQkJcGNpa2JkX2luaXQK

------------AB1311D6E2A7BD0--

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/