diff options
author | Justus Winter <4winter@informatik.uni-hamburg.de> | 2014-03-13 23:27:48 +0100 |
---|---|---|
committer | Justus Winter <4winter@informatik.uni-hamburg.de> | 2014-03-13 23:27:48 +0100 |
commit | a6947217a73eb4b1bcba70f19cf39bf5400cc0e1 (patch) | |
tree | 734ffd95ea35c456d8326058c4da104c18db101d /debian | |
parent | 78b6c0fcb9e15c45d63cc96cbe416b61b37be794 (diff) |
drop buggy libports patch from fix-receiver-lookups.patch
Diffstat (limited to 'debian')
-rw-r--r-- | debian/patches/fix-receiver-lookups.patch | 405 |
1 files changed, 4 insertions, 401 deletions
diff --git a/debian/patches/fix-receiver-lookups.patch b/debian/patches/fix-receiver-lookups.patch index d7bcf0b7..5ed2c300 100644 --- a/debian/patches/fix-receiver-lookups.patch +++ b/debian/patches/fix-receiver-lookups.patch @@ -21,393 +21,6 @@ index 8ad82dc..4885503 100644 + memory_object : memory_object_t; msgseqno seqno : mach_port_seqno_t; object_size_limit : vm_size_t); -diff --git a/libpager/Makefile b/libpager/Makefile -index 7c4da38..b622295 100644 ---- a/libpager/Makefile -+++ b/libpager/Makefile -@@ -31,7 +31,7 @@ HURDLIBS= ports - LDLIBS += -lpthread - OBJS = $(SRCS:.c=.o) memory_objectServer.o notifyServer.o - --MIGSFLAGS = -DSEQNOS -+MIGSFLAGS = -DSEQNOS -imacros $(srcdir)/mig-mutate.h - MIGCOMSFLAGS = -prefix _pager_ - - include ../Makeconf -diff --git a/libpager/chg-compl.c b/libpager/chg-compl.c -index 0b0c99c..d77c46c 100644 ---- a/libpager/chg-compl.c -+++ b/libpager/chg-compl.c -@@ -22,16 +22,15 @@ - when a memory_object_change_attributes call has completed. Read this - in combination with pager-attr.c. */ - kern_return_t --_pager_seqnos_memory_object_change_completed (mach_port_t obj, -+_pager_seqnos_memory_object_change_completed (struct pager *p, - mach_port_seqno_t seq, - boolean_t maycache, - memory_object_copy_strategy_t strat) - { -- struct pager *p; - struct attribute_request *ar; -- -- p = ports_lookup_port (0, obj, _pager_class); -- if (!p) -+ -+ if (!p -+ || p->port.class != _pager_class) - { - printf ("Bad change completed\n"); - return EOPNOTSUPP; -@@ -50,6 +49,5 @@ _pager_seqnos_memory_object_change_completed (mach_port_t obj, - - _pager_release_seqno (p, seq); - pthread_mutex_unlock (&p->interlock); -- ports_port_deref (p); - return 0; - } -diff --git a/libpager/data-request.c b/libpager/data-request.c -index 34b8b43..82ce904 100644 ---- a/libpager/data-request.c -+++ b/libpager/data-request.c -@@ -22,22 +22,21 @@ - - /* Implement pagein callback as described in <mach/memory_object.defs>. */ - kern_return_t --_pager_seqnos_memory_object_data_request (mach_port_t object, -+_pager_seqnos_memory_object_data_request (struct pager *p, - mach_port_seqno_t seqno, - mach_port_t control, - vm_offset_t offset, - vm_size_t length, - vm_prot_t access) - { -- struct pager *p; - short *pm_entry; - int doread, doerror; - error_t err; - vm_address_t page; - int write_lock; - -- p = ports_lookup_port (0, object, _pager_class); -- if (!p) -+ if (!p -+ || p->port.class != _pager_class) - return EOPNOTSUPP; - - /* Acquire the right to meddle with the pagemap */ -@@ -126,7 +125,6 @@ _pager_seqnos_memory_object_data_request (mach_port_t object, - _pager_mark_object_error (p, offset, length, 0); - _pager_allow_termination (p); - pthread_mutex_unlock (&p->interlock); -- ports_port_deref (p); - return 0; - - error_read: -@@ -136,7 +134,6 @@ _pager_seqnos_memory_object_data_request (mach_port_t object, - pthread_mutex_lock (&p->interlock); - _pager_allow_termination (p); - pthread_mutex_unlock (&p->interlock); -- ports_port_deref (p); - return 0; - - allow_release_out: -@@ -144,6 +141,5 @@ _pager_seqnos_memory_object_data_request (mach_port_t object, - release_out: - _pager_release_seqno (p, seqno); - pthread_mutex_unlock (&p->interlock); -- ports_port_deref (p); - return 0; - } -diff --git a/libpager/data-return.c b/libpager/data-return.c -index 6a3b903..ee6c6e8 100644 ---- a/libpager/data-return.c -+++ b/libpager/data-return.c -@@ -26,7 +26,7 @@ - as for _pager_seqnos_memory_object_data_return; the additional - INITIALIZING arg identifies which function is calling us. */ - kern_return_t --_pager_do_write_request (mach_port_t object, -+_pager_do_write_request (struct pager *p, - mach_port_seqno_t seqno, - mach_port_t control, - vm_offset_t offset, -@@ -36,7 +36,6 @@ _pager_do_write_request (mach_port_t object, - int kcopy, - int initializing) - { -- struct pager *p; - short *pm_entries; - int npages, i; - char *notified; -@@ -47,8 +46,8 @@ _pager_do_write_request (mach_port_t object, - int wakeup; - int omitdata = 0; - -- p = ports_lookup_port (0, object, _pager_class); -- if (!p) -+ if (!p -+ || p->port.class != _pager_class) - return EOPNOTSUPP; - - /* Acquire the right to meddle with the pagemap */ -@@ -249,19 +248,17 @@ _pager_do_write_request (mach_port_t object, - } - } - -- ports_port_deref (p); - return 0; - - release_out: - _pager_release_seqno (p, seqno); - pthread_mutex_unlock (&p->interlock); -- ports_port_deref (p); - return 0; - } - - /* Implement pageout call back as described by <mach/memory_object.defs>. */ - kern_return_t --_pager_seqnos_memory_object_data_return (mach_port_t object, -+_pager_seqnos_memory_object_data_return (struct pager *p, - mach_port_seqno_t seqno, - mach_port_t control, - vm_offset_t offset, -@@ -270,6 +267,6 @@ _pager_seqnos_memory_object_data_return (mach_port_t object, - int dirty, - int kcopy) - { -- return _pager_do_write_request (object, seqno, control, offset, data, -+ return _pager_do_write_request (p, seqno, control, offset, data, - length, dirty, kcopy, 0); - } -diff --git a/libpager/data-unlock.c b/libpager/data-unlock.c -index 02339ab..599237c 100644 ---- a/libpager/data-unlock.c -+++ b/libpager/data-unlock.c -@@ -22,18 +22,17 @@ - /* Implement kernel requests for access as described in - <mach/memory_object.defs>. */ - kern_return_t --_pager_seqnos_memory_object_data_unlock (mach_port_t object, -+_pager_seqnos_memory_object_data_unlock (struct pager *p, - mach_port_seqno_t seqno, - mach_port_t control, - vm_offset_t offset, - vm_size_t length, - vm_prot_t access) - { -- struct pager *p; - volatile int err; - -- p = ports_lookup_port (0, object, _pager_class); -- if (!p) -+ if (!p -+ || p->port.class != _pager_class) - return EOPNOTSUPP; - - pthread_mutex_lock (&p->interlock); -@@ -84,6 +83,5 @@ _pager_seqnos_memory_object_data_unlock (mach_port_t object, - _pager_mark_next_request_error (p, offset, length, err); - } - out: -- ports_port_deref (p); - return 0; - } -diff --git a/libpager/mig-decls.h b/libpager/mig-decls.h -new file mode 100644 -index 0000000..0c7b402 ---- /dev/null -+++ b/libpager/mig-decls.h -@@ -0,0 +1,42 @@ -+/* -+ 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 __LIBPAGER_MIG_DECLS_H__ -+#define __LIBPAGER_MIG_DECLS_H__ -+ -+#include "priv.h" -+ -+typedef struct pager *pager_t; -+ -+/* Called by server stub functions. */ -+ -+static inline struct pager * __attribute__ ((unused)) -+begin_using_pager (mach_port_t port) -+{ -+ return ports_lookup_port (0, port, _pager_class); -+} -+ -+static inline void __attribute__ ((unused)) -+end_using_pager (struct pager *p) -+{ -+ if (p) -+ ports_port_deref (p); -+} -+ -+#endif /* __LIBPAGER_MIG_DECLS_H__ */ -diff --git a/libpager/mig-mutate.h b/libpager/mig-mutate.h -new file mode 100644 -index 0000000..54f7de8 ---- /dev/null -+++ b/libpager/mig-mutate.h -@@ -0,0 +1,22 @@ -+/* -+ 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/>. */ -+ -+#define MEMORY_OBJECT_INTRAN pager_t begin_using_pager (memory_object_t) -+#define MEMORY_OBJECT_DESTRUCTOR end_using_pager (pager_t) -+#define MEMORY_OBJECT_IMPORTS import "mig-decls.h"; -diff --git a/libpager/object-init.c b/libpager/object-init.c -index 90ffc01..6683e24 100644 ---- a/libpager/object-init.c -+++ b/libpager/object-init.c -@@ -22,16 +22,14 @@ - /* Implement the object initialiation call as described in - <mach/memory_object.defs>. */ - kern_return_t --_pager_seqnos_memory_object_init (mach_port_t object, -+_pager_seqnos_memory_object_init (struct pager *p, - mach_port_seqno_t seqno, - mach_port_t control, - mach_port_t name, - vm_size_t pagesize) - { -- struct pager *p; -- -- p = ports_lookup_port (0, object, _pager_class); -- if (!p) -+ if (!p -+ || p->port.class != _pager_class) - return EOPNOTSUPP; - - pthread_mutex_lock (&p->interlock); -@@ -73,7 +71,6 @@ _pager_seqnos_memory_object_init (mach_port_t object, - out: - _pager_release_seqno (p, seqno); - pthread_mutex_unlock (&p->interlock); -- ports_port_deref (p); - - return 0; - } -diff --git a/libpager/priv.h b/libpager/priv.h -index 7aa0fb4..d49cbb9 100644 ---- a/libpager/priv.h -+++ b/libpager/priv.h -@@ -139,6 +139,7 @@ struct port_class *_pager_class; - void _pager_wait_for_seqno (struct pager *, mach_port_seqno_t); - void _pager_release_seqno (struct pager *, mach_port_seqno_t); - void _pager_update_seqno (mach_port_t, mach_port_seqno_t); -+void _pager_update_seqno_p (struct pager *, mach_port_seqno_t); - void _pager_block_termination (struct pager *); - void _pager_allow_termination (struct pager *); - error_t _pager_pagemap_resize (struct pager *, vm_address_t); -diff --git a/libpager/seqnos.c b/libpager/seqnos.c -index 77bfbf2..985c434 100644 ---- a/libpager/seqnos.c -+++ b/libpager/seqnos.c -@@ -48,7 +48,6 @@ _pager_release_seqno (struct pager *p, - } - } - -- - /* Just update the seqno. */ - void - _pager_update_seqno (mach_port_t object, -@@ -57,13 +56,22 @@ _pager_update_seqno (mach_port_t object, - struct pager *p; - - p = ports_lookup_port (0, object, _pager_class); -+ _pager_update_seqno_p (p, seqno); - if (p) -+ ports_port_deref (p); -+} -+ -+/* Just update the seqno, pointer version. */ -+void -+_pager_update_seqno_p (struct pager *p, -+ mach_port_seqno_t seqno) -+{ -+ if (p -+ && p->port.class == _pager_class) - { - pthread_mutex_lock (&p->interlock); - _pager_wait_for_seqno (p, seqno); - _pager_release_seqno (p, seqno); - pthread_mutex_unlock (&p->interlock); -- -- ports_port_deref (p); - } - } -diff --git a/libpager/stubs.c b/libpager/stubs.c -index 8478212..5d0417e 100644 ---- a/libpager/stubs.c -+++ b/libpager/stubs.c -@@ -21,7 +21,7 @@ - #include <stdio.h> - - kern_return_t --_pager_seqnos_memory_object_copy (mach_port_t obj, -+_pager_seqnos_memory_object_copy (struct pager *p, - mach_port_seqno_t seq, - memory_object_control_t obj_ctl, - vm_offset_t off, -@@ -30,13 +30,13 @@ _pager_seqnos_memory_object_copy (mach_port_t obj, - { - printf ("m_o_copy called\n"); - -- _pager_update_seqno (obj, seq); -+ _pager_update_seqno_p (p, seq); - - return EOPNOTSUPP; - } - - kern_return_t --_pager_seqnos_memory_object_data_write (mach_port_t obj, -+_pager_seqnos_memory_object_data_write (struct pager *p, - mach_port_seqno_t seq, - mach_port_t ctl, - vm_offset_t off, -@@ -45,7 +45,7 @@ _pager_seqnos_memory_object_data_write (mach_port_t obj, - { - printf ("m_o_data_write called\n"); - -- _pager_update_seqno (obj, seq); -+ _pager_update_seqno_p (p, seq); - - return EOPNOTSUPP; - } diff --git a/mach-defpager/Makefile b/mach-defpager/Makefile index e38a0be..c8e33c5 100644 --- a/mach-defpager/Makefile @@ -813,10 +426,10 @@ index 8f8e13e..b718262 100644 diff --git a/mach-defpager/mig-decls.h b/mach-defpager/mig-decls.h new file mode 100644 -index 0000000..0a2768e +index 0000000..f63fef2 --- /dev/null +++ b/mach-defpager/mig-decls.h -@@ -0,0 +1,40 @@ +@@ -0,0 +1,37 @@ +/* + Copyright (C) 2014 Free Software Foundation, Inc. + Written by Justus Winter. @@ -850,9 +463,6 @@ index 0000000..0a2768e + || ((default_pager_t) dnameof(port))->pager != (port)) + return DEFAULT_PAGER_NULL; + -+ if (port == default_pager_default_port) -+ return DEFAULT_PAGER_DEFAULT_PORT; -+ + return (default_pager_t) dnameof(port); +} + @@ -887,10 +497,10 @@ index 0000000..54aeeba +#define DEFAULT_PAGER_IMPORTS import "mig-decls.h"; diff --git a/mach-defpager/priv.h b/mach-defpager/priv.h new file mode 100644 -index 0000000..53b3efc +index 0000000..20711b2 --- /dev/null +++ b/mach-defpager/priv.h -@@ -0,0 +1,195 @@ +@@ -0,0 +1,188 @@ +/* + * Mach Operating System + * Copyright (c) 1993-1989 Carnegie Mellon University @@ -1077,12 +687,5 @@ index 0000000..53b3efc +#define pnameof(_x_) (((vm_offset_t) (_x_)) + 1) +/* reverse, assumes no-odd-pointers */ +#define dnameof(_x_) (((vm_offset_t) (_x_)) & ~1) -+ -+/* Port for memory_object_create. */ -+extern mach_port_t default_pager_default_port; -+ -+/* A magic value that serves as a fake default_pager_t object for the -+ default_pager_default_port. */ -+#define DEFAULT_PAGER_DEFAULT_PORT ((default_pager_t) -2) + +#endif /* __MACH_DEFPAGER_PRIV_H__ */ |