1 /*****************************************************************************
2 Copyright(c) 2010 YokogawaDigitalComputer Corporation
3 µ¡Ç½¡§¥·¥¹¥Æ¥à¥Þ¥¯¥í¥È¥ì¡¼¥¹¥«¡¼¥Í¥ë¥é¥ó¥É¥é¥¤¥Ö¥é¥ê
8 +-------------- ÍúÎòÈÖ¹æ (000 ¡Á 999)
9 | +--------- ½¤Àµ¤·¤Æ¤¤¤ë¥·¥¹¥Æ¥à¥Ð¡¼¥¸¥ç¥ó
10 | | +--- ¿·µ¬¡¢Êѹ¹¡¢Äɲᢺï½ü¤ÎʬÎà
12 No Ver ʬÎà ǯ·îÆü ̾Á° ÀâÌÀ
13 ---+-----+----+----------+-------------+--------------------------------------
14 000 00.00 ¿·µ¬ 2010/06/22 S.Tonoshita ¿·µ¬³«È¯
15 *****************************************************************************/
22 #define _SMT_OK 0 // Àµ¾ï½ªÎ»
23 #define _SMT_NG -1 // °Û¾ï½ªÎ»
25 /******* ¥Ç¥Ð¥Ã¥°¥×¥ê¥ó¥È½ÐÎÏ¥ì¥Ù¥ëÀßÄê ½é´üÃÍ ******/
30 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
31 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
32 |L|L|L|L|L|L|L|L|L|L|L|L|L|L|L|L|
33 |V|V|V|V|V|V|V|V|V|V|V|V|V|V|V|V|
34 |1|1|1|1|1|1| | | | | | | | | | |
35 |5|4|3|2|1|0|9|8|7|6|5|4|3|2|1|0|
36 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
39 NOTE: ³Æbit¤¬SMT¥Ç¥Ð¥Ã¥°Ê¸¤Î¥ì¥Ù¥ë¤ËÂбþ¤·¡¢Âбþ¤¹¤ë¥ì¥Ù¥ë¤ò¥Þ¥¹¥¯¤¹¤ë
42 Îã1.Á´¤Æ¤Î¥Ç¥Ð¥Ã¥°Ê¸¥ì¥Ù¥ë¤ò½ÐÎϤ¹¤ë
43 #define SMT_LV_MSK 0x0000
45 Îã2.¥ì¥Ù¥ë4°Ê¾å¤Î¤ß½ÐÎϤ¹¤ë
46 #define SMT_LV_MSK 0x000F
48 Îã3.¥ì¥Ù¥ë2¤È¥ì¥Ù¥ë8¤Î¤ß½ÐÎϤ¹¤ë
49 #define SMT_LV_MSK 0xFEFB
52 #define SMT_LV_MSK 0x0000
54 /****** ¥Ç¥Ð¥Ã¥°´Ø¿ô̵¸ú²½ÀßÄê ******/
55 /* °Ê²¼¤ÎÄêµÁ¤ò¹Ô¤¦¤È¥Ç¥Ð¥Ã¥°´Ø¿ô¤¬Ìµ¸ú¤È¤Ê¤ë
56 ¡¦Á´¥Ç¥Ð¥Ã¥°½ÐÎϤò̵¸ú²½
58 ¡¦¥Ý¡¼¥È½ÐÎÏ´Ø¿ô¤ò̵¸ú²½
60 ¡¦¥×¥ê¥ó¥È·Ï´Ø¿ô¤ò̵¸ú²½
61 #define _SMT_PRINT_DIS */
63 #if !defined(_SMT_PORT_DIS) && !defined(_SMT_ALL_DIS)
64 #define _SMT_PORTOUT _SMT_PortOut
65 #else // _SMT_PORT_DIS
66 #define _SMT_PORTOUT 1 ? (void)0 : _SMT_PortOut
67 #endif // _SMT_PORT_DIS
69 #if !defined(_SMT_PRINT_DIS) && !defined(_SMT_ALL_DIS)
70 #define _SMT_PRINTF _SMT_printf
71 #define _SMT_PUTS _SMT_puts
72 #define _SMT_USRMSGTAG0 _SMT_UsrMsgTag0
73 #define _SMT_USRMSGTAG1 _SMT_UsrMsgTag1
74 #define _SMT_USRMSGTAG2 _SMT_UsrMsgTag2
75 #define _SMT_USRMSGTAG3 _SMT_UsrMsgTag3
76 #define _SMT_USRMSGTAG4 _SMT_UsrMsgTag4
77 #else // _SMT_PRINT_DIS
78 #define _SMT_PRINTF 1 ? (void)0 : _SMT_printf
79 #define _SMT_PUTS 1 ? (void)0 : _SMT_puts
80 #define _SMT_USRMSGTAG0 1 ? (void)0 : _SMT_UsrMsgTag0
81 #define _SMT_USRMSGTAG1 1 ? (void)0 : _SMT_UsrMsgTag1
82 #define _SMT_USRMSGTAG2 1 ? (void)0 : _SMT_UsrMsgTag2
83 #define _SMT_USRMSGTAG3 1 ? (void)0 : _SMT_UsrMsgTag3
84 #define _SMT_USRMSGTAG4 1 ? (void)0 : _SMT_UsrMsgTag4
85 #endif // _SMT_PRINT_DIS
87 #if !defined(_SMT_OS_DIS) && !defined(_SMT_ALL_DIS)
88 #define _SMT_OSSWITCH_PROCESS _SMT_OsSwitch_Process
89 #define _SMT_OSSWITCH_THREADPROCESS _SMT_OsSwitch_ThreadProcess
90 #define _SMT_OSSWITCH_PROCESS_NAME _SMT_OsSwitch_Process_Name
91 #define _SMT_OSSWITCH_THREADPROCESS_NAME _SMT_OsSwitch_ThreadProcess_Name
92 #define _SMT_OSSWITCH_IRQ_IN _SMT_OsSwitch_Irq_in
93 #define _SMT_OSSWITCH_IRQ_OUT _SMT_OsSwitch_Irq_out
94 #define _SMT_OSSWITCH_IDLE _SMT_OsSwitch_Idle
95 #define _SMT_OSCALL0 _SMT_OsCall0
96 #define _SMT_OSCALL1 _SMT_OsCall1
97 #define _SMT_OSCALL2 _SMT_OsCall2
98 #define _SMT_OSCALL3 _SMT_OsCall3
99 #define _SMT_OSCALL4 _SMT_OsCall4
100 #define _SMT_OSCALL5 _SMT_OsCall5
101 #define _SMT_OSCALL6 _SMT_OsCall6
102 #define _SMT_OSCALL7 _SMT_OsCall7
103 #define _SMT_OSCALL8 _SMT_OsCall8
104 #define _SMT_OSCALL9 _SMT_OsCall9
105 #define _SMT_OSCALL10 _SMT_OsCall10
106 #define _SMT_OSCALL11 _SMT_OsCall11
107 #define _SMT_OSCALL12 _SMT_OsCall12
108 #define _SMT_OSCALL13 _SMT_OsCall13
109 #define _SMT_OSCALL14 _SMT_OsCall14
110 #define _SMT_OSCALL15 _SMT_OsCall15
111 #define _SMT_OSCALL16 _SMT_OsCall16
113 #define _SMT_OSSWITCH_PROCESS 1 ? (void)0 : _SMT_OsSwitch_Process
114 #define _SMT_OSSWITCH_THREADPROCESS 1 ? (void)0 : _SMT_OsSwitch_ThreadProcess
115 #define _SMT_OSSWITCH_PROCESS_NAME 1 ? (void)0 : _SMT_OsSwitch_Process_Name
116 #define _SMT_OSSWITCH_THREADPROCESS_NAME 1 ? (void)0 : _SMT_OsSwitch_ThreadProcess_Name
117 #define _SMT_OSSWITCH_IRQ_IN 1 ? (void)0 : _SMT_OsSwitch_Irq_in
118 #define _SMT_OSSWITCH_IRQ_OUT 1 ? (void)0 : _SMT_OsSwitch_Irq_out
119 #define _SMT_OSSWITCH_IDLE 1 ? (void)0 : _SMT_OsSwitch_Idle
120 #define _SMT_OSCALL0 1 ? (void)0 : _SMT_OsCall0
121 #define _SMT_OSCALL1 1 ? (void)0 : _SMT_OsCall1
122 #define _SMT_OSCALL2 1 ? (void)0 : _SMT_OsCall2
123 #define _SMT_OSCALL3 1 ? (void)0 : _SMT_OsCall3
124 #define _SMT_OSCALL4 1 ? (void)0 : _SMT_OsCall4
125 #define _SMT_OSCALL5 1 ? (void)0 : _SMT_OsCall5
126 #define _SMT_OSCALL6 1 ? (void)0 : _SMT_OsCall6
127 #define _SMT_OSCALL7 1 ? (void)0 : _SMT_OsCall7
128 #define _SMT_OSCALL8 1 ? (void)0 : _SMT_OsCall8
129 #define _SMT_OSCALL9 1 ? (void)0 : _SMT_OsCall9
130 #define _SMT_OSCALL10 1 ? (void)0 : _SMT_OsCall10
131 #define _SMT_OSCALL11 1 ? (void)0 : _SMT_OsCall11
132 #define _SMT_OSCALL12 1 ? (void)0 : _SMT_OsCall12
133 #define _SMT_OSCALL13 1 ? (void)0 : _SMT_OsCall13
134 #define _SMT_OSCALL14 1 ? (void)0 : _SMT_OsCall14
135 #define _SMT_OSCALL15 1 ? (void)0 : _SMT_OsCall15
136 #define _SMT_OSCALL16 1 ? (void)0 : _SMT_OsCall16
141 // ¥Ý¡¼¥È¥µ¥¤¥ºÀßÄêÃÍ
144 _SMT_PSZ64 = 0, // 64BitÉý¡Ê̤»ÈÍÑ¡Ë
146 _SMT_PSZ16, // 16BitÉý
147 _SMT_PSZ32 // 32BitÉý
154 _SMT_PW = 0, // Write¥¢¥¯¥»¥¹
155 _SMT_PR // Read¥¢¥¯¥»¥¹
160 _SMT_OS_ATTR_CALL = 0,
166 #endif // __cplusplus
167 int _SMT_GetDebugLevel( void );
168 void _SMT_SetDebugLevel( int level );
169 void _SMT_IntrruptInit(void);
170 void _SMT_IntrruptEnable(void);
171 void _SMT_IntrruptDisable(void);
174 #endif // __cplusplus
176 /* ´Ø¿ô¥×¥í¥È¥¿¥¤¥×Àë¸À *****************************************************/
177 extern int (*_SMT_PortOut)(unsigned long addr,unsigned long data,_SMT_PSZ size,_SMT_PRW rw);
178 extern int (*_SMT_Printf)(int level,const char *format , ...);
179 extern int (*_SMT_Puts)(int level,const char *s);
180 extern int (*_SMT_UsrMsgTag0)(int level,unsigned long TagNum);
181 extern int (*_SMT_UsrMsgTag1)(int level,unsigned long TagNum,unsigned long arg1);
182 extern int (*_SMT_UsrMsgTag2)(int level,unsigned long TagNum,unsigned long arg1,unsigned long arg2);
183 extern int (*_SMT_UsrMsgTag3)(int level,unsigned long TagNum,unsigned long arg1,unsigned long arg2,unsigned long arg3);
184 extern int (*_SMT_UsrMsgTag4)(int level,unsigned long TagNum,unsigned long arg1,unsigned long arg2,unsigned long arg3,unsigned long arg4);
185 extern int (*_SMT_OsSwitch_Process)(unsigned long processid);
186 extern int (*_SMT_OsSwitch_ThreadProcess)(unsigned long threadid,unsigned long processid);
187 extern int (*_SMT_OsSwitch_Process_Name)(unsigned long processid,const char *str);
188 extern int (*_SMT_OsSwitch_ThreadProcess_Name)(unsigned long threadid,unsigned long processid,const char *tname,const char *pname);
189 extern int (*_SMT_OsSwitch_Irq_in)(unsigned long irqid);
190 extern int (*_SMT_OsSwitch_Irq_out)(unsigned long irqid);
191 extern int (*_SMT_OsSwitch_Idle)( void );
192 extern int (*_SMT_OsCall0)(int osc,_SMT_OS_CALL attr);
193 extern int (*_SMT_OsCall1)(int osc,_SMT_OS_CALL attr,unsigned long arg1);
194 extern int (*_SMT_OsCall2)(int osc,_SMT_OS_CALL attr,unsigned long arg1,unsigned long arg2);
195 extern int (*_SMT_OsCall3)(int osc,_SMT_OS_CALL attr,unsigned long arg1,unsigned long arg2,unsigned long arg3);
196 extern int (*_SMT_OsCall4)(int osc,_SMT_OS_CALL attr,unsigned long arg1,unsigned long arg2,unsigned long arg3,unsigned long arg4);
197 extern int (*_SMT_OsCall5)(int osc,_SMT_OS_CALL attr,unsigned long arg1,unsigned long arg2,unsigned long arg3,unsigned long arg4,unsigned long arg5);
198 extern int (*_SMT_OsCall6)(int osc,_SMT_OS_CALL attr,unsigned long arg1,unsigned long arg2,unsigned long arg3,unsigned long arg4,unsigned long arg5,unsigned long arg6);
199 extern int (*_SMT_OsCall7)(int osc,_SMT_OS_CALL attr,unsigned long arg1,unsigned long arg2,unsigned long arg3,unsigned long arg4,unsigned long arg5,unsigned long arg6,unsigned long arg7);
200 extern int (*_SMT_OsCall8)(int osc,_SMT_OS_CALL attr,unsigned long arg1,unsigned long arg2,unsigned long arg3,unsigned long arg4,unsigned long arg5,unsigned long arg6,unsigned long arg7,unsigned long arg8);
201 extern int (*_SMT_OsCall9)(int osc,_SMT_OS_CALL attr,unsigned long arg1,unsigned long arg2,unsigned long arg3,unsigned long arg4,unsigned long arg5,unsigned long arg6,unsigned long arg7,unsigned long arg8,unsigned long arg9);
202 extern int (*_SMT_OsCall10)(int osc,_SMT_OS_CALL attr,unsigned long arg1,unsigned long arg2,unsigned long arg3,unsigned long arg4,unsigned long arg5,unsigned long arg6,unsigned long arg7,unsigned long arg8,unsigned long arg9,unsigned long arg10);
203 extern int (*_SMT_OsCall11)(int osc,_SMT_OS_CALL attr,unsigned long arg1,unsigned long arg2,unsigned long arg3,unsigned long arg4,unsigned long arg5,unsigned long arg6,unsigned long arg7,unsigned long arg8,unsigned long arg9,unsigned long arg10,unsigned long arg11);
204 extern int (*_SMT_OsCall12)(int osc,_SMT_OS_CALL attr,unsigned long arg1,unsigned long arg2,unsigned long arg3,unsigned long arg4,unsigned long arg5,unsigned long arg6,unsigned long arg7,unsigned long arg8,unsigned long arg9,unsigned long arg10,unsigned long arg11,unsigned long arg12);
205 extern int (*_SMT_OsCall13)(int osc,_SMT_OS_CALL attr,unsigned long arg1,unsigned long arg2,unsigned long arg3,unsigned long arg4,unsigned long arg5,unsigned long arg6,unsigned long arg7,unsigned long arg8,unsigned long arg9,unsigned long arg10,unsigned long arg11,unsigned long arg12,unsigned long arg13);
206 extern int (*_SMT_OsCall14)(int osc,_SMT_OS_CALL attr,unsigned long arg1,unsigned long arg2,unsigned long arg3,unsigned long arg4,unsigned long arg5,unsigned long arg6,unsigned long arg7,unsigned long arg8,unsigned long arg9,unsigned long arg10,unsigned long arg11,unsigned long arg12,unsigned long arg13,unsigned long arg14);
207 extern int (*_SMT_OsCall15)(int osc,_SMT_OS_CALL attr,unsigned long arg1,unsigned long arg2,unsigned long arg3,unsigned long arg4,unsigned long arg5,unsigned long arg6,unsigned long arg7,unsigned long arg8,unsigned long arg9,unsigned long arg10,unsigned long arg11,unsigned long arg12,unsigned long arg13,unsigned long arg14,unsigned long arg15);
208 extern int (*_SMT_OsCall16)(int osc,_SMT_OS_CALL attr,unsigned long arg1,unsigned long arg2,unsigned long arg3,unsigned long arg4,unsigned long arg5,unsigned long arg6,unsigned long arg7,unsigned long arg8,unsigned long arg9,unsigned long arg10,unsigned long arg11,unsigned long arg12,unsigned long arg13,unsigned long arg14,unsigned long arg15,unsigned long arg16);
211 #endif /* __SMTAPI_H__ */