My Project
Loading...
Searching...
No Matches
Macros | Functions | Variables
omPage.h File Reference

Go to the source code of this file.

Macros

#define OM_SIZEOF_INDEX_PAGE   (SIZEOF_SYSTEM_PAGE << LOG_BIT_SIZEOF_LONG)
 
#define omGetPageShiftOfAddr(addr)    ((((unsigned long) addr) & (OM_SIZEOF_INDEX_PAGE -1)) >> LOG_BIT_SIZEOF_SYSTEM_PAGE)
 
#define omGetPageIndexOfAddr(addr)    (((unsigned long) addr) >> (LOG_BIT_SIZEOF_LONG + LOG_BIT_SIZEOF_SYSTEM_PAGE))
 
#define omIsPageAddr(addr)
 
#define omRegisterPageIndex(index)
 
#define omRegisterExternalAddr(addr)
 
#define omRegisterPageAddr(addr)
 
#define omIsAddrPageAligned(addr)    (((long) (addr) & (SIZEOF_SYSTEM_PAGE -1)) == 0)
 
#define omGetPageOfAddr(addr)    ((void*) ((long) (addr) & ~(SIZEOF_SYSTEM_PAGE -1)))
 
#define omGetBinPageOfAddr(addr)    ((omBinPage) ((long) (addr) & ~(SIZEOF_SYSTEM_PAGE -1)))
 
#define omIsAddrOnPage(addr, page)   (omGetPageOfAddr(addr) == (void*) (page))
 
#define omAreAddrOnSamePage(a1, a2)    (omGetPageOfAddr(a1) == omGetPageOfAddr(a2))
 
#define omIsNotAddrOnFreePage(addr)   (!omIsAddrOnFreePage(addr))
 

Functions

void omPageIndexFault (unsigned long page_index)
 
void * omGetPage ()
 
void omFreePage (void *page)
 
void omReleaseFreePages ()
 
int omGetNumberOfFreePages ()
 
int omGetNumberOfUsedPages ()
 
int omGetNumberOfAllocatedPages ()
 
int omIsAddrOnFreePage (void *addr)
 
int omIsAddrOnRegisteredPage (void *addr)
 

Variables

unsigned long omMaxPageIndex
 
unsigned long omMinPageIndex
 
unsigned long * omPageIndicies
 

Macro Definition Documentation

◆ OM_SIZEOF_INDEX_PAGE

#define OM_SIZEOF_INDEX_PAGE   (SIZEOF_SYSTEM_PAGE << LOG_BIT_SIZEOF_LONG)

Definition at line 36 of file omPage.h.

◆ omAreAddrOnSamePage

#define omAreAddrOnSamePage (   a1,
  a2 
)     (omGetPageOfAddr(a1) == omGetPageOfAddr(a2))

Definition at line 114 of file omPage.h.

◆ omGetBinPageOfAddr

#define omGetBinPageOfAddr (   addr)     ((omBinPage) ((long) (addr) & ~(SIZEOF_SYSTEM_PAGE -1)))

Definition at line 109 of file omPage.h.

◆ omGetPageIndexOfAddr

#define omGetPageIndexOfAddr (   addr)     (((unsigned long) addr) >> (LOG_BIT_SIZEOF_LONG + LOG_BIT_SIZEOF_SYSTEM_PAGE))

Definition at line 41 of file omPage.h.

◆ omGetPageOfAddr

#define omGetPageOfAddr (   addr)     ((void*) ((long) (addr) & ~(SIZEOF_SYSTEM_PAGE -1)))

Definition at line 106 of file omPage.h.

◆ omGetPageShiftOfAddr

#define omGetPageShiftOfAddr (   addr)     ((((unsigned long) addr) & (OM_SIZEOF_INDEX_PAGE -1)) >> LOG_BIT_SIZEOF_SYSTEM_PAGE)

Definition at line 38 of file omPage.h.

◆ omIsAddrOnPage

#define omIsAddrOnPage (   addr,
  page 
)    (omGetPageOfAddr(addr) == (void*) (page))

Definition at line 112 of file omPage.h.

◆ omIsAddrPageAligned

#define omIsAddrPageAligned (   addr)     (((long) (addr) & (SIZEOF_SYSTEM_PAGE -1)) == 0)

Definition at line 103 of file omPage.h.

◆ omIsNotAddrOnFreePage

#define omIsNotAddrOnFreePage (   addr)    (!omIsAddrOnFreePage(addr))

Definition at line 120 of file omPage.h.

◆ omIsPageAddr

#define omIsPageAddr (   addr)
Value:
(((unsigned long)1) << omGetPageShiftOfAddr(addr))) != 0)
unsigned long omMinPageIndex
unsigned long * omPageIndicies
#define omGetPageShiftOfAddr(addr)
Definition: omPage.h:38
#define omGetPageIndexOfAddr(addr)
Definition: omPage.h:41

Definition at line 44 of file omPage.h.

◆ omRegisterExternalAddr

#define omRegisterExternalAddr (   addr)
Value:
do \
{ \
unsigned long _omPageIndex = omGetPageIndexOfAddr(addr); \
omRegisterPageIndex(_omPageIndex); \
omPageIndicies[_omPageIndex - omMinPageIndex] &= \
~ (((unsigned long) 1) << omGetPageShiftOfAddr(addr)); \
} \
while (0)

Definition at line 63 of file omPage.h.

◆ omRegisterPageAddr

#define omRegisterPageAddr (   addr)
Value:
do \
{ \
unsigned long _omPageIndex = omGetPageIndexOfAddr(addr); \
omRegisterPageIndex(_omPageIndex); \
omPageIndicies[_omPageIndex - omMinPageIndex] |= \
(((unsigned long) 1) << omGetPageShiftOfAddr(addr)); \
} \
while (0)

Definition at line 73 of file omPage.h.

◆ omRegisterPageIndex

#define omRegisterPageIndex (   index)
Value:
do \
{ \
if (index < omMinPageIndex || index > omMaxPageIndex) \
{ \
omPageIndexFault(index); \
} \
} \
while (0)
unsigned long omMaxPageIndex
static int index(p_Length length, p_Ord ord)
Definition: p_Procs_Impl.h:592

Definition at line 53 of file omPage.h.

Function Documentation

◆ omFreePage()

void omFreePage ( void *  page)

◆ omGetNumberOfAllocatedPages()

int omGetNumberOfAllocatedPages ( )

◆ omGetNumberOfFreePages()

int omGetNumberOfFreePages ( )

◆ omGetNumberOfUsedPages()

int omGetNumberOfUsedPages ( )

◆ omGetPage()

void * omGetPage ( )

◆ omIsAddrOnFreePage()

int omIsAddrOnFreePage ( void *  addr)

◆ omIsAddrOnRegisteredPage()

int omIsAddrOnRegisteredPage ( void *  addr)

◆ omPageIndexFault()

void omPageIndexFault ( unsigned long  page_index)

◆ omReleaseFreePages()

void omReleaseFreePages ( )

Variable Documentation

◆ omMaxPageIndex

unsigned long omMaxPageIndex
extern

◆ omMinPageIndex

unsigned long omMinPageIndex
extern

◆ omPageIndicies

unsigned long* omPageIndicies
extern