/[hurd]/hurd-l4/hurd/types.h
ViewVC logotype

Diff of /hurd-l4/hurd/types.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.7 by marcus, Fri Apr 9 21:56:43 2004 UTC revision 1.8 by neal, Wed Dec 1 18:12:21 2004 UTC
# Line 42  hurd_task_id_from_thread_id (l4_thread_i Line 42  hurd_task_id_from_thread_id (l4_thread_i
42  }  }
43    
44    
45  /* The type used for a user-side capability ID.  */  /* Client-side capability handle.  */
46  typedef l4_word_t hurd_cap_handle_t;  typedef l4_word_t hurd_cap_handle_t;
47    
 /* Every capability hurd_cap_handle_t consists of two parts: The upper  
    part is a client ID and the lower part is a capability object ID.  
    The client ID is as long as the task ID (which is as long as the  
    version ID).  The cap ID occupies the remainder.  We intimately  
    know that even on 64 bit architectures, both fit into a 32 bit  
    integer value.  */  
 #define HURD_CAP_CLIENT_ID_BITS HURD_TASK_ID_BITS  
 #define HURD_CAP_ID_BITS ((sizeof (hurd_cap_handle_t) * 8) - HURD_TASK_ID_BITS)  
   
 #define _HURD_CAP_CLIENT_ID_MASK \  
   ((L4_WORD_C(1) << HURD_CAP_CLIENT_ID_BITS) - 1)  
 #define _HURD_CAP_ID_MASK ((L4_WORD_C(1) << HURD_CAP_ID_BITS) - 1)  
   
 typedef l4_uint32_t hurd_cap_id_t;  
 typedef l4_uint32_t hurd_cap_client_id_t;  
   
   
 /* Get the capability ID from a user capability.  The capabililty ID  
    is an index into the caps table of a client.  */  
 static inline hurd_cap_client_id_t  
 hurd_cap_client_id (hurd_cap_handle_t cap)  
 {  
   return cap >> HURD_CAP_ID_BITS;  
 }  
   
   
 /* Get the capability ID from a user capability.  The capabililty ID  
    is an index into the caps table of a client.  */  
 static inline hurd_cap_id_t  
 hurd_cap_id (hurd_cap_handle_t cap)  
 {  
   return cap & _HURD_CAP_ID_MASK;  
 }  
   
   
 /* Create a new capability handle from the client and cap ID.  */  
 static inline hurd_cap_handle_t  
 hurd_cap_handle_make (hurd_cap_client_id_t client_id, hurd_cap_id_t cap_id)  
 {  
   return ((client_id & _HURD_CAP_CLIENT_ID_MASK) << HURD_CAP_ID_BITS)  
     | (cap_id & _HURD_CAP_ID_MASK);  
 }  
   
   
48  #endif  /* _HURD_TYPES_H */  #endif  /* _HURD_TYPES_H */

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26