macros.h: Introduce side_ptr macros
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 21 Sep 2023 05:43:57 +0000 (06:43 +0100)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 21 Sep 2023 05:44:15 +0000 (06:44 +0100)
commit326c676c3487d8807db6e814485b65d60ee268aa
tree5f40b3a90a5c00217b20f21b9fbd3ec86dbdd3ef
parentd78c8f2ddb2aed3aa265cd1057fb8aa2aa4e6624
macros.h: Introduce side_ptr macros

The side_ptr macros allow defining a pointer type which is suitable
for use by 32-bit and 64-bit kernels without compatibility code,
while preserving information about the pointer type.

Those pointers are stored as 64-bit integers, and the type of the
actual pointer is kept alongside with the 64-bit pointer value in a
0-len array within a union.

uintptr_t will fit within a uint64_t except on architectures with
128-bit pointers. This provides fixed-size pointers on architectures
with pointer size of 64-bit or less. Architectures with larger
pointer size will have to handle the ABI offset specifics explicitly.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/side/macros.h
This page took 0.022578 seconds and 4 git commands to generate.