X-Git-Url: http://git.joshuawise.com/netwatch.git/blobdiff_plain/92bb2596b1eda2324da82825b882df5dce9dfbbb..2d34b5d2cb94b7976fa40e954bcf060bdb5856c2:/aseg-paging/vm_flags.h?ds=sidebyside 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