;=========================================================================
; file : mman64.inc
; 2010/06/01
; derived from  : linux-2.4.0-test12/include/asm-i386/mman.h
;=========================================================================

%ifndef __MMAN_H__
%define __MMAN_H__

%assign     PROT_READ       0x1     ; page can be read
%assign     PROT_WRITE      0x2     ; page can be written
%assign     PROT_EXEC       0x4     ; page can be executed
%assign     PROT_NONE       0x0     ; page can not be accessed

%assign     MAP_SHARED      0x01    ; Share changes
%assign     MAP_PRIVATE     0x02    ; Changes are private
%assign     MAP_TYPE        0x0f    ; Mask for type of mapping
%assign     MAP_FIXED       0x10    ; Interpret addr exactly
%assign     MAP_ANONYMOUS   0x20    ; don't use a file

%assign     MAP_GROWSDOWN   0x0100  ; stack-like segment
%assign     MAP_DENYWRITE   0x0800  ; ETXTBSY
%assign     MAP_EXECUTABLE  0x1000  ; mark it as an executable
%assign     MAP_LOCKED      0x2000  ; pages are locked
%assign     MAP_NORESERVE   0x4000  ; don't check for reservations

%assign     MS_ASYNC        1       ; sync memory asynchronously
%assign     MS_INVALIDATE   2       ; invalidate the caches
%assign     MS_SYNC         4       ; synchronous memory sync

%assign     MCL_CURRENT     1       ; lock all current mappings
%assign     MCL_FUTURE      2       ; lock all future mappings

%assign     MADV_NORMAL     0x0     ; default page-in behavior
%assign     MADV_RANDOM     0x1     ; page-in minimum required
%assign     MADV_SEQUENTIAL 0x2     ; read-ahead aggressively
%assign     MADV_WILLNEED   0x3     ; pre-fault pages
%assign     MADV_DONTNEED   0x4     ; discard these pages

; compatibility flags
%assign     MAP_ANON    MAP_ANONYMOUS
%assign     MAP_FILE    0

; check linux-2.6.34/arch/x86/kernel/sys_x86_64.c
; mmap(
;   unsigned long addr,
;   unsigned long len,
;   unsigned long prot,
;   unsigned long flags,
;   unsigned long fd,
;   unsigned long off
; )

%endif
