構造体 toppers::itron::jsp::exception_policy

CPU例外のためのポリシークラス [詳細]

#include "toppers/itron/jsp/exception.hpp"

toppers::itron::jsp::exception_policyに対する継承グラフ

Inheritance graph
[凡例]
toppers::itron::jsp::exception_policyのコラボレーション図

Collaboration graph
[凡例]
すべてのメンバ一覧

Public 型

enum  { use_id_ = 0 }
 specified_object<Plociy> クラスが要求する Policy::use_id_ 定数 [詳細]

Static Public メソッド

static void generate_assertions (const kernel_cfg &cfg, std::ostream &ostr)
 パラメータチェックコード の生成
static bool verify (const static_api &api, kernel_object &obj)
 specified_object<Plociy> クラスが要求する Policy::verify 関数
static bool check (const itron::kernel_chk &chk, const s_record &srec, const nm_symbol &syms)
 リンク後のパラメータチェック

Static Public 変数

static const char name_ [] = "exception"
static const char symbol_ [] = "exc"
static const char *const apis_ [] = { "DEF_EXC", 0 }
static const char *const params_ [] = { "%excno { #excatr exchdr }" }
static const char region_format_ [] = "CFG_EXCHDR_ENTRY(@exchdr);\n"
static const char init_format_ [] = "\t{ @%excno, @#excatr, (FP)CFG_EXC_ENTRY(@exchdr) }"

説明

CPU例外のためのポリシークラス

このクラスで実現される静的API

  DEF_EXC( EXCNO excno, { ATR excatr, { ATR excatr, FP exchdr } );

excno は kernel_object において、便宜的にID番号として扱われます。

exception.hpp80 行で定義されています。


列挙型

anonymous enum
 

specified_object<Plociy> クラスが要求する Policy::use_id_ 定数

kernel_object_policy_base クラスでは true に定義しています。 ID番号ではなく、オブジェクト番号を使用する場合は、kernel_object_policy_base から継承したクラスで同名のメンバを再定義してください。

toppers::itron::kernel_object_policy_baseを再定義しています。

exception.hpp85 行で定義されています。

00085 { use_id_ = 0 };


関数

bool toppers::itron::jsp::exception_policy::check const itron::kernel_chk chk,
const s_record srec,
const nm_symbol syms
[static]
 

リンク後のパラメータチェック

引数:
chk チェック情報
srec ロードモジュールのダンプ情報
syms シンボルテーブル

toppers::itron::kernel_object_policy_baseを再定義しています。

exception.cpp99 行で定義されています。

参照先 toppers::nm_symbol::entry::addresstoppers::nm_symbol::find()toppers::itron::kernel_chk::get()toppers::nm_symbol::entry::type.

00100       {
00101         nm_symbol::entry entry = syms.find( "_kernel_excinib_table" );
00102         if ( entry.type < 0 )
00103         {
00104           return false;
00105         }
00106         long tnum_cycid = chk.get( kernel_chk::countof_EXCNO );
00107         long sizeof_FP = chk.get( kernel_chk::sizeof_FP );
00108         long sizeof_EXCINIB = chk.get( kernel_chk::sizeof_EXCINIB );
00109         long offsetof_EXCINIB_cychdr = chk.get( kernel_chk::offsetof_EXCINIB_exchdr );
00110 
00111         for ( int i = 0; i < tnum_cycid; i++ )
00112         {
00113           unsigned long value = 0;
00114           for ( int j = 0; j < sizeof_FP; j++ )
00115           {
00116             int t = srec[entry.address + sizeof_EXCINIB*i + offsetof_EXCINIB_cychdr + j];
00117             if ( t < 0 )
00118             {
00119               return false;
00120             }
00121             value = ( value << 8 ) | ( t & 0xff );
00122           }
00123           if ( value == 0 )
00124           {
00125             error( _( "start address of CPU exception #%1% handler is null" ) % ( i + 1 ) );
00126           }
00127         }
00128         return true;
00129       }

関数の呼び出しグラフ:

void toppers::itron::jsp::exception_policy::generate_assertions const kernel_cfg cfg,
std::ostream &  ostr
[static]
 

パラメータチェックコード の生成

引数:
cfg kernel_cfg.c 生成情報
ostr 出力ストリーム

toppers::itron::kernel_object_policy_baseを再定義しています。

exception.cpp59 行で定義されています。

参照先 toppers::kernel_cfg::get_inib_array()name_.

00060       {
00061         const kernel_cfg::inib_array* pinibs = cfg.get_inib_array( name_ );
00062         static const char pattern[] = 
00063           "#if (@#excatr) != 0x00u\n"
00064           "#error \"`excatr\' of CPU exception handler `@name\' is not 0\"\n"
00065           "#endif\n"
00066           "__CFG_ASSERT((@#excatr) == 0x00u);\n"
00067           "\n";
00068         std::transform( pinibs->begin(), pinibs->end(), std::ostream_iterator<std::string>( ostr ), generator( pattern ) );
00069       }

関数の呼び出しグラフ:

bool toppers::itron::jsp::exception_policy::verify const static_api api,
kernel_object obj
[static]
 

specified_object<Plociy> クラスが要求する Policy::verify 関数

引数:
api 解析対象の静的API情報
obj カーネルオブジェクト情報
戻り値:
判定結果が正常であれば true を返す。

toppers::itron::kernel_object_policy_baseを再定義しています。

exception.cpp77 行で定義されています。

参照先 _toppers::itron::kernel_object::get()toppers::warning().

00078       {
00079         try
00080         {
00081           if ( boost::lexical_cast<long>( obj.get( "%excno" ) ) < 0 )
00082           {
00083             warning( _( "parameter `%1%\' is negative" ) % "excno" );
00084           }
00085         }
00086         catch ( boost::bad_lexical_cast& )
00087         {
00088           // excnoは必ずしも整数定数ではないので、例外が発生しても特に問題はない
00089         }
00090         return true;
00091       }

関数の呼び出しグラフ:


この構造体の説明は次のファイルから生成されました:
Copyright © 2006 by TAKAGI Nobuhisa.
このページは Wed Apr 12 16:32:07 2006 に Doxygen によって生成されました。