usermode/library/mcore/include/mnemosyne.h File Reference

#include <sys/types.h>

Go to the source code of this file.

Defines

#define MNEMOSYNE_PERSISTENT   __attribute__ ((section("PERSISTENT")))
#define PSEGMENT_RESERVED_REGION_START   0x0000100000000000
#define PSEGMENT_RESERVED_REGION_SIZE   0x0000010000000000

Functions

void mnemosyne_reincarnation_callback_register (void(*initializer)())
void * m_pmap (void *start, size_t length, int prot, int flags)
 Maps an address space region into persistent memory.
void * m_pmap2 (void *start, size_t length, int prot, int flags)
 Maps an address space region into persistent memory.
int m_punmap (void *start, size_t length)
void mnemosyne_init_global (void)


Detailed Description

Defines the public interface to the mnemosyne persistent memory allocator. Having this header, one is able to map persistent segments and allocate memory from them safely. One may use persistent globals to point to these dynamic segments. All persistent segments will be automatically reincarnated on every process startup without intervention by the application programmer.

Library implementors making use of Mnemosyne transactional memory will appreciate the reincarnation callback functionality. This functionality allows the implementor to attach his own initializations to be run after persistent segments are guaranteed to have been mapped back into the process.

Author:
Haris Volos <hvolos@cs.wisc.edu>

Andres Jaan Tack <tack@cs.wisc.edu>

Definition in file mnemosyne.h.


Define Documentation

#define MNEMOSYNE_PERSISTENT   __attribute__ ((section("PERSISTENT")))

Allows the declaration of a persistent global variable. A programmer making use of dynamic mnemosyne segments is advised to use these variables to point into the dynamic segments (which, practically, could be mapped anywhere in the virtual address space). Without a global persistent pointer, the programmer risks losing a portion of his address space to memory he will not recover.

Definition at line 61 of file mnemosyne.h.


Function Documentation

void* m_pmap ( void *  start,
size_t  length,
int  prot,
int  flags 
)

Maps an address space region into persistent memory.

Start address is offset by SEGMENT_MAP_START.

Definition at line 871 of file segment.c.

References m_pmap(), SGTB_TYPE_PMAP, and SGTB_VALID_DATA.

Referenced by __attribute__(), persistentHeap::format(), and m_pmap().

void mnemosyne_reincarnation_callback_register ( void(*)()  initializer  ) 

Registers an callback function which is run upon reincarnation of a persistent address space. The client library (or application) may, at this time, be assured that any persistent globals are valid, as well as any dynamic segments which are run.

To register a callback successfully, the routine initializing the callback must run in a constructor (the gcc attribute constructor). It does not matter that this constructor run before or after mnemosyne initializes; in one case, the callback will be queued. In the other, it will be run.

Callbacks registered through this method will be executed in order.

Parameters:
initialize will be called immediately upon complete reincarnation of the persistent address space.

Definition at line 57 of file reincarnation_callback.c.


Generated on Sat Apr 23 11:43:36 2011 for Mnemosyne by  doxygen 1.4.7