[okl4-developer] Confused about Kernel IDs

Carl van Schaik carl at ok-labs.com
Mon Jun 4 10:26:43 EST 2007


Hi Harry,

Sorry for the confusion, the constants are wrong, they should be (id << 
8) + subid.

Thanks,
Carl

Harry Vennik wrote:
> Hi,
>
> I am a bit confused about the encoding of the Kernel ID. The 
> documentation of the OKL4 kernel states that a Kernel ID is of type 
> Version, which is again defined to have two fields of 8 bits each, one 
> for the id, one for the subid.
> In the kip.h header file, I find just that, in the definition of the 
> L4_KernelId_t type:
>
> typedef union {
>     L4_Word_t raw;
>     struct {
>         L4_BITFIELD4(L4_Word_t, __padding:16, subid:8, id:8, __PAD32);
>     } x;
> } L4_KernelId_t;
>
> But then there is something strange, later on in that file:
> #define L4_KID_L4_486           ((0 << 16) + 1)
> #define L4_KID_L4_PENTIUM       ((0 << 16) + 2)
> #define L4_KID_L4_X86           ((0 << 16) + 3)
> #define L4_KID_L4_MIPS          ((1 << 16) + 1)
> #define L4_KID_L4_ALPHA         ((2 << 16) + 1)
> #define L4_KID_FIASCO           ((3 << 16) + 1)
> #define L4_KID_L4KA_Hazelnut    ((4 << 16) + 1)
> #define L4_KID_L4KA_Pistachio   ((4 << 16) + 2)
> #define L4_KID_L4KA_Strawberry  ((4 << 16) + 3)
> #define L4_KID_NICTA_Pistachio  ((5 << 16) + 1)
> #define L4_KID_OKL4             ((6 << 16) + 0)
>
> This doesn't quite match. According to these constants, the id is in 
> bits 16-23 and the subid in 0-7, while the type definition says it 
> should be id in 24-31 and subid in 16-23.
> The latter also matches what the OKL4 documentation says in paragraph 
> D-3.2.4.
>
> Are those constants wrong??
>
> Regards,
>
> Harry
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Developer mailing list
> Developer at okl4.org
> https://lists.okl4.org/mailman/listinfo/developer
>   




More information about the Developer mailing list