X-Git-Url: http://git.joshuawise.com/netwatch.git/blobdiff_plain/9e2a82e4e9495f33b8e6423c335a9a157f056254..807268084f8cf4b02aaaa7ece7071a276c9d61bc:/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