bug-hurd
[Top][All Lists]
Advanced

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

Re: [PATCH] include: make the memory_object_t types translation function


From: Samuel Thibault
Subject: Re: [PATCH] include: make the memory_object_t types translation functions mutable
Date: Tue, 25 Mar 2014 02:49:53 +0100
User-agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)

Justus Winter, le Wed 19 Mar 2014 11:25:44 +0100, a écrit :
> Make the intran, outtran and destructor functions mutable using
> preprocessor macros.  Make it possible to inject imports using the
> MEMORY_OBJECT_IMPORTS macro.  This way, userspace servers can provide
> their own translation functions.

Ack.

> * include/mach/mach_types.defs (memory_object_t): Make the translation
> mutable using preprocessor macros.
> * include/mach/memory_object.defs: Likewise for the inlined type declarations.
> Honor MEMORY_OBJECT_IMPORTS.
> * include/mach/memory_object_default.defs: Likewise.
> ---
>  include/mach/mach_types.defs            | 10 ++++++++++
>  include/mach/memory_object.defs         | 28 ++++++++++++++++++++++++----
>  include/mach/memory_object_default.defs |  4 ++++
>  3 files changed, 38 insertions(+), 4 deletions(-)
> 
> diff --git a/include/mach/mach_types.defs b/include/mach/mach_types.defs
> index 607d5d9..bfce6cb 100644
> --- a/include/mach/mach_types.defs
> +++ b/include/mach/mach_types.defs
> @@ -135,6 +135,16 @@ type memory_object_t = mach_port_t
>               ctype: mach_port_t
>  #if  KERNEL_SERVER
>               intran: ipc_port_t null_conversion(mach_port_t)
> +#else        /* KERNEL_SERVER */
> +#ifdef       MEMORY_OBJECT_INTRAN
> +             intran: MEMORY_OBJECT_INTRAN
> +#endif
> +#ifdef       MEMORY_OBJECT_OUTTRAN
> +             outtran: MEMORY_OBJECT_OUTTRAN
> +#endif
> +#ifdef       MEMORY_OBJECT_DESTRUCTOR
> +             destructor: MEMORY_OBJECT_DESTRUCTOR
> +#endif
>  #endif       /* KERNEL_SERVER */
>               ;
>  
> diff --git a/include/mach/memory_object.defs b/include/mach/memory_object.defs
> index ea7989a..0ed8dbc 100644
> --- a/include/mach/memory_object.defs
> +++ b/include/mach/memory_object.defs
> @@ -42,6 +42,10 @@ subsystem
>  #include <mach/std_types.defs>
>  #include <mach/mach_types.defs>
>  
> +#ifdef       MEMORY_OBJECT_IMPORTS
> +MEMORY_OBJECT_IMPORTS
> +#endif
> +
>  #if  SEQNOS
>  serverprefix seqnos_;
>  serverdemux seqnos_memory_object_server;
> @@ -85,7 +89,11 @@ simpleroutine      memory_object_init(
>  simpleroutine        memory_object_terminate(
>               memory_object           : memory_object_t =
>                                               MACH_MSG_TYPE_MOVE_SEND
> -                                             ctype: mach_port_t;
> +                                             ctype: mach_port_t
> +#ifdef       MEMORY_OBJECT_INTRAN
> +                                             intran: MEMORY_OBJECT_INTRAN
> +#endif
> +                                             ;
>  #if  SEQNOS
>       msgseqno seqno                  : mach_port_seqno_t;
>  #endif       /* SEQNOS */
> @@ -221,7 +229,11 @@ simpleroutine    memory_object_data_write(
>  simpleroutine        memory_object_lock_completed(
>               memory_object           : memory_object_t =
>                       polymorphic|MACH_MSG_TYPE_PORT_SEND_ONCE
> -                     ctype: mach_port_t;
> +                     ctype: mach_port_t
> +#ifdef       MEMORY_OBJECT_INTRAN
> +                     intran: MEMORY_OBJECT_INTRAN
> +#endif
> +                     ;
>  #if  SEQNOS
>       msgseqno seqno                  : mach_port_seqno_t;
>  #endif       /* SEQNOS */
> @@ -252,7 +264,11 @@ simpleroutine    memory_object_lock_completed(
>  simpleroutine        memory_object_supply_completed(
>               memory_object           : memory_object_t =
>                       polymorphic|MACH_MSG_TYPE_PORT_SEND_ONCE
> -                     ctype: mach_port_t;
> +                     ctype: mach_port_t
> +#ifdef       MEMORY_OBJECT_INTRAN
> +                     intran: MEMORY_OBJECT_INTRAN
> +#endif
> +                     ;
>  #if  SEQNOS
>       msgseqno seqno                  : mach_port_seqno_t;
>  #endif       /* SEQNOS */
> @@ -298,7 +314,11 @@ simpleroutine   memory_object_data_return(
>  simpleroutine        memory_object_change_completed(
>               memory_object           : memory_object_t =
>                       polymorphic|MACH_MSG_TYPE_PORT_SEND_ONCE
> -                     ctype: mach_port_t;
> +                     ctype: mach_port_t
> +#ifdef       MEMORY_OBJECT_INTRAN
> +                     intran: MEMORY_OBJECT_INTRAN
> +#endif
> +                     ;
>  #if  SEQNOS
>       msgseqno seqno                  : mach_port_seqno_t;
>  #endif       /* SEQNOS */
> diff --git a/include/mach/memory_object_default.defs 
> b/include/mach/memory_object_default.defs
> index 0eac271..cfd54a4 100644
> --- a/include/mach/memory_object_default.defs
> +++ b/include/mach/memory_object_default.defs
> @@ -40,6 +40,10 @@ subsystem
>  #include <mach/std_types.defs>
>  #include <mach/mach_types.defs>
>  
> +#ifdef       MEMORY_OBJECT_IMPORTS
> +MEMORY_OBJECT_IMPORTS
> +#endif
> +
>  #if  SEQNOS
>  serverprefix seqnos_;
>  serverdemux seqnos_memory_object_default_server;
> -- 
> 1.9.0
> 

-- 
Samuel
"...Unix, MS-DOS, and Windows NT (also known as the Good, the Bad, and
the Ugly)."
(By Matt Welsh)



reply via email to

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