-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathNexRvInfo.h
44 lines (36 loc) · 1.9 KB
/
NexRvInfo.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
* Copyright (c) 2020 IAR Systems AB.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//****************************************************************************
// File NexRvInfo.h - Instruction information access
#ifndef NEXRVINFO_H
#define NEXRVINFO_H
#include <stdint.h> // For uint32_t and uint64_t
#define INFO_LINEAR 0x1 // Linear (plain instruction or not taken BRANCH)
#define INFO_4 0x2 // If not 4, it must be 2 on RISC-V
// 0x4 // Reserved (for exception or so ...)
#define INFO_INDIRECT 0x8 // Possible for most types above
#define INFO_BRANCH 0x10 // Always direct on RISC-V (may have LINEAR too)
#define INFO_JUMP 0x20 // Direct or indirect
#define INFO_CALL 0x40 // Direct or indirect (and always a jump)
#define INFO_RET 0x80 // Return (always indirect and always a jump)
typedef uint64_t InfoAddr;
extern int InfoParse(const char *t, InfoAddr *pAddr, uint32_t *pInfo, InfoAddr *pDest);
extern int InfoInit(const char *filename);
extern unsigned int InfoGet(InfoAddr addr, InfoAddr *pDest);
extern void InfoTerm(void);
#endif // NEXRVINFO_H
//****************************************************************************
// End of NexRvInfo.h file