MISR Toolkit  1.5.1
Data Structures | Macros | Typedefs | Functions
mcache.h File Reference
#include "hqueue.h"

Go to the source code of this file.

Data Structures

struct  _bkt
 
struct  _lelem
 
struct  MCACHE
 

Macros

#define RET_SUCCESS   0
 
#define RET_ERROR   -1
 
#define HASHSIZE   128
 
#define HASHKEY(pgno)   ((pgno -1) % HASHSIZE)
 
#define DEF_PAGESIZE   8192
 
#define DEF_MAXCACHE   1
 
#define MAX_PAGE_NUMBER   0xffffffff /* >= # of pages in a object */
 
#define MCACHE_DIRTY   0x01 /* page needs to be written */
 
#define MCACHE_PINNED   0x02 /* page is pinned into memory */
 
#define ELEM_READ   0x01
 
#define ELEM_WRITTEN   0x02
 
#define ELEM_SYNC   0x03
 
#define MCACHE_EXTEND
 

Typedefs

typedef struct _bkt BKT
 
typedef struct _lelem L_ELEM
 
typedef struct MCACHE MCACHE
 

Functions

MCACHEmcache_open (VOID *key, int32 object_id, int32 pagesize, int32 maxcache, int32 npages, int32 flags)
 
VOID mcache_filter (MCACHE *mp, int32(*pgin)(VOID *cookie, int32 pgno, VOID *page), int32(*pgout)(VOID *cookie, int32 pgno, const VOID *page), VOID *pgcookie)
 
VOID * mcache_new (MCACHE *mp, int32 *pgnoaddr, int32 flags)
 
VOID * mcache_get (MCACHE *mp, int32 pgno, int32 flags)
 
intn mcache_put (MCACHE *mp, VOID *page, int32 flags)
 
intn mcache_sync (MCACHE *mp)
 
intn mcache_close (MCACHE *mp)
 
int32 mcache_get_pagesize (MCACHE *mp)
 
int32 mcache_get_maxcache (MCACHE *mp)
 
int32 mcache_set_maxcache (MCACHE *mp, int32 maxcache)
 
int32 mcache_get_npages (MCACHE *mp)
 

Macro Definition Documentation

◆ DEF_MAXCACHE

#define DEF_MAXCACHE   1

Definition at line 83 of file mcache.h.

◆ DEF_PAGESIZE

#define DEF_PAGESIZE   8192

Definition at line 82 of file mcache.h.

◆ ELEM_READ

#define ELEM_READ   0x01

Definition at line 107 of file mcache.h.

◆ ELEM_SYNC

#define ELEM_SYNC   0x03

Definition at line 109 of file mcache.h.

◆ ELEM_WRITTEN

#define ELEM_WRITTEN   0x02

Definition at line 108 of file mcache.h.

◆ HASHKEY

#define HASHKEY (   pgno)    ((pgno -1) % HASHSIZE)

Definition at line 79 of file mcache.h.

◆ HASHSIZE

#define HASHSIZE   128

Definition at line 78 of file mcache.h.

◆ MAX_PAGE_NUMBER

#define MAX_PAGE_NUMBER   0xffffffff /* >= # of pages in a object */

Definition at line 85 of file mcache.h.

◆ MCACHE_DIRTY

#define MCACHE_DIRTY   0x01 /* page needs to be written */

Definition at line 94 of file mcache.h.

◆ MCACHE_EXTEND

#define MCACHE_EXTEND
Value:
0x10 /* increase number of pages
i.e extend object */

Definition at line 113 of file mcache.h.

◆ MCACHE_PINNED

#define MCACHE_PINNED   0x02 /* page is pinned into memory */

Definition at line 95 of file mcache.h.

◆ RET_ERROR

#define RET_ERROR   -1

Definition at line 65 of file mcache.h.

◆ RET_SUCCESS

#define RET_SUCCESS   0

Definition at line 64 of file mcache.h.

Typedef Documentation

◆ BKT

typedef struct _bkt BKT

◆ L_ELEM

typedef struct _lelem L_ELEM

◆ MCACHE

typedef struct MCACHE MCACHE

Function Documentation

◆ mcache_close()

intn mcache_close ( MCACHE mp)

◆ mcache_filter()

VOID mcache_filter ( MCACHE mp,
int32(*)(VOID *cookie, int32 pgno, VOID *page)  pgin,
int32(*)(VOID *cookie, int32 pgno, const VOID *page)  pgout,
VOID *  pgcookie 
)

◆ mcache_get()

VOID* mcache_get ( MCACHE mp,
int32  pgno,
int32  flags 
)

◆ mcache_get_maxcache()

int32 mcache_get_maxcache ( MCACHE mp)

◆ mcache_get_npages()

int32 mcache_get_npages ( MCACHE mp)

◆ mcache_get_pagesize()

int32 mcache_get_pagesize ( MCACHE mp)

◆ mcache_new()

VOID* mcache_new ( MCACHE mp,
int32 *  pgnoaddr,
int32  flags 
)

◆ mcache_open()

MCACHE* mcache_open ( VOID *  key,
int32  object_id,
int32  pagesize,
int32  maxcache,
int32  npages,
int32  flags 
)

◆ mcache_put()

intn mcache_put ( MCACHE mp,
VOID *  page,
int32  flags 
)

◆ mcache_set_maxcache()

int32 mcache_set_maxcache ( MCACHE mp,
int32  maxcache 
)

◆ mcache_sync()

intn mcache_sync ( MCACHE mp)

MISR Toolkit - Copyright © 2005 - 2020 Jet Propulsion Laboratory
Generated on Fri Jun 19 2020 22:49:54