usermode/library/mtm/src/mode/pwb-common/pwb.c

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 #include "mtm_i.h"
00034 #include "beginend-bits.h"
00035 
00036 void ITM_NORETURN
00037 mtm_pwb_restart_transaction (mtm_tx_t *tx, mtm_restart_reason r)
00038 {
00039         uint32_t actions;
00040 
00041 #if (!defined(ALLOW_ABORTS))
00042         if (tx->mode == MTM_MODE_pwbnl) {
00043                 assert(0 && "Aborts disabled for current mode pwbnl but want to abort.\n");
00044         }       
00045 #endif
00046 
00047         if (r == RESTART_REALLOCATE) {
00048                 assert(0 && "Currently we don't support extending the read/write set size");
00049         }
00050 
00051         rollback_transaction(tx);
00052         cm_delay(tx);
00053         /* TODO: decide whether to transition to a different execution mode 
00054          * after a restart. For example, transition to serial mode
00055          */
00056 
00057         /* Reset field to restart transaction */
00058         pwb_prepare_transaction(tx);
00059 
00060         actions = a_runInstrumentedCode | a_restoreLiveVariables;
00061         //if ((tx->prop & pr_uninstrumentedCode) && (tx->status & TX_IRREVOCABLE)) {
00062         //      actions = a_runUninstrumentedCode | a_restoreLiveVariables;
00063         //}     
00064         
00065         mtm_longjmp (&tx->jb, actions);
00066 }
00067 
00068 

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