• Main Page
  • Related Pages
  • Modules
  • Data Structures
  • Files
  • File List
  • Globals

sst/elements/genericProc/FE/ppcFrontEnd/ppcLoader.h

00001 // Copyright 2007 Sandia Corporation. Under the terms
00002 // of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S.
00003 // Government retains certain rights in this software.
00004 // 
00005 // Copyright (c) 2005-2007, Sandia Corporation
00006 // All rights reserved.
00007 // Copyright (c) 2003-2005, University of Notre Dame
00008 // All rights reserved.
00009 // 
00010 // This file is part of the SST software package. For license
00011 // information, see the LICENSE file in the top level directory of the
00012 // distribution.
00013 
00014 
00015 #ifndef PPCLOADER_H_
00016 #define PPCLOADER_H_
00017 
00018 #include "ppcFront.h"
00019 
00020 #include "mach-o/loader.h"
00021 
00022 //#define NULL 0
00023 
00024 
00025 //:Loads PPC/Mach-O executable into memory
00026 //!SEC:ppcFront
00027 class ppcLoader
00028 {
00029   static char* copyBuf;
00030   static uint bufSize;
00031   static FILE *lle;
00032   static int  execFD;
00033   static bool CopyToTEXT(simAddress dest, void* source, int Bytes);
00034   static bool loadUnixThread(const mach_header *mh, 
00035                              const thread_command* lcs,
00036                              const vector<ppcThread*> &p);
00037   static bool performLoadCommands(const mach_header *Mh,
00038                                   const load_command *lcs,
00039                                   const vector<ppcThread*> &p,
00040                                   const bool subset);
00041   static bool loadSegment(const mach_header *mh,
00042                           const segment_command *lcs,
00043                           const vector<ppcThread*> &p,
00044                           const bool subset);
00045   static bool loadSections(const mach_header *mh,
00046                            const segment_command *lcs,
00047                            bool isExec,
00048                            const bool subset);
00049   static bool getHeader(simAddress*, simRegister[32]);
00050   static bool readRegion();
00051   static bool initLLEThreads(const simAddress, const simRegister[32],
00052                              const vector<ppcThread*> &p);
00053 public:
00054   //: location of constructor section of the header
00055   static simAddress constrLoc;
00056   //: length of constructor section
00057   static simAddress constrSize;
00058   //: subset info
00059   static vector<processor*> *subProc;
00060   //: subset info
00061   static vector<simPID> *subPID;
00062   //: processor to load
00063   static processor *theProc;
00064   static bool LoadFromDevice(int        fd,
00065                              const vector<ppcThread*>   &p,
00066                              processor *proc,
00067                              char       **argv = NULL,
00068                              char       **argp = NULL,
00069                              bool subset=0);
00070   static bool LoadFromDevice(const char *Filename,
00071                              const vector<ppcThread*>   &p,
00072                              processor *proc,
00073                              char       **argv = NULL,
00074                              char       **argp = NULL,
00075                              bool subset=0);
00076   static bool LoadLLE(const char        *Filename,
00077                       const vector<ppcThread*>  &p,
00078                       char      **argv = NULL,
00079                       char      **argp = NULL);
00080 };
00081 
00082 #endif
00083 

Generated on Fri Oct 22 2010 11:02:22 for SST by  doxygen 1.7.1