Feb 2, 2000 onl50t: デスクトップ Solaris 7 cc ドライバのテスト --- cc ドライバのデバッグ#06 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (http://www-online.kek.jp/~inoue/CAMAC/onl50t-sol7/ Desktop/debug-step05.txt) 高エネルギー加速器研究機構 素粒子原子核研究所 物理、オンライングループ 井上 栄二 (1). 現状確認 (A). SPARC CPU-50T、Solaris7 が届いた。 (B). FORCE,CPU-50(UltraSPARC-IIi 300MHz)、に Solaris 7 のシステムを インストールした。 (C). /etc の下のシステム設定の途中、同一SCSIケーブル上に narrow の ディスクと wide のディスクを混在してつないだらシステムが立ち 上がらなくなってしまった。 (D). wide のディスクを narrow のディスクに替えてもらった。 (E). FORCE,CPU-50(UltraSPARC-IIi 300MHz)、に Solaris 7 のシステムを 再インストールした。 (F). /etc の下の各設定、および /export/home の作成をやった。 (G). CPU-50T に Solaris7用の VMEドライバ、FRCvme-2.4.1 をインストール (H). onl50t に ccドライバを make load しようとしたが、64ビット対応に なっていないために組み込めない。 (I). Solaris7、32ビット・カーネルで onl50t を起動して camacドライバを 組み込んだ。 (J). onl50t、Solaris7 で 32ビット・カーネルの下での camacドライバの 動作確認をやった。 正常に実行できた。 (K). Solaris7、32ビット・カーネルの下で、シングルアクション、割り込み を実行した時のデータ転送速度は正常に測定できたが、ブロック転送の データ転送速度を測定時にシステムがフリーズしてしまった。 (L). 32ビットカーネルを使ってブロック転送を実行すると、複数ワードの データ転送時にフリーズすることがある、この時 camacドライバに制御 が移っていないことを確認した。 (M). ドライバプログラムを64ビット対応にするために必要な作業について調 べた。 (N). lintを使ってcamacドライバプログラムをチェック。 camacドライバを    ロード、アンロードできるようになった。 (O). 64ビット・カーネルの下での camacドライバの動作確認をやった。    シングルアクションR/W はNG。 LAM割り込み処理はNG。 ブロック転送は    確認していない。 (P). CGENC、CGENZ、CGENI、CREMIの実行は正常に実行できるようになった。 (2). ここでやるべきこと camac シングルアクション read/write の部分をチェックする。 (3). 現状確認 (3-1). camacシングルアクションread/write を実行時の記録 onl50t[217]% cam1 <--- 2917 のRUN LEDは一瞬点灯して消える正常。    camac バスディスプレーのZ、C は点灯する。 Input n a f (data)>3 0 0 N=3 A=0 F=0 Q=1 X=1 Data:000003(Hex) 00000003(Dec) <--- 3922 の BUSY LEDは一瞬点灯して消える正常。 camac バスディスプレーのX、Q のLEDは点灯 する。 2917 のRUN LEDは点灯したままに なる。 2917 のresetボタンを押してRUN LED    を消した。 Input n a f (data)>3 0 16 5 N=3 A=0 F=16 Q=1 X=1 Data:000005(Hex) 00000005(Dec) <--- BUSY LEDは何も変化しない。 NG. 2917 の RUN LEDは点灯したままになる。 Input n a f (data)>^Conl50t[218]% onl50t[40]% onl50t[40]% <<< cam1 起動時のメッセージ >>> onl50t[40]% onl50t[40]% Jan 25 16:36:13 onl50t unix: NOTICE: cc_open: debug step03. --- CC _INT_AUTO_CLEAR is 4 bytes Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_open: debug step03. --- intrpri is 2 b ytes Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode is 2 bytes Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode = 0x 0 Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf is 2 bytes Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf = 0x3 c01 Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step03. --- unit is 4 byt es Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step03. --- unit = 0x0 Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area is 262144 bytes Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area = 0x31b4128 Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area [0] is 2 bytes Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area [0] = 0x0 Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area [1] = 0x0 Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step04. --- mode is 2 byt es Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step04. --- mode = 0x0 Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step04. --- CC_BIT16 is 4 bytes Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step04. --- CC_BIT16 = 0x 2 Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode is 2 bytes Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode = 0x 0 Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf is 2 bytes Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf = 0x3 c11 Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step05. --- camac write Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step06. --- unit is 4 byt es Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step06. --- unit = 0x0 Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step06. --- mode is 2 byt es Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step06. --- mode = 0x0 Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step06. --- naf is 2 byte s Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step06. --- naf = 0x3c11 Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step06. --- cc->data_area [0] is 2 bytes Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step06. --- cc->data_area [0] = 0x0 Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode is 2 bytes Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode = 0x 0 Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf is 2 bytes Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf = 0x3 c01 Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step03. --- unit is 4 byt es Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step03. --- unit = 0x0 Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area is 262144 bytes Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area = 0x31b4128 Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area [0] is 2 bytes Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area [0] = 0x0 Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area [1] = 0x2 Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step04. --- mode is 2 byt es Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step04. --- mode = 0x0 Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step04. --- CC_BIT16 is 4 bytes Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step04. --- CC_BIT16 = 0x 2 Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode is 2 bytes Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode = 0x 0 Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf is 2 bytes Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf = 0x3 c11 Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step05. --- camac write Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step06. --- unit is 4 byt es Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step06. --- unit = 0x0 Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step06. --- mode is 2 byt es Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step06. --- mode = 0x0 Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step06. --- naf is 2 byte s Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step06. --- naf = 0x3c11 Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step06. --- cc->data_area [0] is 2 bytes Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step06. --- cc->data_area [0] = 0x0 Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode is 2 bytes Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode = 0x 0 Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf is 2 bytes Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf = 0x3 c01 Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step03. --- unit is 4 byt es Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step03. --- unit = 0x0 Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area is 262144 bytes Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area = 0x31b4128 Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area [0] is 2 bytes Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area [0] = 0x0 Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area [1] = 0x3 Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step04. --- mode is 2 byt es Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step04. --- mode = 0x0 Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step04. --- CC_BIT16 is 4 bytes Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step04. --- CC_BIT16 = 0x 2 Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode is 2 bytes Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode = 0x 0 Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf is 2 bytes Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf = 0x3 c11 Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step05. --- camac write Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step06. --- unit is 4 byt es Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step06. --- unit = 0x0 Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step06. --- mode is 2 byt es Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step06. --- mode = 0x0 Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step06. --- naf is 2 byte s Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step06. --- naf = 0x3c11 Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step06. --- cc->data_area [0] is 2 bytes Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step06. --- cc->data_area [0] = 0x0 Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode is 2 bytes Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode = 0x 0 Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf is 2 bytes Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf = 0x3 c01 Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step03. --- unit is 4 byt es Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step03. --- unit = 0x0 Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area is 262144 bytes Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area = 0x31b4128 Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area [0] is 2 bytes Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area [0] = 0x0 Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area [1] = 0x7 Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step04. --- mode is 2 byt es Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step04. --- mode = 0x0 Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step04. --- CC_BIT16 is 4 bytes Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step04. --- CC_BIT16 = 0x 2 Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode is 2 bytes Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode = 0x 0 Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf is 2 bytes Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf = 0x3 c11 Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step05. --- camac write Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step06. --- unit is 4 byt es Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step06. --- unit = 0x0 Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step06. --- mode is 2 byt es Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step06. --- mode = 0x0 Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step06. --- naf is 2 byte s Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step06. --- naf = 0x3c11 Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step06. --- cc->data_area [0] is 2 bytes Jan 25 16:36:13 onl50t Jan 25 16:36:13 onl50t unix: NOTICE: cc_write: debug step06. --- cc->data_area [0] = 0x0 Jan 25 16:36:13 onl50t onl50t[40]% onl50t[40]% onl50t[40]% onl50t[40]% onl50t[40]% <<< NAF=3,0,0 実行時のメッセージ >>> onl50t[40]% onl50t[40]% Jan 25 16:36:36 onl50t unix: NOTICE: cc_write: debug step01. --- c c->mode is 2 bytes Jan 25 16:36:36 onl50t Jan 25 16:36:36 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode = 0x 0 Jan 25 16:36:36 onl50t Jan 25 16:36:36 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf is 2 bytes Jan 25 16:36:36 onl50t Jan 25 16:36:36 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf = 0x6 00 Jan 25 16:36:36 onl50t Jan 25 16:36:36 onl50t unix: NOTICE: cc_write: debug step03. --- unit is 4 byt es Jan 25 16:36:36 onl50t Jan 25 16:36:36 onl50t unix: NOTICE: cc_write: debug step03. --- unit = 0x0 Jan 25 16:36:36 onl50t Jan 25 16:36:36 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area is 262144 bytes Jan 25 16:36:36 onl50t Jan 25 16:36:36 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area = 0x31b4128 Jan 25 16:36:36 onl50t Jan 25 16:36:36 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area [0] is 2 bytes Jan 25 16:36:36 onl50t Jan 25 16:36:36 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area [0] = 0x0 Jan 25 16:36:36 onl50t Jan 25 16:36:36 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area [1] = 0x3 Jan 25 16:36:36 onl50t Jan 25 16:36:36 onl50t unix: NOTICE: cc_write: debug step04. --- mode is 2 byt es Jan 25 16:36:36 onl50t Jan 25 16:36:36 onl50t unix: NOTICE: cc_write: debug step04. --- mode = 0x0 Jan 25 16:36:36 onl50t Jan 25 16:36:36 onl50t unix: NOTICE: cc_write: debug step04. --- CC_BIT16 is 4 bytes Jan 25 16:36:36 onl50t Jan 25 16:36:36 onl50t unix: NOTICE: cc_write: debug step04. --- CC_BIT16 = 0x 2 Jan 25 16:36:36 onl50t onl50t[40]% onl50t[40]% onl50t[40]% onl50t[40]% onl50t[40]% <<< NAF=3,0,16 data=7 実行時のメッセージ >>> onl50t[40]% onl50t[40]% Jan 25 16:36:54 onl50t unix: NOTICE: cc_write: debug step01. --- c c->mode is 2 bytes Jan 25 16:36:54 onl50t Jan 25 16:36:54 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode = 0x 0 Jan 25 16:36:54 onl50t Jan 25 16:36:54 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf is 2 bytes Jan 25 16:36:54 onl50t Jan 25 16:36:54 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf = 0x6 10 Jan 25 16:36:54 onl50t Jan 25 16:36:54 onl50t unix: NOTICE: cc_write: debug step05. --- camac write Jan 25 16:36:54 onl50t unix: NOTICE: cc_write: debug step06. --- unit is 4 byt es Jan 25 16:36:54 onl50t Jan 25 16:36:54 onl50t unix: NOTICE: cc_write: debug step06. --- unit = 0x0 Jan 25 16:36:54 onl50t Jan 25 16:36:54 onl50t unix: NOTICE: cc_write: debug step06. --- mode is 2 byt es Jan 25 16:36:54 onl50t Jan 25 16:36:54 onl50t unix: NOTICE: cc_write: debug step06. --- mode = 0x0 Jan 25 16:36:54 onl50t Jan 25 16:36:54 onl50t unix: NOTICE: cc_write: debug step06. --- naf is 2 byte s Jan 25 16:36:54 onl50t Jan 25 16:36:54 onl50t unix: NOTICE: cc_write: debug step06. --- naf = 0x610 Jan 25 16:36:54 onl50t Jan 25 16:36:54 onl50t unix: NOTICE: cc_write: debug step06. --- cc->data_area [0] is 2 bytes Jan 25 16:36:54 onl50t Jan 25 16:36:54 onl50t unix: NOTICE: cc_write: debug step06. --- cc->data_area [0] = 0x0 Jan 25 16:36:54 onl50t 現在、CGENC()、CGENZ()、CSETI()、CREMI() の動作は正常に実行できている。 状況をわかりやすくするために、cam1プログラム中のこれらの実行ははずして camac read、write のみを実行してデバッグすることにしよう。 (4). read、write のみを実行してみる (4-1). GENC()、CGENZ()、CSETI()、CREMI() をはずして実行する この操作はやらない。 camac read に関係した部分で怪しい個所を先に修正して から動作確認をやる。 (4-2). camac read に関係した部分の修正後の動作確認 システムを "boot -r disk3" でリブートする。 ok boot -r disk3 Resetting ... screen not found. Can't open input device. Keyboard not present. Using ttya for input and output. FORCE,CPU-50(UltraSPARC-IIi 300MHz), No Keyboard OpenBoot 3.10.8, 256 MB memory installed, Serial #9204337. Ethernet address 0:80:42:10:2:74, Host ID: 808c7271. Executing last command: boot -r disk3 Boot device: /pci@1f,0/scsi@4/disk@3,0:a File and args: -r disk3 SunOS Release 5.7 Version Generic_106541-06 64-bit [UNIX(R) System V Release 4. 0] Copyright (c) 1983-1999, Sun Microsystems, Inc. NOTICE: VME: slavewin at vme=0x0, size=0x100000 space=0x302061f configuring network interfaces: hme0 hme1. Hostname: onl50t The / file system (/dev/rdsk/c0t3d0s0) is being checked. /dev/rdsk/c0t3d0s0: 2338 files, 56538 used, 52989 free /dev/rdsk/c0t3d0s0: (45 frags, 6618 blocks, 0.0% fragmentation) Configuring the /devices directory CAMAC device driver V1.4x, 1991-1993 by Y.TAKEUCHI (T.I.T.) Configuring the /dev directory Configuring the /dev directory (compatibility devices) The /var file system (/dev/rdsk/c0t3d0s1) is being checked. /dev/rdsk/c0t3d0s1: 2868 files, 8195 used, 21388 free /dev/rdsk/c0t3d0s1: (132 frags, 2657 blocks, 0.4% fragmentation) The system is coming up. Please wait. checking ufs filesystems /dev/rdsk/c0t3d0s7: 651 files, 49826 used, 7386787 free /dev/rdsk/c0t3d0s7: (907 frags, 923235 blocks, 0.0% fragmentation) NIS domainname is kek.jp starting rpc services: rpcbind keyserv done. Setting netmask of hme0 to 255.255.248.0 Setting default interface for multicast: add net 224.0.0.0: gateway onl50t syslog service starting. Feb 1 16:31:26 onl50t savecore: reboot after panic: CPU0 Privileged Bus Error: AFSR 0x00000000.84000000 AFAR 0x000001ff.0001ff68 System dump time: Fri Jan 28 09:36:14 2000 savecore: not enough space in /var/crash/onl50t (17 MB avail, 33 MB needed) Feb 1 16:31:26 onl50t savecore: not enough space in /var/crash/onl50t (17 MB a vail, 33 MB needed) Print services started. volume management starting. The system is ready. onl50t console login: onl50t[48]% cat cam1.c /******************************************************************** * * * cam1.c 7-OCT-1991 Y.Takeuchi * * * * CAMAC single action test program * * SPARC SFVME-100 CES8216 | K2917 K3922 * ********************************************************************/ #include #include "camlib.h" test() { int status, i, q, x; status = CAMAC(NAF(3, 0, 1), &i, &q, &x); if (status != 0) return status; i |= 2; printf("cam1: i is %lu bytes\n", sizeof (i)); printf("cam1: 2 is %lu bytes\n", sizeof (2)); return CAMAC(NAF(30, 0, 17), &i, &q, &x); /* return 0; */ } main(argc, argv) int argc; char *argv[]; { int loop; int n, a, f, q, x, dat; loop = (argc > 1) ? atoi(argv[1]): 20; if (CAM_Open()) { perror("Open error: "); exit(1); } CSETCR(0); /* CGENC(); CGENZ(); CSETI(); CREMI(); */ while (loop-- > 0) { rewind(stdin); printf("Input n a f (data)>"); scanf("%d %d %d*", &n, &a, &f); if ((f & 0x1C) == 0x10) scanf("%d*", &dat); CAMAC(NAF(n, a, f), &dat, &q, &x); /* test(); */ printf(" N=%d A=%d F=%d Q=%d X=%d Data:%06X(Hex) %08d(Dec)\n\n", n, a, f, q, x, dat, dat); } CAM_Close(); } onl50t[49]% onl50t[46]% cam1 Input n a f (data)>3 0 0 N=3 A=0 F=0 Q=1 X=1 Data:000000(Hex) 00000000(Dec) Input n a f (data)>3 1 0 N=3 A=1 F=0 Q=1 X=1 Data:000007(Hex) 00000007(Dec) Input n a f (data)>3 0 0 N=3 A=0 F=0 Q=1 X=1 Data:000000(Hex) 00000000(Dec) Input n a f (data)>^Conl50t[47]% onl50t[47]% onl50t console login: onl50t console login: onl50t console login: Feb 1 17:43:19 onl50t unix: NOTICE: camac_s: debug step 000. --- (mode)mode | ((uint16_t)cc->cur_crate << 8)=0x0 Feb 1 17:43:19 onl50t Feb 1 17:43:19 onl50t unix: NOTICE: camac_s: debug step000. --- (naf)naf=0x60 0 Feb 1 17:43:19 onl50t Feb 1 17:43:19 onl50t unix: NOTICE: camac_s: debug step000. --- (halt)(uint16 _t)CC_HALT=0x80 Feb 1 17:43:19 onl50t Feb 1 17:43:19 onl50t unix: NOTICE: camac_s: debug step02. --- (after GO)cc-> k->csr=0x1 Feb 1 17:43:19 onl50t Feb 1 17:43:19 onl50t unix: NOTICE: camac_s: debug step0000. --- cc->k->csr=0 x101 Feb 1 17:43:19 onl50t onl50t console login: onl50t console login: onl50t console login: onl50t console login: onl50t console login: onl50t console login: Feb 1 17:43:27 onl50t unix: NOTICE: camac_s: debug step 000. --- (mode)mode | ((uint16_t)cc->cur_crate << 8)=0x0 Feb 1 17:43:27 onl50t Feb 1 17:43:27 onl50t unix: NOTICE: camac_s: debug step000. --- (naf)naf=0x62 0 Feb 1 17:43:27 onl50t Feb 1 17:43:27 onl50t unix: NOTICE: camac_s: debug step000. --- (halt)(uint16 _t)CC_HALT=0x80 Feb 1 17:43:27 onl50t Feb 1 17:43:27 onl50t unix: NOTICE: camac_s: debug step02. --- (after GO)cc-> k->csr=0x1 Feb 1 17:43:27 onl50t Feb 1 17:43:27 onl50t unix: NOTICE: camac_s: debug step0000. --- cc->k->csr=0 x101 Feb 1 17:43:27 onl50t onl50t console login: onl50t console login: onl50t console login: onl50t console login: onl50t console login: Feb 1 17:43:35 onl50t unix: NOTICE: camac_s: debug step 000. --- (mode)mode | ((uint16_t)cc->cur_crate << 8)=0x0 Feb 1 17:43:35 onl50t Feb 1 17:43:35 onl50t unix: NOTICE: camac_s: debug step000. --- (naf)naf=0x60 0 Feb 1 17:43:35 onl50t Feb 1 17:43:35 onl50t unix: NOTICE: camac_s: debug step000. --- (halt)(uint16 _t)CC_HALT=0x80 Feb 1 17:43:35 onl50t Feb 1 17:43:35 onl50t unix: NOTICE: camac_s: debug step02. --- (after GO)cc-> k->csr=0x1 Feb 1 17:43:35 onl50t Feb 1 17:43:35 onl50t unix: NOTICE: camac_s: debug step0000. --- cc->k->csr=0 x101 Feb 1 17:43:35 onl50t ok. camacシングルアクションread は正常に実行できた。 デバッグ用の文をはずして実行してみる。 (4-3). デバッグ用の文をはずした実行 デバッグ用の文を一部残した場合。 onl50t[108]% cam1 Input n a f (data)>3 0 0 N=3 A=0 F=0 Q=1 X=1 Data:000000(Hex) 00000000(Dec) Input n a f (data)>3 1 0 N=3 A=1 F=0 Q=1 X=1 Data:000007(Hex) 00000007(Dec) Input n a f (data)>^Conl50t[109]% onl50t[109]% onl50t console login: onl50t console login: Feb 2 11:30:08 onl50t unix: NOTICE: camac_s: debug step 02. --- (after GO)cc->k->csr=0x1 Feb 2 11:30:08 onl50t Feb 2 11:30:13 onl50t unix: NOTICE: camac_s: debug step02. --- (after GO)cc-> k->csr=0x1 Feb 2 11:30:13 onl50t ok. 正常に実行できた。 この時に実行では GENC()、CGENZ()、CSETI()、CREMI() をはずしてある。 onl50t[121]% cam1 Input n a f (data)>3 0 0 N=3 A=0 F=0 Q=1 X=1 Data:000000(Hex) 00000000(Dec) Input n a f (data)>3 1 0 N=3 A=1 F=0 Q=1 X=1 Data:000007(Hex) 00000007(Dec) Input n a f (data)>^Conl50t[122]% onl50t[122]% Feb 2 11:42:28 onl50t unix: CAMAC device driver V1.4x, 1991-1993 by Y.TAKEUCHI (T.I.T.) Feb 2 11:43:13 onl50t unix: NOTICE: camac_s: debug step02. --- cc->k->csr=0x1 Feb 2 11:43:13 onl50t Feb 2 11:43:18 onl50t unix: NOTICE: camac_s: debug step02. --- cc->k->csr=0x1 Feb 2 11:43:18 onl50t デバッグ用の文を全てはずした場合。 onl50t[97]% cam1 Input n a f (data)>3 0 0 N=3 A=0 F=0 Q=1 X=1 Data:000000(Hex) 00000000(Dec) Input n a f (data)>3 1 0 N=3 A=1 F=0 Q=1 X=1 Data:000000(Hex) 00000000(Dec) Input n a f (data)>3 1 0 N=3 A=1 F=0 Q=1 X=1 Data:000000(Hex) 00000000(Dec) Input n a f (data)>3 0 0 N=3 A=0 F=0 Q=1 X=1 Data:000000(Hex) 00000000(Dec) Input n a f (data)>^Conl50t[98]% Feb 2 11:18:21 onl50t unix: CAMAC device driver V1.4x, 1991-1993 by Y.TAKEUCHI (T.I.T.) onl50t console login: onl50t console login: onl50t console login: NG. 読み出したデータは常にゼロになっている。 この時に実行では GENC()、CGENZ()、CSETI()、CREMI() をはずしてある。 onl50t[159]% cam1 Input n a f (data)>3 0 0 N=3 A=0 F=0 Q=1 X=1 Data:000000(Hex) 00000000(Dec) Input n a f (data)>3 1 0 N=3 A=1 F=0 Q=1 X=1 Data:000000(Hex) 00000000(Dec) Input n a f (data)>3 0 0 N=3 A=0 F=0 Q=1 X=1 Data:000000(Hex) 00000000(Dec) Input n a f (data)>^Conl50t[160]% ^C onl50t[160]% Feb 2 14:13:37 onl50t unix: CAMAC device driver V1.4x, 1991-1993 by Y.TAKEUCHI (T.I.T.) Feb 2 14:14:14 onl50t unix: NOTICE: camac_s: debug step000. --- cc->k address =0xf98008 Feb 2 14:14:14 onl50t Feb 2 14:14:14 onl50t unix: NOTICE: camac_s: debug step000. --- cc->k->csr ad dress =0xf35f6e Feb 2 14:14:14 onl50t Feb 2 14:14:33 onl50t unix: NOTICE: camac_s: debug step000. --- cc->k address =0xf98008 Feb 2 14:14:33 onl50t Feb 2 14:14:33 onl50t unix: NOTICE: camac_s: debug step000. --- cc->k->csr ad dress =0xf35f6e Feb 2 14:14:33 onl50t Feb 2 14:14:47 onl50t unix: NOTICE: camac_s: debug step000. --- cc->k address =0xf98008 Feb 2 14:14:47 onl50t Feb 2 14:14:47 onl50t unix: NOTICE: camac_s: debug step000. --- cc->k->csr ad dress =0xf35f6e Feb 2 14:14:47 onl50t onl50t[164]% cam1 Input n a f (data)>3 0 0 N=3 A=0 F=0 Q=1 X=1 Data:000000(Hex) 00000000(Dec) Input n a f (data)>3 1 0 N=3 A=1 F=0 Q=1 X=1 Data:000007(Hex) 00000007(Dec) Input n a f (data)>3 0 0 N=3 A=0 F=0 Q=1 X=1 Data:000000(Hex) 00000000(Dec) Input n a f (data)>^Conl50t[165]% onl50t[165]% onl50t console login: onl50t console login: Feb 2 14:20:24 onl50t unix: NOTICE: camac_s: debug step 000. --- cc->k address =0xffa008 Feb 2 14:20:24 onl50t Feb 2 14:20:24 onl50t unix: NOTICE: camac_s: debug step000. --- cc->k->csr ad dress =0xf4bf6e Feb 2 14:20:24 onl50t Feb 2 14:20:24 onl50t unix: NOTICE: camac_s: debug step02. --- cc->k->csr=0x1 Feb 2 14:20:24 onl50t Feb 2 14:20:36 onl50t unix: NOTICE: camac_s: debug step000. --- cc->k address =0xffa008 Feb 2 14:20:36 onl50t Feb 2 14:20:36 onl50t unix: NOTICE: camac_s: debug step000. --- cc->k->csr ad dress =0xf4bf6e Feb 2 14:20:36 onl50t Feb 2 14:20:36 onl50t unix: NOTICE: camac_s: debug step02. --- cc->k->csr=0x1 Feb 2 14:20:36 onl50t Feb 2 14:20:42 onl50t unix: NOTICE: camac_s: debug step000. --- cc->k address =0xffa008 Feb 2 14:20:42 onl50t Feb 2 14:20:42 onl50t unix: NOTICE: camac_s: debug step000. --- cc->k->csr ad dress =0xf4bf6e Feb 2 14:20:42 onl50t Feb 2 14:20:42 onl50t unix: NOTICE: camac_s: debug step02. --- cc->k->csr=0x1 Feb 2 14:20:42 onl50t onl50t[181]% cam1 Input n a f (data)>3 0 0 N=3 A=0 F=0 Q=1 X=1 Data:000000(Hex) 00000000(Dec) Input n a f (data)>3 1 0 N=3 A=1 F=0 Q=1 X=1 Data:000007(Hex) 00000007(Dec) Input n a f (data)>^Conl50t[182]% onl50t[182]% onl50t console login: onl50t console login: Feb 2 14:34:28 onl50t unix: NOTICE: camac_s: debug step 000. --- cc->k address =0x1002008 Feb 2 14:34:28 onl50t Feb 2 14:34:31 onl50t unix: NOTICE: camac_s: debug step000. --- cc->k address =0x1002008 Feb 2 14:34:31 onl50t onl50t console login: onl50t[186]% cam1 Input n a f (data)>3 0 0 N=3 A=0 F=0 Q=1 X=1 Data:000000(Hex) 00000000(Dec) Input n a f (data)>3 1 0 N=3 A=1 F=0 Q=1 X=1 Data:000000(Hex) 00000000(Dec) Input n a f (data)>^Conl50t[187]% onl50t[187]% onl50t console login: onl50t console login: Feb 2 14:38:12 onl50t unix: NOTICE: camac_s: debug step 000. --- cc->k address =0x1002008 Feb 2 14:38:12 onl50t Feb 2 14:38:15 onl50t unix: NOTICE: camac_s: debug step000. --- cc->k address =0x1002008 Feb 2 14:38:15 onl50t GO ビットをセットする前でcmn_err()文を実行した場合。 : counter = 0; switch (naf & (uint16_t)0x0018) { case 0x0000: /* CAMAC read */ cmn_err(CE_NOTE," camac_s: debug step000. --- cc->k address =0x%x, cc->k->csr address =0x%x\n", &cc->k, &cc->k->csr); cc->k->csr &= (uint16_t)~CC_WRITE; cc->k->csr |= (uint16_t)CC_GO; /* Go! */ : onl50t[191]% cam1 Input n a f (data)>3 0 0 N=3 A=0 F=0 Q=1 X=1 Data:000000(Hex) 00000000(Dec) Input n a f (data)>3 1 0 N=3 A=1 F=0 Q=1 X=1 Data:000000(Hex) 00000000(Dec) Input n a f (data)>^Conl50t[192]% onl50t[192]% onl50t console login: onl50t console login: Feb 2 14:42:08 onl50t unix: NOTICE: camac_s: debug step 000. --- cc->k address =0x1002008, cc->k->csr address =0xf7bf6e Feb 2 14:42:08 onl50t Feb 2 14:42:13 onl50t unix: NOTICE: camac_s: debug step000. --- cc->k address =0x1002008, cc->k->csr address =0xf7bf6e Feb 2 14:42:13 onl50t NG. camac シングルアクション read は正しくに実行されない。 データの値も正しくない。 cc->k address =0x1002008, cc->k->csr address =0xf7bf6e となっている。 GO ビットをセットした後でcmn_err()文を実行した場合。 : cc->k->csr &= (uint16_t)~CC_WRITE; cc->k->csr |= (uint16_t)CC_GO; /* Go! */ cmn_err(CE_NOTE," camac_s: debug step000. --- cc->k address =0x%x, cc->k->csr address =0x%x\n", &cc->k, &cc->k->csr); while ((cc->k->csr & ((uint16_t)CC_RDY|(uint16_t)CC_ERR)) == 0 && counte r < CC_TIMEOUT_SINGLE) counter++; : onl50t[196]% cam1 Input n a f (data)>3 0 0 N=3 A=0 F=0 Q=1 X=1 Data:000000(Hex) 00000000(Dec) Input n a f (data)>3 1 0 N=3 A=1 F=0 Q=1 X=1 Data:000007(Hex) 00000007(Dec) Input n a f (data)>^Conl50t[197]% onl50t[197]% onl50t console login: onl50t console login: Feb 2 14:46:33 onl50t unix: NOTICE: camac_s: debug step 000. --- cc->k address =0x1002008, cc->k->csr address =0xf91f6e Feb 2 14:46:33 onl50t Feb 2 14:46:37 onl50t unix: NOTICE: camac_s: debug step000. --- cc->k address =0x1002008, cc->k->csr address =0xf91f6e Feb 2 14:46:37 onl50t ok. camac シングルアクション read は正常に実行される。データも正しく 読み出されている。 cc->k address =0x1002008, cc->k->csr address =0xf91f6e となっている。 Feb 3 16:42:13 onl50t unix: CAMAC device driver V1.4x, 1991-1993 by Y.TAKEUCHI (T.I.T.) Feb 4 15:37:13 onl50t su: 'su root' succeeded for inoue on /dev/pts/0 BAD TRAP: cpu=0 type=0x31 rp=0x2a100418f20 addr=0x30000f62f38 mmu_fsr=0x0 drvconfig: trap type = 0x31 addr=0x30000f62f38 pid=946, pc=0x100e3a90, sp=0x2a1004187c1, tstate=0x4414001600, context=0x1972 g1-g7: 1041d800, 275ff610, ff, 10445400, 10a0000, 0, 30000bf7280 Begin traceback... sp = 2a1004187c1 Called from 7808a4f8, fp=2a1004188a1, args=30000f62f38 30000bf7280 20 41 1044e9 e0 14 Called from 1007de5c, fp=2a100418971, args=78016400 30000f62f38 80c00 30000ee20 98 1000 30000ee2000 Called from 1004befc, fp=2a100418a21, args=3000006b540 0 0 10460088 1 10460094 Called from 1004be08, fp=2a100418ad1, args=3000006b540 780160d8 3000006b540 104 44fa8 1044d678 9e Called from 1010d654, fp=2a100418b81, args=1 780160d8 0 9e 3000006b540 30000125 668 Called from 1010d300, fp=2a100418c31, args=3000006b540 30000119988 30000bc65e8 2a1004194ec 30000119988 30000166510 Called from 100e0cdc, fp=2a100418cf1, args=30000166578 1045fc98 1045fc98 0 3000 0125650 30000bc65e8 Called from 1010de68, fp=2a100418da1, args=780160d8 9e 780160d8 30000125670 300 00125668 30000125650 Called from 10109738, fp=2a100418e61, args=9e 30000db1b10 30000122000 30000db1c 10 9e 0 Called from 1010a000, fp=2a100419231, args=30000db1c10 30000db1b10 10459278 104 4d158 10459270 9e Called from 10037df8, fp=2a1004192f1, args=4 0 25d18 2bb60 0 0 Called from 11e28, fp=ffbefb40, args=4 0 25d18 2bb60 0 ff335474 misaligned saved fp = ffbf033f End traceback... panic[cpu0]/thread=30000bf7280: trap syncing file systems... done panic[cpu0]/thread=2a100057d60: panic sync timeout dumping to /dev/dsk/c0t3d0s3, offset 31260672 100% done: 4343 pages dumped, compression ratio 3.41, dump succeeded rebooting... Resetting ... screen not found. Can't open input device. Keyboard not present. Using ttya for input and output. FORCE,CPU-50(UltraSPARC-IIi 300MHz), No Keyboard OpenBoot 3.10.8, 256 MB memory installed, Serial #9204337. Ethernet address 0:80:42:10:2:74, Host ID: 808c7271. Executing last command: boot Boot device: disk3:a File and args: SunOS Release 5.7 Version Generic_106541-06 64-bit [UNIX(R) System V Release 4. 0] Copyright (c) 1983-1999, Sun Microsystems, Inc. NOTICE: VME: slavewin at vme=0x0, size=0x100000 space=0x302061f configuring network interfaces: hme0 hme1. Hostname: onl50t The / file system (/dev/rdsk/c0t3d0s0) is being checked. /dev/rdsk/c0t3d0s0: 2336 files, 56537 used, 52990 free /dev/rdsk/c0t3d0s0: (54 frags, 6617 blocks, 0.0% fragmentation) The /usr file system (/dev/rdsk/c0t3d0s6) is being checked. /dev/rdsk/c0t3d0s6: 30993 files, 617390 used, 323889 free /dev/rdsk/c0t3d0s6: (1297 frags, 40324 blocks, 0.1% fragmentation) Configuring the /devices directory BAD TRAP: cpu=0 type=0x31 rp=0x2a10020af20 addr=0x300009a6f38 mmu_fsr=0x0 drvconfig: trap type = 0x31 addr=0x300009a6f38 pid=59, pc=0x100e3a90, sp=0x2a10020a7c1, tstate=0x4414001602, context=0x17fc g1-g7: 1041d800, 276950e8, ff, 10445400, a02000, 0, 30000102f20 Begin traceback... sp = 2a10020a7c1 Called from 102f23c8, fp=2a10020a8a1, args=300009a6f38 30000102f20 20 41 1044e9 e0 14 Called from 1007de5c, fp=2a10020a971, args=78092400 300009a6f38 80c00 300009260 98 1000 30000926000 Called from 1004befc, fp=2a10020aa21, args=3000085a428 0 0 10460088 1 10460094 Called from 1004be08, fp=2a10020aad1, args=3000085a428 780920d8 3000085a428 104 44fa8 1044d678 9e Called from 1010d654, fp=2a10020ab81, args=1 780920d8 0 9e 3000085a428 30000125 668 Called from 1010d300, fp=2a10020ac31, args=3000085a428 30000119988 30000114d38 2a10020b4ec 30000119988 30000166510 Called from 100e0cdc, fp=2a10020acf1, args=30000166578 1045fc98 1045fc98 0 3000 0125650 30000114d38 Called from 1010dcc8, fp=2a10020ada1, args=780920d8 9e 780920d8 30000125670 300 00125668 30000125650 Called from 10109748, fp=2a10020ae61, args=9e 1045fc98 1045c324 0 10444fa8 3000 04c69c8 Called from 1010a000, fp=2a10020b231, args=300001611e8 300001610e8 10459278 104 4d158 10459270 0 Called from 10037df8, fp=2a10020b2f1, args=4 0 25d18 2db90 0 0 Called from 11e28, fp=ffbefbf0, args=4 0 25d18 2db90 0 ff335474 misaligned saved fp = ffbf03ef End traceback... panic[cpu0]/thread=30000102f20: trap syncing file systems...panic[cpu0]/thread=2a100057d60: panic sync timeout dumping to /dev/dsk/c0t3d0s3, offset 31260672 100% done: 3174 pages dumped, compression ratio 3.98, dump succeeded rebooting... Resetting ... screen not found. Can't open input device. Keyboard not present. Using ttya for input and output. FORCE,CPU-50(UltraSPARC-IIi 300MHz), No Keyboard OpenBoot 3.10.8, 256 MB memory installed, Serial #9204337. Ethernet address 0:80:42:10:2:74, Host ID: 808c7271. Executing last command: boot Boot device: disk3:a File and args: SunOS Release 5.7 Version Generic_106541-06 64-bit [UNIX(R) System V Release 4. 0] Copyright (c) 1983-1999, Sun Microsystems, Inc. NOTICE: VME: slavewin at vme=0x0, size=0x100000 space=0x302061f configuring network interfaces: hme0 hme1. Hostname: onl50t The / file system (/dev/rdsk/c0t3d0s0) is being checked. /dev/rdsk/c0t3d0s0: 2336 files, 56537 used, 52990 free /dev/rdsk/c0t3d0s0: (54 frags, 6617 blocks, 0.0% fragmentation) Configuring the /devices directory BAD TRAP: cpu=0 type=0x31 rp=0x2a10020af20 addr=0x300009ecf38 mmu_fsr=0x0 drvconfig: trap type = 0x31 addr=0x300009ecf38 pid=57, pc=0x100e3a90, sp=0x2a10020a7c1, tstate=0x4414001605, context=0x1ff2 g1-g7: 1041d800, 27695220, ff, 10445400, a02000, 0, 30000102f20 Begin traceback... sp = 2a10020a7c1 Called from 102f23c8, fp=2a10020a8a1, args=300009ecf38 30000102f20 20 41 1044e9 e0 14 Called from 1007de5c, fp=2a10020a971, args=78092400 300009ecf38 80c00 3000096c0 98 1000 3000096c000 Called from 1004befc, fp=2a10020aa21, args=30000868428 0 0 10460088 1 10460094 Called from 1004be08, fp=2a10020aad1, args=30000868428 780920d8 30000868428 104 44fa8 1044d678 9e Called from 1010d654, fp=2a10020ab81, args=1 780920d8 0 9e 30000868428 30000125 668 : : ---xxxx ここまでやった(継続中) (3-3). cc_openルーチンのチェック onl50t[189]% vi cc64.c : cc_open(dev_t *devp, int flag, int otyp, cred_t *cred_p) { register int unit; /* register struct cc_device *cc = &ccdevice[0]; */ register struct cc_device *cc; void bzero(); /* by E.Inoue */ /* register struct K_REG *k = cc->k; */ /* */ unit = getminor(*devp); cc = ddi_get_soft_state(cc_state,unit); cmn_err(CE_NOTE," cc_open: debug step01. --- cc is %lu\n", sizeof(cc)); cmn_err(CE_NOTE," cc_open: debug step01. --- ddi_get_soft_state(cc_state,unit ) is %lu\n", sizeof(ddi_get_soft_state(cc_state,unit))); /* if (unit >= NCC || !md || md->md_alive == 0) return (ENXIO); "cc64.c" 2984 lines, 76633 characters onl50t[189]% onl50t[190]% make clean \rm -f cc cc64 *.o libcamac.a cam1 cam2 cam3 *~ core onl50t[191]% make ./script/cc_build.sh [Building for sun4u] rm -f cc.o cc -O -xarch=v9 -c camlib.c -o camlib.o -I. cc -O -xarch=v9 -c forlib.c -o forlib.o -I. rm -f libcamac.a ar rcv libcamac.a camlib.o forlib.o a - camlib.o a - forlib.o ar: writing libcamac.a cc -O -xarch=v9 cam1.c -o cam1 -I. -L. -lcamac f77 -xarch=v9 -O3 -u cam2.f -o cam2 -I. -L. -lcamac cam2.f: MAIN: cc -O -xarch=v9 cam3.c -o cam3 -I. -L. -lcamac onl50t[192]% onl50t# make unload ./script/cc_unload.sh [Removing CAMAC device driver] [Removing CAMAC device driver from system] [Deleting CAMAC device files] onl50t# make load ./script/cc_load.sh [Installing CAMAC device driver] [Adding CAMAC device driver to system] [Configuring CAMAC device driver] [Making CAMAC device files] sun4u onl50t# onl50t[62]% cam1 Input n a f (data)>^Conl50t[63]% Jan 18 16:43:58 onl50t unix: CAMAC device driver V1.4x, 1991-1993 by Y.TAKEUCHI (T.I.T.) onl50t[40]% onl50t[40]% onl50t[40]% onl50t[40]% Jan 18 16:44:59 onl50t unix: NOTICE: cc_open: debug step01. --- cc is 8 Jan 18 16:44:59 onl50t Jan 18 16:44:59 onl50t unix: NOTICE: cc_open: debug step01. --- ddi_get_soft_s tate(cc_state,unit) is 8 Jan 18 16:44:59 onl50t onl50t[40]% onl50t[40]% vi cc64.c : static int cc_open(dev_t *devp, int flag, int otyp, cred_t *cred_p) { register int unit; : cc->max_branch = CC_K_MAX_BRANCH; cmn_err(CE_NOTE," cc_open: debug step02. --- cc->max_branch is %lu\n", sizeof (cc->max_branch)); cmn_err(CE_NOTE," cc_open: debug step02. --- CC_K_MAX_BRANCH is %lu\n", sizeo f(CC_K_MAX_BRANCH)); cmn_err(CE_NOTE," cc_open: debug step02. --- cc->max_branch= 0x%x\n", cc->max _branch); : onl50t[41]% onl50t[41]% make clean \rm -f cc cc64 *.o libcamac.a cam1 cam2 cam3 *~ core onl50t[42]% make ./script/cc_build.sh [Building for sun4u] rm -f cc.o cc -O -xarch=v9 -c camlib.c -o camlib.o -I. cc -O -xarch=v9 -c forlib.c -o forlib.o -I. rm -f libcamac.a ar rcv libcamac.a camlib.o forlib.o a - camlib.o a - forlib.o ar: writing libcamac.a cc -O -xarch=v9 cam1.c -o cam1 -I. -L. -lcamac f77 -xarch=v9 -O3 -u cam2.f -o cam2 -I. -L. -lcamac cam2.f: MAIN: cc -O -xarch=v9 cam3.c -o cam3 -I. -L. -lcamac onl50t[43]% onl50t# make unload ./script/cc_unload.sh [Removing CAMAC device driver] [Removing CAMAC device driver from system] [Deleting CAMAC device files] onl50t# make load ./script/cc_load.sh [Installing CAMAC device driver] [Adding CAMAC device driver to system] [Configuring CAMAC device driver] [Making CAMAC device files] sun4u onl50t# onl50t[63]% cam1 Input n a f (data)>^Conl50t[64]% Jan 18 17:46:51 onl50t unix: CAMAC device driver V1.4x, 1991-1993 by Y.TAKEUCHI (T.I.T.) onl50t[40]% onl50t[40]% onl50t[40]% Jan 18 17:48:06 onl50t unix: NOTICE: cc_open: debug step01. --- cc is 8 Jan 18 17:48:06 onl50t Jan 18 17:48:06 onl50t unix: NOTICE: cc_open: debug step01. --- ddi_get_soft_s tate(cc_state,unit) is 8 Jan 18 17:48:06 onl50t Jan 18 17:48:06 onl50t unix: NOTICE: cc_open: debug step02. --- cc->max_branch is 4 Jan 18 17:48:06 onl50t Jan 18 17:48:06 onl50t unix: NOTICE: cc_open: debug step02. --- CC_K_MAX_BRANC H is 4 Jan 18 17:48:06 onl50t Jan 18 17:48:06 onl50t unix: NOTICE: cc_open: debug step02. --- cc->max_branch = 0x1 Jan 18 17:48:06 onl50t (4). cc_writeルーチンのチェック (4-1). cam1 で readを実行した時の状況確認 cam1 を走らせると、2917 の ADD_REC LED は一瞬だけ点灯し、camacデータウェ イディスプレーの Z,C LED が点灯する。 そこで NAF=3,0,0 を実行すると、 ADD_REC LEDは一瞬だけ点灯し、RUN LED は点灯したままになる。camacデータ ウェイディスプレーの Z,C LED は消え、3922 のBUSY LED は一瞬だけ点灯し、 camacデータウェイディスプレーの X,Q のLED が点灯する。 読み出された データはつねに 3で意味のないデータが返っている。 以降、NAF=3,0,0 を実行しても RUN LED は点灯したままになっている。 A を 0、1、2、3 と変化してみたがデータウェイディスプレーには指定した A が 正しく表示されている。 以上、 camacデータウェイオペレーションは実行されたが、RUN LED が点灯した ままになっており、意味のないデータが読み返されているというのが現在の readオペレーション時の状況である。 [考察] ADD_REC LED は、VMEバスから 2917 がアドレスされている最中に点灯する。 RUN LED は、2917 がコマンドリストを実行している最中に点灯する。 RUN LED が点灯したままということは camacオペレーションが完了しないままに なっているのかな。 (4-2). cc_write 部をチェック onl50t[50]% vi cc64.c : static int cc_write(dev_t dev, struct uio *uio, cred_t *cred_p) { /* register struct cc_device *cc = &ccdevice[0]; */ register struct cc_device *cc; : copyin((caddr_t)iov->iov_base, (caddr_t)&cc->message, sizeof(cc->message)); cc->status = 0; cc->cc_sys_status = 0; cc->mode = mode = cc->message.mode; cc->naf = naf = cc->message.naf; cmn_err(CE_NOTE," cc_write: debug step01. --- cc->mode is %lu bytes\n", sizeo f(cc->mode)); cmn_err(CE_NOTE," cc_write: debug step01. --- cc->mode = 0x%x \n", cc->mode); cmn_err(CE_NOTE," cc_write: debug step02. --- cc->naf is %lu bytes\n", sizeof (cc->naf)); cmn_err(CE_NOTE," cc_write: debug step02. --- cc->naf = 0x%x \n", cc->naf); : case CC_CMD_DOSINGLE: switch (naf & 0x0018) { case 0x0000: /* CAMAC read */ cmn_err(CE_NOTE," cc_write: debug step03. --- unit is %lu bytes\n", sizeof(un it)); cmn_err(CE_NOTE," cc_write: debug step03. --- unit = 0x%x \n", unit); cmn_err(CE_NOTE," cc_write: debug step03. --- cc->data_area is %lu bytes\n", sizeof(cc->data_area)); cmn_err(CE_NOTE," cc_write: debug step03. --- cc->data_area = 0x%x \n", cc->d ata_area); camac_s(unit, mode, naf, cc->data_area); : onl50t[51]% onl50t[51]% make clean \rm -f cc cc64 *.o libcamac.a cam1 cam2 cam3 *~ core onl50t[52]% make ./script/cc_build.sh [Building for sun4u] rm -f cc.o cc -O -xarch=v9 -c camlib.c -o camlib.o -I. cc -O -xarch=v9 -c forlib.c -o forlib.o -I. rm -f libcamac.a ar rcv libcamac.a camlib.o forlib.o a - camlib.o a - forlib.o ar: writing libcamac.a cc -O -xarch=v9 cam1.c -o cam1 -I. -L. -lcamac f77 -xarch=v9 -O3 -u cam2.f -o cam2 -I. -L. -lcamac cam2.f: MAIN: cc -O -xarch=v9 cam3.c -o cam3 -I. -L. -lcamac onl50t[53]% onl50t# make unload ./script/cc_unload.sh [Removing CAMAC device driver] [Removing CAMAC device driver from system] [Deleting CAMAC device files] onl50t# make load ./script/cc_load.sh [Installing CAMAC device driver] [Adding CAMAC device driver to system] [Configuring CAMAC device driver] [Making CAMAC device files] sun4u onl50t# onl50t[54]% cam1 Input n a f (data)>3 0 0 N=3 A=0 F=0 Q=1 X=1 Data:000003(Hex) 00000003(Dec) Input n a f (data)>3 1 0 N=3 A=1 F=0 Q=1 X=1 Data:000003(Hex) 00000003(Dec) Input n a f (data)>3 2 0 N=3 A=2 F=0 Q=1 X=1 Data:000003(Hex) 00000003(Dec) Input n a f (data)>^Conl50t[55]% Jan 20 10:49:56 onl50t unix: NOTICE: cc_open: debug step01. --- cc is 8 bytes Jan 20 10:49:56 onl50t Jan 20 10:49:56 onl50t unix: NOTICE: cc_open: debug step01. --- ddi_get_soft_st ate(cc_state,unit) is 8 bytes Jan 20 10:49:56 onl50t Jan 20 10:49:56 onl50t unix: NOTICE: cc_open: debug step02. --- cc->max_branch is 4 bytes Jan 20 10:49:56 onl50t Jan 20 10:49:56 onl50t unix: NOTICE: cc_open: debug step02. --- CC_K_MAX_BRANCH is 4 bytes Jan 20 10:49:56 onl50t Jan 20 10:49:56 onl50t unix: NOTICE: cc_open: debug step02. --- cc->max_branch= 0x1 Jan 20 10:49:56 onl50t Jan 20 10:49:56 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode is 2 bytes Jan 20 10:49:56 onl50t Jan 20 10:49:56 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode = 0x0 Jan 20 10:49:56 onl50t Jan 20 10:49:56 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf is 2 b ytes Jan 20 10:49:56 onl50t Jan 20 10:49:56 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf = 0x3c 01 Jan 20 10:49:56 onl50t Jan 20 10:49:56 onl50t unix: NOTICE: cc_write: debug step03. --- unit is 4 byte s Jan 20 10:49:56 onl50t Jan 20 10:49:56 onl50t unix: NOTICE: cc_write: debug step03. --- unit = 0x0 Jan 20 10:49:56 onl50t Jan 20 10:49:56 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area is 262144 bytes Jan 20 10:49:56 onl50t Jan 20 10:49:56 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area = 0x307e128 Jan 20 10:49:56 onl50t Jan 20 10:49:56 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode is 2 bytes Jan 20 10:49:56 onl50t Jan 20 10:49:56 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode = 0x0 Jan 20 10:49:56 onl50t Jan 20 10:49:56 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf is 2 b ytes Jan 20 10:49:56 onl50t Jan 20 10:49:56 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf = 0x3c 11 Jan 20 10:49:56 onl50t Jan 20 10:49:56 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode is 2 bytes Jan 20 10:49:56 onl50t Jan 20 10:49:56 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode = 0x0 Jan 20 10:49:56 onl50t Jan 20 10:49:56 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf is 2 b ytes Jan 20 10:49:56 onl50t Jan 20 10:49:56 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf = 0x3c 01 Jan 20 10:49:56 onl50t Jan 20 10:49:56 onl50t unix: NOTICE: cc_write: debug step03. --- unit is 4 byte s Jan 20 10:49:56 onl50t Jan 20 10:49:56 onl50t unix: NOTICE: cc_write: debug step03. --- unit = 0x0 Jan 20 10:49:56 onl50t Jan 20 10:49:56 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area is 262144 bytes Jan 20 10:49:56 onl50t Jan 20 10:49:56 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area = 0x307e128 Jan 20 10:49:56 onl50t Jan 20 10:49:56 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode is 2 bytes Jan 20 10:49:56 onl50t Jan 20 10:49:56 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode = 0x0 Jan 20 10:49:56 onl50t Jan 20 10:49:56 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf is 2 b ytes Jan 20 10:49:56 onl50t Jan 20 10:49:56 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf = 0x3c 11 Jan 20 10:49:56 onl50t Jan 20 10:49:56 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode is 2 bytes Jan 20 10:49:56 onl50t Jan 20 10:49:56 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode = 0x0 Jan 20 10:49:56 onl50t Jan 20 10:49:56 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf is 2 b ytes Jan 20 10:49:56 onl50t Jan 20 10:49:56 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf = 0x3c 01 Jan 20 10:49:56 onl50t Jan 20 10:49:56 onl50t unix: NOTICE: cc_write: debug step03. --- unit is 4 byte s Jan 20 10:49:56 onl50t Jan 20 10:49:56 onl50t unix: NOTICE: cc_write: debug step03. --- unit = 0x0 Jan 20 10:49:56 onl50t Jan 20 10:49:56 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area is 262144 bytes Jan 20 10:49:56 onl50t Jan 20 10:49:56 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area = 0x307e128 Jan 20 10:49:56 onl50t Jan 20 10:49:56 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode is 2 bytes Jan 20 10:49:56 onl50t Jan 20 10:49:56 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode = 0x0 Jan 20 10:49:56 onl50t Jan 20 10:49:56 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf is 2 b ytes Jan 20 10:49:56 onl50t Jan 20 10:49:56 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf = 0x3c 11 Jan 20 10:49:56 onl50t Jan 20 10:49:56 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode is 2 bytes Jan 20 10:49:56 onl50t Jan 20 10:49:56 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode = 0x0 Jan 20 10:49:56 onl50t Jan 20 10:49:56 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf is 2 b ytes Jan 20 10:49:56 onl50t Jan 20 10:49:56 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf = 0x3c 01 Jan 20 10:49:56 onl50t Jan 20 10:49:56 onl50t unix: NOTICE: cc_write: debug step03. --- unit is 4 byte s Jan 20 10:49:56 onl50t Jan 20 10:49:56 onl50t unix: NOTICE: cc_write: debug step03. --- unit = 0x0 Jan 20 10:49:56 onl50t Jan 20 10:49:56 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area is 262144 bytes Jan 20 10:49:56 onl50t Jan 20 10:49:56 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area = 0x307e128 Jan 20 10:49:56 onl50t Jan 20 10:49:56 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode is 2 bytes Jan 20 10:49:56 onl50t Jan 20 10:49:56 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode = 0x0 Jan 20 10:49:56 onl50t Jan 20 10:49:56 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf is 2 b ytes Jan 20 10:49:56 onl50t Jan 20 10:49:56 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf = 0x3c 11 Jan 20 10:49:56 onl50t Jan 20 10:50:00 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode is 2 bytes Jan 20 10:50:00 onl50t Jan 20 10:50:00 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode = 0x0 Jan 20 10:50:00 onl50t Jan 20 10:50:00 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf is 2 b ytes Jan 20 10:50:00 onl50t Jan 20 10:50:00 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf = 0x60 0 Jan 20 10:50:00 onl50t Jan 20 10:50:00 onl50t unix: NOTICE: cc_write: debug step03. --- unit is 4 byte s Jan 20 10:50:00 onl50t Jan 20 10:50:00 onl50t unix: NOTICE: cc_write: debug step03. --- unit = 0x0 Jan 20 10:50:00 onl50t Jan 20 10:50:00 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area is 262144 bytes Jan 20 10:50:00 onl50t Jan 20 10:50:00 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area = 0x307e128 Jan 20 10:50:00 onl50t Jan 20 10:50:04 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode is 2 bytes Jan 20 10:50:04 onl50t Jan 20 10:50:04 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode = 0x0 Jan 20 10:50:04 onl50t Jan 20 10:50:04 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf is 2 b ytes Jan 20 10:50:04 onl50t Jan 20 10:50:04 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf = 0x62 0 Jan 20 10:50:04 onl50t Jan 20 10:50:04 onl50t unix: NOTICE: cc_write: debug step03. --- unit is 4 byte s Jan 20 10:50:04 onl50t Jan 20 10:50:04 onl50t unix: NOTICE: cc_write: debug step03. --- unit = 0x0 Jan 20 10:50:04 onl50t Jan 20 10:50:04 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area is 262144 bytes Jan 20 10:50:04 onl50t Jan 20 10:50:04 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area = 0x307e128 Jan 20 10:50:04 onl50t Jan 20 10:50:07 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode is 2 bytes Jan 20 10:50:07 onl50t Jan 20 10:50:07 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode = 0x0 Jan 20 10:50:07 onl50t Jan 20 10:50:07 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf is 2 b ytes Jan 20 10:50:07 onl50t Jan 20 10:50:07 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf = 0x64 0 Jan 20 10:50:07 onl50t Jan 20 10:50:07 onl50t unix: NOTICE: cc_write: debug step03. --- unit is 4 byte s Jan 20 10:50:07 onl50t Jan 20 10:50:07 onl50t unix: NOTICE: cc_write: debug step03. --- unit = 0x0 Jan 20 10:50:07 onl50t Jan 20 10:50:07 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area is 262144 bytes Jan 20 10:50:07 onl50t Jan 20 10:50:07 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area = 0x307e128 Jan 20 10:50:07 onl50t camacシングルアクション read をトレースしてみた。 camac_sルーチン中の GO のビットをセットしたが、CC_RDY にならないで終わってしまっている。 したがって、データの読み出しは実行されていない。 トレース時にはcamac シングルアクション read 用のGO のビットをセットする以前に、2917 の RUN LED がすでに点灯したままになっている。 どこで RUN LED が点灯するのかを 調べる。 (4-3). cam1.c でのチェック onl50t[139]% cat cam1.c : main(argc, argv) int argc; char *argv[]; { int loop; int n, a, f, q, x, dat; loop = (argc > 1) ? atoi(argv[1]): 20; if (CAM_Open()) { perror("Open error: "); exit(1); } CSETCR(0); /* CGENC(); CGENZ(); CSETI(); CREMI(); */ while (loop-- > 0) { rewind(stdin); printf("Input n a f (data)>"); scanf("%d %d %d*", &n, &a, &f); if ((f & 0x1C) == 0x10) scanf("%d*", &dat); CAMAC(NAF(n, a, f), &dat, &q, &x); printf(" N=%d A=%d F=%d Q=%d X=%d Data:%06X(Hex) %08d(Dec)\n\n", n, a, f, q, x, dat, dat); } CAM_Close(); } : onl50t[140]% onl50t[140]% cam1 Input n a f (data)>3 0 0 N=3 A=0 F=0 Q=1 X=1 Data:000000(Hex) 00000000(Dec) Input n a f (data)>3 1 0 N=3 A=1 F=0 Q=1 X=1 Data:000007(Hex) 00000007(Dec) Input n a f (data)>^Conl50t[141]% onl50t[40]% onl50t[40]% Jan 20 16:45:21 onl50t unix: NOTICE: cc_open: debug step01. --- cc is 8 bytes Jan 20 16:45:21 onl50t Jan 20 16:45:21 onl50t unix: NOTICE: cc_open: debug step01. --- ddi_get_soft_s tate(cc_state,unit) is 8 bytes Jan 20 16:45:21 onl50t Jan 20 16:45:21 onl50t unix: NOTICE: cc_open: debug step02. --- cc->max_branch is 4 bytes Jan 20 16:45:21 onl50t Jan 20 16:45:21 onl50t unix: NOTICE: cc_open: debug step02. --- CC_K_MAX_BRANC H is 4 bytes Jan 20 16:45:21 onl50t Jan 20 16:45:21 onl50t unix: NOTICE: cc_open: debug step02. --- cc->max_branch = 0x1 Jan 20 16:45:21 onl50t Jan 20 16:45:26 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode is 2 bytes Jan 20 16:45:26 onl50t Jan 20 16:45:26 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode = 0x 0 Jan 20 16:45:26 onl50t Jan 20 16:45:26 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf is 2 bytes Jan 20 16:45:26 onl50t Jan 20 16:45:26 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf = 0x6 00 Jan 20 16:45:26 onl50t Jan 20 16:45:26 onl50t unix: NOTICE: cc_write: debug step03. --- unit is 4 byt es Jan 20 16:45:26 onl50t Jan 20 16:45:26 onl50t unix: NOTICE: cc_write: debug step03. --- unit = 0x0 Jan 20 16:45:26 onl50t Jan 20 16:45:26 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area is 262144 bytes Jan 20 16:45:26 onl50t Jan 20 16:45:26 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area = 0x3116128 Jan 20 16:45:26 onl50t Jan 20 16:45:26 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area [0] is 2 bytes Jan 20 16:45:26 onl50t Jan 20 16:45:26 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area [0] = 0x0 Jan 20 16:45:26 onl50t Jan 20 16:45:26 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area [1] = 0x0 Jan 20 16:45:26 onl50t Jan 20 16:45:26 onl50t unix: NOTICE: camac_s: debug step01. --- cc->k->csr is 2 bytes Jan 20 16:45:26 onl50t Jan 20 16:45:26 onl50t unix: NOTICE: camac_s: debug step01. --- cc->k->csr=0x8 0 Jan 20 16:45:26 onl50t Jan 20 16:45:26 onl50t unix: NOTICE: camac_s: debug step02. --- cc->k->csr is 2 bytes Jan 20 16:45:26 onl50t Jan 20 16:45:26 onl50t unix: NOTICE: camac_s: debug step02. --- cc->k->csr=0x1 01 Jan 20 16:45:26 onl50t Jan 20 16:45:26 onl50t unix: NOTICE: camac_s: debug step05. --- Jan 20 16:45:26 onl50t unix: NOTICE: camac_s: debug step04. --- cc->k->csr is 2 bytes Jan 20 16:45:26 onl50t Jan 20 16:45:26 onl50t unix: NOTICE: camac_s: debug step04. --- cc->k->csr & C C_RDY=0x100 Jan 20 16:45:26 onl50t Jan 20 16:45:26 onl50t unix: NOTICE: camac_s: debug step03. --- *dat is 2 byte s Jan 20 16:45:26 onl50t Jan 20 16:45:26 onl50t unix: NOTICE: camac_s: debug step03. --- *dat=0x0 Jan 20 16:45:26 onl50t Jan 20 16:45:26 onl50t unix: NOTICE: camac_s: debug step03. --- *(dat+1) is 2 bytes Jan 20 16:45:26 onl50t Jan 20 16:45:26 onl50t unix: NOTICE: camac_s: debug step03. --- *(dat+1)=0x0 Jan 20 16:45:26 onl50t Jan 20 16:45:36 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode is 2 bytes Jan 20 16:45:36 onl50t Jan 20 16:45:36 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode = 0x 0 Jan 20 16:45:36 onl50t Jan 20 16:45:36 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf is 2 bytes Jan 20 16:45:36 onl50t Jan 20 16:45:36 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf = 0x6 20 Jan 20 16:45:36 onl50t Jan 20 16:45:36 onl50t unix: NOTICE: cc_write: debug step03. --- unit is 4 byt es Jan 20 16:45:36 onl50t Jan 20 16:45:36 onl50t unix: NOTICE: cc_write: debug step03. --- unit = 0x0 Jan 20 16:45:36 onl50t Jan 20 16:45:36 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area is 262144 bytes Jan 20 16:45:36 onl50t Jan 20 16:45:36 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area = 0x3116128 Jan 20 16:45:36 onl50t Jan 20 16:45:36 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area [0] is 2 bytes Jan 20 16:45:36 onl50t Jan 20 16:45:36 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area [0] = 0x0 Jan 20 16:45:36 onl50t Jan 20 16:45:36 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area [1] = 0x0 Jan 20 16:45:36 onl50t Jan 20 16:45:36 onl50t unix: NOTICE: camac_s: debug step01. --- cc->k->csr is 2 bytes Jan 20 16:45:36 onl50t Jan 20 16:45:36 onl50t unix: NOTICE: camac_s: debug step01. --- cc->k->csr=0x8 0 Jan 20 16:45:36 onl50t Jan 20 16:45:36 onl50t unix: NOTICE: camac_s: debug step02. --- cc->k->csr is 2 bytes Jan 20 16:45:36 onl50t Jan 20 16:45:36 onl50t unix: NOTICE: camac_s: debug step02. --- cc->k->csr=0x1 01 Jan 20 16:45:36 onl50t Jan 20 16:45:36 onl50t unix: NOTICE: camac_s: debug step05. --- Jan 20 16:45:36 onl50t unix: NOTICE: camac_s: debug step04. --- cc->k->csr is 2 bytes Jan 20 16:45:36 onl50t Jan 20 16:45:36 onl50t unix: NOTICE: camac_s: debug step04. --- cc->k->csr & C C_RDY=0x100 Jan 20 16:45:36 onl50t Jan 20 16:45:36 onl50t unix: NOTICE: camac_s: debug step03. --- *dat is 2 byte s Jan 20 16:45:36 onl50t Jan 20 16:45:36 onl50t unix: NOTICE: camac_s: debug step03. --- *dat=0x0 Jan 20 16:45:36 onl50t Jan 20 16:45:36 onl50t unix: NOTICE: camac_s: debug step03. --- *(dat+1) is 2 bytes Jan 20 16:45:36 onl50t Jan 20 16:45:36 onl50t unix: NOTICE: camac_s: debug step03. --- *(dat+1)=0x7 Jan 20 16:45:36 onl50t CAM_Open、CAM_Close、CSETCR を実行しても RUN LED が点灯したままにはなら ない。 CGENC、CGENZ、CSETI、CREMI のどれかひとつを実行すると RUN LED が 点灯したままになってしまう。 ためしに cam1.cファイル中のCGENC、CGENZ、 CSETI、CREMI を実行しないで、以降の whileループのみを実行してみたが、 RUN LED 一瞬だけ点灯して消える。 正常な動作である。 データも正しい値で 読み返されている。 (4-4). CGENC、CGENZ、CSETI、CREMI のチェック onl50t[37]% grep CGENC * cam1.c: CGENC(); cam1.c-org: CGENC(); cam2.f: call CGENC() cam3.c: status += CGENC(); camlib.c:CGENC() camlib.c-bak:CGENC() forlib.c:cgenc_() { CGENC(); } onl50t[38]% onl50t[38]% vi camlib.c : CGENC() { int status, i, q, x; status = CAMAC(NAF(30, 0, 1), &i, &q, &x); if (status != 0) return status; i |= 2; return CAMAC(NAF(30, 0, 17), &i, &q, &x); } : CGENZ() { int status, i, q, x; status = CAMAC(NAF(30, 0, 1), &i, &q, &x); if (status != 0) return status; i |= 1; return CAMAC(NAF(30, 0, 17), &i, &q, &x); } : CSETI() { int status, i, q, x; status = CAMAC(NAF(30, 0, 1), &i, &q, &x); if (status != 0) return status; i |= 4; return CAMAC(NAF(30, 0, 17), &i, &q, &x); } : CREMI() { int status, i, q, x; status = CAMAC(NAF(30, 0, 1), &i, &q, &x); if (status != 0) return status; i &= ~4; return CAMAC(NAF(30, 0, 17), &i, &q, &x); } : onl50t[39]% CAM_Open、CAM_Close、CSETCRルーチンについてチェック。 onl50t[40]% grep CAM_Open * cam1.c: if (CAM_Open()) { cam1.c-org: if (CAM_Open()) { cam3.c: status += CAM_Open("/k3922",1); camlib.h:#define CAM_Open CAMOPN onl50t[41]% grep CAMOPN * cam2.f: call CAMOPN() camlib.c:CAMOPN() camlib.c-bak:CAMOPN() camlib.h:#define CAM_Open CAMOPN camlib.h:#define COPEN CAMOPN forlib.c:camopn_() { CAMOPN(); } forlib.c:copen_() { CAMOPN(); } onl50t[42]% onl50t[42]% grep CAM_Close * cam1.c: CAM_Close(); cam1.c-org: CAM_Close(); cam3.c: CAM_Close(); camlib.h:#define CAM_Close CAMCLS onl50t[43]% grep CAMCLS * cam2.f: call CAMCLS() camlib.c:CAMCLS() camlib.c-bak:CAMCLS() camlib.h:#define CAM_Close CAMCLS camlib.h:#define CCLOSE CAMCLS forlib.c:camcls_() { CAMCLS(); } forlib.c:cclose_() { CAMCLS(); } onl50t[44]% onl50t[45]% vi camlib.c : CAMOPN() { if ((cc_path = open("/dev/cc", O_RDWR)) == -1) return ENODEV; file_pointer = 0; return 0; } CAMCLS() { return close(cc_path); } : CSETCR(crate) int crate; { return ioctl(cc_path, CCIOC_SET_CRATE, &crate); } : onl50t[46]% CGENC、CGENZ、CSETI、CREMI ルーチンでは CAMAC()をコールしているが、 CAM_Open、CAM_Close、CSETCR ルーチンでは CAMAC()をコールしていない。 上でも述べたように、NAF=3,0,0 で CAMAC()をコールした時には何も問題なく 正常に実行できた。 CGENCルーチンでは NAF=30,0,1 と NAF=30,0,17 の2つの CAMAC()コールを実行している。 どちらのコールに問題があるのか調べる。 まず、CGENCルーチンの NAF=30,0,1 をコメントアウトして実行してみる。 onl50t[63]% : CGENC() { int status, i, q, x; /* status = CAMAC(NAF(30, 0, 1), &i, &q, &x); */ if (status != 0) return status; i |= 2; return CAMAC(NAF(30, 0, 17), &i, &q, &x); } : onl50t[64]% onl50t[64]% vi cam1.c : CSETCR(0); CGENC(); /* CGENZ(); CSETI(); CREMI(); */ while (loop-- > 0) { : onl50t[65]% onl50t[65]% make clean \rm -f cc cc64 *.o libcamac.a cam1 cam2 cam3 *~ core onl50t[66]% make ./script/cc_build.sh [Building for sun4u] rm -f cc.o cc -O -xarch=v9 -c camlib.c -o camlib.o -I. cc -O -xarch=v9 -c forlib.c -o forlib.o -I. rm -f libcamac.a ar rcv libcamac.a camlib.o forlib.o a - camlib.o a - forlib.o ar: writing libcamac.a cc -O -xarch=v9 cam1.c -o cam1 -I. -L. -lcamac f77 -xarch=v9 -O3 -u cam2.f -o cam2 -I. -L. -lcamac cam2.f: MAIN: cc -O -xarch=v9 cam3.c -o cam3 -I. -L. -lcamac onl50t[67]% onl50t# make unload ./script/cc_unload.sh [Removing CAMAC device driver] [Removing CAMAC device driver from system] [Deleting CAMAC device files] onl50t# make load ./script/cc_load.sh [Installing CAMAC device driver] [Adding CAMAC device driver to system] [Configuring CAMAC device driver] [Making CAMAC device files] sun4u onl50t# onl50t[143]% cam1 Input n a f (data)>^Conl50t[144]% onl50t[40]% onl50t[40]% Jan 21 14:13:42 onl50t unix: NOTICE: cc_open: debug step01. --- cc is 8 bytes Jan 21 14:13:42 onl50t Jan 21 14:13:42 onl50t unix: NOTICE: cc_open: debug step01. --- ddi_get_soft_s tate(cc_state,unit) is 8 bytes Jan 21 14:13:42 onl50t Jan 21 14:13:42 onl50t unix: NOTICE: cc_open: debug step02. --- cc->max_branch is 4 bytes Jan 21 14:13:42 onl50t Jan 21 14:13:42 onl50t unix: NOTICE: cc_open: debug step02. --- CC_K_MAX_BRANC H is 4 bytes Jan 21 14:13:42 onl50t Jan 21 14:13:42 onl50t unix: NOTICE: cc_open: debug step02. --- cc->max_branch = 0x1 Jan 21 14:13:42 onl50t Jan 21 14:13:42 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode is 2 bytes Jan 21 14:13:42 onl50t Jan 21 14:13:42 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode = 0x 0 Jan 21 14:13:42 onl50t Jan 21 14:13:42 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf is 2 bytes Jan 21 14:13:42 onl50t Jan 21 14:13:42 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf = 0x3 c11 Jan 21 14:13:42 onl50t cam1プログラムを起動すると、RUN LED が点灯したままになった。 次に、CGENCルーチンの NAF=30,0,17 をコメントアウトして実行してみる。 onl50t[69]% vi camlib.c : CGENC() { int status, i, q, x; status = CAMAC(NAF(30, 0, 1), &i, &q, &x); if (status != 0) return status; i |= 2; /* return CAMAC(NAF(30, 0, 17), &i, &q, &x); */ /* CAMAC(NAF(30, 0, 17), &i, &q, &x); */ return; } : onl50t[70]% onl50t[73]% make clean \rm -f cc cc64 *.o libcamac.a cam1 cam2 cam3 *~ core onl50t[74]% make ./script/cc_build.sh [Building for sun4u] rm -f cc.o cc -O -xarch=v9 -c camlib.c -o camlib.o -I. cc -O -xarch=v9 -c forlib.c -o forlib.o -I. rm -f libcamac.a ar rcv libcamac.a camlib.o forlib.o a - camlib.o a - forlib.o ar: writing libcamac.a cc -O -xarch=v9 cam1.c -o cam1 -I. -L. -lcamac f77 -xarch=v9 -O3 -u cam2.f -o cam2 -I. -L. -lcamac cam2.f: MAIN: cc -O -xarch=v9 cam3.c -o cam3 -I. -L. -lcamac onl50t[75]% onl50t# make unload ./script/cc_unload.sh [Removing CAMAC device driver] [Removing CAMAC device driver from system] [Deleting CAMAC device files] onl50t# make load ./script/cc_load.sh [Installing CAMAC device driver] [Adding CAMAC device driver to system] [Configuring CAMAC device driver] [Making CAMAC device files] sun4u onl50t# onl50t[146]% cam1 Input n a f (data)>^Conl50t[147]% onl50t[40]% onl50t[40]% Jan 21 14:28:55 onl50t unix: NOTICE: cc_open: debug step01. --- cc is 8 bytes Jan 21 14:28:55 onl50t Jan 21 14:28:55 onl50t unix: NOTICE: cc_open: debug step01. --- ddi_get_soft_s tate(cc_state,unit) is 8 bytes Jan 21 14:28:55 onl50t Jan 21 14:28:55 onl50t unix: NOTICE: cc_open: debug step02. --- cc->max_branch is 4 bytes Jan 21 14:28:55 onl50t Jan 21 14:28:55 onl50t unix: NOTICE: cc_open: debug step02. --- CC_K_MAX_BRANC H is 4 bytes Jan 21 14:28:55 onl50t Jan 21 14:28:55 onl50t unix: NOTICE: cc_open: debug step02. --- cc->max_branch = 0x1 Jan 21 14:28:55 onl50t Jan 21 14:28:55 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode is 2 bytes Jan 21 14:28:55 onl50t Jan 21 14:28:55 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode = 0x 0 Jan 21 14:28:55 onl50t Jan 21 14:28:55 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf is 2 bytes Jan 21 14:28:55 onl50t Jan 21 14:28:55 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf = 0x3 c01 Jan 21 14:28:55 onl50t Jan 21 14:28:55 onl50t unix: NOTICE: cc_write: debug step03. --- unit is 4 byt es Jan 21 14:28:55 onl50t Jan 21 14:28:55 onl50t unix: NOTICE: cc_write: debug step03. --- unit = 0x0 Jan 21 14:28:55 onl50t Jan 21 14:28:55 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area is 262144 bytes Jan 21 14:28:55 onl50t Jan 21 14:28:55 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area = 0x3116128 Jan 21 14:28:55 onl50t Jan 21 14:28:55 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area [0] is 2 bytes Jan 21 14:28:55 onl50t Jan 21 14:28:55 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area [0] = 0x0 Jan 21 14:28:55 onl50t Jan 21 14:28:55 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area [1] = 0x0 Jan 21 14:28:55 onl50t Jan 21 14:28:55 onl50t unix: NOTICE: camac_s: debug step01. --- cc->k->csr is 2 bytes Jan 21 14:28:55 onl50t Jan 21 14:28:55 onl50t unix: NOTICE: camac_s: debug step01. --- cc->k->csr=0x8 0 Jan 21 14:28:55 onl50t Jan 21 14:28:55 onl50t unix: NOTICE: camac_s: debug step02. --- cc->k->csr is 2 bytes Jan 21 14:28:55 onl50t Jan 21 14:28:55 onl50t unix: NOTICE: camac_s: debug step02. --- cc->k->csr=0x1 01 Jan 21 14:28:55 onl50t Jan 21 14:28:55 onl50t unix: NOTICE: camac_s: debug step05. --- Jan 21 14:28:55 onl50t unix: NOTICE: camac_s: debug step04. --- cc->k->csr is 2 bytes Jan 21 14:28:55 onl50t Jan 21 14:28:55 onl50t unix: NOTICE: camac_s: debug step04. --- cc->k->csr & C C_RDY=0x100 Jan 21 14:28:55 onl50t Jan 21 14:28:55 onl50t unix: NOTICE: camac_s: debug step03. --- *dat is 2 byte s Jan 21 14:28:55 onl50t Jan 21 14:28:55 onl50t unix: NOTICE: camac_s: debug step03. --- *dat=0x0 Jan 21 14:28:55 onl50t Jan 21 14:28:55 onl50t unix: NOTICE: camac_s: debug step03. --- *(dat+1) is 2 bytes Jan 21 14:28:55 onl50t Jan 21 14:28:55 onl50t unix: NOTICE: camac_s: debug step03. --- *(dat+1)=0x0 Jan 21 14:28:55 onl50t cam1プログラムを起動しても、RUN LED は一瞬だけ点灯してすぐに消えた。 正常な動作である。 以上の結果から次のことが言える。 NAF=30,0,1(camac read)を実行しても RUN LED は一瞬だけ点灯してすぐに消え る。 点灯したままになることはない。 NAF=30,0,17(camac write)を実行すると RUN LED が点灯したままになる。 この場合には、以降の camac動作は正常には 実行できなくなる。 つまり、camac write に関係したルーチンに何か問題が あるようだ。 camlib.cファイルを元の状態に戻す。 その後、cc64.cファイル 中の camac write に関係する部分をチェックする。 onl50t[77]% ls -l camlib* -rw-r--r-- 1 inoue kek 9803 Jan 21 14:24 camlib.c -rw-r--r-- 1 inoue kek 9740 Dec 20 15:49 camlib.c-bak -rw-r--r-- 1 inoue kek 9740 Dec 21 16:01 camlib.c-org -rw-r--r-- 1 inoue kek 1415 Dec 20 15:49 camlib.h -rw-r--r-- 1 inoue kek 23040 Jan 21 14:25 camlib.o onl50t[78]% cp camlib.c-org camlib.c onl50t[79]% (5). camac write に関係するルーチンのチェック (5-1). cc_writeルーチンを調べる static int cc_write(dev_t dev, struct uio *uio, cred_t *cred_p) { /* register struct cc_device *cc = &ccdevice[0]; */ register struct cc_device *cc; register struct iovec *iov = uio->uio_iov; register u_short mode, naf; register int len, code, step_count; struct uio uio_save, *uios = &uio_save; struct iovec iov_save, *iovs = &iov_save; int retlen; char klname[9]; minor_t unit; unit = getminor(dev); cc = ddi_get_soft_state(cc_state,unit); /* if (unit >= NCC) return ENXIO; */ cc->dev = dev; cc->uio = uio; cc->ptr_kdata = cc->data_area; cc->len_kdata = 0; /* if (uiomove(&message, sizeof(struct cc_message), UIO_WRITE, uio)) return EFAULT; */ copyin((caddr_t)iov->iov_base, (caddr_t)&cc->message, sizeof(cc->message)); cc->status = 0; cc->cc_sys_status = 0; cc->mode = mode = cc->message.mode; cc->naf = naf = cc->message.naf; cmn_err(CE_NOTE," cc_write: debug step01. --- cc->mode is %lu bytes\n", sizeo f(cc->mode)); cmn_err(CE_NOTE," cc_write: debug step01. --- cc->mode = 0x%x \n", cc->mode); cmn_err(CE_NOTE," cc_write: debug step02. --- cc->naf is %lu bytes\n", sizeof (cc->naf)); cmn_err(CE_NOTE," cc_write: debug step02. --- cc->naf = 0x%x \n", cc->naf); /* save iov, uio */ iovs->iov_base = iov->iov_base; iovs->iov_len = iov->iov_len; uios->uio_iovcnt = uio->uio_iovcnt; uios->uio_offset = uio->uio_offset; uios->uio_segflg = uio->uio_segflg; uios->uio_resid = uio->uio_resid; switch (cc->message.command) { /************************* * CAMAC single action * *************************/ case CC_CMD_DOSINGLE: switch (naf & 0x0018) { case 0x0000: /* CAMAC read */ cmn_err(CE_NOTE," cc_write: debug step03. --- unit is %lu bytes\n", sizeof(un it)); cmn_err(CE_NOTE," cc_write: debug step03. --- unit = 0x%x \n", unit); cmn_err(CE_NOTE," cc_write: debug step03. --- cc->data_area is %lu bytes\n", sizeof(cc->data_area)); cmn_err(CE_NOTE," cc_write: debug step03. --- cc->data_area = 0x%x \n", cc->d ata_area); cmn_err(CE_NOTE," cc_write: debug step03. --- cc->data_area[0] is %lu bytes\n ", sizeof(cc->data_area[0])); cmn_err(CE_NOTE," cc_write: debug step03. --- cc->data_area[0] = 0x%x \n", cc ->data_area[0]); cmn_err(CE_NOTE," cc_write: debug step03. --- cc->data_area[1] = 0x%x \n", cc ->data_area[1]); camac_s(unit, mode, naf, cc->data_area); if ((mode & CC_BIT16) == 0) copyout((caddr_t)cc->data_area, (caddr_t)cc->message.ptr_data, sizeof(u_short) * 2); else copyout((caddr_t)cc->data_area, (caddr_t)cc->message.ptr_data, sizeof(u_short)); break; case 0x0010: /* CAMAC write */ cmn_err(CE_NOTE," cc_write: debug step04. --- camac write"); if ((mode & CC_BIT16) == 0) copyin((caddr_t)cc->message.ptr_data, (caddr_t)cc->data_area, sizeof(u_short) * 2); else copyin((caddr_t)cc->message.ptr_data, (caddr_t)cc->data_area, sizeof(u_short)); cmn_err(CE_NOTE," cc_write: debug step05. --- unit is %lu bytes\n", sizeof(un it)); cmn_err(CE_NOTE," cc_write: debug step05. --- unit = 0x%x \n", unit); cmn_err(CE_NOTE," cc_write: debug step05. --- mode is %lu bytes\n", sizeof(mo de)); cmn_err(CE_NOTE," cc_write: debug step05. --- mode = 0x%x \n", mode); cmn_err(CE_NOTE," cc_write: debug step05. --- naf is %lu bytes\n", sizeof(naf )); cmn_err(CE_NOTE," cc_write: debug step05. --- naf = 0x%x \n", naf); cmn_err(CE_NOTE," cc_write: debug step05. --- cc->data_area[0] is %lu bytes\n ", sizeof(cc->data_area[0])); cmn_err(CE_NOTE," cc_write: debug step05. --- cc->data_area[0] = 0x%x \n", cc ->data_area[0]); camac_s(unit, mode, naf, cc->data_area); break; default: /* NDT */ camac_s(unit, mode, naf, cc->data_area); break; } copyout((caddr_t)((u_short *)&cc->camac_qx), (caddr_t)cc->message.ptr_qx, 2); break; : : static int camac_s(int unit, u_short mode, u_short naf, u_short *dat) { register struct cc_device *cc; /* register struct K_REG *k = cc->k; */ register int counter; cc = ddi_get_soft_state(cc_state,unit); cc->status = 0; /* by E.Inoue */ /* k->csr = CC_RST; */ /* K2917 Reset */ /* E.Inoue */ cc->k->lamc = (u_short)CC_INT_AUTO_CLEAR; cc->k->donc = (u_short)CC_INT_AUTO_CLEAR; cc->k->empc = (u_short)CC_INT_AUTO_CLEAR; cc->k->aboc = (u_short)CC_INT_AUTO_CLEAR; /* end */ cc->k->cma = CC_CMA_INIT; /* Initialize memory pointer */ cc->k->cmr = mode | (cc->cur_crate << 8); /* Write command list */ cc->k->cmr = naf; cc->k->cmr = CC_HALT; cc->k->cma = CC_CMA_INIT; /* Reset memory pointer */ counter = 0; switch (naf & 0x0018) { case 0x0000: /* CAMAC read */ /* E.Inoue: from cmn_err(CE_NOTE," camac_s: debug step02. --- camac read"); E.Inoue: end */ /* E.Inoue cc->k->lamc = (u_short)CC_INT_AUTO_CLEAR; cc->k->donc = (u_short)CC_INT_AUTO_CLEAR; cc->k->empc = (u_short)CC_INT_AUTO_CLEAR; cc->k->aboc = (u_short)CC_INT_AUTO_CLEAR; end */ cc->k->csr &= ~CC_WRITE; cmn_err(CE_NOTE," camac_s: debug step01. --- cc->k->csr is %lu bytes\n", size of(cc->k->csr)); cmn_err(CE_NOTE," camac_s: debug step01. --- cc->k->csr=0x%x\n", cc->k->csr); cc->k->csr |= CC_GO; /* Go! */ cmn_err(CE_NOTE," camac_s: debug step02. --- cc->k->csr is %lu bytes\n", size of(cc->k->csr)); cmn_err(CE_NOTE," camac_s: debug step02. --- cc->k->csr=0x%x\n", cc->k->csr); while ((cc->k->csr & (CC_RDY|CC_ERR)) == 0 && counter < CC_TIMEOUT_SINGL E) counter++; cmn_err(CE_NOTE," camac_s: debug step05. --- "); if ((cc->k->csr & CC_RDY) != 0) { cmn_err(CE_NOTE," camac_s: debug step04. --- cc->k->csr is %lu bytes\n", size of(cc->k->csr)); cmn_err(CE_NOTE," camac_s: debug step04. --- cc->k->csr & CC_RDY=0x%x\n", cc- >k->csr & CC_RDY); if ((mode & CC_BIT16) == 0) { *dat = cc->k->dhr & 0x00FF; cmn_err(CE_NOTE," camac_s: debug step03. --- *dat is %lu bytes\n", sizeof(*da t)); cmn_err(CE_NOTE," camac_s: debug step03. --- *dat=0x%x\n", *dat); *(dat + 1) = cc->k->dlr; cmn_err(CE_NOTE," camac_s: debug step03. --- *(dat+1) is %lu bytes\n", sizeof (*(dat+1))); cmn_err(CE_NOTE," camac_s: debug step03. --- *(dat+1)=0x%x\n", *(dat+1)); } else *dat = cc->k->dlr; } break; case 0x0010: /* CAMAC write */ /* E.Inoue cc->k->lamc = (u_short)CC_INT_AUTO_CLEAR; cc->k->donc = (u_short)CC_INT_AUTO_CLEAR; cc->k->empc = (u_short)CC_INT_AUTO_CLEAR; cc->k->aboc = (u_short)CC_INT_AUTO_CLEAR; end */ cc->k->csr |= CC_WRITE; cmn_err(CE_NOTE," camac_s: debug step06. --- cc->k->csr is %lu bytes\n", size of(cc->k->csr)); cmn_err(CE_NOTE," camac_s: debug step06. --- cc->k->csr=0x%x\n", cc->k->csr); cmn_err(CE_NOTE," camac_s: debug step06. --- CC_WRITE is %lu bytes\n", sizeof (CC_WRITE)); cmn_err(CE_NOTE," camac_s: debug step06. --- CC_WRITE=0x%x\n", CC_WRITE); cc->k->csr |= CC_GO; /* Go! */ cmn_err(CE_NOTE," camac_s: debug step06. --- cc->k->csr is %lu bytes\n", size of(cc->k->csr)); cmn_err(CE_NOTE," camac_s: debug step06. --- cc->k->csr=0x%x\n", cc->k->csr); cmn_err(CE_NOTE," camac_s: debug step06. --- CC_GO is %lu bytes\n", sizeof(CC _GO)); cmn_err(CE_NOTE," camac_s: debug step06. --- CC_GO=0x%x\n", CC_GO); while ((cc->k->csr & (CC_RDY|CC_ERR)) == 0 && counter < CC_TIMEOUT_SINGL E) counter++; if ((cc->k->csr & CC_RDY) != 0) { if ((mode & CC_BIT16) == 0) { cc->k->dhr = *dat; cc->k->dlr = *(dat + 1); } else { cc->k->dlr = *dat; } } break; default: /* NDT */ cc->k->csr |= CC_GO; /* Go! */ break; } onl50t[154]% cam1 Input n a f (data)>3 0 16 7 N=3 A=0 F=16 Q=1 X=1 Data:000007(Hex) 00000007(Dec) Input n a f (data)>3 0 0 N=3 A=0 F=0 Q=1 X=1 Data:000007(Hex) 00000007(Dec) Input n a f (data)>3 0 16 5 N=3 A=0 F=16 Q=1 X=1 Data:000005(Hex) 00000005(Dec) Input n a f (data)>3 0 0 N=3 A=0 F=0 Q=1 X=1 Data:000005(Hex) 00000005(Dec) Input n a f (data)>^Conl50t[155]% onl50t[40]% onl50t[40]% Jan 21 16:32:55 onl50t unix: NOTICE: cc_open: debug step01. --- cc is 8 bytes Jan 21 16:32:55 onl50t Jan 21 16:32:55 onl50t unix: NOTICE: cc_open: debug step01. --- ddi_get_soft_s tate(cc_state,unit) is 8 bytes Jan 21 16:32:55 onl50t Jan 21 16:32:55 onl50t unix: NOTICE: cc_open: debug step02. --- cc->max_branch is 4 bytes Jan 21 16:32:55 onl50t Jan 21 16:32:55 onl50t unix: NOTICE: cc_open: debug step02. --- CC_K_MAX_BRANC H is 4 bytes Jan 21 16:32:55 onl50t Jan 21 16:32:55 onl50t unix: NOTICE: cc_open: debug step02. --- cc->max_branch = 0x1 Jan 21 16:32:55 onl50t Jan 21 16:32:55 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode is 2 bytes Jan 21 16:32:55 onl50t Jan 21 16:32:55 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode = 0x 0 Jan 21 16:32:55 onl50t Jan 21 16:32:55 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf is 2 bytes Jan 21 16:32:55 onl50t Jan 21 16:32:55 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf = 0x3 c01 Jan 21 16:32:55 onl50t Jan 21 16:32:55 onl50t unix: NOTICE: cc_write: debug step03. --- unit is 4 byt es Jan 21 16:32:55 onl50t Jan 21 16:32:55 onl50t unix: NOTICE: cc_write: debug step03. --- unit = 0x0 Jan 21 16:32:55 onl50t Jan 21 16:32:55 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area is 262144 bytes Jan 21 16:32:55 onl50t Jan 21 16:32:55 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area = 0x3116128 Jan 21 16:32:55 onl50t Jan 21 16:32:55 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area [0] is 2 bytes Jan 21 16:32:55 onl50t Jan 21 16:32:55 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area [0] = 0x0 Jan 21 16:32:55 onl50t Jan 21 16:32:55 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area [1] = 0x0 Jan 21 16:32:55 onl50t Jan 21 16:32:55 onl50t unix: NOTICE: camac_s: debug step01. --- cc->k->csr is 2 bytes Jan 21 16:32:55 onl50t Jan 21 16:32:55 onl50t unix: NOTICE: camac_s: debug step01. --- cc->k->csr=0x8 0 Jan 21 16:32:55 onl50t Jan 21 16:32:55 onl50t unix: NOTICE: camac_s: debug step02. --- cc->k->csr is 2 bytes Jan 21 16:32:55 onl50t Jan 21 16:32:55 onl50t unix: NOTICE: camac_s: debug step02. --- cc->k->csr=0x1 01 Jan 21 16:32:55 onl50t Jan 21 16:32:55 onl50t unix: NOTICE: camac_s: debug step05. --- Jan 21 16:32:55 onl50t unix: NOTICE: camac_s: debug step04. --- cc->k->csr is 2 bytes Jan 21 16:32:55 onl50t Jan 21 16:32:55 onl50t unix: NOTICE: camac_s: debug step04. --- cc->k->csr & C C_RDY=0x100 Jan 21 16:32:55 onl50t Jan 21 16:32:55 onl50t unix: NOTICE: camac_s: debug step03. --- *dat is 2 byte s Jan 21 16:32:55 onl50t Jan 21 16:32:55 onl50t unix: NOTICE: camac_s: debug step03. --- *dat=0x0 Jan 21 16:32:55 onl50t Jan 21 16:32:55 onl50t unix: NOTICE: camac_s: debug step03. --- *(dat+1) is 2 bytes Jan 21 16:32:55 onl50t Jan 21 16:32:55 onl50t unix: NOTICE: camac_s: debug step03. --- *(dat+1)=0x0 Jan 21 16:32:55 onl50t Jan 21 16:32:55 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode is 2 bytes Jan 21 16:32:55 onl50t Jan 21 16:32:55 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode = 0x 0 Jan 21 16:32:55 onl50t Jan 21 16:32:55 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf is 2 bytes Jan 21 16:32:55 onl50t Jan 21 16:32:55 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf = 0x3 c11 Jan 21 16:32:55 onl50t Jan 21 16:32:55 onl50t unix: NOTICE: cc_write: debug step04. --- camac write Jan 21 16:32:55 onl50t unix: NOTICE: cc_write: debug step05. --- unit is 4 byt es Jan 21 16:32:55 onl50t Jan 21 16:32:55 onl50t unix: NOTICE: cc_write: debug step05. --- unit = 0x0 Jan 21 16:32:55 onl50t Jan 21 16:32:55 onl50t unix: NOTICE: cc_write: debug step05. --- mode is 2 byt es Jan 21 16:32:55 onl50t Jan 21 16:32:55 onl50t unix: NOTICE: cc_write: debug step05. --- mode = 0x0 Jan 21 16:32:55 onl50t Jan 21 16:32:55 onl50t unix: NOTICE: cc_write: debug step05. --- naf is 2 byte s Jan 21 16:32:55 onl50t Jan 21 16:32:55 onl50t unix: NOTICE: cc_write: debug step05. --- naf = 0x3c11 Jan 21 16:32:55 onl50t Jan 21 16:32:55 onl50t unix: NOTICE: cc_write: debug step05. --- cc->data_area [0] is 2 bytes Jan 21 16:32:55 onl50t Jan 21 16:32:55 onl50t unix: NOTICE: cc_write: debug step05. --- cc->data_area [0] = 0x0 Jan 21 16:32:55 onl50t Jan 21 16:32:55 onl50t unix: NOTICE: camac_s: debug step06. --- cc->k->csr is 2 bytes Jan 21 16:32:55 onl50t Jan 21 16:32:55 onl50t unix: NOTICE: camac_s: debug step06. --- cc->k->csr=0xa 0 Jan 21 16:32:55 onl50t Jan 21 16:32:55 onl50t unix: NOTICE: camac_s: debug step06. --- CC_WRITE is 4 bytes Jan 21 16:32:55 onl50t Jan 21 16:32:55 onl50t unix: NOTICE: camac_s: debug step06. --- CC_WRITE=0x20 Jan 21 16:32:55 onl50t Jan 21 16:32:55 onl50t unix: NOTICE: camac_s: debug step06. --- cc->k->csr is 2 bytes Jan 21 16:32:55 onl50t Jan 21 16:32:55 onl50t unix: NOTICE: camac_s: debug step06. --- cc->k->csr=0x1 21 Jan 21 16:32:55 onl50t Jan 21 16:32:55 onl50t unix: NOTICE: camac_s: debug step06. --- CC_GO is 4 byt es Jan 21 16:32:55 onl50t Jan 21 16:32:55 onl50t unix: NOTICE: camac_s: debug step06. --- CC_GO=0x1 Jan 21 16:32:55 onl50t Jan 21 16:36:46 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode is 2 bytes Jan 21 16:36:46 onl50t Jan 21 16:36:46 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode = 0x 0 Jan 21 16:36:46 onl50t Jan 21 16:36:46 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf is 2 bytes Jan 21 16:36:46 onl50t Jan 21 16:36:46 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf = 0x6 10 Jan 21 16:36:46 onl50t Jan 21 16:36:46 onl50t unix: NOTICE: cc_write: debug step04. --- camac write Jan 21 16:36:46 onl50t unix: NOTICE: cc_write: debug step05. --- unit is 4 byt es Jan 21 16:36:46 onl50t Jan 21 16:36:46 onl50t unix: NOTICE: cc_write: debug step05. --- unit = 0x0 Jan 21 16:36:46 onl50t Jan 21 16:36:46 onl50t unix: NOTICE: cc_write: debug step05. --- mode is 2 byt es Jan 21 16:36:46 onl50t Jan 21 16:36:46 onl50t unix: NOTICE: cc_write: debug step05. --- mode = 0x0 Jan 21 16:36:46 onl50t Jan 21 16:36:46 onl50t unix: NOTICE: cc_write: debug step05. --- naf is 2 byte s Jan 21 16:36:46 onl50t Jan 21 16:36:46 onl50t unix: NOTICE: cc_write: debug step05. --- naf = 0x610 Jan 21 16:36:46 onl50t Jan 21 16:36:46 onl50t unix: NOTICE: cc_write: debug step05. --- cc->data_area [0] is 2 bytes Jan 21 16:36:46 onl50t Jan 21 16:36:46 onl50t unix: NOTICE: cc_write: debug step05. --- cc->data_area [0] = 0x0 Jan 21 16:36:46 onl50t Jan 21 16:36:46 onl50t unix: NOTICE: camac_s: debug step06. --- cc->k->csr is 2 bytes Jan 21 16:36:46 onl50t Jan 21 16:36:46 onl50t unix: NOTICE: camac_s: debug step06. --- cc->k->csr=0xa 0 Jan 21 16:36:46 onl50t Jan 21 16:36:46 onl50t unix: NOTICE: camac_s: debug step06. --- CC_WRITE is 4 bytes Jan 21 16:36:46 onl50t Jan 21 16:36:46 onl50t unix: NOTICE: camac_s: debug step06. --- CC_WRITE=0x20 Jan 21 16:36:46 onl50t Jan 21 16:36:46 onl50t unix: NOTICE: camac_s: debug step06. --- cc->k->csr is 2 bytes Jan 21 16:36:46 onl50t Jan 21 16:36:46 onl50t unix: NOTICE: camac_s: debug step06. --- cc->k->csr=0x1 21 Jan 21 16:36:46 onl50t Jan 21 16:36:46 onl50t unix: NOTICE: camac_s: debug step06. --- CC_GO is 4 byt es Jan 21 16:36:46 onl50t Jan 21 16:36:46 onl50t unix: NOTICE: camac_s: debug step06. --- CC_GO=0x1 Jan 21 16:36:46 onl50t Jan 21 16:36:51 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode is 2 bytes Jan 21 16:36:51 onl50t Jan 21 16:36:51 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode = 0x 0 Jan 21 16:36:51 onl50t Jan 21 16:36:51 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf is 2 bytes Jan 21 16:36:51 onl50t Jan 21 16:36:51 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf = 0x6 00 Jan 21 16:36:51 onl50t Jan 21 16:36:51 onl50t unix: NOTICE: cc_write: debug step03. --- unit is 4 byt es Jan 21 16:36:51 onl50t Jan 21 16:36:51 onl50t unix: NOTICE: cc_write: debug step03. --- unit = 0x0 Jan 21 16:36:51 onl50t Jan 21 16:36:51 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area is 262144 bytes Jan 21 16:36:51 onl50t Jan 21 16:36:51 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area = 0x3116128 Jan 21 16:36:51 onl50t Jan 21 16:36:51 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area [0] is 2 bytes Jan 21 16:36:51 onl50t Jan 21 16:36:51 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area [0] = 0x0 Jan 21 16:36:51 onl50t Jan 21 16:36:51 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area [1] = 0x7 Jan 21 16:36:51 onl50t Jan 21 16:36:51 onl50t unix: NOTICE: camac_s: debug step01. --- cc->k->csr is 2 bytes Jan 21 16:36:51 onl50t Jan 21 16:36:51 onl50t unix: NOTICE: camac_s: debug step01. --- cc->k->csr=0x8 0 Jan 21 16:36:51 onl50t Jan 21 16:36:51 onl50t unix: NOTICE: camac_s: debug step02. --- cc->k->csr is 2 bytes Jan 21 16:36:51 onl50t Jan 21 16:36:51 onl50t unix: NOTICE: camac_s: debug step02. --- cc->k->csr=0x1 01 Jan 21 16:36:51 onl50t Jan 21 16:36:51 onl50t unix: NOTICE: camac_s: debug step05. --- Jan 21 16:36:51 onl50t unix: NOTICE: camac_s: debug step04. --- cc->k->csr is 2 bytes Jan 21 16:36:51 onl50t Jan 21 16:36:51 onl50t unix: NOTICE: camac_s: debug step04. --- cc->k->csr & C C_RDY=0x100 Jan 21 16:36:51 onl50t Jan 21 16:36:51 onl50t unix: NOTICE: camac_s: debug step03. --- *dat is 2 byte s Jan 21 16:36:51 onl50t Jan 21 16:36:51 onl50t unix: NOTICE: camac_s: debug step03. --- *dat=0x0 Jan 21 16:36:51 onl50t Jan 21 16:36:51 onl50t unix: NOTICE: camac_s: debug step03. --- *(dat+1) is 2 bytes Jan 21 16:36:51 onl50t Jan 21 16:36:51 onl50t unix: NOTICE: camac_s: debug step03. --- *(dat+1)=0x7 Jan 21 16:36:51 onl50t Jan 21 16:37:09 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode is 2 bytes Jan 21 16:37:09 onl50t Jan 21 16:37:09 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode = 0x 0 Jan 21 16:37:09 onl50t Jan 21 16:37:09 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf is 2 bytes Jan 21 16:37:09 onl50t Jan 21 16:37:09 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf = 0x6 10 Jan 21 16:37:09 onl50t Jan 21 16:37:09 onl50t unix: NOTICE: cc_write: debug step04. --- camac write Jan 21 16:37:09 onl50t unix: NOTICE: cc_write: debug step05. --- unit is 4 byt es Jan 21 16:37:09 onl50t Jan 21 16:37:09 onl50t unix: NOTICE: cc_write: debug step05. --- unit = 0x0 Jan 21 16:37:09 onl50t Jan 21 16:37:09 onl50t unix: NOTICE: cc_write: debug step05. --- mode is 2 byt es Jan 21 16:37:09 onl50t Jan 21 16:37:09 onl50t unix: NOTICE: cc_write: debug step05. --- mode = 0x0 Jan 21 16:37:09 onl50t Jan 21 16:37:09 onl50t unix: NOTICE: cc_write: debug step05. --- naf is 2 byte s Jan 21 16:37:09 onl50t Jan 21 16:37:09 onl50t unix: NOTICE: cc_write: debug step05. --- naf = 0x610 Jan 21 16:37:09 onl50t Jan 21 16:37:09 onl50t unix: NOTICE: cc_write: debug step05. --- cc->data_area [0] is 2 bytes Jan 21 16:37:09 onl50t Jan 21 16:37:09 onl50t unix: NOTICE: cc_write: debug step05. --- cc->data_area [0] = 0x0 Jan 21 16:37:09 onl50t Jan 21 16:37:09 onl50t unix: NOTICE: camac_s: debug step06. --- cc->k->csr is 2 bytes Jan 21 16:37:09 onl50t Jan 21 16:37:09 onl50t unix: NOTICE: camac_s: debug step06. --- cc->k->csr=0xa 0 Jan 21 16:37:09 onl50t Jan 21 16:37:09 onl50t unix: NOTICE: camac_s: debug step06. --- CC_WRITE is 4 bytes Jan 21 16:37:09 onl50t Jan 21 16:37:09 onl50t unix: NOTICE: camac_s: debug step06. --- CC_WRITE=0x20 Jan 21 16:37:09 onl50t Jan 21 16:37:09 onl50t unix: NOTICE: camac_s: debug step06. --- cc->k->csr is 2 bytes Jan 21 16:37:09 onl50t Jan 21 16:37:09 onl50t unix: NOTICE: camac_s: debug step06. --- cc->k->csr=0x1 21 Jan 21 16:37:09 onl50t Jan 21 16:37:09 onl50t unix: NOTICE: camac_s: debug step06. --- CC_GO is 4 byt es Jan 21 16:37:09 onl50t Jan 21 16:37:09 onl50t unix: NOTICE: camac_s: debug step06. --- CC_GO=0x1 Jan 21 16:37:09 onl50t Jan 21 16:37:18 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode is 2 bytes Jan 21 16:37:18 onl50t Jan 21 16:37:18 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode = 0x 0 Jan 21 16:37:18 onl50t Jan 21 16:37:18 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf is 2 bytes Jan 21 16:37:18 onl50t Jan 21 16:37:18 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf = 0x6 00 Jan 21 16:37:18 onl50t Jan 21 16:37:18 onl50t unix: NOTICE: cc_write: debug step03. --- unit is 4 byt es Jan 21 16:37:18 onl50t Jan 21 16:37:18 onl50t unix: NOTICE: cc_write: debug step03. --- unit = 0x0 Jan 21 16:37:18 onl50t Jan 21 16:37:18 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area is 262144 bytes Jan 21 16:37:18 onl50t Jan 21 16:37:18 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area = 0x3116128 Jan 21 16:37:18 onl50t Jan 21 16:37:18 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area [0] is 2 bytes Jan 21 16:37:18 onl50t Jan 21 16:37:18 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area [0] = 0x0 Jan 21 16:37:18 onl50t Jan 21 16:37:18 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area [1] = 0x5 Jan 21 16:37:18 onl50t Jan 21 16:37:18 onl50t unix: NOTICE: camac_s: debug step01. --- cc->k->csr is 2 bytes Jan 21 16:37:18 onl50t Jan 21 16:37:18 onl50t unix: NOTICE: camac_s: debug step01. --- cc->k->csr=0x8 0 Jan 21 16:37:18 onl50t Jan 21 16:37:18 onl50t unix: NOTICE: camac_s: debug step02. --- cc->k->csr is 2 bytes Jan 21 16:37:18 onl50t Jan 21 16:37:18 onl50t unix: NOTICE: camac_s: debug step02. --- cc->k->csr=0x1 01 Jan 21 16:37:18 onl50t Jan 21 16:37:18 onl50t unix: NOTICE: camac_s: debug step05. --- Jan 21 16:37:18 onl50t unix: NOTICE: camac_s: debug step04. --- cc->k->csr is 2 bytes Jan 21 16:37:18 onl50t Jan 21 16:37:18 onl50t unix: NOTICE: camac_s: debug step04. --- cc->k->csr & C C_RDY=0x100 Jan 21 16:37:18 onl50t Jan 21 16:37:18 onl50t unix: NOTICE: camac_s: debug step03. --- *dat is 2 byte s Jan 21 16:37:18 onl50t Jan 21 16:37:18 onl50t unix: NOTICE: camac_s: debug step03. --- *dat=0x0 Jan 21 16:37:18 onl50t Jan 21 16:37:18 onl50t unix: NOTICE: camac_s: debug step03. --- *(dat+1) is 2 bytes Jan 21 16:37:18 onl50t Jan 21 16:37:18 onl50t unix: NOTICE: camac_s: debug step03. --- *(dat+1)=0x5 Jan 21 16:37:18 onl50t camac write をトレースするための文を付加して cam1 を実行したら、camac write は何も問題なく実行できてしまった。 RUN LED も一瞬だけついてから 消える。 正常な動作である。 変数や定数のサイズ等をチェックしてみよう。 (5-2). camac_sルーチンを調べる camac_sルーチンの中に付加したトレース用の文が入っている時と入っていない 時の動作を確認した。  o トレース用の文が入っていない時には、cam1プログラムを起動したとき (CGENC、CGENZ、CGENI、CREMIの実行で) 2917 の RUN LEDが点灯したまま    になってしまうという症状が現れる。 o トレース用の文が入っている時には、cam1プログラムを起動したとき (CGENC、CGENZ、CGENI、CREMIの実行で) 2917 の RUN LEDが点灯したまま    になってしまうという症状は現れない。 一瞬だけ点いてすぐに消える。 camac_sルーチンの中に付加したトレース用の文をコメントアウトしたあと、 camac_sルーチン中の変数の整合性を適切にする。 : static int camac_s(int unit, u_short mode, u_short naf, u_short *dat) { register struct cc_device *cc; : cc->k->csr &= (uint16_t)~CC_WRITE; /* E.Inoue cmn_err(CE_NOTE," camac_s: debug step01. --- cc->k->csr is %lu bytes\n", size of(cc->k->csr)); cmn_err(CE_NOTE," camac_s: debug step01. --- cc->k->csr=0x%x\n", cc->k->csr); end */ cc->k->csr |= (uint16_t)CC_GO; /* Go! */ /* E.Inoue cmn_err(CE_NOTE," camac_s: debug step02. --- cc->k->csr is %lu bytes\n", size of(cc->k->csr)); cmn_err(CE_NOTE," camac_s: debug step02. --- cc->k->csr=0x%x\n", cc->k->csr); end */ while ((cc->k->csr & ((uint16_t)CC_RDY|(uint16_t)CC_ERR)) == 0 && (uint1 6_t)counter < (uint16_t)CC_TIMEOUT_SINGLE) (uint16_t)counter++; /* E.Inoue cmn_err(CE_NOTE," camac_s: debug step05. --- "); end */ if ((cc->k->csr & (uint16_t)CC_RDY) != 0) { /* E.Inoue cmn_err(CE_NOTE," camac_s: debug step04. --- cc->k->csr is %lu bytes\n", size of(cc->k->csr)); cmn_err(CE_NOTE," camac_s: debug step04. --- cc->k->csr & CC_RDY=0x%x\n", cc- >k->csr & CC_RDY); end */ if ((mode & (uint16_t)CC_BIT16) == 0) { *dat = cc->k->dhr & 0x00FF; /* E.Inoue cmn_err(CE_NOTE," camac_s: debug step03. --- *dat is %lu bytes\n", sizeof(*da t)); cmn_err(CE_NOTE," camac_s: debug step03. --- *dat=0x%x\n", *dat); end */ *(dat + 1) = cc->k->dlr; /* E.Inoue cmn_err(CE_NOTE," camac_s: debug step03. --- *(dat+1) is %lu bytes\n", sizeof (*(dat+1))); cmn_err(CE_NOTE," camac_s: debug step03. --- *(dat+1)=0x%x\n", *(dat+1)); end */ } else *dat = cc->k->dlr; } break; case 0x0010: /* CAMAC write */ /* E.Inoue cc->k->lamc = (u_short)CC_INT_AUTO_CLEAR; cc->k->donc = (u_short)CC_INT_AUTO_CLEAR; cc->k->empc = (u_short)CC_INT_AUTO_CLEAR; cc->k->aboc = (u_short)CC_INT_AUTO_CLEAR; end */ /* E.Inoue cc->k->csr |= CC_WRITE; end */ cc->k->csr |= (uint16_t)CC_WRITE; /* E.Inoue cmn_err(CE_NOTE," camac_s: debug step06. --- cc->k->csr is %lu bytes\n", size of(cc->k->csr)); cmn_err(CE_NOTE," camac_s: debug step06. --- cc->k->csr=0x%x\n", cc->k->csr); cmn_err(CE_NOTE," camac_s: debug step06. --- CC_WRITE is %lu bytes\n", sizeof (CC_WRITE)); cmn_err(CE_NOTE," camac_s: debug step06. --- CC_WRITE=0x%x\n", CC_WRITE); end */ /* E.Inoue cc->k->csr |= CC_GO; end */ /* Go! */ cc->k->csr |= (uint16_t)CC_GO; /* Go! */ /* E.Inoue cmn_err(CE_NOTE," camac_s: debug step06. --- cc->k->csr is %lu bytes\n", size of(cc->k->csr)); cmn_err(CE_NOTE," camac_s: debug step06. --- cc->k->csr=0x%x\n", cc->k->csr); cmn_err(CE_NOTE," camac_s: debug step06. --- CC_GO is %lu bytes\n", sizeof(CC _GO)); cmn_err(CE_NOTE," camac_s: debug step06. --- CC_GO=0x%x\n", CC_GO); end */ /* E.Inoue while ((cc->k->csr & (CC_RDY|CC_ERR)) == 0 && counter < CC_TIMEOUT_SINGL E) end */ while ((cc->k->csr & ((uint16_t)CC_RDY|(uint16_t)CC_ERR)) == 0 && (uint1 6_t)counter < (uint16_t)CC_TIMEOUT_SINGLE) (uint16_t)counter++; if ((cc->k->csr & (uint16_t)CC_RDY) != 0) { if ((mode & (uint16_t)CC_BIT16) == 0) { cc->k->dhr = *dat; cc->k->dlr = *(dat + 1); } else { cc->k->dlr = *dat; } } break; default: /* NDT */ cc->k->csr |= (uint16_t)CC_GO; /* Go! */ break; } while ((cc->k->csr & ((uint16_t)CC_DONE | (uint16_t)CC_ERR)) == 0 && (uint16 _t)counter < (uint16_t)CC_TIMEOUT_SINGLE) (uint16_t)counter++; cc->camac_qx = cc->k->csr; if ((uint16_t)counter >= (uint16_t)CC_TIMEOUT_SINGLE) { cc->status = (uint16_t)CC_STA_SINGLE_TIMEOUT; } return cc->status; } : onl50t[82]% make clean \rm -f cc cc64 *.o libcamac.a cam1 cam2 cam3 *~ core onl50t[83]% make ./script/cc_build.sh [Building for sun4u] rm -f cc.o cc -O -xarch=v9 -c camlib.c -o camlib.o -I. cc -O -xarch=v9 -c forlib.c -o forlib.o -I. rm -f libcamac.a ar rcv libcamac.a camlib.o forlib.o a - camlib.o a - forlib.o ar: writing libcamac.a cc -O -xarch=v9 cam1.c -o cam1 -I. -L. -lcamac f77 -xarch=v9 -O3 -u cam2.f -o cam2 -I. -L. -lcamac cam2.f: MAIN: cc -O -xarch=v9 cam3.c -o cam3 -I. -L. -lcamac onl50t[84]% onl50t# make unload ./script/cc_unload.sh [Removing CAMAC device driver] [Removing CAMAC device driver from system] [Deleting CAMAC device files] onl50t# make load ./script/cc_load.sh [Installing CAMAC device driver] [Adding CAMAC device driver to system] [Configuring CAMAC device driver] [Making CAMAC device files] sun4u onl50t# onl50t[176]% cam1 Input n a f (data)>3 0 0 N=3 A=0 F=0 Q=1 X=1 Data:000003(Hex) 00000003(Dec) Input n a f (data)>3 0 16 5 N=3 A=0 F=16 Q=1 X=1 Data:000005(Hex) 00000005(Dec) Input n a f (data)>^Conl50t[177]% Jan 24 14:48:04 onl50t unix: CAMAC device driver V1.4x, 1991-1993 by Y.TAKEUCHI (T.I.T.) onl50t[40]% onl50t[40]% Jan 24 14:50:11 onl50t unix: NOTICE: cc_open: debug step01. --- cc is 8 bytes Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_open: debug step01. --- ddi_get_soft_s tate(cc_state,unit) is 8 bytes Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_open: debug step02. --- cc->max_branch is 4 bytes Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_open: debug step02. --- CC_K_MAX_BRANC H is 4 bytes Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_open: debug step02. --- cc->max_branch = 0x1 Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode is 2 bytes Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode = 0x 0 Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf is 2 bytes Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf = 0x3 c01 Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step03. --- unit is 4 byt es Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step03. --- unit = 0x0 Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area is 262144 bytes Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area = 0x3116128 Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area [0] is 2 bytes Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area [0] = 0x0 Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area [1] = 0x0 Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode is 2 bytes Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode = 0x 0 Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf is 2 bytes Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf = 0x3 c11 Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step04. --- camac write Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step05. --- unit is 4 byt es Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step05. --- unit = 0x0 Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step05. --- mode is 2 byt es Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step05. --- mode = 0x0 Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step05. --- naf is 2 byte s Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step05. --- naf = 0x3c11 Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step05. --- cc->data_area [0] is 2 bytes Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step05. --- cc->data_area [0] = 0x0 Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode is 2 bytes Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode = 0x 0 Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf is 2 bytes Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf = 0x3 c01 Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step03. --- unit is 4 byt es Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step03. --- unit = 0x0 Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area is 262144 bytes Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area = 0x3116128 Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area [0] is 2 bytes Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area [0] = 0x0 Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area [1] = 0x2 Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode is 2 bytes Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode = 0x 0 Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf is 2 bytes Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf = 0x3 c11 Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step04. --- camac write Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step05. --- unit is 4 byt es Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step05. --- unit = 0x0 Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step05. --- mode is 2 byt es Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step05. --- mode = 0x0 Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step05. --- naf is 2 byte s Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step05. --- naf = 0x3c11 Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step05. --- cc->data_area [0] is 2 bytes Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step05. --- cc->data_area [0] = 0x0 Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode is 2 bytes Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode = 0x 0 Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf is 2 bytes Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf = 0x3 c01 Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step03. --- unit is 4 byt es Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step03. --- unit = 0x0 Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area is 262144 bytes Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area = 0x3116128 Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area [0] is 2 bytes Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area [0] = 0x0 Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area [1] = 0x3 Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode is 2 bytes Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode = 0x 0 Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf is 2 bytes Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf = 0x3 c11 Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step04. --- camac write Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step05. --- unit is 4 byt es Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step05. --- unit = 0x0 Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step05. --- mode is 2 byt es Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step05. --- mode = 0x0 Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step05. --- naf is 2 byte s Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step05. --- naf = 0x3c11 Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step05. --- cc->data_area [0] is 2 bytes Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step05. --- cc->data_area [0] = 0x0 Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode is 2 bytes Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode = 0x 0 Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf is 2 bytes Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf = 0x3 c01 Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step03. --- unit is 4 byt es Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step03. --- unit = 0x0 Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area is 262144 bytes Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area = 0x3116128 Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area [0] is 2 bytes Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area [0] = 0x0 Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area [1] = 0x7 Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode is 2 bytes Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode = 0x 0 Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf is 2 bytes Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf = 0x3 c11 Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step04. --- camac write Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step05. --- unit is 4 byt es Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step05. --- unit = 0x0 Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step05. --- mode is 2 byt es Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step05. --- mode = 0x0 Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step05. --- naf is 2 byte s Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step05. --- naf = 0x3c11 Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step05. --- cc->data_area [0] is 2 bytes Jan 24 14:50:11 onl50t Jan 24 14:50:11 onl50t unix: NOTICE: cc_write: debug step05. --- cc->data_area [0] = 0x0 Jan 24 14:50:11 onl50t onl50t[40]% onl50t[40]% onl50t[40]% <<< 以下は、NAF=3,0,0 実行時のメッセージ >>> onl50t[40]% onl50t[40]% Jan 24 14:50:38 onl50t unix: NOTICE: cc_write: debug step01. --- c c->mode is 2 bytes Jan 24 14:50:38 onl50t Jan 24 14:50:38 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode = 0x 0 Jan 24 14:50:38 onl50t Jan 24 14:50:38 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf is 2 bytes Jan 24 14:50:38 onl50t Jan 24 14:50:38 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf = 0x6 00 Jan 24 14:50:38 onl50t Jan 24 14:50:38 onl50t unix: NOTICE: cc_write: debug step03. --- unit is 4 byt es Jan 24 14:50:38 onl50t Jan 24 14:50:38 onl50t unix: NOTICE: cc_write: debug step03. --- unit = 0x0 Jan 24 14:50:38 onl50t Jan 24 14:50:38 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area is 262144 bytes Jan 24 14:50:38 onl50t Jan 24 14:50:38 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area = 0x3116128 Jan 24 14:50:38 onl50t Jan 24 14:50:38 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area [0] is 2 bytes Jan 24 14:50:38 onl50t Jan 24 14:50:38 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area [0] = 0x0 Jan 24 14:50:38 onl50t Jan 24 14:50:38 onl50t unix: NOTICE: cc_write: debug step03. --- cc->data_area [1] = 0x3 Jan 24 14:50:38 onl50t onl50t[40]% onl50t[40]% onl50t[40]% <<< 以下は、NAF=3,0,16 実行時のメッセージ >>> onl50t[40]% onl50t[40]% onl50t[40]% Jan 24 14:50:59 onl50t unix: NOTICE: cc_write: debug step01. --- c c->mode is 2 bytes Jan 24 14:50:59 onl50t Jan 24 14:50:59 onl50t unix: NOTICE: cc_write: debug step01. --- cc->mode = 0x 0 Jan 24 14:50:59 onl50t Jan 24 14:50:59 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf is 2 bytes Jan 24 14:50:59 onl50t Jan 24 14:50:59 onl50t unix: NOTICE: cc_write: debug step02. --- cc->naf = 0x6 10 Jan 24 14:50:59 onl50t Jan 24 14:50:59 onl50t unix: NOTICE: cc_write: debug step04. --- camac write Jan 24 14:50:59 onl50t unix: NOTICE: cc_write: debug step05. --- unit is 4 byt es Jan 24 14:50:59 onl50t Jan 24 14:50:59 onl50t unix: NOTICE: cc_write: debug step05. --- unit = 0x0 Jan 24 14:50:59 onl50t Jan 24 14:50:59 onl50t unix: NOTICE: cc_write: debug step05. --- mode is 2 byt es Jan 24 14:50:59 onl50t Jan 24 14:50:59 onl50t unix: NOTICE: cc_write: debug step05. --- mode = 0x0 Jan 24 14:50:59 onl50t Jan 24 14:50:59 onl50t unix: NOTICE: cc_write: debug step05. --- naf is 2 byte s Jan 24 14:50:59 onl50t Jan 24 14:50:59 onl50t unix: NOTICE: cc_write: debug step05. --- naf = 0x610 Jan 24 14:50:59 onl50t Jan 24 14:50:59 onl50t unix: NOTICE: cc_write: debug step05. --- cc->data_area [0] is 2 bytes Jan 24 14:50:59 onl50t Jan 24 14:50:59 onl50t unix: NOTICE: cc_write: debug step05. --- cc->data_area [0] = 0x0 Jan 24 14:50:59 onl50t cam1プログラムを起動した時、以前のように RUN LED が点灯したままにはなら ない。 一瞬だけ点いてすぐに消える。 これは正常な動作である。 続いて NAF=3,0,0 (camac read) と NAF=3,0,16 (camac write) 実行してみた。 この時は、どちらの場合も RUN LED が点灯したままになってしまった。 camac データウェイ・オペレーションは、NAF=3,0,0 (camac read) 時には実行される が、NAF=3,0,16 (camac write) 時には実行されなかった。 データウェイ・オペ レーションの実行確認は 3922 の BUSY LED で行った。 これで、CGENC、CGENZ、CGENI、CREMIの実行は正常に実行できるようになった。 続いて、データ転送を伴うシングルアクション read/write の部分を調べる。 (5-3). camac read に関係する部分を調べる ---xxxx (B). write の実行時 cam1 を走らせると、データウェイディスプレーの Z,C LED は点灯する。 そこで NAF=3,0,16 d=5 を実行すると、ADD-REC LED は一瞬だけ点灯し、RUN LED が点灯したままになる。 ---xxxx (4). cc_writeルーチンのチェック (4-1). copyin関数を調べる Kernel Functions for Drivers copyin(9F) NAME copyin - copy data from a user program to a driver buffer SYNOPSIS #include #include int copyin(const void *userbuf, void *driverbuf, size_t cn); INTERFACE LEVEL Architecture independent level 1 (DDI/DKI). PARAMETERS userbuf User program source address from which data is transferred. driverbuf Driver destination address to which data is transferred. cn Number of bytes transferred. DESCRIPTION copyin() copies data from a user program source address to a driver buffer. The driver developer must ensure that ade- quate space is allocated for the destination address. Addresses that are word-aligned are moved most efficiently. However, the driver developer is not obligated to ensure alignment. This function automatically finds the most effi- cient move according to address alignment. RETURN VALUES Under normal conditions a 0 is returned indicating a suc- cessful copy. Otherwise, a -1 is returned if one of the following occurs: o paging fault; the driver tried to access a page of memory for which it did not have read or write access o invalid user address, such as a user area or stack area o invalid address that would have resulted in data being copied into the user block If a -1 is returned to the caller, driver entry point rou- tines should return EFAULT. CONTEXT copyin() can be called from user context only. SunOS 5.7 Last change: 1 May 1996 1 Kernel Functions for Drivers copyin(9F) EXAMPLES Example 1: An ioctl() Routine A driver ioctl(9E) routine (line 10) can be used to get or set device attributes or registers. In the XX_GETREGS condi- tion (line 17), the driver copies the current device regis- ter values to a user data area (line 18). If the specified argument contains an invalid address, an error code is returned. 1 struct device { /* layout of physical device registers */ 2 int control; /* physical device control word */ 3 int status; /* physical device status word */ 4 short recv_char; /* receive character from device */ 5 short xmit_char; /* transmit character to device */ 6 }; 7 8 extern struct device xx_addr[]; /* phys. device regs. location */ 9 . . . 10 xx_ioctl(dev_t dev, int cmd, int arg, int mode, 11 cred_t *cred_p, int *rval_p) 12 ... 13 { 14 register struct device *rp = &xx_addr[getminor(dev) >> 4]; 15 switch (cmd) { 16 17 case XX_GETREGS: /* copy device regs. to user program */ 18 if (copyin(arg, rp, sizeof(struct device))) 19 return(EFAULT); 20 break; 21 ... 22 } 23 ... 24 } SEE ALSO ioctl(9E), bcopy(9F), copyout(9F), ddi_copyin(9F), ddi_copyout(9F), uiomove(9F). Writing Device Drivers NOTES Driver writers who intend to support layered ioctls in their ioctl(9E) routines should use ddi_copyin(9F) instead. Driver defined locks should not be held across calls to this function. This should not be used from a streams driver. See M_COPYIN and M_COPYOUT in STREAMS Programming Guide. SunOS 5.7 Last change: 1 May 1996 2 ---xxxx --- (6). セクション (6-1). サブセクション (6-1-1). サブサブセクション