bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/2] proc: fix the receiver lookup in S_proc_exception_raise


From: Justus Winter
Subject: Re: [PATCH 2/2] proc: fix the receiver lookup in S_proc_exception_raise
Date: Mon, 20 Jan 2014 10:26:35 +0100
User-agent: alot/0.3.4

Quoting Samuel Thibault (2014-01-19 21:14:03)
> Justus Winter, le Sat 18 Jan 2014 18:19:26 +0100, a écrit :
> > * proc/mgt.c (S_proc_exception_raise): Update accordingly.
> > * proc/mig-decls.h: New file.
> > * proc/proc_exc.defs: Add translation functions.
> 
> Why putting translation functions into proc_exc, rather than using
> mutation?

I'm not sure I understand your question.  But maybe I do.  Here's my
answer:

Because proc/proc_exc.defs is a private special version of
mach/exc.defs.  I saw little value in making this mutable using
mutator-macros.

But this is an excellent opportunity to discuss "best practices" for
this.  In the Hurd source one can find every possible way to declare
and/or implement the mig translation functions.  In the past I've
always adopted to the way it is handled in the surrounding code
(i.e. in the directory), but I've come to believe that we should use
the same method everywhere.

Some cases:

libdiskfs:
  mutator-macros in fsmutations.h, translator-functions in diskfs.h.

libnetfs:
  mutator-macros in mutations.h, translator-functions in priv.h.

libtrivfs:
  mutator-macros in fsmutations.h, translator-functions in migsupport.c.

pfinet:
  mutator-macros in mutations.h, translator-functions in misc.c.

pflocal:
  mutator-macros in mig-mutate.h, translator-functions in mig-decls.h.

Thoughts:

* I like pflocal's solution best.  The naming convention is concise
  and it doesn't unnecessarily puts the translator functions in some
  common header file like e.g. libdiskfs does.

* libtrivfs and pfinet put the translator functions into a .c file
  preventing them from being inlined in the mig-generated server
  functions.

Justus



reply via email to

[Prev in Thread] Current Thread [Next in Thread]