Richard Braun, le Mon 02 Apr 2012 14:58:55 +0200, a écrit : > On Mon, Apr 02, 2012 at 02:54:17PM +0200, Samuel Thibault wrote: > > > I believe we're thinking of two different things here. My current idea > > > of the solution is to directly convert names (32-bits) to ports or other > > > IPC objects (e.g. port sets, 64-bits). > > > > That's what I'm suggesting from the beginning. That needs two differents > > types (64bit mach_port_t and 32bit mach_port_name_t), where there is > > currently just one (vm_offset_t mach_port_t). > > Then I don't see why you want two different types. There would be one > 32-bits mach_port_t, and no mach_port_name_t.
Because there is code in GNU Mach that uses mach_port_t as a pointer, see e.g. kdportdeath(), which just casts mach_port_t into ipc_port_t, or ipc_kmsg_copyin_header which casts back the just-resolved object into mach_port_t. Such code might have to simply use the ipc_port_t type instead, I don't know. What I know for sure, however, is that xnu does typedef ipc_port_t mach_port_t, which makes me tend to think that in the kernel, mach_port_t is supposed to be a pointer, while mach_port_name_t is for the port names. Samuel