メインページ | モジュール | 名前空間一覧 | クラス階層 | 構成 | ファイル一覧 | 名前空間メンバ | 構成メンバ | ファイルメンバ | 関連ページ

toppers/complement.hpp

解説を見る。
00001 /*
00002  *  TOPPERS/C++ API Template Library
00003  *      Toyohashi Open Platform for Embedded Real-Time Systems/
00004  *      C++ API Template Library
00005  *
00006  *  Copyright (C) 2004 by TAKAGI Nobuhisa
00007  *
00008  *  上記著作権者は,以下の (1)〜(4) の条件か,Free Software Foundation
00009  *  によって公表されている GNU General Public License の Version 2 に記
00010  *  述されている条件を満たす場合に限り,本ソフトウェア(本ソフトウェア
00011  *  を改変したものを含む.以下同じ)を使用・複製・改変・再配布(以下,
00012  *  利用と呼ぶ)することを無償で許諾する.
00013  *  (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作
00014  *      権表示,この利用条件および下記の無保証規定が,そのままの形でソー
00015  *      スコード中に含まれていること.
00016  *  (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使
00017  *      用できる形で再配布する場合には,再配布に伴うドキュメント(利用
00018  *      者マニュアルなど)に,上記の著作権表示,この利用条件および下記
00019  *      の無保証規定を掲載すること.
00020  *  (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使
00021  *      用できない形で再配布する場合には,次のいずれかの条件を満たすこ
00022  *      と.
00023  *    (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著
00024  *        作権表示,この利用条件および下記の無保証規定を掲載すること.
00025  *    (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに
00026  *        報告すること.
00027  *  (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損
00028  *      害からも,上記著作権者およびTOPPERSプロジェクトを免責すること.
00029  *
00030  *  本ソフトウェアは,無保証で提供されているものである.上記著作権者お
00031  *  よびTOPPERSプロジェクトは,本ソフトウェアに関して,その適用可能性も
00032  *  含めて,いかなる保証も行わない.また,本ソフトウェアの利用により直
00033  *  接的または間接的に生じたいかなる損害に関しても,その責任を負わない.
00034  *
00035  *  @(#) $Id: complement.hpp,v 1.1.1.1 2004/04/14 09:30:28 takagi-n Exp $
00036  */
00037 
00047 #ifndef TOPPERS_COMPLEMENT_HPP_
00048 #define TOPPERS_COMPLEMENT_HPP_
00049 
00050 #include <toppers/config.hpp>
00051 
00052 struct t_ctsk;
00053 struct t_rtsk;
00054 struct t_rtst;
00055 struct t_dtex;
00056 struct t_rtex;
00057 struct t_csem;
00058 struct t_rsem;
00059 struct t_cflg;
00060 struct t_rflg;
00061 struct t_cdtq;
00062 struct t_rdtq;
00063 struct t_cmbx;
00064 struct t_rmbx;
00065 struct t_msg;
00066 struct t_msg_pri;
00067 struct t_cmtx;
00068 struct t_rmtx;
00069 struct t_cmbf;
00070 struct t_rmbf;
00071 struct t_cpor;
00072 struct t_rpor;
00073 struct t_rrdv;
00074 struct t_cmpf;
00075 struct t_rmpf;
00076 struct t_cmpl;
00077 struct t_rmpl;
00078 struct t_ccyc;
00079 struct t_rcyc;
00080 struct t_calm;
00081 struct t_ralm;
00082 struct t_dovr;
00083 struct t_rovr;
00084 struct t_rsys;
00085 struct t_dinh;
00086 struct t_cisr;
00087 struct t_risr;
00088 struct t_dsvc;
00089 struct t_dexc;
00090 struct t_rcfg;
00091 struct t_rver;
00092 
00093 //  toppers_private 名前空間は、実装の都合上 toppers 名前空間にあってはならない
00094 //  ライブラリ要素を配置するために、ライブラリが内部的に使用する。
00095 //  ユーザがこの名前空間内の要素を直接使用してはならない。
00096 namespace toppers_private
00097 {
00098     struct large_type
00099     {
00100         ER fake1_;
00101         ER_ID fake2_;
00102         ER_UINT fake3_;
00103     };
00104 
00105     struct yes_type { char fake_; };
00106     struct no_type { char fake_[2]; };
00107 
00108     large_type (cre_tsk)(...);
00109     large_type (acre_tsk)(...);
00110     large_type (del_tsk)(...);
00111     large_type (sta_tsk)(...);
00112     void (exd_tsk)(int);
00113     large_type (ref_tsk)(...);
00114     large_type (ref_tst)(...);
00115     large_type (def_tex)(...);
00116     large_type (ref_tex)(...);
00117     large_type (cre_sem)(...);
00118     large_type (acre_sem)(...);
00119     large_type (del_sem)(...);
00120     large_type (ref_sem)(...);
00121     large_type (cre_flg)(...);
00122     large_type (acre_flg)(...);
00123     large_type (del_flg)(...);
00124     large_type (ref_flg)(...);
00125     large_type (cre_dtq)(...);
00126     large_type (acre_dtq)(...);
00127     large_type (del_dtq)(...);
00128     large_type (ref_dtq)(...);
00129     large_type (cre_mbx)(...);
00130     large_type (acre_mbx)(...);
00131     large_type (del_mbx)(...);
00132     large_type (ref_mbx)(...);
00133     large_type (cre_mtx)(...);
00134     large_type (acre_mtx)(...);
00135     large_type (del_mtx)(...);
00136     large_type (loc_mtx)(...);
00137     large_type (ploc_mtx)(...);
00138     large_type (tloc_mtx)(...);
00139     large_type (unl_mtx)(...);
00140     large_type (ref_mtx)(...);
00141     large_type (cre_mbf)(...);
00142     large_type (acre_mbf)(...);
00143     large_type (del_mbf)(...);
00144     large_type (snd_mbf)(...);
00145     large_type (psnd_mbf)(...);
00146     large_type (tsnd_mbf)(...);
00147     large_type (rcv_mbf)(...);
00148     large_type (prcv_mbf)(...);
00149     large_type (trcv_mbf)(...);
00150     large_type (ref_mbf)(...);
00151     large_type (cre_por)(...);
00152     large_type (acre_por)(...);
00153     large_type (del_por)(...);
00154     large_type (cal_por)(...);
00155     large_type (tcal_por)(...);
00156     large_type (acp_por)(...);
00157     large_type (pacp_por)(...);
00158     large_type (tacp_por)(...);
00159     large_type (fwd_por)(...);
00160     large_type (rpl_rdv)(...);
00161     large_type (ref_por)(...);
00162     large_type (ref_rdv)(...);
00163     large_type (cre_mpf)(...);
00164     large_type (acre_mpf)(...);
00165     large_type (del_mpf)(...);
00166     large_type (ref_mpf)(...);
00167     large_type (set_tim)(...);
00168     large_type (cre_mpl)(...);
00169     large_type (acre_mpl)(...);
00170     large_type (del_mpl)(...);
00171     large_type (get_mpl)(...);
00172     large_type (pget_mpl)(...);
00173     large_type (tget_mpl)(...);
00174     large_type (rel_mpl)(...);
00175     large_type (ref_mpl)(...);
00176     large_type (cre_cyc)(...);
00177     large_type (acre_cyc)(...);
00178     large_type (del_cyc)(...);
00179     large_type (ref_cyc)(...);
00180     large_type (cre_alm)(...);
00181     large_type (acre_alm)(...);
00182     large_type (del_alm)(...);
00183     large_type (sta_alm)(...);
00184     large_type (stp_alm)(...);
00185     large_type (ref_alm)(...);
00186     large_type (def_ovr)(...);
00187     large_type (sta_ovr)(...);
00188     large_type (stp_ovr)(...);
00189     large_type (ref_ovr)(...);
00190     large_type (ref_sys)(...);
00191     large_type (def_inh)(...);
00192     large_type (cre_isr)(...);
00193     large_type (acre_isr)(...);
00194     large_type (del_isr)(...);
00195     large_type (ref_isr)(...);
00196     large_type (dis_int)(...);
00197     large_type (ena_int)(...);
00198     large_type (chg_ims)(...);
00199     large_type (chg_ipm)(...);
00200     large_type (get_ixx)(...);
00201     large_type (get_ims)(...);
00202     large_type (get_ipm)(...);
00203     large_type (def_svc)(...);
00204     large_type (cal_svc)(...);
00205     large_type (def_exc)(...);
00206     large_type (ref_cfg)(...);
00207     large_type (ref_ver)(...);
00208     large_type (vxsns_ctx)(...);
00209     large_type (vxsns_loc)(...);
00210     large_type (vxsns_dsp)(...);
00211     large_type (vxsns_dpn)(...);
00212     large_type (vxsns_tex)(...);
00213     large_type (vxget_tim)(...);
00214     large_type (cal_svc)(...);
00215 
00216     yes_type test_svc(void (*)());
00217     yes_type test_svc(BOOL (*)());
00218     no_type test_svc(...);
00219 
00220 #if !defined(sta_ovr) && !defined(OVRTIM) && !defined(TOPPERS_HAS_OVRTIM)
00221 
00222     char (*test_ovrtim(ER (*)(ID, unsigned char)))[1];
00223     char (*test_ovrtim(ER (*)(ID, unsigned short)))[2];
00224     char (*test_ovrtim(ER (*)(ID, unsigned int)))[3];
00225     char (*test_ovrtim(ER (*)(ID, unsigned long)))[4];
00226 #ifdef  TOPPERS_LONG_LONG
00227     char (*test_ovrtim(ER (*)(ID, unsigned TOPPERS_LONG_LONG)))[5];
00228 #endif
00229     char (*test_ovrtim(...))[6];
00230 
00231     template <int> struct typeof_ovrtim { typedef UINT type; };
00232     template <> struct typeof_ovrtim<1> { typedef unsigned char type; };
00233     template <> struct typeof_ovrtim<2> { typedef unsigned short type; };
00234     template <> struct typeof_ovrtim<3> { typedef unsigned int type; };
00235     template <> struct typeof_ovrtim<4> { typedef unsigned long type; };
00236 #ifdef  TOPPERS_LONG_LONG
00237     template <> struct typeof_ovrtim<5> { typedef unsigned TOPPERS_LONG_LONG type; };
00238 #endif
00239 
00240 #endif
00241 
00242 #if !defined(chg_ims) && !defined(IMS) && !defined(TOPPERS_HAS_IMS)
00243 
00244     char (*test_chg_ims(ER (*)(unsigned char)))[1];
00245     char (*test_chg_ims(ER (*)(unsigned short)))[2];
00246     char (*test_chg_ims(ER (*)(unsigned int)))[3];
00247     char (*test_chg_ims(ER (*)(unsigned long)))[4];
00248 #ifdef  TOPPERS_LONG_LONG
00249     char (*test_chg_ims(ER (*)(unsigned TOPPERS_LONG_LONG)))[5];
00250 #endif
00251     char (*test_chg_ims(...))[6];
00252 
00253     template <int> struct typeof_ims { typedef UINT type; };
00254     template <> struct typeof_ims<1> { typedef unsigned char type; };
00255     template <> struct typeof_ims<2> { typedef unsigned short type; };
00256     template <> struct typeof_ims<3> { typedef unsigned int type; };
00257     template <> struct typeof_ims<4> { typedef unsigned long type; };
00258 #ifdef  TOPPERS_LONG_LONG
00259     template <> struct typeof_ims<5> { typedef unsigned TOPPERS_LONG_LONG type; };
00260 #endif
00261 
00262 #endif
00263 
00264 #if !defined(vxget_tim) && !defined(SYSUTIM) && !defined(TOPPERS_HAS_SYSUTIM)
00265 
00266     char (*test_vxget_tim(ER (*)(unsigned char*)))[1];
00267     char (*test_vxget_tim(ER (*)(unsigned short*)))[2];
00268     char (*test_vxget_tim(ER (*)(unsigned int*)))[3];
00269     char (*test_vxget_tim(ER (*)(unsigned long*)))[4];
00270 #ifdef  TOPPERS_LONG_LONG
00271     char (*test_vxget_tim(ER (*)(unsigned TOPPERS_LONG_LONG*)))[5];
00272 #endif
00273     char (*test_vxget_tim(...))[6];
00274 
00275     template <int> struct typeof_sysutim { typedef UINT type; };
00276     template <> struct typeof_sysutim<1> { typedef unsigned char type; };
00277     template <> struct typeof_sysutim<2> { typedef unsigned short type; };
00278     template <> struct typeof_sysutim<3> { typedef unsigned int type; };
00279     template <> struct typeof_sysutim<4> { typedef unsigned long type; };
00280 #ifdef  TOPPERS_LONG_LONG
00281     template <> struct typeof_sysutim<5> { typedef unsigned TOPPERS_LONG_LONG type; };
00282 #endif
00283 
00284 #endif
00285 
00286 #ifndef TBIT_RDVPTN
00287     typedef UINT    RDVPTN;
00288     typedef INT     RDVNO;
00289 #endif
00290 
00291 }
00292 
00293 namespace toppers
00294 {
00295 
00296     using namespace toppers_private;
00297 
00298 #if !defined(sta_ovr) && !defined(OVRTIM) && !defined(TOPPERS_HAS_OVRTIM)
00299     typedef typeof_ovrtim<sizeof *test_ovrtim(&sta_ovr)>::type OVRTIM;
00300 #endif
00301 
00302 #if !defined(chg_ims) && !defined(IMS) && !defined(TOPPERS_HAS_IMS)
00303     typedef typeof_ims<sizeof *test_chg_ims(&chg_ims)>::type IMS;
00304 #endif
00305 
00306 #if !defined(vxget_tim) && !defined(SYSUTIM) && !defined(TOPPERS_HAS_SYSUTIM)
00307     typedef typeof_sysutim<sizeof *test_vxget_tim(&vxget_tim)>::type SYSUTIM;
00308 #endif
00309 
00310 #ifndef INHNO
00311     typedef UINT    INHNO;
00312 #endif
00313 #ifndef INTNO
00314     typedef UINT    INTNO;
00315 #endif
00316 }
00317 
00318 #endif  // ! TOPPERS_COMPLEMENT_HPP_