35 lines
746 B
C
35 lines
746 B
C
#ifndef SOCKS_USER_VM_H_
|
|
#define SOCKS_USER_VM_H_
|
|
|
|
#include <stdint.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
extern uintptr_t __pagemap_base(void);
|
|
extern uintptr_t __pagemap_limit(void);
|
|
|
|
/* kernel higher-half base virtual address. */
|
|
#define VM_KERNEL_VOFFSET (__pagemap_base())
|
|
|
|
/* direct page-mapping region.
|
|
NOTE that these are the maximum bounds of this region.
|
|
the actual size depends on the amount of physical
|
|
memory present. */
|
|
#define VM_PAGEMAP_BASE (__pagemap_base())
|
|
#define VM_PAGEMAP_LIMIT (__pagemap_limit())
|
|
|
|
#define VM_PAGE_SIZE 0x1000
|
|
#define VM_PAGE_MASK (VM_PAGE_SIZE-1)
|
|
#define VM_PAGE_SHIFT 12
|
|
|
|
#define VM_PAGE_MIN_ORDER VM_PAGE_4K
|
|
#define VM_PAGE_MAX_ORDER VM_PAGE_8M
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|