usermode/library/mcore/src/pregionlayout.h

00001 /*
00002     Copyright (C) 2011 Computer Sciences Department, 
00003     University of Wisconsin -- Madison
00004 
00005     ----------------------------------------------------------------------
00006 
00007     This file is part of Mnemosyne: Lightweight Persistent Memory, 
00008     originally developed at the University of Wisconsin -- Madison.
00009 
00010     Mnemosyne was originally developed primarily by Haris Volos
00011     with contributions from Andres Jaan Tack.
00012 
00013     ----------------------------------------------------------------------
00014 
00015     Mnemosyne is free software; you can redistribute it and/or
00016     modify it under the terms of the GNU General Public License
00017     as published by the Free Software Foundation, version 2
00018     of the License.
00019  
00020     Mnemosyne is distributed in the hope that it will be useful,
00021     but WITHOUT ANY WARRANTY; without even the implied warranty of
00022     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00023     GNU General Public License for more details.
00024 
00025     You should have received a copy of the GNU General Public License
00026     along with this program; if not, write to the Free Software
00027     Foundation, Inc., 51 Franklin Street, Fifth Floor, 
00028     Boston, MA  02110-1301, USA.
00029 
00030 ### END HEADER ###
00031 */
00032 
00033 #ifndef _PERSISTENT_REGION_LAYOUT
00034 #define _PERSISTENT_REGION_LAYOUT
00035 
00036 
00037 /* 
00038  * We reserve a large hole in the 47-bit virtual space for mapping 
00039  * persistent memory segments.
00040  * FIXME: Even if we ensure persistent segments fall into the reserved space,
00041  * the kernel has to be aware about this reservation to make sure that no other 
00042  * memory is allocated there. Indead, when mmap is passed 0 as starting
00043  * address, it searches for an empty region starting from the end of the last
00044  * allocated region. So it could be very easily map a non-persistent region 
00045  * into the reserved space.
00046  *
00047  * Each region must be page aligned. We use PAGE_ALIGN to accomblish this.
00048  *
00049  * The end address of the region is not included in the region. More formally,
00050  * given a start and end address, the region is defined as [start, end) .
00051  *
00052  */
00053 
00054 #define PSEGMENT_RESERVED_REGION_START   0x0000100000000000
00055 #define PSEGMENT_RESERVED_REGION_SIZE    0x0000010000000000 /* 1 TB */
00056 #define PSEGMENT_RESERVED_REGION_END     (PSEGMENT_RESERVED_REGION_START +    \
00057                                           PSEGMENT_RESERVED_REGION_SIZE)
00058 /* Segment table */
00059 #define SEGMENT_TABLE_START              PSEGMENT_RESERVED_REGION_START
00060 #define SEGMENT_TABLE_NUM_ENTRIES        1024
00061 #define SEGMENT_TABLE_SIZE               (sizeof(m_segtbl_entry_t) *          \
00062                                           SEGMENT_TABLE_NUM_ENTRIES)
00063 
00064 #define SEGMENT_TABLE_HOLE               0x10000
00065 #define SEGMENT_TABLE_END                PAGE_ALIGN(                          \
00066                                              SEGMENT_TABLE_START +            \
00067                                              SEGMENT_TABLE_HOLE +             \
00068                                              SEGMENT_TABLE_SIZE)
00069 /* Log pool */                                                                            
00070 #define LOG_POOL_START                   SEGMENT_TABLE_END 
00071 #define LOG_POOL_SIZE                    (32*16*1024*1024+32*32*64)
00072 #define LOG_POOL_HOLE                    0x10000
00073 #define LOG_POOL_END                     PAGE_ALIGN(                          \
00074                                              LOG_POOL_START +                 \
00075                                              LOG_POOL_HOLE +                  \
00076                                                                                      LOG_POOL_SIZE)
00077 /* pmap segments start addr */                                                                            
00078 #define SEGMENT_MAP_START                LOG_POOL_END
00079 
00080 
00081 
00082 #endif /* _PERSISTENT_REGION_LAYOUT */

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