[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH hurd 2/5] libpager: use libports notification functions
From: |
Samuel Thibault |
Subject: |
Re: [PATCH hurd 2/5] libpager: use libports notification functions |
Date: |
Thu, 11 Dec 2014 01:08:37 +0100 |
User-agent: |
Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30) |
Justus Winter, le Wed 10 Dec 2014 17:21:56 +0100, a écrit :
> Now that we do not use sequence numbers anymore, we can simply use
> libports notification server functions.
>
> * libpager/Makefile (SRCS): Drop `no-senders.c', and `notify-stubs.c'.
> (OBJS): Drop `notifyServer.o'.
> * libpager/demuxer.c (pager_demuxer): Use libports server functions.
> * libpager/mig-mutate.h: Drop all notification mutators.
> * libpager/no-senders.c: Remove file.
> * libpager/notify-stubs.c: Likewise.
Ack.
> ---
> libpager/Makefile | 6 ++---
> libpager/demuxer.c | 4 ++--
> libpager/mig-mutate.h | 9 --------
> libpager/no-senders.c | 34 ---------------------------
> libpager/notify-stubs.c | 61
> -------------------------------------------------
> 5 files changed, 5 insertions(+), 109 deletions(-)
> delete mode 100644 libpager/no-senders.c
> delete mode 100644 libpager/notify-stubs.c
>
> diff --git a/libpager/Makefile b/libpager/Makefile
> index 2bfd845..72b4bfd 100644
> --- a/libpager/Makefile
> +++ b/libpager/Makefile
> @@ -20,16 +20,16 @@ makemode := library
> libname = libpager
> SRCS = data-request.c data-return.c data-unlock.c pager-port.c \
> inhibit-term.c lock-completed.c lock-object.c mark-error.c \
> - no-senders.c object-init.c object-terminate.c pagemap.c \
> + object-init.c object-terminate.c pagemap.c \
> pager-create.c pager-flush.c pager-shutdown.c pager-sync.c \
> stubs.c demuxer.c chg-compl.c pager-attr.c clean.c \
> - dropweak.c notify-stubs.c get-upi.c pager-memcpy.c pager-return.c \
> + dropweak.c get-upi.c pager-memcpy.c pager-return.c \
> offer-page.c
> installhdrs = pager.h
>
> HURDLIBS= ports
> LDLIBS += -lpthread
> -OBJS = $(SRCS:.c=.o) memory_objectServer.o notifyServer.o
> +OBJS = $(SRCS:.c=.o) memory_objectServer.o
>
> MIGSFLAGS = -imacros $(srcdir)/mig-mutate.h
> MIGCOMSFLAGS = -prefix _pager_
> diff --git a/libpager/demuxer.c b/libpager/demuxer.c
> index 57a6ccb..4dd3cd8 100644
> --- a/libpager/demuxer.c
> +++ b/libpager/demuxer.c
> @@ -22,7 +22,7 @@
>
> #include "priv.h"
> #include "memory_object_S.h"
> -#include "notify_S.h"
> +#include "libports/notify_S.h"
> #include "queue.h"
>
> /*
> @@ -89,7 +89,7 @@ pager_demuxer (struct requests *requests,
>
> mig_routine_t routine;
> if (! ((routine = _pager_memory_object_server_routine (inp)) ||
> - (routine = _pager_notify_server_routine (inp))))
> + (routine = ports_notify_server_routine (inp))))
> return FALSE;
>
> #define MASK (8u - 1u)
> diff --git a/libpager/mig-mutate.h b/libpager/mig-mutate.h
> index c4f30ce..66d37cd 100644
> --- a/libpager/mig-mutate.h
> +++ b/libpager/mig-mutate.h
> @@ -21,12 +21,3 @@
> #define MEMORY_OBJECT_INTRAN_PAYLOAD pager_t begin_using_pager_payload
> #define MEMORY_OBJECT_DESTRUCTOR end_using_pager (pager_t)
> #define MEMORY_OBJECT_IMPORTS import "mig-decls.h";
> -
> -#define NOTIFY_INTRAN \
> - port_info_t begin_using_port_info_port (mach_port_t)
> -#define NOTIFY_INTRAN_PAYLOAD \
> - port_info_t begin_using_port_info_payload
> -#define NOTIFY_DESTRUCTOR \
> - end_using_port_info (port_info_t)
> -#define NOTIFY_IMPORTS \
> - import "libports/mig-decls.h";
> diff --git a/libpager/no-senders.c b/libpager/no-senders.c
> deleted file mode 100644
> index b750101..0000000
> --- a/libpager/no-senders.c
> +++ /dev/null
> @@ -1,34 +0,0 @@
> -/* Called when a nosenders notification happens
> - Copyright (C) 1994, 1995 Free Software Foundation
> -
> - This program 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.
> -
> - This program 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 this program; if not, write to the Free Software
> - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
> -
> -
> -#include "priv.h"
> -#include <mach/notify.h>
> -#include "notify_S.h"
> -
> -error_t
> -_pager_do_mach_notify_no_senders (struct port_info *pi,
> - mach_port_mscount_t mscount)
> -{
> - if (!pi ||
> - pi->class != _pager_class)
> - return EOPNOTSUPP;
> -
> - ports_no_senders (pi, mscount);
> -
> - return 0;
> -}
> diff --git a/libpager/notify-stubs.c b/libpager/notify-stubs.c
> deleted file mode 100644
> index 6440815..0000000
> --- a/libpager/notify-stubs.c
> +++ /dev/null
> @@ -1,61 +0,0 @@
> -/*
> - Copyright (C) 1995, 2011 Free Software Foundation, Inc.
> - Written by Michael I. Bushnell.
> -
> - 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 this program; if not, write to the Free Software
> - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. */
> -
> -#include "priv.h"
> -#include "notify_S.h"
> -#include <errno.h>
> -
> -error_t
> -_pager_do_mach_notify_port_deleted (struct port_info *pi,
> - mach_port_t name
> - __attribute__ ((unused)))
> -{
> - return 0;
> -}
> -
> -error_t
> -_pager_do_mach_notify_msg_accepted (struct port_info *pi,
> - mach_port_t name
> - __attribute__ ((unused)))
> -{
> - return 0;
> -}
> -
> -error_t
> -_pager_do_mach_notify_port_destroyed (struct port_info *pi,
> - mach_port_t name
> - __attribute__ ((unused)))
> -{
> - return 0;
> -}
> -
> -error_t
> -_pager_do_mach_notify_send_once (struct port_info *pi)
> -{
> - return 0;
> -}
> -
> -error_t
> -_pager_do_mach_notify_dead_name (struct port_info *pi,
> - mach_port_t name
> - __attribute__ ((unused)))
> -{
> - return 0;
> -}
> --
> 2.1.3
>
--
Samuel
Be warned that typing \fBkillall \fIname\fP may not have the desired
effect on non-Linux systems, especially when done by a privileged user.
(From the killall manual page)
- [PATCH hurd 1/5] libpager: remove the `seqno' parameters, Justus Winter, 2014/12/10
- [PATCH hurd 2/5] libpager: use libports notification functions, Justus Winter, 2014/12/10
- Re: [PATCH hurd 2/5] libpager: use libports notification functions,
Samuel Thibault <=
- [PATCH hurd 3/5] ext2fs: tune the size of the inode cache, Justus Winter, 2014/12/10
- [PATCH hurd 5/5] Replace `bcopy' with `memcpy' or `memmove' as appropriate, Justus Winter, 2014/12/10
- [PATCH hurd 4/5] Replace `bzero' with `memset', Justus Winter, 2014/12/10
- Re: [PATCH hurd 1/5] libpager: remove the `seqno' parameters, Samuel Thibault, 2014/12/10