Skip to content

types.h

typedef unsigned int   uint;
typedef unsigned short ushort;
typedef unsigned char  uchar;

TIP

固定宽度的整数类型,确保在不同平台上有一致的大小。 这对于处理硬件寄存器、文件系统和网络协议等底层数据结构至关重要。

typedef unsigned char uint8;
typedef unsigned short uint16;
typedef unsigned int  uint32;
typedef unsigned long uint64;

TIP

RISC-V 64位架构下页表项(Page Table Entry)的类型。 xv6 使用它来存储物理页号以及相关的权限和状态标志位。

typedef uint64 pde_t;