Apr 13, 1999 frc7v-cl1: Server Solaris 2.6、cc ドライバのテスト --- クライアントシステム上での cc ドライバのデバッグ#01(その22) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (http://www-online.kek.jp/~inoue/CAMAC/onl8v1-sol2.6-serv/ Cli1-CAMAC/debug-step22.txt) 高エネルギー加速器研究機構 素粒子原子核研究所 物理、オンライングループ 井上 栄二 (1). 現状確認 (A). 株式会社ロジックハウスの白田様より SPARC CPU-8VT と、VMEドライバ v2.3.1 を借用した。 (B). 株式会社ロジックハウスの白田様より Server Solaris 2.6 のシステム がインストールされているハードディスクを借用した。 (C). 借用したハードディスクのサーバ側のシステム設定を変更して、KEK の FP クラスタ上で立ち上げた。 (D). ファイルを直接修正する方法で、クライアント(その1)側のシステム 設定を変更したがクライアントは立ち上がれなかった。 (E). Solsticeを起動してホストマネージャを使って、frc7v-cl1ディスクレス クライアントの設定をやり直した。 (F). ディスクレス・クライアントのシステム、frc7v-cl1 が起動できること を確認した。 (G). frc7v-cl1 のシステムにVMEドライバ、FRCvme-2.3.1 をインストールし、 その後、frc7v-cl1 のシステム設定をやり直した。 (H). Solsticeを起動してホストマネージャを使って、frc7v-cl2ディスクレス クライアントの設定をやり直した。 (I). ディスクレス・クライアントのシステム、frc7v-cl2 が起動できること を確認した。 (J). frc7v-cl1、クライアントのシステムに ccドライバをインストールした。 (K). frc7v-cl1、クライアントのシステム上でサンプル・プログラムを実行 シングルアクションの 24ビットread/write は ok. LAM割り込み処理は、ok. ブロック転送 read/write は NG. (L). CPU-7Vのボードで FRCvme2.3.1 が正しく動作できることを確認した。 (M). frc8vt、サーバ・システムに ccドライバをインストールした。 (N). frc8vt、サーバ・システム上でンプル・プログラムを実行 シングルアクションの 24ビットread/write は ok. LAM割り込み処理は、ok. ブロック転送 read/write は 16 および 24ビットとも、ok. (O). 株式会社ロジックハウスの高橋様の修正された ccドライバを実行したが 状況に変化はなかった。 (P). 株式会社ロジックハウスの白田様の提案より、デスクレス・クライアント のシステムにローカル・ディスクをつなぎ、マウントした後で ccドライバ を実行したが状況に変化はなかった。 (Q). cam2 プログラムを実行すると、 cc.cプログラム中のどの命令を実行 した時にパニックを起こすのか調べた。 (R). 株式会社ロジックハウスの高橋様の提案より、savecore について調べる。 savecoreコマンドにより、vmcore.x および unix.x ファイルを入手した。 (S). ドライバ・プログラムが DMA完了の待ち状態のままになっているのを 確認 (T). cam2プログラムを frc8vt、frc7v-cl1上で実行して結果を調べた。    frc8vt上での実行: (1). cv_wait_sig()コールが入っていると、そこで待ち状態が続く。 (2). cv_wait_sig()コールが入っていないと、正常終了する。    frc7v-cl1上での実行: (1). cv_wait_sig()コールが入っていると、そこで待ち状態が続く。 (U). cv_wait_sig() を while文でループさせることで、シグナルを受け取れた (V). DMA 開始前に以前の割り込み信号が残って影響を与えていないことを 確認した。 (W). バーチャル・アドレス・スペースの割り当てを追加して動作させてみたが 症状は変わらない。 (X). cc->bp へのアクセスを camac_b()ルーチンでやらないようにしてみたが 症状は変わらない。 (Y). Soft State Managementルーチンを使ってみたが症状は変わらない。 (Z). minphys のバッファサイズを大きくして試してみたが症状は変わらない。 (2-A). camac_b()を呼び出す箇所で渡す値をチェックしたが症状は変わらない。 (2-B). クラッシュダンプのチェック。 physio()でエラー。 (2-C). cc_strategy()ルーチンをチェック。 physio()でエラー。 (2-D). cc_strategy()ルーチンのcv_wait() を mutexロックした。変化なし。 (2-E). クラッシュダンプのチェック。 camac_b+0x2d0アドレスでエラー。 0xf60b5080?i camac_b+0x2d0: ld [%l0], %l1 $q (2-F). cc_device構造体へ cc_sys_statusを付加して調べた。 変化なし。 (2-G). cc->cc_sys_status = bp->b_error; の行をcc_intr()ルーチンへ持って いって動作させた。 ok. cam2、camacブロック転送は正常に実行できた。 (2-H). デバッグ用に付加した部分で実行上必要のない文を削除した。cam3実行 でタイムアウト時にシステムクラッシュが起きた。 (2). ここでやるべきこと cam3のデバッグをやる。 状況確認。 (3). cam3実行時にタイムアウトでシステムクラッシュを起こす状況を確認 cam3、camac割り込み処理を実行する。 frc7v-cl1[61]% cam3 *** Now waiting LAM ... N=3 Loop=10 Timeout=0 sec Interrupted !! count=1 Interrupted !! count=2 Interrupted !! count=3 Interrupted !! count=4 Interrupted !! count=5 Interrupted !! count=6 Interrupted !! count=7 ここで故意にタイムアウトを起こしてみた。 システムはパニックを起こしてリブートしてしまった。 BAD TRAP: type=9 rp=fbe25cb4 addr=70 mmu_fsr=1a6 rw=2 sched: Data fault kernel write fault at addr=0x70, pme=0x0 MMU sfsr=1a6: Invalid Address on supv data store at level 1 pte addr = 0xf5981000, level = 1 pid=0, pc=0xf0067430, sp=0xfbe25d00, psr=0x48000c5, context=0 g1-g7: 8, f02368c0, fbe25e80, 0, 0, 1, fbe25e80 Begin traceback... sp = fbe25d00 Called from f0092a38, fp=fbe25d60, args=fc08da30 f6087a68 20 f0274e38 a91 0 Called from f0092b44, fp=fbe25dc0, args=f5927aa0 f59282c0 107dd33 f5927ac0 40000 000 f592878c Called from f005fc58, fp=fbe25e20, args=f5927aa0 f5927ab4 f0274e38 f0274e38 f59b b4ac 4400ae2 Called from f0092afc, fp=0, args=f5927aa0 0 a0000 2d50b 63b5025c 1 End traceback... panic: Data fault syncing file systems... 2 done 2864 static and sysmap kernel pages 84 dynamic kernel data pages 494 kernel-pageable pages 0 segkmap kernel pages 0 segvn kernel pages 0 current user process pages 3442 total pages (3442 chunks) dumping to vp f59444dc, offset 140440 3442 total pages, dump succeeded rebooting... Resetting ... screen not found. Can't open input device. Keyboard not present. Using tty for input and output. SPARC CPU-7V, No Keyboard ROM Rev. 2.15.1, 64 MB memory installed, Serial #9157050. Ethernet address 0:80:42:b:49:ba, Host ID: 808bb9ba. apply failed. Initializing Memory - Type help for more information ok ok boot net -r Boot device: /iommu/sbus/ledma@5,8400010/le@5,8c00000 File and args: -r 2dc00 hostname: frc7v-cl1 domainname: kek.jp root server: frc8vt root directory: /export/root/frc7v-cl1 SunOS Release 5.6 Version Generic_105181-05 [UNIX(R) System V Release 4.0] Copyright (c) 1983-1997, Sun Microsystems, Inc. configuring network interfaces: le0. Hostname: frc7v-cl1 Configuring the /devices directory FRCvme V2.3.1 VME Nexus (FGA-5000 FGA-5100) NOTICE: VME: slavewin at vme=0x0, size=0x100000 space=0x2d020617 CAMAC device driver V1.3x, 1991-1993 by Y.TAKEUCHI (T.I.T.) cc0 at VME0: vme16d16 0xff00 VME level 4 vector 0xff sparc ipl 7 vmemem0 at VME0: vme32d16 0x0 vmemem1 at VME0: vme16d16 0x0 vmemem2 at VME0: vme24d16 0x0 vmemem3 at VME0: vme32d32 0x0 vmemem4 at VME0: vme16d32 0x0 vmemem5 at VME0: vme24d32 0x0 vmeplus0 at VME0: vme16d16 0x0 and vme24d16 0x0 and vme32d16 0x0 and vme16d32 0x 0 and vme24d32 0x0 and vme32d32 0x0 and space 0x2f offset 0x0 and space 0x6f offset 0x0 and space 0x10 offset 0x0 and space 0x11 offset 0x0 and space 0x50 offset 0x0 and space 0x51 offset 0x0 vmedma0 at VME0 vmefdma0 at VME0 vmedvma0 at VME0 vmectl0 at VME0 Configuring the /dev directory Configuring the /dev directory (compatibility devices) The system is coming up. Please wait. checking for crash dump...System went down at Wed Apr 7 14:52:09 1999 Saving 3442 pages of image in vmcore.44 3442 pages saved. Processing modules: Done. Constructing Namelist file: /var/crash/frc7v-cl1/unix.44 Namelist file complete. default ICCFP1.kek.jp done add net default: gateway ICCFP1 NIS domainname is kek.jp starting rpc services: rpcbind keyserv done. Setting netmask of le0 to 255.255.252.0 Setting default interface for multicast: add net 224.0.0.0: gateway frc7v-cl1 "/dev/swap" is not valid for swapping. It must be a block device or a regular file with the "save user text on execution" bit set. syslog service starting. syslogd: line 24: unexpected getnetconfig failure Print services started. volume management starting. Wnn6: Key License Server started.... Nihongo Multi Client Server (Wnn6 R2.30) Finished Reading Files The system is ready. frc7v-cl1 console login: ホームディレクトリをマウントする。 onlsun1[59]% !! rlogin frc7v-cl1 Password: No directory! Logging in with home=/ Last login: Wed Apr 7 11:37:39 from onlsun1.kek.jp Sun Microsystems Inc. SunOS 5.6 Generic August 1997 frc7v-cl1% su Password: # mount frc8vt:/export/home/frc8vt /export/home/frc7v-cl1 # frc7v-cl1% logout Connection closed. onlsun1[60]% !! rlogin frc7v-cl1 Last login: Wed Apr 7 15:00:06 from onlsun1.kek.jp Sun Microsystems Inc. SunOS 5.6 Generic August 1997 frc7v-cl1[33]% ls -l total 10 drwxr-xr-x 3 inoue staff 512 Feb 9 15:34 CAMAC/ drwxr-xr-x 3 inoue staff 512 Apr 5 17:47 Driver-samples-2.6/ drwxr-xr-x 3 inoue staff 512 Nov 6 11:07 FORCE/ drwxr-xr-x 2 inoue staff 512 Feb 18 10:29 Ktaka/ -rw------- 1 inoue staff 592 Feb 26 16:49 mbox frc7v-cl1[34]% クラッシュ・ファイルをチェックする。 frc7v-cl1[40]% adb -k unix.44 vmcore.44 physmem 3e2d $c complete_panic(0x0,0x4400ce0,0x0,0x44000e0,0x0,0xf00) + 5c do_panic(0x1,0xfbe25b64,0x0,0x48000e0,0x1,0xf5bc9400) + a8 vcmn_err(0x3,0xf0269878,0xfbe25b64,0x3,0xffeec000,0x0) + 180 cmn_err(0x3,0xf0269878,0xfbe26,0x53,0x53,0xf025e400) + 1c die(0x9,0xfbe25cb4,0x70,0x1a6,0x2,0xf0269878) + bc trap(0x0,0xfbe25cb4,0xf0000000,0x0,0x2,0x1) + 7e4 fault(?) + 84 mutex_enter(0x70,0xfc08da30,0xf026de48,0xf026de8c,0xf026f050,0xf005faa0) cc_timeout(0xfc08da30,0xf6087a68,0x20,0xf0274e38,0xa91,0x0) + 38 callout_execute(0xf5927aa0,0xf59282c0,0x107dd33,0xf5927ac0,0x40000000,0xf592878c ) + b8 callout_thread(0xf5927aa0,0xf5927ab4,0xf0274e38,0xf0274e38,0xf59bb4ac,0x4400ae2) + 48 0xf0067430?i mutex_enter: mutex_enter: ldstub [%o0], %o1 mutex_enter,50?ai mutex_enter: mutex_enter: ldstub [%o0], %o1 mutex_enter+4: orcc %g0, %o1, %g0 mutex_enter+8: bne mutex_vector_enter mutex_enter+0xc: sra %g7, 0x5, %o2 mutex_enter+0x10: jmp %o7 + 0x8 mutex_enter+0x14: st %o2, [%o0] mutex_adaptive_tryenter: ldstub [%o0], %o1 mutex_adaptive_tryenter+4: orcc %g0, %o1, %g0 mutex_adaptive_tryenter+8: bne mutex_adaptive_tryenter+0x18 mutex_adaptive_tryenter+0xc: sra %g7, 0x5, %o2 mutex_adaptive_tryenter+0x10: jmp %o7 + 0x8 mutex_adaptive_tryenter+0x14: st %o2, [%o0] mutex_adaptive_tryenter+0x18: jmp %o7 + 0x8 mutex_adaptive_tryenter+0x1c: clr %o0 lockstat_enter_wrapper: save %sp, -0x60, %sp lockstat_enter_wrapper+4: ldub [%g7 + 0x59], %l0 lockstat_enter_wrapper+8: add %l0, 0x1, %l1 lockstat_enter_wrapper+0xc: stb %l1, [%g7 + 0x59] lockstat_enter_wrapper+0x10: sethi %hi(0xf027a000), %g1 lockstat_enter_wrapper+0x14: ld [%g1 + 0x260], %g1 lockstat_enter_wrapper+0x18: mov %i0, %o0 lockstat_enter_wrapper+0x1c: mov %i7, %o1 lockstat_enter_wrapper+0x20: jmpl %g1, %o7 lockstat_enter_wrapper+0x24: mov %g7, %o2 lockstat_enter_wrapper+0x28: stb %l0, [%g7 + 0x59] lockstat_enter_wrapper+0x2c: ret lockstat_enter_wrapper+0x30: restore %g0, 0x1, %o0 mutex_exit: ld [%o0], %o2 mutex_exit+4: sra %g7, 0x5, %o1 mutex_exit+8: cmp %o1, %o2 mutex_exit+0xc: be,a mutex_exit_nofault mutex_exit+0x10: swap [%o0], %g0 mutex_exit+0x14: ba,a mutex_vector_exit mutex_exit+0x18: nop mutex_exit_nofault: lduh [%o0 + 0x4], %o1 mutex_exit_nofault+4: orcc %g0, %o1, %g0 mutex_exit_nofault+8: bne mutex_adaptive_release mutex_exit_nofault+0xc: nop mutex_exit_fault: jmp %o7 + 0x8 mutex_exit_fault+4: mov 0x20, %o2 mutex_exit_fault+8: mov 0x1, %o3 lockstat_exit_wrapper: save %sp, -0x60, %sp lockstat_exit_wrapper+4: ldub [%g7 + 0x59], %l0 lockstat_exit_wrapper+8: add %l0, 0x1, %l1 lockstat_exit_wrapper+0xc: stb %l1, [%g7 + 0x59] lockstat_exit_wrapper+0x10: sethi %hi(0xf027a000), %g1 lockstat_exit_wrapper+0x14: ld [%g1 + 0x264], %g1 lockstat_exit_wrapper+0x18: mov %i0, %o0 lockstat_exit_wrapper+0x1c: mov %i7, %o1 lockstat_exit_wrapper+0x20: mov %i2, %o2 lockstat_exit_wrapper+0x24: mov %i3, %o3 lockstat_exit_wrapper+0x28: jmpl %g1, %o7 lockstat_exit_wrapper+0x2c: mov %g7, %o4 lockstat_exit_wrapper+0x30: stb %l0, [%g7 + 0x59] lockstat_exit_wrapper+0x34: ret lockstat_exit_wrapper+0x38: restore rw_enter: rd %psr, %o5 rw_enter+4: andn %o5, 0xf00, %g1 rw_enter+8: wr %g1, 0xa00, %psr rw_enter+0xc: srl %o0, 0x6, %o4 rw_enter+0x10: sethi %hi(0xf025f400), %o3 rw_enter+0x14: or %o3, 0x0, %o3 rw_enter+0x18: and %o4, 0x3ff, %o4 rw_enter+0x1c: add %o3, %o4, %o3 rw_enter+0x20: ldstub [%o3], %o4 rw_enter+0x24: orcc %g0, %o4, %g0 rw_enter+0x28: be rw_enter+0x48 rw_enter+0x2c: and %o5, 0xf00, %o5 rw_enter+0x30: save %sp, -0x60, %sp rw_enter+0x34: call atomic_lock_set rw_enter+0x38: mov %i3, %o0 rw_enter+0x3c: restore rw_enter+0x40: rd %psr, %g1 rw_enter+0x44: andn %g1, 0xf00, %g1 rw_enter+0x48: cmp %o1, 0x0 rw_enter+0x4c: be rw_enter+0x98 rw_enter+0x50: ld [%o0], %o4 rw_enter+0x54: ld [%g7 + 0xf8], %o2 rw_enter+0x58: add %o2, 0x1, %o2 rw_enter+0x5c: st %o2, [%g7 + 0xf8] cc_timeout,50?ai cc_timeout: cc_timeout: save %sp, -0x60, %sp cc_timeout+4: st %i0, [%fp + 0x44] cc_timeout+8: sethi %hi(0xf608f400), %l0 cc_timeout+0xc: or %l0, 0x264, %l0 cc_timeout+0x10: ld [%l0], %l0 cc_timeout+0x14: ld [%fp + 0x44], %l1 cc_timeout+0x18: or %l0, %g0, %o0 cc_timeout+0x1c: or %l1, %g0, %o1 cc_timeout+0x20: call ddi_get_soft_state cc_timeout+0x24: nop cc_timeout+0x28: or %o0, %g0, %l0 cc_timeout+0x2c: or %l0, %g0, %i5 cc_timeout+0x30: add %i5, 0x70, %l0 cc_timeout+0x34: or %l0, %g0, %o0 cc_timeout+0x38: call mutex_enter cc_timeout+0x3c: nop cc_timeout+0x40: add %i5, 0xa0, %l0 cc_timeout+0x44: ld [%l0], %l0 cc_timeout+0x48: cmp %l0, 0x0 cc_timeout+0x4c: be cc_timeout+0xa0 cc_timeout+0x50: nop cc_timeout+0x54: add %i5, 0x90, %l0 cc_timeout+0x58: ld [%l0], %l0 cc_timeout+0x5c: or %l0, %g0, %o0 cc_timeout+0x60: call ddi_dma_unbind_handle cc_timeout+0x64: nop cc_timeout+0x68: add %i5, 0x9c, %l0 cc_timeout+0x6c: ld [%l0], %l0 cc_timeout+0x70: add %l0, 0x54, %l0 cc_timeout+0x74: ld [%l0], %l1 cc_timeout+0x78: add %i5, 0xa4, %l0 cc_timeout+0x7c: st %l1, [%l0] cc_timeout+0x80: add %i5, 0x9c, %l0 cc_timeout+0x84: ld [%l0], %l0 cc_timeout+0x88: or %l0, %g0, %o0 cc_timeout+0x8c: call biodone cc_timeout+0x90: nop cc_timeout+0x94: clr %l1 cc_timeout+0x98: add %i5, 0xa0, %l0 cc_timeout+0x9c: st %l1, [%l0] cc_timeout+0xa0: add %i5, 0x50, %l0 cc_timeout+0xa4: ld [%l0], %l0 cc_timeout+0xa8: sethi %hi(0x8000), %l1 cc_timeout+0xac: or %l0, %l1, %l1 cc_timeout+0xb0: add %i5, 0x50, %l0 cc_timeout+0xb4: st %l1, [%l0] cc_timeout+0xb8: add %i5, 0x78, %l0 cc_timeout+0xbc: or %l0, %g0, %o0 cc_timeout+0xc0: call cv_signal cc_timeout+0xc4: nop cc_timeout+0xc8: add %i5, 0x70, %l0 cc_timeout+0xcc: or %l0, %g0, %o0 cc_timeout+0xd0: call mutex_exit cc_timeout+0xd4: nop cc_timeout+0xd8: ba cc_timeout+0xe0 cc_timeout+0xdc: nop cc_timeout+0xe0: ret cc_timeout+0xe4: restore cc_timeout+0xe8: unimp 0x10000 cc_timeout+0xec: unimp 0x10000 cc_timeout+0xf0: unimp 0x10000 cc_timeout+0xf4: unimp 0x10000 cc_intr: save %sp, -0x68, %sp cc_intr+4: st %i0, [%fp + 0x44] cc_intr+8: sethi %hi(0xf608f400), %l0 cc_intr+0xc: or %l0, 0x264, %l0 cc_intr+0x10: ld [%l0], %l0 cc_intr+0x14: ld [%fp + 0x44], %l1 cc_intr+0x18: or %l0, %g0, %o0 cc_intr+0x1c: or %l1, %g0, %o1 cc_intr+0x20: call ddi_get_soft_state cc_intr+0x24: nop cc_intr+0x28: or %o0, %g0, %l0 cc_intr+0x2c: or %l0, %g0, %i5 cc_intr+0x30: add %i5, 0x70, %l0 cc_intr+0x34: or %l0, %g0, %o0 cc_intr+0x38: call mutex_enter cc_intr+0x3c: nop cc_intr+0x40: add %i5, 0x8, %l0 cc_intr+0x44: ld [%l0], %l0 callout_execute,50?ai callout_execute: callout_execute: save %sp, -0x60, %sp callout_execute+4: call mutex_enter callout_execute+8: mov %i0, %o0 callout_execute+0xc: sethi %hi(0x40000000), %i4 callout_execute+0x10: sethi %hi(0x80000000), %l1 callout_execute+0x14: add %i0, 0x820, %i1 callout_execute+0x18: add %i0, 0x20, %i3 callout_execute+0x1c: ld [%i0 + 0xc], %o0 callout_execute+0x20: ld [%i0 + 0x10], %l0 callout_execute+0x24: mov %l0, %i2 callout_execute+0x28: sub %l0, %o0, %o1 callout_execute+0x2c: cmp %o1, 0x0 callout_execute+0x30: bg callout_execute+0x174 callout_execute+0x34: and %l0, 0x1ff, %o1 callout_execute+0x38: sll %o1, 0x2, %o1 callout_execute+0x3c: ld [%o1 + %i1], %l2 callout_execute+0x40: cmp %l2, 0x0 callout_execute+0x44: be callout_execute+0x15c callout_execute+0x48: add %i1, %o1, %i5 callout_execute+0x4c: ld [%l2 + 0x10], %o0 callout_execute+0x50: ld [%l2 + 0x14], %o1 callout_execute+0x54: or %o0, %l1, %l3 callout_execute+0x58: cmp %o1, %l0 callout_execute+0x5c: bne,a callout_execute+0x148 callout_execute+0x60: ld [%l2 + 0x8], %l2 callout_execute+0x64: andcc %o0, %l1, %g0 callout_execute+0x68: bne,a callout_execute+0x148 callout_execute+0x6c: ld [%l2 + 0x8], %l2 callout_execute+0x70: mov %i0, %o0 callout_execute+0x74: st %g7, [%l2 + 0x20] callout_execute+0x78: call mutex_exit callout_execute+0x7c: st %l3, [%l2 + 0x10] callout_execute+0x80: andcc %l3, %i4, %g0 callout_execute+0x84: be callout_execute+0xb4 callout_execute+0x88: sethi %hi(0xf028c400), %o0 callout_execute+0x8c: add %o0, 0x9c, %l4 callout_execute+0x90: call mutex_enter callout_execute+0x94: mov %l4, %o0 callout_execute+0x98: ld [%l2 + 0x18], %o1 callout_execute+0x9c: jmpl %o1, %o7 callout_execute+0xa0: ld [%l2 + 0x1c], %o0 callout_execute+0xa4: call mutex_exit callout_execute+0xa8: mov %l4, %o0 callout_execute+0xac: ba callout_execute+0xc0 callout_execute+0xb0: nop callout_execute+0xb4: ld [%l2 + 0x18], %o1 callout_execute+0xb8: jmpl %o1, %o7 callout_execute+0xbc: ld [%l2 + 0x1c], %o0 callout_execute+0xc0: call mutex_enter callout_execute+0xc4: mov %i0, %o0 callout_execute+0xc8: ld [%l2], %o1 callout_execute+0xcc: ld [%l2 + 0x4], %o0 callout_execute+0xd0: cmp %o1, 0x0 callout_execute+0xd4: be callout_execute+0xe0 callout_execute+0xd8: cmp %o0, 0x0 callout_execute+0xdc: st %o0, [%o1 + 0x4] callout_execute+0xe0: be,a callout_execute+0xf4 callout_execute+0xe4: sra %l3, 0x4, %o0 callout_execute+0xe8: st %o1, [%o0] callout_execute+0xec: ba callout_execute+0x104 callout_execute+0xf0: ld [%l2 + 0x8], %o1 callout_execute+0xf4: and %o0, 0x1ff, %o0 callout_execute+0xf8: sll %o0, 0x2, %o0 callout_execute+0xfc: st %o1, [%o0 + %i3] callout_execute+0x100: ld [%l2 + 0x8], %o1 callout_execute+0x104: ld [%l2 + 0xc], %o0 callout_execute+0x108: cmp %o1, 0x0 callout_execute+0x10c: be callout_execute+0x118 callout_execute+0x110: cmp %o0, 0x0 callout_execute+0x114: st %o0, [%o1 + 0xc] callout_execute+0x118: be,a callout_execute+0x12c callout_execute+0x11c: st %o1, [%i5] callout_execute+0x120: st %o1, [%o0 + 0x8] callout_execute+0x124: ba callout_execute+0x130 callout_execute+0x128: ld [%i0 + 0x8], %o0 callout_execute+0x12c: ld [%i0 + 0x8], %o0 callout_execute+0x130: st %o0, [%l2] callout_execute+0x134: add %l2, 0x24, %o0 callout_execute+0x138: st %l2, [%i0 + 0x8] callout_execute+0x13c: call cv_broadcast callout_thread,30?ai callout_thread: callout_thread: save %sp, -0x60, %sp callout_thread+4: sethi %hi(0xf027d400), %o2 callout_thread+8: sethi %hi(0xf0092000), %o0 callout_thread+0xc: sethi %hi(0xf0279400), %g1 callout_thread+0x10: mov %g7, %o4 callout_thread+0x14: add %g1, 0x3cc, %o1 callout_thread+0x18: add %o2, 0x2ac, %o3 callout_thread+0x1c: add %o0, 0x3ec, %o0 callout_thread+0x20: call callb_add_thread callout_thread+0x24: clr %o2 callout_thread+0x28: add %i0, 0x14, %i1 callout_thread+0x2c: call mutex_enter callout_thread+0x30: mov %i0, %o0 callout_thread+0x34: mov %i1, %o0 callout_thread+0x38: call cv_wait callout_thread+0x3c: mov %i0, %o1 callout_thread+0x40: call mutex_exit callout_thread+0x44: mov %i0, %o0 callout_thread+0x48: call callout_execute callout_thread+0x4c: mov %i0, %o0 callout_thread+0x50: ba callout_thread+0x2c callout_thread+0x54: nop callout_schedule_1: save %sp, -0x60, %sp callout_schedule_1+4: call mutex_enter callout_schedule_1+8: mov %i0, %o0 callout_schedule_1+0xc: sethi %hi(0xf028c400), %o0 callout_schedule_1+0x10: ld [%i0 + 0x10], %o3 callout_schedule_1+0x14: ld [%o0 + 0x88], %o1 callout_schedule_1+0x18: mov %i0, %i1 callout_schedule_1+0x1c: sub %o3, %o1, %o0 callout_schedule_1+0x20: cmp %o0, 0x0 callout_schedule_1+0x24: st %o1, [%i0 + 0xc] callout_schedule_1+0x28: bg callout_schedule_1+0xc0 callout_schedule_1+0x2c: sethi %hi(0x80000000), %o2 callout_schedule_1+0x30: add %i0, 0x820, %o0 callout_schedule_1+0x34: and %o3, 0x1ff, %o4 callout_schedule_1+0x38: sll %o4, 0x2, %o4 callout_schedule_1+0x3c: ld [%o0 + %o4], %o4 callout_schedule_1+0x40: cmp %o4, 0x0 callout_schedule_1+0x44: be,a callout_schedule_1+0xb0 callout_schedule_1+0x48: add %o3, 0x1, %o3 callout_schedule_1+0x4c: ld [%o4 + 0x14], %o5 callout_schedule_1+0x50: cmp %o5, %o3 callout_schedule_1+0x54: bne,a callout_schedule_1+0xa0 callout_schedule_1+0x58: ld [%o4 + 0x8], %o4 callout_schedule_1+0x5c: ld [%o4 + 0x10], %o5 callout_schedule_1+0x60: andcc %o5, %o2, %g0 callout_schedule_1+0x64: bne,a callout_schedule_1+0xa0 $ #include #include #include "camlib.h" #define DEFN 3 #define DEFLOP 10 #define DEFTIMEOUT 10 /**************************** * Main routine * ****************************/ main(argc, argv) int argc; char *argv[]; { int i, n, mask, status; int nafenalam, nafdislam, nafclrlam; int dat, q, x; int loop, timeo; /* Read options */ n = (argc > 1) ? atoi(argv[1]) : DEFN; loop = (argc > 2) ? atoi(argv[2]) : DEFLOP; timeo = (argc > 3) ? atoi(argv[3]) : DEFTIMEOUT; /* Initialize valiable */ mask = 1 << (n - 1); nafenalam = NAF(n, 0, 26); nafdislam = NAF(n, 0, 24); nafclrlam = NAF(n, 0, 10); /* Open and Initialize CAMAC */ status = 0; status += CAM_Open("/k3922",1); status += CSETBR(1); status += CSETCR(0); status += CGENC(); status += CGENZ(); status += CREMI(); if (status != 0) { printf("INIT. ERROR!\n"); exit(1); } /* Enable LAM */ status = 0; status = CAMAC(nafenalam, &dat, &q, &x); status += CAM_EnableLAM(mask); if (status != 0) { printf("Enable LAM ERROR! N=%d status=0x%x\n", n, status); /* exit(2); */ } /******** * loop * ********/ printf("\n\n*** Now waiting LAM ... N=%d Loop=%d Timeout=%d sec\n\n", n, loop, timeo / 100); for(i = 0; i < loop; i++) { if (CAM_WaitLAM(timeo)) /* Wait event */ printf("Timeout !! count=%d\n", i + 1); else printf("Interrupted !! count=%d\n", i + 1); CAMAC(nafclrlam, &dat, &q, &x); /* clear LAM */ /* CAMAC(NAF(11,0,8), &dat, &q, &x); printf("%d\n",q); */ } CAM_DisableLAM(); CAM_Close(); printf("\n\n*** cam3 nomal end.\n\n"); } frc7v-cl1[54]% cam3プログラムでやっていることのポイントをチェック。 status = CAMAC(nafenalam, &dat, &q, &x); status += CAM_EnableLAM(mask); : for(i = 0; i < loop; i++) { if (CAM_WaitLAM(timeo)) /* Wait event */ printf("Timeout !! count=%d\n", i + 1); else printf("Interrupted !! count=%d\n", i + 1); CAMAC(nafclrlam, &dat, &q, &x); /* clear LAM */ /* CAMAC(NAF(11,0,8), &dat, &q, &x); printf("%d\n",q); */ } CAM_DisableLAM(); ステップとしては、 1. camacモジュールに対して LAMイネーブルを実行。 2. camacコントローラに対して LAMイネーブルを実行。 3. LAM を待つ。 4. LAM割り込みが発生したら、LAMソースをクリアする。 5. タイムアウトタイム内にLAM割り込みが発生しなかったら タイムアウト処理を行う。 6. 指定回数だけ LAM処理が実行されたら、camacコントローラに対して LAMディセーブルを実行。 の部分がポイントになる。 この内、項目 1 と 4 は camacシングルアクション動作である。 これについて は正常に動作するのを確認しているので、ここでは調査の対象からはずす。 項目 2、3 および 5 を中心に調べる。 1. CAM_EnableLAM(mask) 2. CAM_WaitLAM(timeo) 3. printf("Timeout !! count=%d\n", i + 1); CAM_EnableLAM()ルーチンが実行していることを調べる。 frc7v-cl1[57]% pwd /export/home/frc7v-cl1/inoue/CAMAC/Driver/FORCE-5V-sol2.5 frc7v-cl1[58]% ls Makefile camlib.o cc_common.h README cc cc_config.h cam1* cc.c forlib.c cam1.c cc.c-Apr-7-1999-ok forlib.o cam2* cc.c-bak/ k2917.h cam2.f cc.c-org ktaka/ cam2.nm cc.conf libcamac.a cam3* cc.h out cam3.c cc.h-Apr-5-1999 out1 camlib.c cc.h-org out2 camlib.h cc.new.c* script/ frc7v-cl1[59]% grep CAM_EnableLAM * cam3.c: status += CAM_EnableLAM(mask); camlib.h:#define CAM_EnableLAM CELAM frc7v-cl1[60]% grep CELAM * cam2.nm:[165] | 75952| 40|FUNC |GLOB |0 |8 |CELAM camlib.c:CELAM(mask) camlib.h:#define CAM_EnableLAM CELAM camlib.h:#define CENLAM CELAM forlib.c: CELAM(*mask); frc7v-cl1[61]% vi camlib.c : CELAM(mask) int mask; { return ioctl(cc_path, CCIOC_ENABLE_LAM, &mask); } : frc7v-cl1[62]% CAM_WaitLAM()ルーチンが実行していることを調べる。 frc7v-cl1[62]% grep CAM_WaitLAM * cam3.c: if (CAM_WaitLAM(timeo)) /* Wait event */ camlib.h:#define CAM_WaitLAM CWLAM frc7v-cl1[63]% grep CWLAM * cam2.nm:[173] | 76028| 52|FUNC |GLOB |0 |8 |CWLAM camlib.c:CWLAM(timeout) camlib.h:#define CAM_WaitLAM CWLAM camlib.h:#define CWTLAM CWLAM forlib.c: return CWLAM(*timeout); frc7v-cl1[64]% vi camlib.c : CWLAM(timeout) int timeout; { errno = 0; ioctl(cc_path, CCIOC_WAIT_LAM, &timeout); return errno; } : frc7v-cl1[65]% 調べる部分は、次の個所が中心となる。 ioctl(cc_path, CCIOC_ENABLE_LAM, &mask); ioctl(cc_path, CCIOC_WAIT_LAM, &timeout); cc_timeout cc.cファイルをチェック。 frc7v-cl1[69]% vi cc.c : void cc_timeout(int unit) { /* register struct cc_device *cc = &ccdevice[0]; */ register struct cc_device *cc; cc = ddi_get_soft_state(cc_state,unit); mutex_enter(&cc->mutex); /* start MUTEX */ /* free DMA resources */ if (cc->executing_dma_flag != 0) { /* chenge logichouse */ /* ddi_dma_free(cc->handle); */ ddi_dma_unbind_handle(cc->handle); /* end */ cc->cc_sys_status = cc->bp->b_error; biodone(cc->bp); cc->executing_dma_flag = 0; } /* set timeout */ cc->interrupt |= CC_INT_TIMEOUT; cv_signal(&cc->cv); mutex_exit(&cc->mutex); /* end MUTEX */ return; } : : static int cc_ioctl(dev_t dev, int cmd, int arg, int flag, cred_t *cred_p, int *rval_p) { /* register struct cc_device *cc = &ccdevice[0]; */ register struct cc_device *cc; /* register struct K_REG *k = cc->k; */ u_short sdat; int idat, *data = (int *)arg; int s; minor_t unit; unit = getminor(dev); cc = ddi_get_soft_state(cc_state,unit); switch (cmd) { case CCIOC_CHK_BRANCH: *(int *)data = cc->max_branch; break; case CCIOC_SET_BRANCH: if (*(int *)data >= 0 && *(int *)data < cc->max_branch) cc->cur_branch = *(int *)data; break; case CCIOC_SET_CRATE: if (*(int *)data >= 0 && *(int *)data < MAX_CRATE) cc->cur_crate = *(int *)data; break; case CCIOC_WAIT_LAM : cc->interrupt = 0; cc->k->lamc = CC_INT_AUTO_CLEAR | CC_INT_ENABLE | intrpri; /* lock out clock */ s = spl5(); if (cc->interrupt & CC_INT_LAM) { cc->interrupt &= ~CC_INT_LAM; return 0; } mutex_enter(&cc->mutex); /* start MUTEX */ cc->timeout_id = timeout(cc_timeout, (caddr_t)&unit, *(int *)data * hz); /* wait interrupt */ /* cv_timedwait(&cc->cv, &cc->mutex, timeout); if (cc->interrupt == 0) cc->interrupt |= CC_INT_TIMEOUT; */ if (cv_wait_sig(&cc->cv, &cc->mutex) == 0) { untimeout(cc->timeout_id); mutex_exit(&cc->mutex); /* end MUTEX */ return EINTR; } mutex_exit(&cc->mutex); /* end MUTEX */ splx(s); if( cc->interrupt & CC_INT_LAM ) { cc->interrupt &= ~CC_INT_LAM; } else if( cc->interrupt & CC_INT_TIMEOUT ) { cc->interrupt &= ~CC_INT_TIMEOUT; return CC_STA_SINGLE_TIMEOUT; /* set value to "errno" */ } break; case CCIOC_ENABLE_LAM : camac_s(unit, CC_BIT24, NAF(30, 13, 17), (u_short *)data); camac_s(unit, CC_BIT16, NAF(30, 0, 1), &sdat); sdat |= 0x100; camac_s(unit, CC_BIT16, NAF(30, 0, 17), &sdat); break; case CCIOC_DISABLE_LAM : cc->k->lamc = CC_INT_AUTO_CLEAR | intrpri; idat = 0; camac_s(unit, CC_BIT24, NAF(30, 13, 17), (u_short *)&idat); camac_s(unit, CC_BIT16, NAF(30, 0, 1), &sdat); sdat &= ~0x100; camac_s(unit, CC_BIT16, NAF(30, 0, 17), &sdat); break; case CCIOC_REG_DUMP : /* data[0] = k->cser; data[1] = k->docr; data[2] = k->sccr; data[3] = k->mtc; data[4] = k->machi; data[5] = k->maclo; data[6] = k->lamc; data[7] = k->donc; data[8] = k->empc; data[9] = k->aboc; data[10] = k->lamv; data[11] = k->donv; data[12] = k->empv; data[13] = k->abov; data[14] = k->amr; data[15] = k->cma; data[16] = k->cwc; data[17] = k->srr; data[18] = k->csr; */ break; case CCIOC_RESET : cc->k->csr = CC_RST; /* by E.Inoue from >>> */ /* set interrupt registers of K2917 */ cc->k->lamc = (u_short)(CC_INT_AUTO_CLEAR | intrpri); cc->k->donc = (u_short)(CC_INT_AUTO_CLEAR | intrpri); cc->k->empc = (u_short)(CC_INT_AUTO_CLEAR | intrpri); cc->k->aboc = (u_short)(CC_INT_AUTO_CLEAR | intrpri); cc->k->lamv = (u_short)intrvec; cc->k->donv = (u_short)intrvec; cc->k->empv = (u_short)intrvec; cc->k->abov = (u_short)intrvec; /* to <<< */ break; case CCIOC_READ_STATUS : /* data[0] = k->cser; data[1] = k->docr; data[2] = k->sccr; data[3] = k->mtc; data[4] = k->machi; data[5] = k->maclo; data[6] = k->lamc; data[7] = k->donc; data[8] = k->empc; data[9] = k->aboc; data[10] = k->lamv; data[11] = k->donv; data[12] = k->empv; data[13] = k->abov; data[14] = k->amr; data[15] = k->cma; data[16] = k->cwc; data[17] = k->srr; data[18] = k->csr; */ /* k->csr = CC_RST; */ break; case CCIOC_KINIT : ptr_dir = 0; ptr_cma = CC_KLIST_CMAINIT; break; default : break; } return 0; } mutex_enter()について mutex は相互排他の方針を強いるものである。 一時にただひとつだけの スレッドだけが特定の mutex を保持できる。 保持している mutex をロック しようとするスレッドは mutex がアンロックされるまでブロックされる。 mutex は厳密にひとまとめになっていて、リカーシブにはロックされない。 それは、mutex が入ったときとは逆の順番に抜けるべきであるということを 意味し、抜ける前に再び入ることはできない。 mutex_init() は mutex を イニシャライズする。 さらにもう一度イニシャライズしようとするとエラー になる。 type 引数は MUTEX_DRIVER にすべきである。 arg には mutex で用意されている variant型の type特有の情報を指定する。 ドライバ mutexes の mutex_init() がコールされるとき、インタラプト・ハンドラに よって mutex が使われる場合には、arg は ddi_get_iblock_cookie(9F) あるいはddi_get_soft_iblock_cookie(9F) から返される ddi_iblock_cookie にすべきである。 mutex がインタラプト・ハンドラ内で使われることがない 場合には引数は NULL にすべきである。 mutex を手に入れるために mutex_enter() が使われる。 mutex がすでにホールドされている場合には、 呼び出したスレッドはブロックされる。 mutex の返還がされた後で、 呼び出したスレッドがオーナになる。 もし、呼び出したスレッドがすでに mutex をホールドしている場合にはパニックを引き起こす。 cc_timeout のルーチンを修正して再実行 frc7v-cl1[49]% diff cc.c-Apr-7-1999-ok cc.c 848c848,850 < void cc_timeout(int unit) --- > /* void cc_timeout(int unit) */ > static void > cc_timeout(int unit) 894c896 < /* E.Inoue: from */ --- : frc7v-cl1[50]% cc.cファイルをコンパイルする。 frc7v-cl1[50]% make ./script/cc_build.sh [Building for sun4m] rm -f cc.o frc7v-cl1[51]% frc8vt# pwd /usr/kernel/drv frc8vt# ls -l cc* -rwxr-xr-x 1 root sys 58936 Apr 9 10:06 cc* -rwxr-xr-x 1 root sys 288 Apr 9 10:07 cc.conf* frc8vt# rcp frc7v-cl1:/export/home/frc7v-cl1/inoue/CAMAC/Driver/FORCE-5V-sol2.5/cc . frc8vt# rcp frc7v-cl1:/export/home/frc7v-cl1/inoue/CAMAC/Driver/FORCE-5V-sol2.5/cc.conf . frc8vt# ls -l cc* -rwxr-xr-x 1 root sys 58808 Apr 9 10:54 cc* -rwxr-xr-x 1 root sys 288 Apr 9 10:54 cc.conf* frc8vt# cc および cc.confファイルをコピーし直す。 frc7v-cl1# make unload ./script/cc_unload.sh [Removing CAMAC device driver] [Removing CAMAC device driver from system] [Deleting CAMAC device files] frc7v-cl1# make load ./script/cc_load.sh [Installing CAMAC device driver] cp: cannot create /usr/kernel/drv/cc: Read-only file system cp: cannot create /usr/kernel/drv/cc.conf: Read-only file system [Adding CAMAC device driver to system] [Configuring CAMAC device driver] [Making CAMAC device files] frc7v-cl1# cam3プログラムを実行する。 frc7v-cl1[85]% cam3 *** Now waiting LAM ... N=3 Loop=10 Timeout=0 sec Interrupted !! count=1 Interrupted !! count=2 Interrupted !! count=3 ここで、故意にタイムアウトを起こしてみる。 システムはクラッシュしてリブートしてしまった。 BAD TRAP: type=9 rp=fbe25cb4 addr=70 mmu_fsr=1a6 rw=2 sched: Data fault kernel write fault at addr=0x70, pme=0x0 MMU sfsr=1a6: Invalid Address on supv data store at level 1 pte addr = 0xf5981000, level = 1 pid=0, pc=0xf0067430, sp=0xfbe25d00, psr=0x48000c7, context=0 g1-g7: 8, f01568c0, fbe25e80, 0, 0, 1, fbe25e80 Begin traceback... sp = fbe25d00 Called from f0092a38, fp=fbe25d60, args=fc055a30 f6086a68 20 f0274e38 4d4 0 Called from f0092b44, fp=fbe25dc0, args=f5927aa0 f59282c0 5c7c2 f5927ac0 4000000 0 f59289c8 Called from f005fc58, fp=fbe25e20, args=f5927aa0 f5927ab4 f0274e38 f0274e38 f59b b4ac 4400ae2 Called from f0092afc, fp=0, args=f5927aa0 0 a0000 2d50b 63b5025c 1 End traceback... panic: Data fault syncing file systems... 2 done 2816 static and sysmap kernel pages 96 dynamic kernel data pages 488 kernel-pageable pages 0 segkmap kernel pages 0 segvn kernel pages 0 current user process pages 3400 total pages (3400 chunks) dumping to vp f59454dc, offset 140776 3400 total pages, dump succeeded rebooting... Resetting ... screen not found. Can't open input device. Keyboard not present. Using tty for input and output. SPARC CPU-7V, No Keyboard ROM Rev. 2.15.1, 64 MB memory installed, Serial #9157050. Ethernet address 0:80:42:b:49:ba, Host ID: 808bb9ba. apply failed. Initializing Memory - Type help for more information ok ok boot net -r Boot device: /iommu/sbus/ledma@5,8400010/le@5,8c00000 File and args: -r 2dc00 hostname: frc7v-cl1 domainname: kek.jp root server: frc8vt root directory: /export/root/frc7v-cl1 SunOS Release 5.6 Version Generic_105181-05 [UNIX(R) System V Release 4.0] Copyright (c) 1983-1997, Sun Microsystems, Inc. configuring network interfaces: le0. Hostname: frc7v-cl1 Configuring the /devices directory FRCvme V2.3.1 VME Nexus (FGA-5000 FGA-5100) NOTICE: VME: slavewin at vme=0x0, size=0x100000 space=0x2d020617 CAMAC device driver V1.3x, 1991-1993 by Y.TAKEUCHI (T.I.T.) cc0 at VME0: vme16d16 0xff00 VME level 4 vector 0xff sparc ipl 7 vmemem0 at VME0: vme32d16 0x0 vmemem1 at VME0: vme16d16 0x0 vmemem2 at VME0: vme24d16 0x0 vmemem3 at VME0: vme32d32 0x0 vmemem4 at VME0: vme16d32 0x0 vmemem5 at VME0: vme24d32 0x0 vmeplus0 at VME0: vme16d16 0x0 and vme24d16 0x0 and vme32d16 0x0 and vme16d32 0x 0 and vme24d32 0x0 and vme32d32 0x0 and space 0x2f offset 0x0 and space 0x6f offset 0x0 and space 0x10 offset 0x0 and space 0x11 offset 0x0 and space 0x50 offset 0x0 and space 0x51 offset 0x0 vmedma0 at VME0 vmefdma0 at VME0 vmedvma0 at VME0 vmectl0 at VME0 Configuring the /dev directory Configuring the /dev directory (compatibility devices) The system is coming up. Please wait. checking for crash dump...System went down at Fri Apr 9 11:08:12 1999 Saving 3400 pages of image in vmcore.50 3400 pages saved. Processing modules: Done. Constructing Namelist file: /var/crash/frc7v-cl1/unix.50 Namelist file complete. default ICCFP1.kek.jp done add net default: gateway ICCFP1 NIS domainname is kek.jp starting rpc services: rpcbind keyserv done. Setting netmask of le0 to 255.255.252.0 Setting default interface for multicast: add net 224.0.0.0: gateway frc7v-cl1 "/dev/swap" is not valid for swapping. It must be a block device or a regular file with the "save user text on execution" bit set. syslog service starting. syslogd: line 24: unexpected getnetconfig failure Print services started. volume management starting. Wnn6: Key License Server started.... Nihongo Multi Client Server (Wnn6 R2.30) Finished Reading Files The system is ready. frc7v-cl1 console login: クラッシュ・ファイルのチェック。 frc7v-cl1[35]% adb -k unix.50 vmcore.50 physmem 3e2d $c complete_panic(0x0,0x4400ce2,0x0,0x44000e2,0x0,0xf00) + 5c do_panic(0x1,0xfbe25b64,0x0,0x48000e2,0x1,0xf5bdd600) + a8 vcmn_err(0x3,0xf0269878,0xfbe25b64,0x3,0xffeec000,0x0) + 180 cmn_err(0x3,0xf0269878,0xfbe26,0x53,0x53,0xf025e400) + 1c die(0x9,0xfbe25cb4,0x70,0x1a6,0x2,0xf0269878) + bc trap(0x0,0xfbe25cb4,0xf0000000,0x0,0x2,0x1) + 7e4 fault(?) + 84 mutex_enter(0x70,0xfc055a30,0xf026de48,0xf026de8c,0xf026f050,0xf005faa0) cc_timeout(0xfc055a30,0xf6086a68,0x20,0xf0274e38,0x4d4,0x0) + 38 callout_execute(0xf5927aa0,0xf59282c0,0x5c7c2,0xf5927ac0,0x40000000,0xf59289c8)+ b8 callout_thread(0xf5927aa0,0xf5927ab4,0xf0274e38,0xf0274e38,0xf59bb4ac,0x4400ae2) + 48 cc_timeout,10?ai cc_timeout: cc_timeout: save %sp, -0x60, %sp cc_timeout+4: st %i0, [%fp + 0x44] cc_timeout+8: sethi %hi(0xf608e400), %l0 cc_timeout+0xc: or %l0, 0x264, %l0 cc_timeout+0x10: ld [%l0], %l0 cc_timeout+0x14: ld [%fp + 0x44], %l1 cc_timeout+0x18: or %l0, %g0, %o0 cc_timeout+0x1c: or %l1, %g0, %o1 cc_timeout+0x20: call ddi_get_soft_state cc_timeout+0x24: nop cc_timeout+0x28: or %o0, %g0, %l0 cc_timeout+0x2c: or %l0, %g0, %i5 cc_timeout+0x30: add %i5, 0x70, %l0 cc_timeout+0x34: or %l0, %g0, %o0 cc_timeout+0x38: call mutex_enter cc_timeout+0x3c: nop $ 問題はまだ解決していなかったようです。 > cc_timeout()がコールされた時にシステムクラッシュが起きています。 ioctl()ルーチン内のtimeout()を設定しているところで、 mutex_enter()   ↓ timeout() の順番で呼び出しているようです。 この順番を逆にして試して頂けますか? timeout()   ↓ mutex_enter() に変更して ---ここまで cc.cファイルの修正。 frc7v-cl1[40]% vi cc.c : /* mutex_enter(&cc->mutex); */ /* start MUTEX */ cc->timeout_id = timeout(cc_timeout, (caddr_t)&unit, *(int *)data * hz); mutex_enter(&cc->mutex); /* start MUTEX */ /* wait interrupt */ /* cv_timedwait(&cc->cv, &cc->mutex, timeout); if (cc->interrupt == 0) cc->interrupt |= CC_INT_TIMEOUT; */ if (cv_wait_sig(&cc->cv, &cc->mutex) == 0) { untimeout(cc->timeout_id); mutex_exit(&cc->mutex); /* end MUTEX */ return EINTR; } mutex_exit(&cc->mutex); /* end MUTEX */ splx(s); : "cc.c" 2910 lines, 73236 characters frc7v-cl1[41]% cc.cファイルをコンパイルする。 frc7v-cl1[41]% make ./script/cc_build.sh [Building for sun4m] rm -f cc.o frc7v-cl1[42]% cc および cc.confファイルをコピーし直す。 frc8vt# pwd /usr/kernel/drv frc8vt# rcp frc7v-cl1:/export/home/frc7v-cl1/inoue/CAMAC/Driver/FORCE-5V-sol2.5/cc . frc8vt# rcp frc7v-cl1:/export/home/frc7v-cl1/inoue/CAMAC/Driver/FORCE-5V-sol2.5/cc.conf . frc8vt# ls -l cc* -rwxr-xr-x 1 root sys 58808 Apr 9 14:02 cc* -rwxr-xr-x 1 root sys 288 Apr 9 14:03 cc.conf* frc8vt# ccドライバをロードし直す。 frc7v-cl1# make unload ./script/cc_unload.sh [Removing CAMAC device driver] [Removing CAMAC device driver from system] [Deleting CAMAC device files] frc7v-cl1# make load ./script/cc_load.sh [Installing CAMAC device driver] cp: cannot create /usr/kernel/drv/cc: Read-only file system cp: cannot create /usr/kernel/drv/cc.conf: Read-only file system [Adding CAMAC device driver to system] [Configuring CAMAC device driver] [Making CAMAC device files] frc7v-cl1# cam3プログラムを実行する。 frc7v-cl1[52]% cam3 *** Now waiting LAM ... N=3 Loop=10 Timeout=0 sec Interrupted !! count=1 Interrupted !! count=2 Interrupted !! count=3 ここで故意にタイムアウトを起こしてやる。 システムはパニックを起こしてリブートしてしまった。 BAD TRAP: type=9 rp=fbe25cb4 addr=70 mmu_fsr=1a6 rw=2 sched: Data fault kernel write fault at addr=0x70, pme=0x0 MMU sfsr=1a6: Invalid Address on supv data store at level 1 pte addr = 0xf5981000, level = 1 pid=0, pc=0xf0067430, sp=0xfbe25d00, psr=0x48000c7, context=0 g1-g7: 8, f01928c0, fbe25e80, 0, 0, 1, fbe25e80 Begin traceback... sp = fbe25d00 Called from f0092a38, fp=fbe25d60, args=fc064a30 f606ba68 20 f0274e38 509 0 Called from f0092b44, fp=fbe25dc0, args=f5927aa0 f59282c0 f9201 f5927ac0 4000000 0 f59282c4 Called from f005fc58, fp=fbe25e20, args=f5927aa0 f5927ab4 f0274e38 f0274e38 f59b b4ac 4400ae2 Called from f0092afc, fp=0, args=f5927aa0 0 a0000 2d50b 63b5025c 1 End traceback... panic: Data fault syncing file systems... 2 done 2787 static and sysmap kernel pages 74 dynamic kernel data pages 490 kernel-pageable pages 0 segkmap kernel pages 0 segvn kernel pages 0 current user process pages 3351 total pages (3351 chunks) dumping to vp f59444dc, offset 141168 3351 total pages, dump succeeded rebooting... Resetting ... screen not found. Can't open input device. Keyboard not present. Using tty for input and output. SPARC CPU-7V, No Keyboard ROM Rev. 2.15.1, 64 MB memory installed, Serial #9157050. Ethernet address 0:80:42:b:49:ba, Host ID: 808bb9ba. apply failed. Initializing Memory \ Type help for more information ok ok boot net -r Boot device: /iommu/sbus/ledma@5,8400010/le@5,8c00000 File and args: -r 2dc00 hostname: frc7v-cl1 domainname: kek.jp root server: frc8vt root directory: /export/root/frc7v-cl1 SunOS Release 5.6 Version Generic_105181-05 [UNIX(R) System V Release 4.0] Copyright (c) 1983-1997, Sun Microsystems, Inc. configuring network interfaces: le0. Hostname: frc7v-cl1 Configuring the /devices directory FRCvme V2.3.1 VME Nexus (FGA-5000 FGA-5100) NOTICE: VME: slavewin at vme=0x0, size=0x100000 space=0x2d020617 CAMAC device driver V1.3x, 1991-1993 by Y.TAKEUCHI (T.I.T.) cc0 at VME0: vme16d16 0xff00 VME level 4 vector 0xff sparc ipl 7 vmemem0 at VME0: vme32d16 0x0 vmemem1 at VME0: vme16d16 0x0 vmemem2 at VME0: vme24d16 0x0 vmemem3 at VME0: vme32d32 0x0 vmemem4 at VME0: vme16d32 0x0 vmemem5 at VME0: vme24d32 0x0 vmeplus0 at VME0: vme16d16 0x0 and vme24d16 0x0 and vme32d16 0x0 and vme16d32 0x 0 and vme24d32 0x0 and vme32d32 0x0 and space 0x2f offset 0x0 and space 0x6f offset 0x0 and space 0x10 offset 0x0 and space 0x11 offset 0x0 and space 0x50 offset 0x0 and space 0x51 offset 0x0 vmedma0 at VME0 vmefdma0 at VME0 vmedvma0 at VME0 vmectl0 at VME0 Configuring the /dev directory Configuring the /dev directory (compatibility devices) The system is coming up. Please wait. checking for crash dump...System went down at Fri Apr 9 14:00:05 1999 Saving 3351 pages of image in vmcore.51 3351 pages saved. Processing modules: Done. Constructing Namelist file: /var/crash/frc7v-cl1/unix.51 Namelist file complete. default ICCFP1.kek.jp done add net default: gateway ICCFP1 NIS domainname is kek.jp starting rpc services: rpcbind keyserv done. Setting netmask of le0 to 255.255.252.0 Setting default interface for multicast: add net 224.0.0.0: gateway frc7v-cl1 "/dev/swap" is not valid for swapping. It must be a block device or a regular file with the "save user text on execution" bit set. syslog service starting. syslogd: line 24: unexpected getnetconfig failure Print services started. volume management starting. Wnn6: Key License Server started.... Nihongo Multi Client Server (Wnn6 R2.30) Finished Reading Files The system is ready. frc7v-cl1 console login: ホームディレクトリをマウントする。 onlsun1[71]% !! rlogin frc7v-cl1 Password: No directory! Logging in with home=/ Last login: Fri Apr 9 13:41:20 from onlsun1.kek.jp Sun Microsystems Inc. SunOS 5.6 Generic August 1997 frc7v-cl1% su Password: # mount frc8vt:/export/home/frc8vt /export/home/frc7v-cl1 # frc7v-cl1% logout Connection closed. onlsun1[72]% !! rlogin frc7v-cl1 Last login: Fri Apr 9 14:06:29 from onlsun1.kek.jp Sun Microsystems Inc. SunOS 5.6 Generic August 1997 frc7v-cl1[33]% クラッシュ・ファイルをチェック。 frc7v-cl1[36]% adb -k unix.51 vmcore.51 physmem 3e2d $c complete_panic(0x0,0x4400ce2,0x0,0x44000e2,0x0,0xf00) + 5c do_panic(0x1,0xfbe25b64,0x0,0x48000e2,0x1,0xf5bc8600) + a8 vcmn_err(0x3,0xf0269878,0xfbe25b64,0x3,0xffeec000,0x0) + 180 cmn_err(0x3,0xf0269878,0xfbe26,0x53,0x53,0xf025e400) + 1c die(0x9,0xfbe25cb4,0x70,0x1a6,0x2,0xf0269878) + bc trap(0x0,0xfbe25cb4,0xf0000000,0x0,0x2,0x1) + 7e4 fault(?) + 84 mutex_enter(0x70,0xfc064a30,0xf026de48,0xf026de8c,0xf026f050,0xf005faa0) cc_timeout(0xfc064a30,0xf606ba68,0x20,0xf0274e38,0x509,0x0) + 38 callout_execute(0xf5927aa0,0xf59282c0,0xf9201,0xf5927ac0,0x40000000,0xf59282c4)+ b8 callout_thread(0xf5927aa0,0xf5927ab4,0xf0274e38,0xf0274e38,0xf59bb4ac,0x4400ae2) + 48 $ dump on /dev/dsk/c0t3d0s1 size 83988K pem: no event handler FRCvme V2.3.1 VME Nexus (FGA-5000 FGA-5100) NOTICE: VME: slavewin at vme=0x0, size=0x100000 space=0x2d020617 VME0 at sbus0: SBus slot 5 0xffffe00 sparc ipl 15, SBus level 1 sparc ipl 2, SBus level 2 sparc ipl 3, SBus level 3 sparc ipl 5, SBus level 4 sparc ipl 7, SBus level 5 sparc ipl 9, SBus level 6 sparc ipl 11, SBus level 7 sparc ipl 13 CAMAC device driver V1.3x, 1991-1993 by Y.TAKEUCHI (T.I.T.) cc0 at VME0: vme16d16 0xff00 VME level 4 vector 0xff sparc ipl 7 cc0 is /iommu@0,10000000/sbus@0,10001000/VME@5,ffffe00/cc@2d,ff0 0 vmemem0 at VME0: vme32d16 0x0 vmemem0 is /iommu@0,10000000/sbus@0,10001000/VME@5,ffffe00/vmeme m@d,0 vmemem1 at VME0: vme16d16 0x0 vmemem1 is /iommu@0,10000000/sbus@0,10001000/VME@5,ffffe00/vmeme m@2d,0 vmemem2 at VME0: vme24d16 0x0 vmemem2 is /iommu@0,10000000/sbus@0,10001000/VME@5,ffffe00/vmeme m@3d,0 vmemem3 at VME0: vme32d32 0x0 vmemem3 is /iommu@0,10000000/sbus@0,10001000/VME@5,ffffe00/vmeme m@4d,0 vmemem4 at VME0: vme16d32 0x0 vmemem4 is /iommu@0,10000000/sbus@0,10001000/VME@5,ffffe00/vmeme m@6d,0 vmemem5 at VME0: vme24d32 0x0 vmemem5 is /iommu@0,10000000/sbus@0,10001000/VME@5,ffffe00/vmeme m@7d,0 sbusmem0 at sbus0: SBus slot 0 0x0 sbusmem0 is /iommu@0,10000000/sbus@0,10001000/sbusmem@0,0 sbusmem1 at sbus0: SBus slot 1 0x0 sbusmem1 is /iommu@0,10000000/sbus@0,10001000/sbusmem@1,0 sbusmem2 at sbus0: SBus slot 2 0x0 sbusmem2 is /iommu@0,10000000/sbus@0,10001000/sbusmem@2,0 sbusmem3 at sbus0: SBus slot 3 0x0 sbusmem3 is /iommu@0,10000000/sbus@0,10001000/sbusmem@3,0 sbusmem4 at sbus0: SBus slot 4 0x0 sbusmem4 is /iommu@0,10000000/sbus@0,10001000/sbusmem@4,0 sbusmem5 at sbus0: SBus slot 5 0x0 sbusmem5 is /iommu@0,10000000/sbus@0,10001000/sbusmem@5,0 SUNW,bpp0 at sbus0: SBus slot 5 0xc800000 SBus level 2 sparc ipl 3 SUNW,bpp0 is /iommu@0,10000000/sbus@0,10001000/SUNW,bpp@5,c80000 0 pseudo-device: winlock0 winlock0 is /pseudo/winlock@0 pseudo-device: lockstat0 lockstat0 is /pseudo/lockstat@0 pseudo-device: vol0 vol0 is /pseudo/vol@0 pseudo-device: llc10 llc10 is /pseudo/llc1@0 vmeplus0 at VME0: vme16d16 0x0 and vme24d16 0x0 and vme32d16 0x0 and vme16d32 0x0 and vme24d32 0x0 and vme32d32 0x0 and space 0x 2f offset 0x0 and space 0x6f offset 0x0 and space 0x10 offset 0x0 and space 0x11 offset 0x0 and space 0x50 offset 0x0 and space 0x51 offset 0x0 vmeplus0 is /iommu@0,10000000/sbus@0,10001000/VME@5,ffffe00/vmep lus@2d,0 pseudo-device: pm0 pm0 is /pseudo/pm@0 vmedma0 at VME0 vmedma0 is /iommu@0,10000000/sbus@0,10001000/VME@5,ffffe00/vmedm a vmefdma0 at VME0 vmefdma0 is /iommu@0,10000000/sbus@0,10001000/VME@5,ffffe00/vmef dma vmedvma0 at VME0 vmedvma0 is /iommu@0,10000000/sbus@0,10001000/VME@5,ffffe00/vmed vma vmectl0 at VME0 vmectl0 is /iommu@0,10000000/sbus@0,10001000/VME@5,ffffe00/vmect l sysconfig0: LCA is XC4003 compatible sysconfig0 at root: obio 0x71380000 sysconfig0 is /sysconfig@0,71380000 BAD TRAP: type=9 rp=fbe25cb4 addr=70 mmu_fsr=1a6 rw=2 sched: Data fault kernel write fault at addr=0x70, pme=0x0 MMU sfsr=1a6: Invalid Address on supv data store at level 1 pte addr = 0xf5981000, level = 1 pid=0, pc=0xf0067430, sp=0xfbe25d00, psr=0x48000c7, context=0 g1-g7: 8, f01928c0, fbe25e80, 0, 0, 1, fbe25e80 Begin traceback... sp = fbe25d00 Called from f0092a38, fp=fbe25d60, args=fc064a30 f606ba68 20 f02 74e38 509 0 Called from f0092b44, fp=fbe25dc0, args=f5927aa0 f59282c0 f9201 f5927ac0 40000000 f59282c4 Called from f005fc58, fp=fbe25e20, args=f5927aa0 f5927ab4 f0274e 38 f0274e38 f59bb4ac 4400ae2 Called from f0092afc, fp=0, args=f5927aa0 0 a0000 2d50b 63b5025c 1 End traceback... panic: Data fault syncing file systems... 2 done 2787 static and sysmap kernel pages 74 dynamic kernel data pages 490 kernel-pageable pages 0 segkmap kernel pages 0 segvn kernel pages 0 current user process pages 3351 total pages (3351 chunks) dumping to vp f59444dc, offset $q frc7v-cl1[37]% 症状に変化は見られない。 クラッシュ・ファイルのチェック frc7v-cl1[44]% adb -k unix.51 vmcore.51 physmem 3e2d $c complete_panic(0x0,0x4400ce2,0x0,0x44000e2,0x0,0xf00) + 5c do_panic(0x1,0xfbe25b64,0x0,0x48000e2,0x1,0xf5bc8600) + a8 vcmn_err(0x3,0xf0269878,0xfbe25b64,0x3,0xffeec000,0x0) + 180 cmn_err(0x3,0xf0269878,0xfbe26,0x53,0x53,0xf025e400) + 1c die(0x9,0xfbe25cb4,0x70,0x1a6,0x2,0xf0269878) + bc trap(0x0,0xfbe25cb4,0xf0000000,0x0,0x2,0x1) + 7e4 fault(?) + 84 mutex_enter(0x70,0xfc064a30,0xf026de48,0xf026de8c,0xf026f050,0xf005faa0) cc_timeout(0xfc064a30,0xf606ba68,0x20,0xf0274e38,0x509,0x0) + 38 callout_execute(0xf5927aa0,0xf59282c0,0xf9201,0xf5927ac0,0x40000000,0xf59282c4)+ b8 callout_thread(0xf5927aa0,0xf5927ab4,0xf0274e38,0xf0274e38,0xf59bb4ac,0x4400ae2) + 48 cc_timeout,50?ai cc_timeout: cc_timeout: save %sp, -0x60, %sp cc_timeout+4: st %i0, [%fp + 0x44] cc_timeout+8: sethi %hi(0xf6073400), %l0 cc_timeout+0xc: or %l0, 0x264, %l0 cc_timeout+0x10: ld [%l0], %l0 cc_timeout+0x14: ld [%fp + 0x44], %l1 cc_timeout+0x18: or %l0, %g0, %o0 cc_timeout+0x1c: or %l1, %g0, %o1 cc_timeout+0x20: call ddi_get_soft_state cc_timeout+0x24: nop cc_timeout+0x28: or %o0, %g0, %l0 cc_timeout+0x2c: or %l0, %g0, %i5 cc_timeout+0x30: add %i5, 0x70, %l0 cc_timeout+0x34: or %l0, %g0, %o0 cc_timeout+0x38: call mutex_enter cc_timeout+0x3c: nop cc_timeout+0x40: add %i5, 0xa0, %l0 cc_timeout+0x44: ld [%l0], %l0 cc_timeout+0x48: cmp %l0, 0x0 cc_timeout+0x4c: be cc_timeout+0xa0 cc_timeout+0x50: nop cc_timeout+0x54: add %i5, 0x90, %l0 cc_timeout+0x58: ld [%l0], %l0 cc_timeout+0x5c: or %l0, %g0, %o0 cc_timeout+0x60: call ddi_dma_unbind_handle cc_timeout+0x64: nop cc_timeout+0x68: add %i5, 0x9c, %l0 cc_timeout+0x6c: ld [%l0], %l0 cc_timeout+0x70: add %l0, 0x54, %l0 cc_timeout+0x74: ld [%l0], %l1 cc_timeout+0x78: add %i5, 0xa4, %l0 cc_timeout+0x7c: st %l1, [%l0] cc_timeout+0x80: add %i5, 0x9c, %l0 cc_timeout+0x84: ld [%l0], %l0 cc_timeout+0x88: or %l0, %g0, %o0 cc_timeout+0x8c: call biodone cc_timeout+0x90: nop cc_timeout+0x94: clr %l1 cc_timeout+0x98: add %i5, 0xa0, %l0 cc_timeout+0x9c: st %l1, [%l0] cc_timeout+0xa0: add %i5, 0x50, %l0 cc_timeout+0xa4: ld [%l0], %l0 cc_timeout+0xa8: sethi %hi(0x8000), %l1 cc_timeout+0xac: or %l0, %l1, %l1 cc_timeout+0xb0: add %i5, 0x50, %l0 cc_timeout+0xb4: st %l1, [%l0] cc_timeout+0xb8: add %i5, 0x78, %l0 cc_timeout+0xbc: or %l0, %g0, %o0 cc_timeout+0xc0: call cv_signal cc_timeout+0xc4: nop cc_timeout+0xc8: add %i5, 0x70, %l0 cc_timeout+0xcc: or %l0, %g0, %o0 cc_timeout+0xd0: call mutex_exit cc_timeout+0xd4: nop cc_timeout+0xd8: ba cc_timeout+0xe0 cc_timeout+0xdc: nop cc_timeout+0xe0: ret cc_timeout+0xe4: restore cc_timeout+0xe8: unimp 0x10000 cc_timeout+0xec: unimp 0x10000 cc_timeout+0xf0: unimp 0x10000 cc_timeout+0xf4: unimp 0x10000 cc_intr: save %sp, -0x68, %sp cc_intr+4: st %i0, [%fp + 0x44] cc_intr+8: sethi %hi(0xf6073400), %l0 cc_intr+0xc: or %l0, 0x264, %l0 cc_intr+0x10: ld [%l0], %l0 cc_intr+0x14: ld [%fp + 0x44], %l1 cc_intr+0x18: or %l0, %g0, %o0 cc_intr+0x1c: or %l1, %g0, %o1 cc_intr+0x20: call ddi_get_soft_state cc_intr+0x24: nop cc_intr+0x28: or %o0, %g0, %l0 cc_intr+0x2c: or %l0, %g0, %i5 cc_intr+0x30: add %i5, 0x70, %l0 cc_intr+0x34: or %l0, %g0, %o0 cc_intr+0x38: call mutex_enter cc_intr+0x3c: nop cc_intr+0x40: add %i5, 0x8, %l0 cc_intr+0x44: ld [%l0], %l0 cc_ioctl,200?ai cc_ioctl: cc_ioctl: save %sp, -0x78, %sp cc_ioctl+4: st %i5, [%fp + 0x58] cc_ioctl+8: st %i4, [%fp + 0x54] cc_ioctl+0xc: st %i3, [%fp + 0x50] cc_ioctl+0x10: st %i2, [%fp + 0x4c] cc_ioctl+0x14: st %i1, [%fp + 0x48] cc_ioctl+0x18: st %i0, [%fp + 0x44] cc_ioctl+0x1c: ld [%fp + 0x4c], %l0 cc_ioctl+0x20: st %l0, [%fp - 0x10] cc_ioctl+0x24: ld [%fp + 0x44], %l0 cc_ioctl+0x28: or %l0, %g0, %o0 cc_ioctl+0x2c: call getminor cc_ioctl+0x30: nop cc_ioctl+0x34: or %o0, %g0, %l0 cc_ioctl+0x38: st %l0, [%fp - 0x18] cc_ioctl+0x3c: sethi %hi(0xf6073400), %l0 cc_ioctl+0x40: or %l0, 0x264, %l0 cc_ioctl+0x44: ld [%l0], %l0 cc_ioctl+0x48: ld [%fp - 0x18], %l1 cc_ioctl+0x4c: or %l0, %g0, %o0 cc_ioctl+0x50: or %l1, %g0, %o1 cc_ioctl+0x54: call ddi_get_soft_state cc_ioctl+0x58: nop cc_ioctl+0x5c: or %o0, %g0, %l0 cc_ioctl+0x60: or %l0, %g0, %i5 cc_ioctl+0x64: ba cc_ioctl+0x5c8 cc_ioctl+0x68: nop cc_ioctl+0x6c: add %i5, 0x44, %l0 cc_ioctl+0x70: ld [%l0], %l1 cc_ioctl+0x74: ld [%fp - 0x10], %l0 cc_ioctl+0x78: st %l1, [%l0] cc_ioctl+0x7c: ba cc_ioctl+0x6b4 cc_ioctl+0x80: nop cc_ioctl+0x84: ld [%fp - 0x10], %l0 cc_ioctl+0x88: ld [%l0], %l0 cc_ioctl+0x8c: cmp %l0, 0x0 cc_ioctl+0x90: bl cc_ioctl+0xc4 cc_ioctl+0x94: nop cc_ioctl+0x98: ld [%fp - 0x10], %l0 cc_ioctl+0x9c: ld [%l0], %l1 cc_ioctl+0xa0: add %i5, 0x44, %l0 cc_ioctl+0xa4: ld [%l0], %l0 cc_ioctl+0xa8: cmp %l1, %l0 cc_ioctl+0xac: bge cc_ioctl+0xc4 cc_ioctl+0xb0: nop cc_ioctl+0xb4: ld [%fp - 0x10], %l0 cc_ioctl+0xb8: ld [%l0], %l1 cc_ioctl+0xbc: add %i5, 0x48, %l0 cc_ioctl+0xc0: st %l1, [%l0] cc_ioctl+0xc4: ba cc_ioctl+0x6b4 cc_ioctl+0xc8: nop cc_ioctl+0xcc: ld [%fp - 0x10], %l0 cc_ioctl+0xd0: ld [%l0], %l0 cc_ioctl+0xd4: cmp %l0, 0x0 cc_ioctl+0xd8: bl cc_ioctl+0x104 cc_ioctl+0xdc: nop cc_ioctl+0xe0: ld [%fp - 0x10], %l0 cc_ioctl+0xe4: ld [%l0], %l0 cc_ioctl+0xe8: cmp %l0, 0x8 cc_ioctl+0xec: bge cc_ioctl+0x104 cc_ioctl+0xf0: nop cc_ioctl+0xf4: ld [%fp - 0x10], %l0 cc_ioctl+0xf8: ld [%l0], %l1 cc_ioctl+0xfc: add %i5, 0x4c, %l0 cc_ioctl+0x100: st %l1, [%l0] cc_ioctl+0x104: ba cc_ioctl+0x6b4 cc_ioctl+0x108: nop cc_ioctl+0x10c: clr %l1 cc_ioctl+0x110: add %i5, 0x50, %l0 cc_ioctl+0x114: st %l1, [%l0] cc_ioctl+0x118: sethi %hi(0xf6073000), %l0 cc_ioctl+0x11c: or %l0, 0x1b8, %l0 cc_ioctl+0x120: lduh [%l0], %l0 cc_ioctl+0x124: sll %l0, 0x10, %l0 cc_ioctl+0x128: srl %l0, 0x10, %l0 cc_ioctl+0x12c: or %l0, 0x18, %l1 cc_ioctl+0x130: add %i5, 0x8, %l0 cc_ioctl+0x134: ld [%l0], %l0 cc_ioctl+0x138: add %l0, 0x40, %l0 cc_ioctl+0x13c: sth %l1, [%l0] cc_ioctl+0x140: call spltty cc_ioctl+0x144: nop cc_ioctl+0x148: or %o0, %g0, %l0 cc_ioctl+0x14c: st %l0, [%fp - 0x14] cc_ioctl+0x150: add %i5, 0x50, %l0 cc_ioctl+0x154: ld [%l0], %l0 cc_ioctl+0x158: and %l0, 0x1, %l0 cc_ioctl+0x15c: cmp %l0, %g0 cc_ioctl+0x160: be cc_ioctl+0x18c cc_ioctl+0x164: nop cc_ioctl+0x168: add %i5, 0x50, %l0 cc_ioctl+0x16c: ld [%l0], %l0 cc_ioctl+0x170: and %l0, -0x2, %l1 cc_ioctl+0x174: add %i5, 0x50, %l0 cc_ioctl+0x178: st %l1, [%l0] cc_ioctl+0x17c: clr %l0 cc_ioctl+0x180: st %l0, [%fp - 0x4] cc_ioctl+0x184: ba cc_ioctl+0x6c4 cc_ioctl+0x188: nop cc_ioctl+0x18c: sethi %hi(0xf606b800), %l2 cc_ioctl+0x190: or %l2, 0x268, %l2 cc_ioctl+0x194: add %fp, -0x18, %l3 cc_ioctl+0x198: ld [%fp - 0x10], %l0 cc_ioctl+0x19c: ld [%l0], %l1 cc_ioctl+0x1a0: sethi %hi(0xf0260000), %l0 cc_ioctl+0x1a4: or %l0, 0xd8, %l0 cc_ioctl+0x1a8: ld [%l0], %l0 cc_ioctl+0x1ac: or %l1, %g0, %o0 cc_ioctl+0x1b0: or %l0, %g0, %o1 cc_ioctl+0x1b4: call fpdispr+0x10 cc_ioctl+0x1b8: nop cc_ioctl+0x1bc: or %o0, %g0, %l0 cc_ioctl+0x1c0: or %l2, %g0, %o0 cc_ioctl+0x1c4: or %l3, %g0, %o1 cc_ioctl+0x1c8: or %l0, %g0, %o2 cc_ioctl+0x1cc: call timeout cc_ioctl+0x1d0: nop cc_ioctl+0x1d4: or %o0, %g0, %l1 cc_ioctl+0x1d8: add %i5, 0x98, %l0 cc_ioctl+0x1dc: st %l1, [%l0] cc_ioctl+0x1e0: add %i5, 0x70, %l0 cc_ioctl+0x1e4: or %l0, %g0, %o0 cc_ioctl+0x1e8: call mutex_enter cc_ioctl+0x1ec: nop cc_ioctl+0x1f0: add %i5, 0x78, %l0 cc_ioctl+0x1f4: add %i5, 0x70, %l1 cc_ioctl+0x1f8: or %l0, %g0, %o0 cc_ioctl+0x1fc: or %l1, %g0, %o1 cc_ioctl+0x200: call cv_wait_sig cc_ioctl+0x204: nop cc_ioctl+0x208: or %o0, %g0, %l0 cc_ioctl+0x20c: cmp %l0, 0x0 cc_ioctl+0x210: bne cc_ioctl+0x24c cc_ioctl+0x214: nop cc_ioctl+0x218: add %i5, 0x98, %l0 cc_ioctl+0x21c: ld [%l0], %l0 cc_ioctl+0x220: or %l0, %g0, %o0 cc_ioctl+0x224: call untimeout cc_ioctl+0x228: nop cc_ioctl+0x22c: add %i5, 0x70, %l0 cc_ioctl+0x230: or %l0, %g0, %o0 cc_ioctl+0x234: call mutex_exit cc_ioctl+0x238: nop cc_ioctl+0x23c: mov 0x4, %l0 cc_ioctl+0x240: st %l0, [%fp - 0x4] cc_ioctl+0x244: ba cc_ioctl+0x6c4 cc_ioctl+0x248: nop cc_ioctl+0x24c: add %i5, 0x70, %l0 cc_ioctl+0x250: or %l0, %g0, %o0 cc_ioctl+0x254: call mutex_exit cc_ioctl+0x258: nop cc_ioctl+0x25c: ld [%fp - 0x14], %l0 cc_ioctl+0x260: or %l0, %g0, %o0 cc_ioctl+0x264: call i_ddi_splx cc_ioctl+0x268: nop cc_ioctl+0x26c: add %i5, 0x50, %l0 cc_ioctl+0x270: ld [%l0], %l0 cc_ioctl+0x274: and %l0, 0x1, %l0 cc_ioctl+0x278: cmp %l0, %g0 cc_ioctl+0x27c: be cc_ioctl+0x2a0 cc_ioctl+0x280: nop cc_ioctl+0x284: add %i5, 0x50, %l0 cc_ioctl+0x288: ld [%l0], %l0 cc_ioctl+0x28c: and %l0, -0x2, %l1 cc_ioctl+0x290: add %i5, 0x50, %l0 cc_ioctl+0x294: st %l1, [%l0] cc_ioctl+0x298: ba cc_ioctl+0x2e8 cc_ioctl+0x29c: nop cc_ioctl+0x2a0: add %i5, 0x50, %l0 cc_ioctl+0x2a4: ld [%l0], %l0 cc_ioctl+0x2a8: sethi %hi(0x8000), %l1 cc_ioctl+0x2ac: and %l0, %l1, %l0 cc_ioctl+0x2b0: cmp %l0, %g0 cc_ioctl+0x2b4: be cc_ioctl+0x2e8 cc_ioctl+0x2b8: nop cc_ioctl+0x2bc: add %i5, 0x50, %l0 cc_ioctl+0x2c0: ld [%l0], %l0 cc_ioctl+0x2c4: sethi %hi(0x8000), %l1 cc_ioctl+0x2c8: xor %l1, -0x1, %l1 cc_ioctl+0x2cc: and %l0, %l1, %l1 cc_ioctl+0x2d0: add %i5, 0x50, %l0 cc_ioctl+0x2d4: st %l1, [%l0] cc_ioctl+0x2d8: mov -0x1, %l0 cc_ioctl+0x2dc: st %l0, [%fp - 0x4] cc_ioctl+0x2e0: ba cc_ioctl+0x6c4 cc_ioctl+0x2e4: nop cc_ioctl+0x2e8: ba cc_ioctl+0x6b4 cc_ioctl+0x2ec: nop cc_ioctl+0x2f0: ld [%fp - 0x18], %l0 cc_ioctl+0x2f4: clr %l1 cc_ioctl+0x2f8: sethi %hi(0x3c00), %l2 cc_ioctl+0x2fc: or %l2, 0x1b1, %l2 cc_ioctl+0x300: ld [%fp - 0x10], %l3 cc_ioctl+0x304: or %l0, %g0, %o0 cc_ioctl+0x308: or %l1, %g0, %o1 cc_ioctl+0x30c: or %l2, %g0, %o2 cc_ioctl+0x310: or %l3, %g0, %o3 cc_ioctl+0x314: call camac_s cc_ioctl+0x318: nop cc_ioctl+0x31c: ld [%fp - 0x18], %l0 cc_ioctl+0x320: mov 0x2, %l1 cc_ioctl+0x324: sethi %hi(0x3c00), %l2 cc_ioctl+0x328: or %l2, 0x1, %l2 cc_ioctl+0x32c: add %fp, -0x6, %l3 cc_ioctl+0x330: or %l0, %g0, %o0 cc_ioctl+0x334: or %l1, %g0, %o1 cc_ioctl+0x338: or %l2, %g0, %o2 cc_ioctl+0x33c: or %l3, %g0, %o3 cc_ioctl+0x340: call camac_s cc_ioctl+0x344: nop cc_ioctl+0x348: lduh [%fp - 0x6], %l0 cc_ioctl+0x34c: mov 0x100, %l1 cc_ioctl+0x350: or %l0, %l1, %l0 cc_ioctl+0x354: sth %l0, [%fp - 0x6] cc_ioctl+0x358: ld [%fp - 0x18], %l0 cc_ioctl+0x35c: mov 0x2, %l1 cc_ioctl+0x360: sethi %hi(0x3c00), %l2 cc_ioctl+0x364: or %l2, 0x11, %l2 cc_ioctl+0x368: add %fp, -0x6, %l3 cc_ioctl+0x36c: or %l0, %g0, %o0 cc_ioctl+0x370: or %l1, %g0, %o1 cc_ioctl+0x374: or %l2, %g0, %o2 cc_ioctl+0x378: or %l3, %g0, %o3 cc_ioctl+0x37c: call camac_s cc_ioctl+0x380: nop cc_ioctl+0x384: ba cc_ioctl+0x6b4 cc_ioctl+0x388: nop cc_ioctl+0x38c: sethi %hi(0xf6073000), %l0 cc_ioctl+0x390: or %l0, 0x1b8, %l0 cc_ioctl+0x394: lduh [%l0], %l0 cc_ioctl+0x398: sll %l0, 0x10, %l0 cc_ioctl+0x39c: srl %l0, 0x10, %l0 cc_ioctl+0x3a0: or %l0, 0x8, %l1 cc_ioctl+0x3a4: add %i5, 0x8, %l0 cc_ioctl+0x3a8: ld [%l0], %l0 cc_ioctl+0x3ac: add %l0, 0x40, %l0 cc_ioctl+0x3b0: sth %l1, [%l0] cc_ioctl+0x3b4: clr %l0 cc_ioctl+0x3b8: st %l0, [%fp - 0xc] cc_ioctl+0x3bc: ld [%fp - 0x18], %l0 cc_ioctl+0x3c0: clr %l1 cc_ioctl+0x3c4: sethi %hi(0x3c00), %l2 cc_ioctl+0x3c8: or %l2, 0x1b1, %l2 cc_ioctl+0x3cc: add %fp, -0xc, %l3 cc_ioctl+0x3d0: or %l0, %g0, %o0 cc_ioctl+0x3d4: or %l1, %g0, %o1 cc_ioctl+0x3d8: or %l2, %g0, %o2 cc_ioctl+0x3dc: or %l3, %g0, %o3 cc_ioctl+0x3e0: call camac_s cc_ioctl+0x3e4: nop cc_ioctl+0x3e8: ld [%fp - 0x18], %l0 cc_ioctl+0x3ec: mov 0x2, %l1 cc_ioctl+0x3f0: sethi %hi(0x3c00), %l2 cc_ioctl+0x3f4: or %l2, 0x1, %l2 cc_ioctl+0x3f8: add %fp, -0x6, %l3 cc_ioctl+0x3fc: or %l0, %g0, %o0 cc_ioctl+0x400: or %l1, %g0, %o1 cc_ioctl+0x404: or %l2, %g0, %o2 cc_ioctl+0x408: or %l3, %g0, %o3 cc_ioctl+0x40c: call camac_s cc_ioctl+0x410: nop cc_ioctl+0x414: lduh [%fp - 0x6], %l0 cc_ioctl+0x418: sethi %hi(0xfc00), %l1 cc_ioctl+0x41c: or %l1, 0x2ff, %l1 cc_ioctl+0x420: and %l0, %l1, %l0 cc_ioctl+0x424: sth %l0, [%fp - 0x6] cc_ioctl+0x428: ld [%fp - 0x18], %l0 cc_ioctl+0x42c: mov 0x2, %l1 cc_ioctl+0x430: sethi %hi(0x3c00), %l2 cc_ioctl+0x434: or %l2, 0x11, %l2 cc_ioctl+0x438: add %fp, -0x6, %l3 cc_ioctl+0x43c: or %l0, %g0, %o0 cc_ioctl+0x440: or %l1, %g0, %o1 cc_ioctl+0x444: or %l2, %g0, %o2 cc_ioctl+0x448: or %l3, %g0, %o3 cc_ioctl+0x44c: call camac_s cc_ioctl+0x450: nop cc_ioctl+0x454: ba cc_ioctl+0x6b4 cc_ioctl+0x458: nop cc_ioctl+0x45c: ba cc_ioctl+0x6b4 cc_ioctl+0x460: nop cc_ioctl+0x464: sethi %hi(0x1000), %l1 cc_ioctl+0x468: add %i5, 0x8, %l0 cc_ioctl+0x46c: ld [%l0], %l0 cc_ioctl+0x470: add %l0, 0x6e, %l0 cc_ioctl+0x474: sth %l1, [%l0] cc_ioctl+0x478: sethi %hi(0xf6073000), %l0 cc_ioctl+0x47c: or %l0, 0x1b8, %l0 cc_ioctl+0x480: lduh [%l0], %l0 cc_ioctl+0x484: sll %l0, 0x10, %l0 cc_ioctl+0x488: srl %l0, 0x10, %l0 cc_ioctl+0x48c: or %l0, 0x8, %l1 cc_ioctl+0x490: add %i5, 0x8, %l0 cc_ioctl+0x494: ld [%l0], %l0 cc_ioctl+0x498: add %l0, 0x40, %l0 cc_ioctl+0x49c: sth %l1, [%l0] cc_ioctl+0x4a0: sethi %hi(0xf6073000), %l0 cc_ioctl+0x4a4: or %l0, 0x1b8, %l0 cc_ioctl+0x4a8: lduh [%l0], %l0 cc_ioctl+0x4ac: sll %l0, 0x10, %l0 cc_ioctl+0x4b0: srl %l0, 0x10, %l0 cc_ioctl+0x4b4: or %l0, 0x8, %l1 cc_ioctl+0x4b8: add %i5, 0x8, %l0 cc_ioctl+0x4bc: ld [%l0], %l0 cc_ioctl+0x4c0: add %l0, 0x42, %l0 cc_ioctl+0x4c4: sth %l1, [%l0] cc_ioctl+0x4c8: sethi %hi(0xf6073000), %l0 cc_ioctl+0x4cc: or %l0, 0x1b8, %l0 cc_ioctl+0x4d0: lduh [%l0], %l0 cc_ioctl+0x4d4: sll %l0, 0x10, %l0 cc_ioctl+0x4d8: srl %l0, 0x10, %l0 cc_ioctl+0x4dc: or %l0, 0x8, %l1 cc_ioctl+0x4e0: add %i5, 0x8, %l0 cc_ioctl+0x4e4: ld [%l0], %l0 cc_ioctl+0x4e8: add %l0, 0x44, %l0 cc_ioctl+0x4ec: sth %l1, [%l0] cc_ioctl+0x4f0: sethi %hi(0xf6073000), %l0 cc_ioctl+0x4f4: or %l0, 0x1b8, %l0 cc_ioctl+0x4f8: lduh [%l0], %l0 cc_ioctl+0x4fc: sll %l0, 0x10, %l0 cc_ioctl+0x500: srl %l0, 0x10, %l0 cc_ioctl+0x504: or %l0, 0x8, %l1 cc_ioctl+0x508: add %i5, 0x8, %l0 cc_ioctl+0x50c: ld [%l0], %l0 cc_ioctl+0x510: add %l0, 0x46, %l0 cc_ioctl+0x514: sth %l1, [%l0] cc_ioctl+0x518: sethi %hi(0xf6073000), %l0 cc_ioctl+0x51c: or %l0, 0x1ba, %l0 cc_ioctl+0x520: lduh [%l0], %l1 cc_ioctl+0x524: add %i5, 0x8, %l0 cc_ioctl+0x528: ld [%l0], %l0 cc_ioctl+0x52c: add %l0, 0x48, %l0 cc_ioctl+0x530: sth %l1, [%l0] cc_ioctl+0x534: sethi %hi(0xf6073000), %l0 cc_ioctl+0x538: or %l0, 0x1ba, %l0 cc_ioctl+0x53c: lduh [%l0], %l1 cc_ioctl+0x540: add %i5, 0x8, %l0 cc_ioctl+0x544: ld [%l0], %l0 cc_ioctl+0x548: add %l0, 0x4a, %l0 cc_ioctl+0x54c: sth %l1, [%l0] cc_ioctl+0x550: sethi %hi(0xf6073000), %l0 cc_ioctl+0x554: or %l0, 0x1ba, %l0 cc_ioctl+0x558: lduh [%l0], %l1 cc_ioctl+0x55c: add %i5, 0x8, %l0 cc_ioctl+0x560: ld [%l0], %l0 cc_ioctl+0x564: add %l0, 0x4c, %l0 cc_ioctl+0x568: sth %l1, [%l0] cc_ioctl+0x56c: sethi %hi(0xf6073000), %l0 cc_ioctl+0x570: or %l0, 0x1ba, %l0 cc_ioctl+0x574: lduh [%l0], %l1 cc_ioctl+0x578: add %i5, 0x8, %l0 cc_ioctl+0x57c: ld [%l0], %l0 cc_ioctl+0x580: add %l0, 0x4e, %l0 cc_ioctl+0x584: sth %l1, [%l0] cc_ioctl+0x588: ba cc_ioctl+0x6b4 cc_ioctl+0x58c: nop cc_ioctl+0x590: ba cc_ioctl+0x6b4 cc_ioctl+0x594: nop cc_ioctl+0x598: clr %l1 cc_ioctl+0x59c: sethi %hi(0xf60f3400), %l0 cc_ioctl+0x5a0: or %l0, 0x290, %l0 cc_ioctl+0x5a4: st %l1, [%l0] cc_ioctl+0x5a8: mov 0x64, %l1 cc_ioctl+0x5ac: sethi %hi(0xf60f3400), %l0 cc_ioctl+0x5b0: or %l0, 0x294, %l0 cc_ioctl+0x5b4: sth %l1, [%l0] cc_ioctl+0x5b8: ba cc_ioctl+0x6b4 cc_ioctl+0x5bc: nop cc_ioctl+0x5c0: ba cc_ioctl+0x6b4 cc_ioctl+0x5c4: nop cc_ioctl+0x5c8: ld [%fp + 0x48], %l2 cc_ioctl+0x5cc: sethi %hi(0x7ffb9c00), %l0 cc_ioctl+0x5d0: xor %l0, -0xf9, %l0 cc_ioctl+0x5d4: cmp %l2, %l0 cc_ioctl+0x5d8: bge cc_ioctl+0x610 cc_ioctl+0x5dc: nop cc_ioctl+0x5e0: sethi %hi(0x7ffb9c00), %l1 cc_ioctl+0x5e4: xor %l1, -0xff, %l1 cc_ioctl+0x5e8: sub %l2, %l1, %l0 cc_ioctl+0x5ec: cmp %l0, 0x4 cc_ioctl+0x5f0: bgu cc_ioctl+0x5c0 cc_ioctl+0x5f4: nop cc_ioctl+0x5f8: sll %l0, 0x2, %l1 cc_ioctl+0x5fc: sethi %hi(0xf606c400), %l0 cc_ioctl+0x600: or %l0, 0x5c, %l0 cc_ioctl+0x604: ld [%l0 + %l1], %l0 cc_ioctl+0x608: jmp %l0 cc_ioctl+0x60c: nop cc_ioctl+0x610: sethi %hi(0x40046000), %l0 cc_ioctl+0x614: or %l0, 0x300, %l0 cc_ioctl+0x618: cmp %l2, %l0 cc_ioctl+0x61c: bge cc_ioctl+0x654 cc_ioctl+0x620: nop cc_ioctl+0x624: sethi %hi(0x7ffb9c00), %l0 cc_ioctl+0x628: xor %l0, -0xf9, %l0 cc_ioctl+0x62c: cmp %l2, %l0 cc_ioctl+0x630: be cc_ioctl+0x464 cc_ioctl+0x634: nop cc_ioctl+0x638: sethi %hi(0x7ffb9c00), %l0 cc_ioctl+0x63c: xor %l0, -0xf7, %l0 cc_ioctl+0x640: cmp %l2, %l0 cc_ioctl+0x644: be cc_ioctl+0x598 cc_ioctl+0x648: nop cc_ioctl+0x64c: ba cc_ioctl+0x5c0 cc_ioctl+0x650: nop cc_ioctl+0x654: sethi %hi(0x40046000), %l0 cc_ioctl+0x658: or %l0, 0x308, %l0 cc_ioctl+0x65c: cmp %l2, %l0 cc_ioctl+0x660: bge cc_ioctl+0x684 cc_ioctl+0x664: nop cc_ioctl+0x668: sethi %hi(0x40046000), %l0 cc_ioctl+0x66c: or %l0, 0x300, %l0 cc_ioctl+0x670: cmp %l2, %l0 cc_ioctl+0x674: be cc_ioctl+0x6c cc_ioctl+0x678: nop cc_ioctl+0x67c: ba cc_ioctl+0x5c0 cc_ioctl+0x680: nop cc_ioctl+0x684: sethi %hi(0x40046000), %l0 cc_ioctl+0x688: or %l0, 0x308, %l0 cc_ioctl+0x68c: cmp %l2, %l0 cc_ioctl+0x690: be cc_ioctl+0x590 cc_ioctl+0x694: nop cc_ioctl+0x698: sethi %hi(0x40706000), %l0 cc_ioctl+0x69c: or %l0, 0x306, %l0 cc_ioctl+0x6a0: cmp %l2, %l0 cc_ioctl+0x6a4: be cc_ioctl+0x45c cc_ioctl+0x6a8: nop cc_ioctl+0x6ac: ba cc_ioctl+0x5c0 cc_ioctl+0x6b0: nop cc_ioctl+0x6b4: clr %l0 cc_ioctl+0x6b8: st %l0, [%fp - 0x4] cc_ioctl+0x6bc: ba cc_ioctl+0x6c4 cc_ioctl+0x6c0: nop cc_ioctl+0x6c4: ld [%fp - 0x4], %l0 cc_ioctl+0x6c8: or %l0, %g0, %i0 cc_ioctl+0x6cc: ret cc_ioctl+0x6d0: restore cc_ioctl+0x6d4: ld [%i2 - 0x1f4], %i3 cc_ioctl+0x6d8: ld [%i2 - 0x1ac], %i3 cc_ioctl+0x6dc: ld [%i2 - 0x16c], %i3 cc_ioctl+0x6e0: ld [%i3 + %i0], %i3 cc_ioctl+0x6e4: ld [%i3 + %l4], %i3 cc_ioctl+0x6e8: unimp 0x10000 cc_ioctl+0x6ec: unimp 0x10000 cc_ioctl+0x6f0: unimp 0x10000 cc_ioctl+0x6f4: unimp 0x10000 next_instruction: save %sp, -0x68, %sp next_instruction+4: st %i0, [%fp + 0x44] next_instruction+8: ld [%fp + 0x44], %l0 next_instruction+0xc: add %l0, 0x40, %l0 next_instruction+0x10: ld [%l0], %l0 next_instruction+0x14: cmp %l0, %g0 next_instruction+0x18: be next_instruction+0x38 next_instruction+0x1c: nop next_instruction+0x20: clr %l1 next_instruction+0x24: ld [%fp + 0x44], %l0 next_instruction+0x28: add %l0, 0x40, %l0 next_instruction+0x2c: st %l1, [%l0] next_instruction+0x30: ba next_instruction+0x80 next_instruction+0x34: nop next_instruction+0x38: ld [%fp + 0x44], %l0 next_instruction+0x3c: add %l0, 0xc, %l0 next_instruction+0x40: ld [%l0], %l2 next_instruction+0x44: ld [%fp + 0x44], %l0 next_instruction+0x48: add %l0, 0xc, %l0 next_instruction+0x4c: ld [%l0], %l0 next_instruction+0x50: lduh [%l0], %l0 next_instruction+0x54: sll %l0, 0x10, %l0 next_instruction+0x58: srl %l0, 0x10, %l0 next_instruction+0x5c: sethi %hi(0xfc00), %l1 next_instruction+0x60: or %l1, 0x300, %l1 next_instruction+0x64: and %l0, %l1, %l0 next_instruction+0x68: sra %l0, 0x8, %l0 next_instruction+0x6c: sll %l0, 0x1, %l1 next_instruction+0x70: add %l2, %l1, %l1 next_instruction+0x74: ld [%fp + 0x44], %l0 next_instruction+0x78: add %l0, 0xc, %l0 next_instruction+0x7c: st %l1, [%l0] next_instruction+0x80: clr %l0 next_instruction+0x84: st %l0, [%fp - 0x4] next_instruction+0x88: ba next_instruction+0x90 next_instruction+0x8c: nop next_instruction+0x90: ld [%fp - 0x4], %l0 next_instruction+0x94: or %l0, %g0, %i0 next_instruction+0x98: ret next_instruction+0x9c: restore next_instruction+0xa0: unimp 0x10000 next_instruction+0xa4: unimp 0x10000 next_instruction+0xa8: unimp 0x10000 next_instruction+0xac: unimp 0x10000 flush_buf: save %sp, -0x60, %sp flush_buf+4: st %i0, [%fp + 0x44] flush_buf+8: sethi %hi(0xf6073400), %l1 flush_buf+0xc: or %l1, 0x268, %l1 flush_buf+0x10: ld [%fp + 0x44], %l0 flush_buf+0x14: add %l0, 0x18, %l0 flush_buf+0x18: ld [%l0], %l2 flush_buf+0x1c: ld [%fp + 0x44], %l0 flush_buf+0x20: add %l0, 0x28, %l0 flush_buf+0x24: ld [%l0], %l0 flush_buf+0x28: sll %l0, 0x1, %l0 flush_buf+0x2c: or %l1, %g0, %o0 flush_buf+0x30: or %l2, %g0, %o1 flush_buf+0x34: or %l0, %g0, %o2 flush_buf+0x38: call copyout flush_buf+0x3c: nop flush_buf+0x40: or %o0, %g0, %l1 flush_buf+0x44: ld [%fp + 0x44], %l0 flush_buf+0x48: add %l0, 0xa4, %l0 flush_buf+0x4c: st %l1, [%l0] flush_buf+0x50: ld [%fp + 0x44], %l0 flush_buf+0x54: add %l0, 0x18, %l0 $q frc7v-cl1[45]% ddi_get_soft_state() について ほとんどのデバイス・ドライバは、コントロールするデバイスの各インスタンス 毎にステート情報を保持している; たとえば、デバイス・コントロール レジスタのソフトコピー、ハードウェアのひとつにアクセスしている間中 保持しなければならない mutex、パーティション・テーブル、あるいは unit構造などである。 これらのユティリティ・ルーチンは、そのような state情報を保持することで、ドライバによって使われるスペースをデバイス ドライバが管理することを意図している。 たとえば、ドライバがひとつの state構造の中に各インスタンスのstateを保持するならば、インスタンスが アタッチ、ディアタッチされることで、これらのルーチンはドライバの 各インスタンス用の別々の構造体をダイナミックにアロケート、ディアロケート するために使うことができる。 ルーチンを使うために、ドライバを書く人は stateポインタを宣言することが 必要である。 state_p はドライブ構造毎にセットでハングする場所で使う。 すべてのものはこのルーチンが管理する。 ddi_soft_state_init() は stateポインタをイニシャライズするために、 あるいは soft state構造体のサイズをセットするために、さらに必要ならば ドライバがそのような構造体に前もって数を割り当てることを許すために、 通常はドライバの _init(9E)ルーチンの中でコールされる。 ddi_soft_state_zalloc() はドライバの attach(9E)ルーチンの中で通常は コールされる。 ルーチンは itemナンバを渡される。  getminor() について 高橋さんからのメール ---ここから こちらで調べたところ、以下の修正にて うまく行きそうです。 132行目 static void cc_timeout();         ↓ static void cc_timeout(caddr_t unit); 848行目 void cc_timeout(int unit)         ↓ void cc_timeout(caddr_t unit) 853行目 cc = ddi_get_soft_state(cc_state,unit);         ↓ cc = ddi_get_soft_state(cc_state,(int)*unit); ---ここまで cc.cファイルを修正する。 frc7v-cl1[43]% vi cc.c : static u_int cc_intr(); /* By E.Inoue */ /*static void cc_timeout(); */ static void cc_timeout(caddr_t unit); static int camac_s(int unit, u_short mode, u_short naf, : /* By E.Inoue */ /* void cc_timeout(int unit) */ /* cc_timeout(int unit) */ static void cc_timeout(caddr_t unit) { /* register struct cc_device *cc = &ccdevice[0]; */ register struct cc_device *cc; /* cc = ddi_get_soft_state(cc_state,unit); */ cc = ddi_get_soft_state(cc_state,(int)*unit); mutex_enter(&cc->mutex); /* start MUTEX */ : "cc.c" 2915 lines, 73399 characters frc7v-cl1[44]% cc.cファイルをコンパイルする。 frc7v-cl1[44]% make ./script/cc_build.sh [Building for sun4m] rm -f cc.o frc7v-cl1[45]% cc および cc.confファイルをコピーし直す。 frc8vt# pwd /usr/kernel/drv frc8vt# ls -l cc* -rwxr-xr-x 1 root sys 58808 Apr 9 14:02 cc* -rwxr-xr-x 1 root sys 288 Apr 9 14:03 cc.conf* frc8vt# rcp frc7v-cl1:/export/home/frc7v-cl1/inoue/CAMAC/Driver/FORCE-5V-sol2.5/ cc . frc8vt# rcp frc7v-cl1:/export/home/frc7v-cl1/inoue/CAMAC/Driver/FORCE-5V-sol2.5/ /cc.conf . frc8vt# ls -l cc* -rwxr-xr-x 1 root sys 58824 Apr 12 10:15 cc* -rwxr-xr-x 1 root sys 288 Apr 12 10:15 cc.conf* frc8vt# ccドライバをロードし直す。 frc7v-cl1# source /.cshrc frc7v-cl1# make unload ./script/cc_unload.sh [Removing CAMAC device driver] [Removing CAMAC device driver from system] [Deleting CAMAC device files] frc7v-cl1# make load ./script/cc_load.sh [Installing CAMAC device driver] cp: cannot create /usr/kernel/drv/cc: Read-only file system cp: cannot create /usr/kernel/drv/cc.conf: Read-only file system [Adding CAMAC device driver to system] [Configuring CAMAC device driver] [Making CAMAC device files] frc7v-cl1# cam3プログラムを実行する。 frc7v-cl1[87]% cam3 *** Now waiting LAM ... N=3 Loop=10 Timeout=0 sec Interrupted !! count=1 Interrupted !! count=2 Interrupted !! count=3 Timeout !! count=4 Timeout !! count=5 Interrupted !! count=6 Interrupted !! count=7 Interrupted !! count=8 Timeout !! count=9 Timeout !! count=10 *** cam3 nomal end. frc7v-cl1[88]% cam3 *** Now waiting LAM ... N=3 Loop=10 Timeout=0 sec Timeout !! count=1 Interrupted !! count=2 Timeout !! count=3 Timeout !! count=4 Interrupted !! count=5 Interrupted !! count=6 Interrupted !! count=7 Timeout !! count=8 Interrupted !! count=9 Timeout !! count=10 *** cam3 nomal end. frc7v-cl1[89]% cam3、camac割り込み処理は timeout処理も含めて問題は起きていない。 frc7v-cl1[89]% cam1 5 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 0 16 3333 N=3 A=0 F=16 Q=1 X=1 Data:000D05(Hex) 00003333(Dec) Input n a f (data)>3 0 0 N=3 A=0 F=0 Q=1 X=1 Data:000D05(Hex) 00003333(Dec) Input n a f (data)>3 0 16 55 N=3 A=0 F=16 Q=1 X=1 Data:000037(Hex) 00000055(Dec) Input n a f (data)>3 0 0 N=3 A=0 F=0 Q=1 X=1 Data:000037(Hex) 00000055(Dec) frc7v-cl1[90]% cam1、camacシングルアクション read/write は正常に実行できている。 frc7v-cl1[90]% cam2 Input transfer mode (1:word 2:long word) >1 Input loop >5 Input mode (0:QSTOP 1:QIGNORE 2:QREPEAT 3:QSCAN) >1 Input data counts >5 Input n a f >3 0 0 MODE=1 N= 3 A= 0 F= 0 len= 5 lenr= 5 error= 0(Hex) Data( 1)= 0 0x 0(Hex) Data( 2)= 0 0x 0(Hex) Data( 3)= 0 0x 0(Hex) Data( 4)= 0 0x 0(Hex) Data( 5)= 0 0x 0(Hex) Data( 6)= 0 0x 0(Hex) Data( 7)= 0 0x 0(Hex) Data( 8)= 0 0x 0(Hex) Data( 9)= 0 0x 0(Hex) Data(10)= 0 0x 0(Hex) Input n a f >3 0 16 Input data >8856 MODE=1 N= 3 A= 0 F=16 len= 5 lenr= 5 error= 0(Hex) Data( 1)= 8856 0x 2298(Hex) Data( 2)= 8856 0x 2298(Hex) Data( 3)= 8856 0x 2298(Hex) Data( 4)= 8856 0x 2298(Hex) Data( 5)= 8856 0x 2298(Hex) Data( 6)= 0 0x 0(Hex) Data( 7)= 0 0x 0(Hex) Data( 8)= 0 0x 0(Hex) Data( 9)= 0 0x 0(Hex) Data(10)= 0 0x 0(Hex) Input n a f >3 0 0 MODE=1 N= 3 A= 0 F= 0 len= 5 lenr= 5 error= 0(Hex) Data( 1)= 8856 0x 2298(Hex) Data( 2)= 8856 0x 2298(Hex) Data( 3)= 8856 0x 2298(Hex) Data( 4)= 8856 0x 2298(Hex) Data( 5)= 8856 0x 2298(Hex) Data( 6)= 0 0x 0(Hex) Data( 7)= 0 0x 0(Hex) Data( 8)= 0 0x 0(Hex) Data( 9)= 0 0x 0(Hex) Data(10)= 0 0x 0(Hex) Input n a f >3 0 16 Input data >9876 MODE=1 N= 3 A= 0 F=16 len= 5 lenr= 5 error= 0(Hex) Data( 1)= 9876 0x 2694(Hex) Data( 2)= 9876 0x 2694(Hex) Data( 3)= 9876 0x 2694(Hex) Data( 4)= 9876 0x 2694(Hex) Data( 5)= 9876 0x 2694(Hex) Data( 6)= 0 0x 0(Hex) Data( 7)= 0 0x 0(Hex) Data( 8)= 0 0x 0(Hex) Data( 9)= 0 0x 0(Hex) Data(10)= 0 0x 0(Hex) Input n a f >3 0 0 MODE=1 N= 3 A= 0 F= 0 len= 5 lenr= 5 error= 0(Hex) Data( 1)= 9876 0x 2694(Hex) Data( 2)= 9876 0x 2694(Hex) Data( 3)= 9876 0x 2694(Hex) Data( 4)= 9876 0x 2694(Hex) Data( 5)= 9876 0x 2694(Hex) Data( 6)= 0 0x 0(Hex) Data( 7)= 0 0x 0(Hex) Data( 8)= 0 0x 0(Hex) Data( 9)= 0 0x 0(Hex) Data(10)= 0 0x 0(Hex) frc7v-cl1[91]% cam2、16ビット camacブロック転送は正常に実行できた。 frc7v-cl1[91]% cam2 Input transfer mode (1:word 2:long word) >2 Input loop >5 Input mode (0:QSTOP 1:QIGNORE 2:QREPEAT 3:QSCAN) >1 Input data counts >5 Input n a f >3 0 0 MODE=1 N= 3 A= 0 F= 0 len= 5 lenr= 5 error= 0(Hex) Data( 1)= -16777216 0x FF000000(Hex) Data( 2)= -16777216 0x FF000000(Hex) Data( 3)= -16777216 0x FF000000(Hex) Data( 4)= -16777216 0x FF000000(Hex) Data( 5)= -16777216 0x FF000000(Hex) Data( 6)= 0 0x 0(Hex) Data( 7)= 0 0x 0(Hex) Data( 8)= 0 0x 0(Hex) Data( 9)= 0 0x 0(Hex) Data(10)= 0 0x 0(Hex) Input n a f >3 0 16 Input data >6636321 MODE=1 N= 3 A= 0 F=16 len= 5 lenr= 5 error= 0(Hex) Data( 1)= 6636321 0x 654321(Hex) Data( 2)= 6636321 0x 654321(Hex) Data( 3)= 6636321 0x 654321(Hex) Data( 4)= 6636321 0x 654321(Hex) Data( 5)= 6636321 0x 654321(Hex) Data( 6)= 0 0x 0(Hex) Data( 7)= 0 0x 0(Hex) Data( 8)= 0 0x 0(Hex) Data( 9)= 0 0x 0(Hex) Data(10)= 0 0x 0(Hex) Input n a f >3 0 0 MODE=1 N= 3 A= 0 F= 0 len= 5 lenr= 5 error= 0(Hex) Data( 1)= -10140895 0x FF654321(Hex) Data( 2)= -10140895 0x FF654321(Hex) Data( 3)= -10140895 0x FF654321(Hex) Data( 4)= -10140895 0x FF654321(Hex) Data( 5)= -10140895 0x FF654321(Hex) Data( 6)= 0 0x 0(Hex) Data( 7)= 0 0x 0(Hex) Data( 8)= 0 0x 0(Hex) Data( 9)= 0 0x 0(Hex) Data(10)= 0 0x 0(Hex) Input n a f >3 0 16 Input data >66666 MODE=1 N= 3 A= 0 F=16 len= 5 lenr= 5 error= 0(Hex) Data( 1)= 66666 0x 1046A(Hex) Data( 2)= 66666 0x 1046A(Hex) Data( 3)= 66666 0x 1046A(Hex) Data( 4)= 66666 0x 1046A(Hex) Data( 5)= 66666 0x 1046A(Hex) Data( 6)= 0 0x 0(Hex) Data( 7)= 0 0x 0(Hex) Data( 8)= 0 0x 0(Hex) Data( 9)= 0 0x 0(Hex) Data(10)= 0 0x 0(Hex) Input n a f >3 0 0 MODE=1 N= 3 A= 0 F= 0 len= 5 lenr= 5 error= 0(Hex) Data( 1)= -16710550 0x FF01046A(Hex) Data( 2)= -16710550 0x FF01046A(Hex) Data( 3)= -16710550 0x FF01046A(Hex) Data( 4)= -16710550 0x FF01046A(Hex) Data( 5)= -16710550 0x FF01046A(Hex) Data( 6)= 0 0x 0(Hex) Data( 7)= 0 0x 0(Hex) Data( 8)= 0 0x 0(Hex) Data( 9)= 0 0x 0(Hex) Data(10)= 0 0x 0(Hex) frc7v-cl1[92]% cam2、24ビット camacブロック転送は正常に実行できた。 ---xxx ここまでやった(継続中) --- (6). セクション (6-1). サブセクション (6-1-1). サブサブセクション