C Language Data Model

The 64-bit kernel uses the LP64 (Long Pointer 64-bit) C language data model and requires kernel extensions to do the same. The LP64 data model defines pointers, long, and long long types as 64 bits, int as 32 bits, short as 16 bits, and char as 8 bits.

In the ILP32 data model, long and pointer types are 32 bits. In order to port an existing 32-bit kernel extension to the 64-bit kernel environment, source code must be modified to be type-safe under LP64. This means ensuring that data types are used in a consistent fashion. Source code is incorrect for the 64-bit environment if it assumes that pointers, long, and int are all the same size.

In addition, the use of system-derived types must be examined whenever values are passed from an application to the kernel. For example, size_t is a system-derived type whose size depends on the compilation mode, and key_t is a system-derived type that is 64 bits in the 64-bit kernel environment.