Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:24:09

0001 /*
0002  * Copyright (c) 2003-2006 The Regents of The University of Michigan
0003  * All rights reserved.
0004  *
0005  * Redistribution and use in source and binary forms, with or without
0006  * modification, are permitted provided that the following conditions are
0007  * met: redistributions of source code must retain the above copyright
0008  * notice, this list of conditions and the following disclaimer;
0009  * redistributions in binary form must reproduce the above copyright
0010  * notice, this list of conditions and the following disclaimer in the
0011  * documentation and/or other materials provided with the distribution;
0012  * neither the name of the copyright holders nor the names of its
0013  * contributors may be used to endorse or promote products derived from
0014  * this software without specific prior written permission.
0015  *
0016  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
0017  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
0018  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
0019  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
0020  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
0021  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
0022  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
0023  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
0024  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
0025  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
0026  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
0027  *
0028  * Authors: Nathan Binkert
0029  *          Ali Saidi
0030  */
0031 
0032 #ifndef __M5OP_H__
0033 #define __M5OP_H__
0034 
0035 #ifdef __cplusplus
0036 extern "C" {
0037 #endif
0038 
0039 #include <stdint.h>
0040 
0041 void arm(uint64_t address);
0042 void quiesce(void);
0043 void quiesceNs(uint64_t ns);
0044 void quiesceCycle(uint64_t cycles);
0045 uint64_t quiesceTime(void);
0046 uint64_t rpns(void);
0047 void wakeCPU(uint64_t cpuid);
0048 
0049 void m5_exit(uint64_t ns_delay);
0050 void m5_fail(uint64_t ns_delay, uint64_t code);
0051 uint64_t m5_initparam(void);
0052 void m5_checkpoint(uint64_t ns_delay, uint64_t ns_period);
0053 void m5_reset_stats(uint64_t ns_delay, uint64_t ns_period);
0054 void m5_dump_stats(uint64_t ns_delay, uint64_t ns_period);
0055 void m5_dumpreset_stats(uint64_t ns_delay, uint64_t ns_period);
0056 uint64_t m5_readfile(void *buffer, uint64_t len, uint64_t offset);
0057 uint64_t m5_writefile(void *buffer, uint64_t len, uint64_t offset, const char *filename);
0058 void m5_debugbreak(void);
0059 void m5_switchcpu(void);
0060 void m5_addsymbol(uint64_t addr, char *symbol);
0061 void m5_panic(void);
0062 void m5_work_begin(uint64_t workid, uint64_t threadid);
0063 void m5_work_end(uint64_t workid, uint64_t threadid);
0064 
0065 // These operations are for critical path annotation
0066 void m5a_bsm(char *sm, const void *id, int flags);
0067 void m5a_esm(char *sm);
0068 void m5a_begin(int flags, char *st);
0069 void m5a_end(void);
0070 void m5a_q(const void *id, char *q, int count);
0071 void m5a_dq(const void *id, char *q, int count);
0072 void m5a_wf(const void *id, char *q, char *sm, int count);
0073 void m5a_we(const void *id, char *q, char *sm, int count);
0074 void m5a_ws(const void *id, char *q, char *sm);
0075 void m5a_sq(const void *id, char *q, int count, int flags);
0076 void m5a_aq(const void *id, char *q, int count);
0077 void m5a_pq(const void *id, char *q, int count);
0078 void m5a_l(char *lsm, const void *id, char *sm);
0079 void m5a_identify(uint64_t id);
0080 uint64_t m5a_getid(void);
0081 
0082 #define M5_AN_FL_NONE   0x0
0083 #define M5_AN_FL_BAD    0x2
0084 #define M5_AN_FL_LINK   0x10
0085 #define M5_AN_FL_RESET  0x20
0086 
0087 #ifdef __cplusplus
0088 }
0089 #endif
0090 #endif // __M5OP_H__