The Linux kernel, for example, uses the following definitions for page-table
entries in different levels of amd64's four-level page tables:
typedef struct { unsigned long pte; } pte_t;
typedef struct { unsigned long pmd; } pmd_t;
typedef struct { unsigned long pud; } pud_t;
typedef struct { unsigned long pgd; } pgd_t;
That way, even though they're all represented as 64-bit values, the compiler
will catch you if you try to mix-and-match different types without doing
appropriate work.Passing small structs in registers means that Linux can do that, and pass around `pte_t`s as parameters, without having to worry about paying a runtime cost for their typechecking.