[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 13/21: proc: fix the receiver lookup in S_proc_exception_raise
From: |
Samuel Thibault |
Subject: |
[hurd] 13/21: proc: fix the receiver lookup in S_proc_exception_raise |
Date: |
Tue, 04 Feb 2014 17:25:27 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch upstream
in repository hurd.
commit 7cb7fa6b3a0d02985b4a51f7823bc1cb631d6bfa
Author: Justus Winter <address@hidden>
Date: Thu Nov 28 19:39:35 2013 +0100
proc: fix the receiver lookup in S_proc_exception_raise
* proc/mgt.c (S_proc_exception_raise): Update accordingly.
* proc/mig-decls.h: New file.
* proc/proc_exc.defs: Add translation functions.
---
proc/mgt.c | 7 ++-----
proc/mig-decls.h | 42 ++++++++++++++++++++++++++++++++++++++++++
proc/proc_exc.defs | 8 +++++++-
3 files changed, 51 insertions(+), 6 deletions(-)
diff --git a/proc/mgt.c b/proc/mgt.c
index 602ba84..5e0accd 100644
--- a/proc/mgt.c
+++ b/proc/mgt.c
@@ -417,7 +417,7 @@ S_proc_handle_exceptions (struct proc *p,
the thread_set_state requested by proc_handle_exceptions and then
send an exception_raise message as requested. */
kern_return_t
-S_proc_exception_raise (mach_port_t excport,
+S_proc_exception_raise (struct exc *e,
mach_port_t reply,
mach_msg_type_name_t reply_type,
mach_port_t thread,
@@ -428,8 +428,7 @@ S_proc_exception_raise (mach_port_t excport,
{
error_t err;
struct proc *p;
- struct exc *e = ports_lookup_port (proc_bucket, excport, exc_class);
- if (!e)
+ if (!e || e->pi.bucket != proc_bucket || e->pi.class != exc_class)
return EOPNOTSUPP;
p = task_find (task);
@@ -455,7 +454,6 @@ S_proc_exception_raise (mach_port_t excport,
the faulting thread's state to run its recovery code, which should
dequeue that message. */
err = thread_set_state (thread, e->flavor, e->thread_state, e->statecnt);
- ports_port_deref (e);
mach_port_deallocate (mach_task_self (), thread);
mach_port_deallocate (mach_task_self (), task);
if (err)
@@ -484,7 +482,6 @@ S_proc_exception_raise (mach_port_t excport,
/* Nuke the task; we will get a notification message and report that
it died with SIGNO. */
task_terminate (task);
- ports_port_deref (e);
/* In the MACH_SEND_NOTIFY_IN_PROGRESS case, the kernel did a
pseudo-receive of the RPC request message that may have added user
diff --git a/proc/mig-decls.h b/proc/mig-decls.h
new file mode 100644
index 0000000..0d5bd4d
--- /dev/null
+++ b/proc/mig-decls.h
@@ -0,0 +1,42 @@
+/* Translation functions for mig.
+
+ Copyright (C) 2013 Free Software Foundation, Inc.
+
+ Written by Justus Winter <address@hidden>
+
+ This file is part of the GNU Hurd.
+
+ The GNU Hurd is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2, or (at
+ your option) any later version.
+
+ The GNU Hurd is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with the GNU Hurd. If not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef __MIG_DECLS_H__
+#define __MIG_DECLS_H__
+
+#include "proc.h"
+
+typedef struct exc* exc_t;
+
+static inline exc_t __attribute__ ((unused))
+begin_using_exc_port (mach_port_t port)
+{
+ return ports_lookup_port (NULL, port, exc_class);
+}
+
+static inline void __attribute__ ((unused))
+end_using_exc (exc_t exc)
+{
+ if (exc != NULL)
+ ports_port_deref (exc);
+}
+
+#endif
diff --git a/proc/proc_exc.defs b/proc/proc_exc.defs
index e9c58f1..c910824 100644
--- a/proc/proc_exc.defs
+++ b/proc/proc_exc.defs
@@ -33,9 +33,15 @@ subsystem proc_exc 2400;
#include <mach/std_types.defs>
ServerPrefix S_;
+import "mig-decls.h";
+
+type exception_t = mach_port_copy_send_t
+ cusertype: mach_port_t
+ intran: exc_t begin_using_exc_port (exception_t)
+ destructor: end_using_exc (exc_t);
routine proc_exception_raise (
- exception_port: mach_port_t;
+ exception_port: exception_t;
replyport reply: mach_port_poly_t;
msgoption flags: integer_t;
thread: mach_port_t;
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] branch upstream updated (5aa7b58 -> 5f34e6b), Samuel Thibault, 2014/02/04
- [hurd] 06/21: libtrivfs: include the mig-generated server headers in demuxer.c, Samuel Thibault, 2014/02/04
- [hurd] 12/21: utils: include the mig-generated server headers in fakeauth.c, Samuel Thibault, 2014/02/04
- [hurd] 05/21: libnetfs: include the mig-generated server headers in demuxer.c, Samuel Thibault, 2014/02/04
- [hurd] 16/21: Merge branch 'master' of git.savannah.gnu.org:/srv/git/hurd/hurd, Samuel Thibault, 2014/02/04
- [hurd] 15/21: Make pfinet re-open ethernet device on transmission error, Samuel Thibault, 2014/02/04
- [hurd] 13/21: proc: fix the receiver lookup in S_proc_exception_raise,
Samuel Thibault <=
- [hurd] 21/21: Merge remote-tracking branch 'upstream/master' into upstream, Samuel Thibault, 2014/02/04
- [hurd] 04/21: libdiskfs: include the mig-generated server headers in demuxer.c, Samuel Thibault, 2014/02/04
- [hurd] 17/21: Also re-open Ethernet device on EMIG_SERVER_DIED, Samuel Thibault, 2014/02/04
- [hurd] 08/21: proc: include the mig-generated server headers in main.c, Samuel Thibault, 2014/02/04
- [hurd] 19/21: Fix crash on fsysopts when pfinet has no IPv6, Samuel Thibault, 2014/02/04
- [hurd] 09/21: pfinet: include the mig-generated server headers in main.c, Samuel Thibault, 2014/02/04
- [hurd] 03/21: trans: fix the receiver lookup in password, Samuel Thibault, 2014/02/04
- [hurd] 10/21: pflocal: include the mig-generated server headers, Samuel Thibault, 2014/02/04
- [hurd] 07/21: exec: include the mig-generated server headers in main.c, Samuel Thibault, 2014/02/04
- [hurd] 02/21: Rename variables with the name "error" to "err"., Samuel Thibault, 2014/02/04