-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaddrspace.c
More file actions
40 lines (34 loc) · 1.46 KB
/
Copy pathaddrspace.c
File metadata and controls
40 lines (34 loc) · 1.46 KB
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
/* addrspace.c */
/*****************************************************************************/
/* SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only */
/* */
/* AS */
/* */
/* Address Space enumeration */
/* */
/*****************************************************************************/
#include "strutil.h"
#include "addrspace.h"
const char *SegNames[SegCountPlusStruct] =
{
"NOTHING", "CODE", "DATA", "IDATA", "XDATA", "YDATA",
"BITDATA", "IO", "REG", "ROMDATA", "EEDATA", "STRUCT"
};
char SegShorts[SegCountPlusStruct] =
{
'-','C','D','I','X','Y','B','P','R','O','E','S'
};
/*!------------------------------------------------------------------------
* \fn addrspace_lookup(const char *p_name)
* \brief look up address space's name
* \param p_name name in source
* \return enum or SegCountPlusStruct if not found
* ------------------------------------------------------------------------ */
as_addrspace_t addrspace_lookup(const char *p_name)
{
as_addrspace_t res;
for (res = SegNone; res < SegCountPlusStruct; res++)
if (!as_strcasecmp(p_name, SegNames[res]))
break;
return res;
}