[minix3] what is _ENDPOINT(p,e)

33 views
Skip to first unread message

bootbhai

unread,
Apr 27, 2010, 3:15:31 AM4/27/10
to minix3
what is _ENDPOINT(p,e)....
what does the above macro do???

--
You received this message because you are subscribed to the Google Groups "minix3" group.
To post to this group, send email to min...@googlegroups.com.
To unsubscribe from this group, send email to minix3+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/minix3?hl=en.

Claudiu-Dan Gheorghe

unread,
Apr 27, 2010, 3:54:00 AM4/27/10
to min...@googlegroups.com
Hi,

As I know is one of few macros meant to deal with endpoint (user
process) identifiers[1].

_ENDPOINT() in particular I think is used for generating new endpoint
identifiers, for example at fork()[2].

[1] include/minix/endpoint.h
[2] kernel/system/do_fork.c, line: 72

On Tue, Apr 27, 2010 at 10:15 AM, bootbhai <jayes...@gmail.com> wrote:
> what is _ENDPOINT(p,e)....
> what does the above macro do???
>

--
Claudiu Gheorghe

Tomas Hruby

unread,
Apr 27, 2010, 3:56:00 AM4/27/10
to min...@googlegroups.com
> what is _ENDPOINT(p,e)....

_ENDPOINT(g, p)

> what does the above macro do???

This is an internal kernel/system macro which creates an endpoint
(endpoint_t) from the in-kernel process slot number p and a generation
number g. Servers keep 1:1 mapping between their own tables and kernel
process table thus they use _ENDPOINT_P to figure the slot out.
_ENDPOINT_G is used to find out whether the slot has been reused by
another process or another incarnation in the mean time.

HTH

T.

bootbhai

unread,
Apr 27, 2010, 5:32:27 AM4/27/10
to minix3



>Servers keep 1:1 mapping between their own tables and kernel
> process table thus they use _ENDPOINT_P to figure the slot out.
> _ENDPOINT_G is used to find out whether the slot has been reused by
> another process or another incarnation in the mean time.

_ENDPOINT_P figures out the slot in kernel process table or server's
tables??


which part of the code does the mapping between kernel process table
and server's process table??

Tomas Hruby

unread,
Apr 27, 2010, 5:36:58 AM4/27/10
to min...@googlegroups.com
On Tue, Apr 27, 2010 at 02:32:27AM -0700, bootbhai wrote:
>
>
>
> >Servers keep 1:1 mapping between their own tables and kernel
> > process table thus they use _ENDPOINT_P to figure the slot out.
> > _ENDPOINT_G is used to find out whether the slot has been reused by
> > another process or another incarnation in the mean time.
>
> _ENDPOINT_P figures out the slot in kernel process table or server's
> tables??

it is 100% valid only in kernel, however, it is convenient to have the
same mapping in the servers too.

>
>
> which part of the code does the mapping between kernel process table
> and server's process table??

Each server does it on its own. There is no requirement on the
mapping. Userland only must keep the endpoints in whatever way it likes
as the endpoint is the only identifier valid in the kernel. It is used
for kernel calls and ipc.

T.
Reply all
Reply to author
Forward
0 new messages