X-Git-Url: http://git.joshuawise.com/netwatch.git/blobdiff_plain/8e6328ba94e7dadaef31a6186ba6d4437e1f06b3..037ce545946a8bc2d482d24e3bbdb6174a93ca46:/aseg-paging/vm_flags.h?ds=inline diff --git a/aseg-paging/vm_flags.h b/aseg-paging/vm_flags.h index d89c9a8..f003516 100644 --- a/aseg-paging/vm_flags.h +++ b/aseg-paging/vm_flags.h @@ -8,6 +8,13 @@ #ifndef _VM_FLAGS_H #define _VM_FLAGS_H +#define PTE_FOR(x) (((unsigned int)(x) >> 12) & 0x3FF) +#define PDE_FOR(x) ((unsigned int)(x) >> 22) +#define ADDR_12_MASK(x) ((unsigned int)(x) & ~((1 << 12) - 1)) +#define ADDR_22_MASK(x) ((unsigned int)(x) & ~((1 << 22) - 1)) +#define LOWER_12(x) ((unsigned int)(x) & ((1 << 12) - 1)) +#define LOWER_22(x) ((unsigned int)(x) & ((1 << 22) - 1)) + #define PDE_4M_ADDR_SHIFT 22 #define PTE_4K_ADDR_SHIFT 12 #define PDE_TABLE_ADDR_SHIFT 12