Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/compat/darwin Bugfix: notifications sent by iohidsystem ...
details: https://anonhg.NetBSD.org/src/rev/60ebfd16dc25
branches: trunk
changeset: 551883:60ebfd16dc25
user: manu <manu%NetBSD.org@localhost>
date: Sat Sep 13 16:07:44 2003 +0000
description:
Bugfix: notifications sent by iohidsystem kernel threads are to be
hnalded as mmessages coming from the kernel, since the threas has
no p->p_emuldata
diffstat:
sys/compat/darwin/darwin_iohidsystem.c | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
diffs (33 lines):
diff -r c4e9eef9c7b2 -r 60ebfd16dc25 sys/compat/darwin/darwin_iohidsystem.c
--- a/sys/compat/darwin/darwin_iohidsystem.c Sat Sep 13 15:55:29 2003 +0000
+++ b/sys/compat/darwin/darwin_iohidsystem.c Sat Sep 13 16:07:44 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: darwin_iohidsystem.c,v 1.11 2003/09/13 07:56:54 manu Exp $ */
+/* $NetBSD: darwin_iohidsystem.c,v 1.12 2003/09/13 16:07:44 manu Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: darwin_iohidsystem.c,v 1.11 2003/09/13 07:56:54 manu Exp $");
+__KERNEL_RCSID(0, "$NetBSD: darwin_iohidsystem.c,v 1.12 2003/09/13 16:07:44 manu Exp $");
#include "ioconf.h"
#include "wsmux.h"
@@ -502,7 +502,13 @@
#endif
mr->mr_refcount++;
- (void)mach_message_get((mach_msg_header_t *)req, sizeof(*req), mp, l);
+
+ /*
+ * Call mach_message_get with a NULL lwp: the message is sent
+ * by the kernel, not a userprocess. If we do not do that,
+ * we crash because iohidsystem thread has p->p_emuldata == NULL.
+ */
+ mach_message_get((mach_msg_header_t *)req, sizeof(*req), mp, NULL);
#ifdef DEBUG_MACH_MSG
printf("pid %d: message queued on port %p (%d) [%p]\n",
l->l_proc->p_pid, mp, req->req_msgh.msgh_id,
Home |
Main Index |
Thread Index |
Old Index