[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 05/61: exec: fix receiver lookup
From: |
Samuel Thibault |
Subject: |
[hurd] 05/61: exec: fix receiver lookup |
Date: |
Tue, 27 May 2014 08:32:09 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch upstream
in repository hurd.
commit f274c66b2141aca0f332e272b77cd0a048cef7f6
Author: Justus Winter <address@hidden>
Date: Fri Nov 29 12:35:13 2013 +0100
exec: fix receiver lookup
* exec/Makefile (exec_startup-MIGSFLAGS): New variable.
* exec/execmutations.h: Add mutators for exec_startup_t.
* exec/mig-decls.h: New file.
* exec/priv.h (bootinfo_t): New type declaration to appease mig.
* exec/exec.c (S_exec_startup_get_info): Fix receiver lookup.
---
exec/Makefile | 1 +
exec/exec.c | 5 +----
exec/execmutations.h | 8 ++++++++
exec/mig-decls.h | 40 ++++++++++++++++++++++++++++++++++++++++
exec/priv.h | 2 +-
5 files changed, 51 insertions(+), 5 deletions(-)
diff --git a/exec/Makefile b/exec/Makefile
index 3ef742d..d332f36 100644
--- a/exec/Makefile
+++ b/exec/Makefile
@@ -30,6 +30,7 @@ HURDLIBS = trivfs fshelp iohelp ports ihash shouldbeinlibc
OTHERLIBS = -lpthread
exec-MIGSFLAGS = -imacros $(srcdir)/execmutations.h
+exec_startup-MIGSFLAGS = -imacros $(srcdir)/execmutations.h
include ../Makeconf
diff --git a/exec/exec.c b/exec/exec.c
index e693f63..935762e 100644
--- a/exec/exec.c
+++ b/exec/exec.c
@@ -1457,7 +1457,7 @@ S_exec_setexecdata (struct trivfs_protid *protid,
/* RPC sent on the bootstrap port. */
kern_return_t
-S_exec_startup_get_info (mach_port_t port,
+S_exec_startup_get_info (struct bootinfo *boot,
vm_address_t *user_entry,
vm_address_t *phdr_data, vm_size_t *phdr_size,
vm_address_t *stack_base, vm_size_t *stack_size,
@@ -1472,11 +1472,8 @@ S_exec_startup_get_info (mach_port_t port,
mach_msg_type_number_t *nports,
int **intarray, mach_msg_type_number_t *nints)
{
- struct bootinfo *boot = ports_lookup_port (port_bucket, port,
- execboot_portclass);
if (! boot)
return EOPNOTSUPP;
- ports_port_deref (boot);
/* Pass back all the information we are storing. */
diff --git a/exec/execmutations.h b/exec/execmutations.h
index ffcba9c..2acca7a 100644
--- a/exec/execmutations.h
+++ b/exec/execmutations.h
@@ -7,4 +7,12 @@
import "priv.h"; \
import "../libtrivfs/mig-decls.h"; \
+#define EXEC_STARTUP_INTRAN \
+ bootinfo_t begin_using_bootinfo_port (exec_startup_t)
+#define EXEC_STARTUP_DESTRUCTOR \
+ end_using_bootinfo (bootinfo_t)
+#define EXEC_STARTUP_IMPORTS \
+ import "priv.h"; \
+ import "mig-decls.h";
+
#define SERVERCOPY 1
diff --git a/exec/mig-decls.h b/exec/mig-decls.h
new file mode 100644
index 0000000..0437414
--- /dev/null
+++ b/exec/mig-decls.h
@@ -0,0 +1,40 @@
+/*
+ Copyright (C) 2014 Free Software Foundation, Inc.
+ Written by Justus Winter.
+
+ 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 __EXEC_MIG_DECLS_H__
+#define __EXEC_MIG_DECLS_H__
+
+#include "priv.h"
+
+/* Called by server stub functions. */
+
+static inline struct bootinfo * __attribute__ ((unused))
+begin_using_bootinfo_port (mach_port_t port)
+{
+ return ports_lookup_port (port_bucket, port, execboot_portclass);
+}
+
+static inline void __attribute__ ((unused))
+end_using_bootinfo (struct bootinfo *b)
+{
+ if (b)
+ ports_port_deref (b);
+}
+
+#endif /* __EXEC_MIG_DECLS_H__ */
diff --git a/exec/priv.h b/exec/priv.h
index 85e03ae..733f35c 100644
--- a/exec/priv.h
+++ b/exec/priv.h
@@ -52,6 +52,7 @@ struct bootinfo
vm_address_t phdr_addr, user_entry;
vm_size_t phdr_size;
};
+typedef struct bootinfo *bootinfo_t;
/* Where to put the service ports. */
@@ -151,5 +152,4 @@ extern int *std_ints;
extern size_t std_nports, std_nints;
extern pthread_rwlock_t std_lock;
-
#endif /* exec_priv_h */
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] branch upstream updated (d8b7d42 -> 55dd7de), Samuel Thibault, 2014/05/27
- [hurd] 02/61: Fix spurious unlock on error, Samuel Thibault, 2014/05/27
- [hurd] 04/61: hurd: add a new type for the exec_startup protocol, Samuel Thibault, 2014/05/27
- [hurd] 10/61: console-client: drop DIST_FILES from Makefile, Samuel Thibault, 2014/05/27
- [hurd] 05/61: exec: fix receiver lookup,
Samuel Thibault <=
- [hurd] 08/61: hurd: add a new type interrupt_t for the interrupt protocol, Samuel Thibault, 2014/05/27
- [hurd] 09/61: libports: fix receiver lookup, Samuel Thibault, 2014/05/27
- [hurd] 06/61: libdiskfs: fix receiver lookup, Samuel Thibault, 2014/05/27
- [hurd] 11/61: boot: remove the ourdevice hack, Samuel Thibault, 2014/05/27
- [hurd] 01/61: libpager: fix receiver lookups, Samuel Thibault, 2014/05/27
- [hurd] 03/61: Merge branch 'master' of git.savannah.gnu.org:/srv/git/hurd/hurd, Samuel Thibault, 2014/05/27
- [hurd] 19/61: Add missing receiver lookup fix, Samuel Thibault, 2014/05/27
- [hurd] 13/61: libpager: fix notify_port_t receiver lookups, Samuel Thibault, 2014/05/27
- [hurd] 20/61: libdiskfs: set the default sync interval to 30 seconds, Samuel Thibault, 2014/05/27
- [hurd] 12/61: console: fix notify_port_t receiver lookups, Samuel Thibault, 2014/05/27