19 #ifndef __FREEMASTER_TSA_H
20 #define __FREEMASTER_TSA_H
30 #define FMSTR_TSA_VERSION 2U
33 #define FMSTR_TSA_INFO_ENTRYTYPE_MASK 0x0003U
34 #define FMSTR_TSA_INFO_STRUCT 0x0000U
35 #define FMSTR_TSA_INFO_RO_VAR 0x0001U
36 #define FMSTR_TSA_INFO_MEMBER 0x0002U
37 #define FMSTR_TSA_INFO_RW_VAR 0x0003U
38 #define FMSTR_TSA_INFO_VAR_FLAG 0x0001U
39 #define FMSTR_TSA_INFO_RWV_FLAG 0x0002U
47 #ifndef FMSTR_TSATBL_STRPTR
48 #define FMSTR_TSATBL_STRPTR const char*
50 #ifndef FMSTR_TSATBL_STRPTR_CAST
51 #define FMSTR_TSATBL_STRPTR_CAST(x) ((FMSTR_TSATBL_STRPTR)(x))
53 #ifndef FMSTR_TSATBL_VOIDPTR
54 #define FMSTR_TSATBL_VOIDPTR const void*
56 #ifndef FMSTR_TSATBL_VOIDPTR_CAST
57 #define FMSTR_TSATBL_VOIDPTR_CAST(x) ((FMSTR_TSATBL_VOIDPTR)(x))
71 #ifndef FMSTR_USE_TSA_INROM
72 #define FMSTR_USE_TSA_INROM 0
74 #if FMSTR_USE_TSA_INROM
75 #define FMSTR_TSA_CDECL const
77 #define FMSTR_TSA_CDECL
83 #define FMSTR_TSA_FUNC(id) FMSTR_TsaGetTable_##id
84 #define FMSTR_TSA_FUNC_PROTO(id) const FMSTR_TSA_ENTRY* FMSTR_TSA_FUNC(id) (FMSTR_TSA_TSIZE* pTableSize)
86 #define FMSTR_TSA_TABLE_BEGIN(id) \
87 FMSTR_TSA_FUNC_PROTO(id); \
88 FMSTR_TSA_FUNC_PROTO(id) { \
89 static FMSTR_TSA_CDECL FMSTR_TSA_ENTRY fmstr_tsatable[] = {
92 #define FMSTR_TSA_INFO1(elem, flags) FMSTR_TSATBL_VOIDPTR_CAST(((sizeof(elem))<<2)|(flags))
93 #define FMSTR_TSA_INFO2(size, flags) FMSTR_TSATBL_VOIDPTR_CAST(((size)<<2)|(flags))
95 #define FMSTR_TSA_STRUCT(name) \
96 { FMSTR_TSATBL_STRPTR_CAST(#name), FMSTR_TSATBL_STRPTR_CAST(NULL), FMSTR_TSATBL_VOIDPTR_CAST(NULL), FMSTR_TSA_INFO1(name, FMSTR_TSA_INFO_STRUCT) },
98 #define FMSTR_TSA_MEMBER(parenttype,name,type) \
99 { FMSTR_TSATBL_STRPTR_CAST(#name), FMSTR_TSATBL_STRPTR_CAST(type), FMSTR_TSATBL_VOIDPTR_CAST(&((parenttype*)0)->name), FMSTR_TSA_INFO1(((parenttype*)0)->name, FMSTR_TSA_INFO_MEMBER) },
101 #define FMSTR_TSA_RO_VAR(name,type) \
102 { FMSTR_TSATBL_STRPTR_CAST(#name), FMSTR_TSATBL_STRPTR_CAST(type), FMSTR_TSATBL_VOIDPTR_CAST(&(name)), FMSTR_TSA_INFO1(name, FMSTR_TSA_INFO_RO_VAR) },
104 #define FMSTR_TSA_RW_VAR(name,type) \
105 { FMSTR_TSATBL_STRPTR_CAST(#name), FMSTR_TSATBL_STRPTR_CAST(type), FMSTR_TSATBL_VOIDPTR_CAST(&(name)), FMSTR_TSA_INFO1(name, FMSTR_TSA_INFO_RW_VAR) },
107 #define FMSTR_TSA_RO_MEM(name,type,addr,size) \
108 { FMSTR_TSATBL_STRPTR_CAST(#name), FMSTR_TSATBL_STRPTR_CAST(type), FMSTR_TSATBL_VOIDPTR_CAST(addr), FMSTR_TSA_INFO2(size, FMSTR_TSA_INFO_RO_VAR) },
110 #define FMSTR_TSA_RW_MEM(name,type,addr,size) \
111 { FMSTR_TSATBL_STRPTR_CAST(#name), FMSTR_TSATBL_STRPTR_CAST(type), FMSTR_TSATBL_VOIDPTR_CAST(addr), FMSTR_TSA_INFO2(size, FMSTR_TSA_INFO_RW_VAR) },
113 #define FMSTR_TSA_TABLE_END() }; \
114 if(pTableSize) *pTableSize = sizeof(fmstr_tsatable); \
115 return fmstr_tsatable; }
122 #define FMSTR_TSA_UINT8 "\xE0"
123 #define FMSTR_TSA_UINT16 "\xE1"
124 #define FMSTR_TSA_UINT32 "\xE2"
125 #define FMSTR_TSA_UINT64 "\xE3"
126 #define FMSTR_TSA_SINT8 "\xF0"
127 #define FMSTR_TSA_SINT16 "\xF1"
128 #define FMSTR_TSA_SINT32 "\xF2"
129 #define FMSTR_TSA_SINT64 "\xF3"
130 #define FMSTR_TSA_UFRAC16 "\xE5"
131 #define FMSTR_TSA_UFRAC32 "\xE6"
132 #define FMSTR_TSA_FRAC16 "\xF5"
133 #define FMSTR_TSA_FRAC32 "\xF6"
134 #define FMSTR_TSA_FLOAT "\xFA"
135 #define FMSTR_TSA_DOUBLE "\xFB"
138 #define FMSTR_TSA_USERTYPE(type) #type
141 #define FMSTR_TSA_MEMORY NULL
147 #define FMSTR_TSA_TABLE_LIST_BEGIN() \
148 const FMSTR_TSA_ENTRY* FMSTR_TsaGetTable(FMSTR_TSA_TINDEX nTableIndex, FMSTR_TSA_TSIZE* pTableSize) {
150 #define FMSTR_TSA_TABLE(id) \
151 if(!nTableIndex--) { \
152 FMSTR_TSA_FUNC_PROTO(id); \
153 return FMSTR_TSA_FUNC(id)(pTableSize); \
156 #define FMSTR_TSA_TABLE_LIST_END() \
unsigned short FMSTR_SIZE
Definition: freemaster.h:39
FMSTR_SIZE FMSTR_TSA_TINDEX
Definition: freemaster_tsa.h:42
Definition: freemaster_tsa.h:62
const FMSTR_TSA_ENTRY * FMSTR_TsaGetTable(FMSTR_TSA_TINDEX nTableIndex, FMSTR_TSA_TSIZE *pTableSize)
FMSTR_SIZE FMSTR_TSA_TSIZE
Definition: freemaster_tsa.h:43
unsigned char * FMSTR_ADDR
Definition: freemaster.h:38
FreeMASTER Driver main API header file, Kxx(40/60) platform.