June 12, 2000 onl50t: デスクトップ Solaris 7 cc ドライバのテスト --- cc ドライバのデバッグ#011 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (http://www-online.kek.jp/~inoue/CAMAC/onl50t-sol7/ Desktop/debug-step10.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の実行は正常に実行できるようになった。 (Q). camac シングルアクション read/write の部分をデバッグ中にシステムを 壊してしまった。 (R). Solaris 7 のシステム再インストールした(その2)。 (S). /etc の下の各設定、および /export/home の作成をした(その2)。 (T). VMEドライバ、FRCvme-2.4.1 を再インストールした(その2)。 (U). ccドライバをインストールした(その2)。 (V). camac Z、C が正しく動作できるが、camacシングルアクションread/write がうまく実行できない状況に復旧できた。 (W). camac シングルアクション read/writeは正常に実行できた。 (X). camac LAM割り込み処理の部分をチェック(その1)。 cc_attach()ルーチンを修正した。 camac 割り込み処理は NG. (Y). camac LAM割り込み処理は正常に実行できた。 (Z). camacブロック転送readは正しく実行できた。 camacブロック転送writeはNG. DMAをスタートすると"DMA Buffer Empty" の割り込みがかかってDMAは実行されない。 (2). ここでやるべきこと camacブロック転送writeの部分をチェックする。 (3). 現状確認 (3-1). camacブロック転送を実行時の記録 onl50t[52]% 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 >1 Input n a f >3 0 0 MODE=1 N= 3 A= 0 F= 0 len= 1 lenr= 1 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 1 0 MODE=1 N= 3 A= 1 F= 0 len= 1 lenr= 1 error= 0(Hex) Data( 1)= 3 0x 3(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 >555 MODE=1 N= 3 A= 0 F=16 len= 1 lenr= 0 error= 0(Hex) Data( 1)= 555 0x 22B(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 0 ここでフリーズした。 May 12 13:43:29 onl50t unix: CAMAC device driver V1.4x, 1991-1993 by Y.TAKEUCHI (T.I.T.) May 12 13:44:14 onl50t unix: NOTICE: cc_write enter: May 12 13:44:14 onl50t May 12 13:44:14 onl50t unix: NOTICE: cc_write enter: May 12 13:44:14 onl50t May 12 13:44:14 onl50t unix: NOTICE: cc_write enter: May 12 13:44:14 onl50t May 12 13:44:14 onl50t unix: NOTICE: cc_write enter: May 12 13:44:14 onl50t May 12 13:44:14 onl50t unix: NOTICE: cc_write enter: May 12 13:44:14 onl50t May 12 13:44:14 onl50t unix: NOTICE: cc_write enter: May 12 13:44:14 onl50t onl50t console login: onl50t console login: onl50t console login: May 12 13:44:22 onl50t unix: NOTICE: cc_write enter: May 12 13:44:22 onl50t May 12 13:44:22 onl50t unix: NOTICE: cc_write: CC_CMD_DOBLOCK enter: May 12 13:44:22 onl50t May 12 13:44:22 onl50t unix: NOTICE: cc_write: cc->kreg->donv = 0xffff May 12 13:44:22 onl50t May 12 13:44:22 onl50t unix: NOTICE: cc_write: cc->kreg->csr = 0xa0 May 12 13:44:22 onl50t May 12 13:44:22 onl50t unix: NOTICE: camac_b: read: call physio --- uio = 0x485 940 May 12 13:44:22 onl50t May 12 13:44:22 onl50t unix: NOTICE: cc_strategy: mode = 0x2a May 12 13:44:22 onl50t May 12 13:44:22 onl50t unix: NOTICE: cc_strategy: naf = 0x600 May 12 13:44:22 onl50t May 12 13:44:22 onl50t unix: NOTICE: cc_strategy: wc = 0x1 May 12 13:44:22 onl50t May 12 13:44:22 onl50t unix: NOTICE: cc_strategy: check1. May 12 13:44:22 onl50t May 12 13:44:22 onl50t unix: NOTICE: cc_strategy: check2. May 12 13:44:22 onl50t May 12 13:44:22 onl50t unix: NOTICE: cc_strategy: dma_addr = 0x588 May 12 13:44:22 onl50t May 12 13:44:22 onl50t unix: NOTICE: cc_strategy: check3. --- start DMA May 12 13:44:22 onl50t May 12 13:44:22 onl50t unix: NOTICE: cc_intr: enter intrrupt: cc->kreg->csr = 0 x80 May 12 13:44:22 onl50t May 12 13:44:22 onl50t unix: NOTICE: cc_intr: wc = 0x0 May 12 13:44:22 onl50t May 12 13:44:22 onl50t unix: NOTICE: cc_intr: CC_INT_DONE: step02. May 12 13:44:22 onl50t unix: NOTICE: cc_intr: CC_INT_EMPTY: step02. May 12 13:44:22 onl50t unix: NOTICE: cc_intr: CC_INT_ABORT: step02. May 12 13:44:22 onl50t unix: NOTICE: cc_intr: cc->executing_dma_flag != 0: step 03. May 12 13:44:22 onl50t unix: NOTICE: cc_intr: cc->interrupt != 0: step04. May 12 13:44:22 onl50t unix: NOTICE: cc_intr: exit intrrupt: cc->kreg->csr = 0x 80 May 12 13:44:22 onl50t May 12 13:44:22 onl50t unix: NOTICE: cc_strategy: check4. --- return cc_strateg y May 12 13:44:22 onl50t May 12 13:44:22 onl50t unix: NOTICE: camac_b: read: physio return value = 0x0 May 12 13:44:22 onl50t May 12 13:44:22 onl50t unix: NOTICE: camac_b: read: cc->kreg->csr = 0x80 May 12 13:44:22 onl50t May 12 13:44:22 onl50t unix: NOTICE: cc_write: return camac_b(). May 12 13:44:22 onl50t May 12 13:44:22 onl50t unix: NOTICE: cc_write: cc->interrupt = 0xe May 12 13:44:22 onl50t May 12 13:44:22 onl50t unix: NOTICE: cc_write: cc->kreg->donv = 0xffff May 12 13:44:22 onl50t May 12 13:44:22 onl50t unix: NOTICE: cc_write: cc->kreg->csr = 0x80 May 12 13:44:22 onl50t onl50t console login: onl50t console login: onl50t console login: May 12 13:44:33 onl50t unix: NOTICE: cc_write enter: May 12 13:44:33 onl50t May 12 13:44:33 onl50t unix: NOTICE: cc_write: CC_CMD_DOBLOCK enter: May 12 13:44:33 onl50t May 12 13:44:33 onl50t unix: NOTICE: cc_write: cc->kreg->donv = 0xffff May 12 13:44:33 onl50t May 12 13:44:33 onl50t unix: NOTICE: cc_write: cc->kreg->csr = 0x80 May 12 13:44:33 onl50t May 12 13:44:33 onl50t unix: NOTICE: camac_b: read: call physio --- uio = 0x485 940 May 12 13:44:33 onl50t May 12 13:44:33 onl50t unix: NOTICE: cc_strategy: mode = 0x2a May 12 13:44:33 onl50t May 12 13:44:33 onl50t unix: NOTICE: cc_strategy: naf = 0x620 May 12 13:44:33 onl50t May 12 13:44:33 onl50t unix: NOTICE: cc_strategy: wc = 0x1 May 12 13:44:33 onl50t May 12 13:44:33 onl50t unix: NOTICE: cc_strategy: check1. May 12 13:44:33 onl50t May 12 13:44:33 onl50t unix: NOTICE: cc_strategy: check2. May 12 13:44:33 onl50t May 12 13:44:33 onl50t unix: NOTICE: cc_strategy: dma_addr = 0x588 May 12 13:44:33 onl50t May 12 13:44:33 onl50t unix: NOTICE: cc_strategy: check3. --- start DMA May 12 13:44:33 onl50t May 12 13:44:33 onl50t unix: NOTICE: cc_intr: enter intrrupt: cc->kreg->csr = 0 x80 May 12 13:44:33 onl50t May 12 13:44:33 onl50t unix: NOTICE: cc_intr: wc = 0x0 May 12 13:44:33 onl50t May 12 13:44:33 onl50t unix: NOTICE: cc_intr: CC_INT_DONE: step02. May 12 13:44:33 onl50t unix: NOTICE: cc_intr: CC_INT_EMPTY: step02. May 12 13:44:33 onl50t unix: NOTICE: cc_intr: CC_INT_ABORT: step02. May 12 13:44:33 onl50t unix: NOTICE: cc_intr: cc->executing_dma_flag != 0: step 03. May 12 13:44:33 onl50t unix: NOTICE: cc_intr: cc->interrupt != 0: step04. May 12 13:44:33 onl50t unix: NOTICE: cc_intr: exit intrrupt: cc->kreg->csr = 0x 80 May 12 13:44:33 onl50t May 12 13:44:33 onl50t unix: NOTICE: cc_strategy: check4. --- return cc_strateg y May 12 13:44:33 onl50t May 12 13:44:33 onl50t unix: NOTICE: camac_b: read: physio return value = 0x0 May 12 13:44:33 onl50t May 12 13:44:33 onl50t unix: NOTICE: camac_b: read: cc->kreg->csr = 0x80 May 12 13:44:33 onl50t May 12 13:44:33 onl50t unix: NOTICE: cc_write: return camac_b(). May 12 13:44:33 onl50t May 12 13:44:33 onl50t unix: NOTICE: cc_write: cc->interrupt = 0xe May 12 13:44:33 onl50t May 12 13:44:33 onl50t unix: NOTICE: cc_write: cc->kreg->donv = 0xffff May 12 13:44:33 onl50t May 12 13:44:33 onl50t unix: NOTICE: cc_write: cc->kreg->csr = 0x80 May 12 13:44:33 onl50t onl50t console login: onl50t console login: onl50t console login: May 12 13:44:45 onl50t unix: NOTICE: cc_write enter: May 12 13:44:45 onl50t May 12 13:44:45 onl50t unix: NOTICE: cc_write: CC_CMD_DOBLOCK enter: May 12 13:44:45 onl50t May 12 13:44:45 onl50t unix: NOTICE: cc_write: cc->kreg->donv = 0xffff May 12 13:44:45 onl50t May 12 13:44:45 onl50t unix: NOTICE: cc_write: cc->kreg->csr = 0x80 May 12 13:44:45 onl50t May 12 13:44:45 onl50t unix: NOTICE: camac_b: write: call physio --- uio = 0x48 5940 May 12 13:44:45 onl50t May 12 13:44:45 onl50t unix: NOTICE: cc_strategy: mode = 0x2a May 12 13:44:45 onl50t May 12 13:44:45 onl50t unix: NOTICE: cc_strategy: naf = 0x610 May 12 13:44:45 onl50t May 12 13:44:45 onl50t unix: NOTICE: cc_strategy: wc = 0x1 May 12 13:44:45 onl50t May 12 13:44:45 onl50t unix: NOTICE: cc_strategy: check1. May 12 13:44:45 onl50t May 12 13:44:45 onl50t unix: NOTICE: cc_strategy: check2. May 12 13:44:45 onl50t May 12 13:44:45 onl50t unix: NOTICE: cc_strategy: dma_addr = 0x588 May 12 13:44:45 onl50t May 12 13:44:45 onl50t unix: NOTICE: cc_strategy: check3. --- start DMA May 12 13:44:45 onl50t May 12 13:44:45 onl50t unix: NOTICE: cc_intr: enter intrrupt: cc->kreg->csr = 0 x461 May 12 13:44:45 onl50t May 12 13:44:45 onl50t unix: NOTICE: cc_intr: wc = 0x1 May 12 13:44:45 onl50t May 12 13:44:45 onl50t unix: NOTICE: cc_intr: CC_INT_EMPTY: step02. May 12 13:44:45 onl50t unix: NOTICE: cc_intr: CC_INT_ABORT: step02. May 12 13:44:45 onl50t unix: NOTICE: cc_intr: cc->executing_dma_flag != 0: step 03. May 12 13:44:45 onl50t unix: NOTICE: cc_intr: cc->interrupt != 0: step04. May 12 13:44:45 onl50t unix: NOTICE: cc_intr: exit intrrupt: cc->kreg->csr = 0x 461 May 12 13:44:45 onl50t May 12 13:44:45 onl50t unix: NOTICE: cc_strategy: check4. --- return cc_strateg y May 12 13:44:45 onl50t May 12 13:44:45 onl50t unix: NOTICE: camac_b: write: physio return value = 0x0 May 12 13:44:45 onl50t May 12 13:44:45 onl50t unix: NOTICE: camac_b: write: cc->kreg->csr = 0x461 May 12 13:44:45 onl50t May 12 13:44:45 onl50t unix: NOTICE: cc_write: return camac_b(). May 12 13:44:45 onl50t May 12 13:44:45 onl50t unix: NOTICE: cc_write: cc->interrupt = 0xe May 12 13:44:45 onl50t May 12 13:44:45 onl50t unix: NOTICE: cc_write: cc->kreg->donv = 0xffff May 12 13:44:45 onl50t May 12 13:44:45 onl50t unix: NOTICE: cc_write: cc->kreg->csr = 0x461 May 12 13:44:45 onl50t onl50t console login: onl50t console login: onl50t console login: May 12 13:44:58 onl50t unix: NOTICE: cc_write enter: May 12 13:44:58 onl50t May 12 13:44:58 onl50t unix: NOTICE: cc_write: CC_CMD_DOBLOCK enter: May 12 13:44:58 onl50t May 12 13:44:58 onl50t unix: NOTICE: cc_write: cc->kreg->donv = 0xffff May 12 13:44:58 onl50t May 12 13:44:58 onl50t unix: NOTICE: cc_write: cc->kreg->csr = 0x461 May 12 13:44:58 onl50t May 12 13:44:58 onl50t unix: NOTICE: camac_b: read: call physio --- uio = 0x485 940 May 12 13:44:58 onl50t May 12 13:44:58 onl50t unix: NOTICE: cc_strategy: mode = 0x2a May 12 13:44:58 onl50t May 12 13:44:58 onl50t unix: NOTICE: cc_strategy: naf = 0x600 May 12 13:44:58 onl50t May 12 13:44:58 onl50t unix: NOTICE: cc_strategy: wc = 0x1 May 12 13:44:58 onl50t May 12 13:44:58 onl50t unix: NOTICE: cc_strategy: check1. May 12 13:44:58 onl50t May 12 13:44:58 onl50t unix: NOTICE: cc_strategy: check2. May 12 13:44:58 onl50t May 12 13:44:58 onl50t unix: NOTICE: cc_strategy: dma_addr = 0x588 May 12 13:44:58 onl50t May 12 13:44:58 onl50t unix: NOTICE: cc_strategy: check3. --- start DMA May 12 13:44:58 onl50t May 12 13:44:58 onl50t unix: NOTICE: cc_strategy: check4. --- return cc_strateg y May 12 13:44:58 onl50t BAD TRAP: cpu=0 type=0x31 rp=0x2a100053880 addr=0x0 mmu_fsr=0x0 BAD TRAP occurred in module "unix" due to a NULL pointer dereference. sched: trap type = 0x31 pid=0, pc=0x10036564, sp=0x2a100053121, tstate=0xf0001600, context=0x0 g1-g7: 2a100053d60, 1041ef68, 0, 8, 30000573ed8, 0, 2a100053d60 Begin traceback... sp = 2a100053121 Called from 10074cbc, fp=2a1000531d1, args=98 0 20 10423600 300000d16b8 0 Called from 100ebd00, fp=2a100053281, args=30000033000 faf2a8 30000033038 1 8000 000000000000 30000034578 Called from 1002e110, fp=2a100053351, args=3000002bf68 0 10000 30000573eb2 30000 573eb0 30000573ea8 Called from 100ebb70, fp=0, args=30000573e80 0 0 0 0 0 End traceback... panic[cpu0]/thread=2a100053d60: trap syncing file systems...panic[cpu0]/thread=2a100057d60: panic sync timeout dumping to /dev/dsk/c0t3d0s3, offset 31260672 100% done: 4709 pages dumped, compression ratio 3.46, dump succeeded rebooting... Resetting ... 1回目と2回目のブロック転送readは、DMA転送終了を示す DONEによる割り込み がかかっている。 しかし、3回目のブロック転送writeでは、"DMA Buffer Empt y" によって割り込みがかかっている。 この時、2917 のワードカウントレジス タの値は0x1の状態で、CSRレジスタの DMA、GOの各ビットはセットされたままに なっておりDMA転送はまだ完了していないことを示している。 2917は RUN と M1 の LEDが点灯したままになっている。 M1の点灯は、Q-Ignoreモードで camac の実行が行われていることを示している。 ここで起きているトラブルと直接の 関連は無い。 (4). 関連する man (4-1). write(9E)について Driver Entry Points write(9E) NAME write - write data to a device SYNOPSIS #include #include #include #include #include #include int prefixwrite(dev_t dev, struct uio *uio_p, cred_t *cred_p); INTERFACE LEVEL Architecture independent level 1 (DDI/DKI). This entry point is optional. PARAMETERS dev デバイスナンバー。 uio_p ユーザスペースの中のデータがストアされるべき場所を記述した uio(9S)構造体へのポインタ。 cred_p I/O処理用のユーザ credential構造体へのポインタ。 DESCRIPTION キャラクタI/Oや rawデータI/Oのために使われる、ドライバの write()ルーチンは    write(2)システムコールによって cb_ops(9S) を通して間接的にコールされる。    write()ルーチンは uio(9S)構造体によって記述されたユーザスペースからデバイス    へのデータ転送を監督する。 write()ルーチンは dev のマイナーナンバーの有効性、cred_p でポイントされた ユーザ credentials の有効性が適切かどうかチェックすべきである。 RETURN VALUES The write() routine should return 0 for success, or the appropriate error number. EXAMPLES Example 1: The following is an example of a write() routine using physio(9F) to perform writes to a seekable device: static int xxwrite(dev_t dev, struct uio *uiop, cred_t *credp) { int instance; SunOS 5.7 Last change: 28 Mar 1997 1 Driver Entry Points write(9E) xx_t xx; instance = getminor(dev); xx = ddi_get_soft_state(xxstate, instance); if (xx == NULL) return (ENXIO); return (physio(xxstrategy, NULL, dev, B_WRITE, xxmin, uiop)); } SEE ALSO read(2), write(2), read(9E), physio(9F), cb_ops(9S), uio(9S) Writing Device Drivers SunOS 5.7 Last change: 28 Mar 1997 2 (4-2). read(9E)について Driver Entry Points read(9E) NAME read - read data from a device SYNOPSIS #include #include #include #include #include #include #include int prefixread(dev_t dev, struct uio *uio_p, cred_t *cred_p); INTERFACE LEVEL Architecture independent level 1 (DDI/DKI). This entry point is optional. PARAMETERS dev Device number. uio_p Pointer to the uio(9S) structure that describes where the data is to be stored in user space. cred_p Pointer to the user credential structure for the I/O transaction. DESCRIPTION The driver read() routine is called indirectly through cb_ops(9S) by the read(2) system call. The read() routine should check the validity of the minor number component of dev and the user credential structure pointed to by cred_p (if pertinent). The read() routine should supervise the data transfer into the user space described by the uio(9S) structure. RETURN VALUES The read() routine should return 0 for success, or the appropriate error number. EXAMPLES Example 1: read() routine using physio() The following is an example of a read() routine using physio(9F) to perform reads from a non-seekable device: static int xxread(dev_t dev, struct uio *uiop, cred_t *credp) { int rval; offset_t off; SunOS 5.7 Last change: 19 Nov 1997 1 Driver Entry Points read(9E) int instance; xx_t xx; instance = getminor(dev); xx = ddi_get_soft_state(xxstate, instance); if (xx == NULL) return (ENXIO); off = uiop->uio_loffset; rval = physio(xxstrategy, NULL, dev, B_READ, xxmin, uiop); uiop->uio_loffset = off; return (rval); } SEE ALSO read(2), write(9E), physio(9F), cb_ops(9S), uio(9S) Writing Device Drivers SunOS 5.7 Last change: 19 Nov 1997 2 (4-3). cb_ops(9S)について Data Structures for Drivers cb_ops(9S) NAME cb_ops - character/block entry points structure SYNOPSIS #include #include #include INTERFACE LEVEL Solaris DDI specific (Solaris DDI). DESCRIPTION cb_ops はキャラクタおよびブロックエントリーポイントの両方をサポートする ドライバ用の全エントリーポイントを収めている。 ユーザプロセスが直接に デバイスにアクセスすることをサポートしているすべてのリーフデバイスドライバ は cb_ops 構造体を宣言すべきである。 同時にドライバの中で複数のスレッドの実行が安全にできるすべてのドライバは cb_flag フィールドに D_MP フラッグをセットしなければならない。 ドライバが64ビットオフセットを適切に処理できるならば、cb_flag フィールド に D_64BIT もセットすべきである。 これは、ドライバが uio(9S) 構造体の uio_loffset フィールドを使うことを指定する。 mt-streams(9F) は、cb_flag フィールドにセットされるその他のフラッグを記述 する。 cb_rev は、cb_ops 構造体のリビジョンナンバーである。 このフィールドはCB_REV にセットされなければならない。 Non-STREAMS ドライバは cb_str にNULLをセットすべきである。 The following DDI/DKI or DKI-only or DDI-only functions are provided in the character/block driver operations structure. block/char Function Description b/c XXopen DDI/DKI b/c XXclose DDI/DKI b XXstrategy DDI/DKI b XXprint DDI/DKI b XXdump DDI(Sun) c XXread DDI/DKI c XXwrite DDI/DKI c XXioctl DDI/DKI c XXdevmap DDI(Sun) c XXmmap DKI c XXsegmap DKI c XXchpoll DDI/DKI c XXprop_op DDI(Sun) c XXaread DDI(Sun) c XXawrite DDI(Sun) SunOS 5.7 Last change: 30 Sep 1996 1 Data Structures for Drivers cb_ops(9S) STRUCTURE MEMBERS int (*cb_open)(dev_t *devp, int flag, int otyp, cred_t *credp); int (*cb_close)(dev_t dev, int flag, int otyp, cred_t *credp); int (*cb_strategy)(struct buf *bp);int(*cb_print)(dev_t dev, char *str ); int (*cb_dump)(dev_t dev, caddr_t addr, daddr_t blkno, int nblk); int (*cb_read)(dev_t dev, struct uio *uiop, cred_t *credp); int (*cb_write)(dev_t dev, struct uio *uiop, cred_t *credp); int (*cb_ioctl)(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp, int *rvalp); int (*cb_devmap)(dev_t dev, devmap_cookie_t dhp, offset_t off, size_t len, size_t *maplen, uint_t model); int (*cb_mmap)(dev_t dev, off_t off, int prot); int (*cb_segmap)(dev_t dev, off_t off, struct as *asp, caddr_t *addrp, off_t len, unsigned int prot, unsigned int maxprot, unsigned int flags, cred_t *credp); int (*cb_chpoll)(dev_t dev, short events, int anyyet, short *reventsp, struct pollhead **phpp); int (*cb_prop_op)(dev_t dev, dev_info_t *dip, ddi_prop_op_t prop_op, int mod_flags, char *name, caddr_t valuep, int *length); struct streamtab *cb_str; /* streams information */ int cb_flag;intcb_rev; int (*cb_aread)(dev_t dev, struct aio_req *aio, cred_t *credp); int (*cb_awrite)(dev_t dev, struct aio_req *aio, cred_t *credp); SEE ALSO aread(9E), awrite(9E), chpoll(9E), close(9E), dump(9E), ioctl(9E), mmap(9E), open(9E), print(9E), prop_op(9E), read(9E), segmap(9E), strategy(9E), write(9E), nochpoll(9F), nodev(9F), nulldev(9F), dev_ops(9S), qinit(9S) Writing Device Drivers STREAMS Programming Guide SunOS 5.7 Last change: 30 Sep 1996 2 (4-4). dev_ops(9S)について Data Structures for Drivers dev_ops(9S) NAME dev_ops - デバイス動作構造体 SYNOPSIS #include #include INTERFACE LEVEL Solaris DDI specific (Solaris DDI). DESCRIPTION dev_ops はドライバ・コモン・フィールドおよび bus_ops と cb_ops(9S) への ポインタを収めている。 以下はデバイス動作構造体に用意されているデバイス関数である。 すべての フィールドはコンパイル時にセットされなければならない。 devo_rev 作り上げるドライバのバージョン。 これは、DEVO_REVにセットせよ。 devo_refcnt ドライバ参照カウント。 これは 0 にセットせよ。 devo_getinfo デバイスドライバ情報のゲット。(see getinfo(9E)) devo_identify ドライバがデバイスと結び付けられているかどうかを確認。 See identify(9E). devo_probe デバイスを調査する。 See probe(9E). devo_attach ドライバを dev_info に結び付ける。 See attach(9E). devo_detach 取り外し/ドライバをアンロードするための準備をする。 See detach(9E). devo_reset デバイスをリセットする。 (このリリースではサポートされない) nodev にセットせよ。 devo_cb_ops リーフドライバ用の cb_ops(9S) 構造体へのポインタ。 devo_bus_ops nexus ドライバ用の bus 動作構造体へのポインタ。 リーフドライバ用 の場合には、NULL にセットせよ。 SunOS 5.7 Last change: 24 Jun 1997 1 Data Structures for Drivers dev_ops(9S) devo_power システムに取りつけられたデバイスの電源をコントロールする。 See power(9E). STRUCTURE MEMBERS int devo_rev; int devo_refcnt; int (*devo_getinfo)(dev_info_t *dip, ddi_info_cmd_t infocmd, void *arg, void **result); int (*devo_identify)(dev_info_t *dip); int (*devo_probe)(dev_info_t *dip); int (*devo_attach)(dev_info_t *dip, ddi_attach_cmd_t cmd); int (*devo_detach)(dev_info_t *dip, ddi_detach_cmd_t cmd); int (*devo_reset)(dev_info_t *dip, ddi_reset_cmd_t cmd); struct cb_ops *devo_cb_ops; struct bus_ops *devo_bus_ops; int (*devo_power)(dev_info_t *dip, int component, int level); SEE ALSO attach(9E), detach(9E), getinfo(9E), identify(9E), probe(9E), power(9E), nodev(9F) Writing Device Drivers SunOS 5.7 Last change: 24 Jun 1997 2 (4-5). uio(9S)について Data Structures for Drivers uio(9S) NAME uio - scatter/gather I/O request structure SYNOPSIS #include INTERFACE LEVEL Architecture independent level 1 (DDI/DKI). DESCRIPTION uio 構造体は、異なるデータストレージエリアの中にばらばらに在る I/O リクエス トを記述する(scatter/gather I/O)。 リクエストは、I/O データがユーザスペース あるいはカーネルスペースの読まれるべきあるいは書き込まれるべき場所を示して いる iovec 構造体のリストである。 エントリポイントを通してドライバに渡される uio 構造体の内容は、ドライバに よって書かれるべきではない。 uiomove(9F) 関数は uio 構造体の状態保持に関連 する全オーバーヘッドの面倒をみる。 ドライバによってアロケートされた uio 構造体は、使用する前にbzero(9F)、 kmem_zalloc(9F)、あるいは相当のものによってゼロに初期化されるべきである。 STRUCTURE MEMBERS iovec_t *uio_iov; /* uio 構造体用の iovec 開始のリストへの */ /* ポインタ。 */ int uio_iovcnt; /* リスト中の iovecs の数。 */ off_t uio_offset; /* データが転送されるファイル中での 32ビット */ /* オフセット。 See NOTES. */ offset_t uio_loffset; /* データが転送されるファイル中での 64ビット */ /* オフセット。 See NOTES. */ uio_seg_t uio_segflg; /* I/O 転送のタイプを見分ける: */ /* UIO_SYSSPACE: kernel <-> kernel */ /* UIO_USERSPACE: kernel <-> user */ short uio_fmode; /* ファイルモードフラッグ(not driver setable)*/ daddr_t uio_limit; /* ファイル用の32ビット ulimit(maximum block */ /* offset). not driver setable. See NOTES. */ diskaddr_t uio_llimit; /* ファイル用の64ビット ulimit(maximum block */ /* offset). not driver setable. See NOTES. */ int uio_resid; /* 残余のカウント */ uio_iov メンバは uio 用の iovec(9S) リストの始まりへのポインタである。 uio 構造体がエントリポイントを通してドライバに渡される時、ドライバは uio_iov をセットすべきではない。 uio 構造体がドライバによって作成される時 uio_iov はドライバによって初期化されるべきである、そしてその後は書かれる べきではない。 SEE ALSO SunOS 5.7 Last change: 28 Mar 1997 1 Data Structures for Drivers uio(9S) aread(9E), awrite(9E), read(9E), write(9E), bzero(9F), kmem_zalloc(9F), uiomove(9F), cb_ops(9S), iovec(9S) Writing Device Drivers NOTES uio_offset か uio_loffset の内の一つだけがドライバによって解読されるべきで ある。 ドライバがどちらのフィールドを解読するかは、cb_ops(9S) 構造体の セッティングによる。 uio_limit か uio_llimit の内の一つだけがドライバによって解読されるべきで ある。 ドライバがどちらのフィールドを解読するかは、cb_ops(9S) 構造体の セッティングによる。 シーク可能なデバイス上で I/O を行う時、ドライバは uio 構造体の uio_offset もしくは uio_loffset フィールドを変更すべきではない。 そのようなデバイスに 対する I/O は最大オフセット値によって強制される。 位置の概念が関係しない ようなデバイス上での I/O を実行する時、ドライバは uio_offset あるいは uio_loffset を保ち、I/O 動作を実行する。 そして、uio_offset あるいは uio_loffset をフィールドの初期値にリストアする。 このやり方でデバイスに行わ れる I/O は強制されない。 SunOS 5.7 Last change: 28 Mar 1997 2 (4-6). iovec(9S)について Data Structures for Drivers iovec(9S) NAME iovec - data storage structure for I/O using uio SYNOPSIS #include INTERFACE LEVEL Architecture independent level 1 (DDI/DKI). DESCRIPTION iovec 構造体は uio(9S) 構造体の転送のためのデータストレージ領域を記述する。 概念的に、ベースアドレスおよび長さの詳述として考えてもよい。 STRUCTURE MEMBERS caddr_t iov_base; /* iovec 構造体によって表現されるデータストレージ */ /* 領域のベースアドレス */ int iov_len; /* データストレージ領域のバイトサイズ */ SEE ALSO uio(9S) Writing Device Drivers SunOS 5.7 Last change: 11 Apr 1991 1 (4-7). writev(2)について System Calls write(2) NAME write, pwrite, writev - write on a file SYNOPSIS #include ssize_t write(int fildes, const void *buf, size_t nbyte); ssize_t pwrite(int fildes, const void *buf, size_t nbyte, off_t offset); #include ssize_t writev(int fildes, const struct iovec *iov, int iovcnt); DESCRIPTION The write() function attempts to write nbyte bytes from the buffer pointed to by buf to the file associated with the open file descriptor, fildes. If nbyte is 0, write() will return 0 and have no other results if the file is a regular file; otherwise, the results are unspecified. On a regular file or other file capable of seeking, the actual writing of data proceeds from the position in the file indicated by the file offset associated with fildes. Before successful return from write(), the file offset is incremented by the number of bytes actually written. On a regular file, if this incremented file offset is greater than the length of the file, the length of the file will be set to this file offset. If the O_SYNC flag of the file status flags is set and fildes refers to a regular file, a successful write() does not return until the data is delivered to the underlying hardware. If fildes refers to a socket, write() is equivalent to send(3N) with no flags set. On a file not capable of seeking, writing always takes place starting at the current position. The value of a file offset associated with such a device is undefined. If the O_APPEND flag of the file status flags is set, the file offset will be set to the end of the file prior to each write and no intervening file modification operation will occur between changing the file offset and the write opera- tion. SunOS 5.7 Last change: 28 Jan 1998 1 System Calls write(2) For regular files, no data transfer will occur past the offset maximum established in the open file description with fildes. A write() to a regular file is blocked if mandatory file/record locking is set (see chmod(2)), and there is a record lock owned by another process on the segment of the file to be written: o If O_NDELAY or O_NONBLOCK is set, write() returns -1 and sets errno to EAGAIN. o If O_NDELAY and O_NONBLOCK are clear, write() sleeps until all blocking locks are removed or the write() is terminated by a signal. If a write() requests that more bytes be written than there is room for-for example, if the write would exceed the pro- cess file size limit (see getrlimit(2) and ulimit(2)), the system file size limit, or the free space on the device-only as many bytes as there is room for will be written. For example, suppose there is space for 20 bytes more in a file before reaching a limit. A write() of 512-bytes returns 20. The next write() of a non-zero number of bytes gives a failure return (except as noted for pipes and FIFO below). If write() is interrupted by a signal before it writes any data, it will return -1 with errno set to EINTR. If write() is interrupted by a signal after it successfully writes some data, it will return the number of bytes writ- ten. If the value of nbyte is greater than SSIZE_MAX, the result is implementation-dependent. After a write() to a regular file has successfully returned: o Any successful read(2) from each byte position in the file that was modified by that write will return the data specified by the write() for that position until such byte positions are again modified. o Any subsequent successful write() to the same byte position in the file will overwrite that file data. Write requests to a pipe or FIFO are handled the same as a regular file with the following exceptions: o There is no file offset associated with a pipe, hence each write request appends to the end of the pipe. SunOS 5.7 Last change: 28 Jan 1998 2 System Calls write(2) o Write requests of {PIPE_BUF} bytes or less are guaranteed not to be interleaved with data from other processes doing writes on the same pipe. Writes of greater than {PIPE_BUF} bytes may have data inter- leaved, on arbitrary boundaries, with writes by other processes, whether or not the O_NONBLOCK or O_NDELAY flags are set. o If O_NONBLOCK and O_NDELAY are clear, a write request may cause the process to block, but on normal comple- tion it returns nbyte. o If O_NONBLOCK and O_NDELAY are set, write() does not block the process. If a write() request for PIPE_BUF or fewer bytes succeeds completely write() returns nbyte. Otherwise, if O_NONBLOCK is set, it returns -1 and sets errno to EAGAIN or if O_NDELAY is set, it returns 0. A write() request for greater than {PIPE_BUF} bytes transfers what it can and returns the number of bytes written or it transfers no data and, if O_NONBLOCK is set, returns -1 with errno set to EAGAIN or if O_NDELAY is set, it returns 0. Finally, if a request is greater than PIPE_BUF bytes and all data previously written to the pipe has been read, write() transfers at least PIPE_BUF bytes. When attempting to write to a file descriptor (other than a pipe, a FIFO, a socket, or a STREAM) that supports nonblock- ing writes and cannot accept the data immediately: o If O_NONBLOCK and O_NDELAY are clear, write() blocks until the data can be accepted. o If O_NONBLOCK or O_NDELAY is set, write() does not block the process. If some data can be written without blocking the process, write() writes what it can and returns the number of bytes written. Otherwise, if O_NONBLOCK is set, it returns -1 and sets errno to EAGAIN or if O_NDELAY is set, it returns 0. Upon successful completion, where nbyte is greater than 0, write() will mark for update the st_ctime and st_mtime fields of the file, and if the file is a regular file, the S_ISUID and S_ISGID bits of the file mode may be cleared. For STREAMS files (see intro(2) and streamio(7I)), the operation of write() is determined by the values of the minimum and maximum nbyte range ("packet size") accepted by the STREAM. These values are contained in the topmost STREAM module, and can not be set or tested from user level. If nbyte falls within the packet size range, nbyte bytes are written. If nbyte does not fall within the range and the SunOS 5.7 Last change: 28 Jan 1998 3 System Calls write(2) minimum packet size value is zero, write() breaks the buffer into maximum packet size segments prior to sending the data downstream (the last segment may be smaller than the maximum packet size). If nbyte does not fall within the range and the minimum value is non-zero, write() fails and sets errno to ERANGE. Writing a zero-length buffer (nbyte is zero) to a STREAMS device sends a zero length message with zero returned. However, writing a zero-length buffer to a pipe or FIFO sends no message and zero is returned. The user program may issue the I_SWROPT ioctl(2) to enable zero-length messages to be sent across the pipe or FIFO (see streamio(7I)). When writing to a STREAM, data messages are created with a priority band of zero. When writing to a socket or to a STREAM that is not a pipe or a FIFO: o If O_NDELAY and O_NONBLOCK are not set, and the STREAM cannot accept data (the STREAM write queue is full due to internal flow control conditions), write() blocks until data can be accepted. o If O_NDELAY or O_NONBLOCK is set and the STREAM cannot accept data, write() returns -1 and sets errno to EAGAIN. o If O_NDELAY or O_NONBLOCK is set and part of the buffer has already been written when a condition occurs in which the STREAM cannot accept additional data, write() terminates and returns the number of bytes written. コール以前に、STREAM head が非同期エラーを処理した場合には、write() および writev() 関数は失敗する。 この場合、errno の値は write() や writev() の結果 を反映していないが、以前のエラーを反映している。 pwrite() The pwrite() function performs the same action as write(), except that it writes into a given position without changing the file pointer. The first three arguments to pwrite() are the same as write() with the addition of a fourth argument offset for the desired position inside the file. writev() writev() 関数は write() と同じ動作を実行するが、iov アレー: iov[0], iov[1], ..., iov[iovcnt-1] のメンバによって指定された iovcnt バッファから出力 データを集める。 iovcnt バッファは 0より大きくて {IOV_MAX} より小さいもし くは等しいならば有効である。 {IOV_MAX}の定義については、intro(2) を参照。 SunOS 5.7 Last change: 28 Jan 1998 4 System Calls write(2) iovec 構造体は以下のメンバを収めている: caddr_t iov_base; int iov_len; 各 iovec エントリは、データが書き込まれるメモリ領域のベースアドレスおよび 長さを指定する。 writev() 関数は、次に進む前に領域からの全データを常に書き 込む。 フィールドがレギュラーファイルに関連し、iov によってポイントされるアレーの iov_len メンバの全てが 0 であるならば、writev() は 0 をリターンし他になにも 影響を及ぼさない。 他のファイルタイプに対しては、振る舞いは特定されない。 iov_len 値の合計が、SSIZE_MAX よりも大きい場合には、動作は失敗し、データは 転送されない。 RETURN VALUES Upon successful completion, write() returns the number of bytes actually written to the file associated with fildes. This number is never greater than nbyte. Otherwise, -1 is returned, the file-pointer remains unchanged, and errno is set to indicate the error. 正常終了時に、writev() は実際に書き込まれたバイト数をリターンする。 異常 終了時には、-1 をリターンし、ファイルポインタは変更されずに残っている。 そして、errno はエラーを表すようにセットされる。 ERRORS write(), pwrite(), および writev() 関数は以下の場合失敗である: EAGAIN Mandatory file/record locking is set, O_NDELAY or O_NONBLOCK is set, and there is a blocking record lock; total amount of system memory available when reading using raw I/O is temporarily insuffi- cient; an attempt is made to write to a STREAM that can not accept data with the O_NDELAY or O_NONBLOCK flag set; or a write to a pipe or FIFO of PIPE_BUF bytes or less is requested and less than nbytes of free space is available. EBADF The fildes argument is not a valid file descriptor open for writing. EDEADLK The write was going to go to sleep and cause a deadlock situation to occur. EDQUOT The user's quota of disk blocks on the file system containing the file has been exhausted. SunOS 5.7 Last change: 28 Jan 1998 5 System Calls write(2) EFAULT The buf argument points to an illegal address. EFBIG An attempt is made to write a file that exceeds the process's file size limit or the maximum file size (see getrlimit(2) and ulimit(2)). EFBIG The file is a regular file, nbyte is greater than 0, and the starting position is greater than or equal to the offset maximum established in the file description associated with fildes. EINTR A signal was caught during the write operation and no data was transferred. EIO The process is in the background and is attempting to write to its controlling terminal whose TOSTOP flag is set, or the process is neither ignoring nor blocking SIGTTOU signals and the process group of the process is orphaned. ENOLCK Enforced record locking was enabled and {LOCK_MAX} regions are already locked in the system, or the system record lock table was full and the write could not go to sleep until the blocking record lock was removed. ENOLINK The fildes argument is on a remote machine and the link to that machine is no longer active. ENOSPC During a write to an ordinary file, there is no free space left on the device. ENOSR An attempt is made to write to a STREAMS with insufficient STREAMS memory resources available in the system. ENXIO A hangup occurred on the STREAM being written to. EPIPE An attempt is made to write to a pipe or a FIFO that is not open for reading by any process, or that has only one end open (or to a file descrip- tor created by socket(3N), using type SOCK_STREAM that is no longer connected to a peer endpoint). A SIGPIPE signal will also be sent to the process. The process dies unless special provisions were taken to catch or ignore the signal. ERANGE The transfer request size was outside the range supported by the STREAMS file associated with fildes. SunOS 5.7 Last change: 28 Jan 1998 6 System Calls write(2) The pwrite() function fails and the file pointer remains unchanged if: ESPIPE The fildes argument is associated with a pipe or FIFO. writev() 関数は以下の場合失敗である: EINVAL iov アレーの iov_len 値の合計が ssize_t をオーバーフロー。 write() および writev() 関数は以下の場合失敗であるかもしれない: EINVAL The STREAM or multiplexer referenced by fildes is linked (directly or indirectly) downstream from a multiplexer. ENXIO A request was made of a non-existent device, or the request was outside the capabilities of the device. ENXIO A hangup occurred on the STREAM being written to. A write to a STREAMS file may fail if an error message has been received at the STREAM head. In this case, errno is set to the value included in the error message. writev() 関数は次の場合失敗である: EINVAL iovcnt 引数が 0 よりも小さいか等しい、もしくは {IOV_MAX} よりも 大きい; iov アレーの iov_len 値の一つが負だった; あるいは、 iov アレーの iov_len 値の合計が int をオーバーフローした。 USAGE The pwrite() function has a transitional interface for 64- bit file offsets. See lf64(5). ATTRIBUTES See attributes(5) for descriptions of the following attri- butes: ____________________________________________________________ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | |_____________________________|_____________________________| | MT-Level | write() is Async-Signal-Safe| |_____________________________|_____________________________| SEE ALSO Intro(2), chmod(2), creat(2), dup(2), fcntl(2), getrlimit(2), ioctl(2), lseek(2), open(2), pipe(2), ulimit(2), send(3N), socket(3N), attributes(5), lf64(5), streamio(7I) SunOS 5.7 Last change: 28 Jan 1998 7 (4-8). physio(9F)、minphys(9F)について Kernel Functions for Drivers physio(9F) NAME physio, minphys - perform physical I/O SYNOPSIS #include #include #include int physio(int(*strat )(struct buf *), struct buf *bp, dev_t dev, int rw, void (*mincnt )(struct buf *), struct uio *uio); voidminphys(struct buf *bp); INTERFACE LEVEL Solaris DDI specific (Solaris DDI). PARAMETERS physio() strat デバイス・ストラテジー・ルーチンへのポインタ bp 転送を記述する buf(9S) 構造体へのポインタ。 bp が NULL にセット される場合には、physio() は実行完了で自動的にリリースするような ものをアロケートする。 dev デバイス・ナンバー。 rw Read/write フラッグ。 これはデバイスからの読み出し時には B_READ であり、デバイスへの書き込み時には B_WRITE である。 mincnt 最大転送ユニットサイズを制限するルーチン。 uio ユーザ I/O リクエストを記述する uio 構造体へのポインタ。 minphys() bp buf 構造体へのポインタ。 DESCRIPTION physio() はデバイス dev と uio構造体で記述されたアドレススペース間の バッファ化されない I/O を実行する。 転送開始の前に physio() は、uio構造体の中に指定されたアドレススペースの プロテクションをチェックすることによって、要求された動作が有効であることを 検証する。 この時、physio() は、I/O転送に関連するページをロックする、これで ページアウトされることなく使うことができる。 デバイス・ストラテジ・ルーチン strat()は、物理的な I/O動作を実行するのに1回あるいはそれ以上コールされる。 SunOS 5.7 Last change: 2 Apr 1993 1 Kernel Functions for Drivers physio(9F) physio() は strat() が各転送を完了するまでブロックするために biowait(9F) を 使う。 完了で、あるいはエラーの検出で、physio() はページをアンロックし エラーステータスをリターンする。 physio() はシステムおよびデバイスを maximum transfer unit size、maximum length で拘束するように、mincnt() を使う。 minphys() は physio() 動作で使用 するためのシステム mincnt() ルーチンである。 自身のローカルな mincnt() ルー チンを備えていないドライバは、minphys() で physio() をコールすべきである。 minphys() はシステムの能力を分別のある標準値にするために、bp->b_bcount の値 を制限する。 自身の mincnt() ルーチンを備えているドライバも、システム限度を 越えないことを確実にするために、minphys() をコールすべきである。 RETURN VALUES physio() returns: 0 Upon success. non-zero Upon failure. CONTEXT physio() can be called from user context only. SEE ALSO strategy(9E), biodone(9F), biowait(9F), buf(9S), uio(9S) Writing Device Drivers WARNINGS 各 buf 転送が完了するまでブロックするように、physio() は biowait() をコール するので、転送が完了した時 biodone(9F) をコールするのはドライバの責任で ある。 さもないと、physio() は永遠にブロックし続ける。 SunOS 5.7 Last change: 2 Apr 1993 2 (4-9). strategy(9E)について Driver Entry Points strategy(9E) NAME strategy - perform block I/O SYNOPSIS #include #include #include #include int prefixstrategy(struct buf *bp); INTERFACE LEVEL Architecture independent level 1 (DDI/DKI). This entry point is required for block devices. PARAMETERS bp buf(9S) 構造体へのポインタである。 DESCRIPTION strategy() ルーチンは、ブロックデバイスでデータを read および writeブロック するためにカーネルによって(cb_ops(9S)を通して)間接的にコールされる。 strategy() は、ブロックデバイスの raw character interface( read(9E), write(9E) and ioctl(9E)) をサポートするためにも直接的にあるいは間接的に コールされる。 strategy() の役目は転送のセットアップおよび初期化である。 RETURN VALUES strategy() ルーチンは、常に 0 をリターンすべきである。 エラーが起った場合 bioerror(9F) および biodone(9F)をコールして、buf(9S) 構造体の b_flags メンバを B_ERROR にセットすべきである。 partial 転送はエラーであることを 考慮しない点に注意せよ。 SEE ALSO ioctl(9E), read(9E), write(9E), biodone(9F), buf(9S), cb_ops(9S) Writing Device Drivers SunOS 5.7 Last change: 09 Aug 1998 1 (4-10). biowait(9F)について Kernel Functions for Drivers biowait(9F) NAME biowait - ブロック I/O が未完了となっているプロセスをサスペンドする SYNOPSIS #include #include int biowait(struct buf *bp); INTERFACE LEVEL Architecture independent level 1 (DDI/DKI). PARAMETERS bp 転送を記述している buf 構造体へのポインタ。 DESCRIPTION getrbuf(9F) で自身の buf 構造体をアロケートしているドライバは、現在の スレッドをサスペンドするために biowait() 関数を使い、転送の完了を待つことが できる。 転送が完了した時、biowait() によってブロックされていたスレッドに知らせる ために、ドライバは biodone(9F) をコールしなければならない。 biodone() は、 通常割り込みルーチンの中でコールされる。 RETURN VALUES 0 成功した場合 non-zero I/O が失敗した場合。 biowait() は リターンすべきエラーナンバを 取り出すために geterror(9F) をコールする。 CONTEXT biowait() can be called from user context only. SEE ALSO biodone(9F), geterror(9F), getrbuf(9F), buf(9S) Writing Device Drivers SunOS 5.7 Last change: 11 Apr 1991 1 (4-11). biodone(9F)について Kernel Functions for Drivers biodone(9F) NAME biodone - release buffer after buffer I/O transfer and notify blocked threads SYNOPSIS #include #include void biodone(struct buf *bp); INTERFACE LEVEL Architecture independent level 1 (DDI/DKI). PARAMETERS bp buf(9S) 構造体へのポインタ。 DESCRIPTION biodone() は I/O の完了を待っているブロックされたプロセスに、buf(9S) 構造体 の b_flags フィールドに B_DONE フラッグをセットして知らせる。 そして、I/O が非同期ならば、バッファをリリースする。 バッファ I/O リクエストが完了した 時、ドライバ割り込みルーチンあるいは strategy(9E) ルーチンによってbiodone() がコールされる。 bp がカーネルのバッファを記述する場合、biodone() は完了ルーチンをコールする べき能力を備えている。 ルーチンのアドレスはbuf(9S) 構造体の b_iodone フィー ルドで指定される。 そのようなルーチンが指定される場合、biodone() はそれを コールし、他の動作を実行しないでリターンする。 そうでない場合、上記の ステップを実行する。 CONTEXT biodone() can be called from user or interrupt context. EXAMPLES Example 1: Generally, the first validation test performed by any block device strategy(9E) routine is a check for an end-of-file (EOF) condition. The strategy(9E) routine is responsible for determining an EOF condition when the device is accessed directly. If a read(2) request is made for one block beyond the limits of the device (line 10), it will report an EOF condition. Otherwise, if the request is outside the limits of the dev- ice, the routine will report an error condition. In either case, report the I/O operation as complete (line 27). 1 #define RAMDNBLK /* Number of blocks in RAM disk */ 2 #define RAMDBSIZJ /* Number of bytes per block */ 3 char ramdblks[RAMDNBLK][RAMDBSIZ]; /* Array containing RAM disk */ SunOS 5.7 Last change: 23 Apr 1996 1 Kernel Functions for Drivers biodone(9F) 4 5 static int 6 ramdstrategy(struct buf *bp) 7 { 8 daddr_t blkno = bp->b_blkno; /* get block number */ 9 10 if ((blkno < 0) || (blkno >= RAMDNBLK)) { 11 /* 12 * If requested block is outside RAM disk 13 * limits, test for EOF which could result 14 * from a direct (physio) request. 15 */ 16 if ((blkno == RAMDNBLK) && (bp->b_flags & B_READ)) { 17 /* 18 * If read is for block beyond RAM disk 19 * limits, mark EOF condition. 20 */ 21 bp->b_resid = bp->b_bcount; /* compute return value */ 22 23 } else { /* I/O attempt is beyond */ 24 bp->b_error = ENXIO; /* limits of RAM disk */ 25 bp->b_flags |= B_ERROR; /* return error */ 26 } 27 biodone(bp); /* mark I/O complete (B_DONE) */ 28 /* 29 * Wake any processes awaiting this I/O 30 * or release buffer for asynchronous 31 * (B_ASYNC) request. 32 */ 33 return (0); 34 } ... SEE ALSO read(2), strategy(9E), biowait(9F), ddi_add_intr(9F), delay(9F), timeout(9F), untimeout(9F), buf(9S) Writing Device Drivers WARNINGS biodone() をコールした後、bp はドライバによって参照して利用することはもはや できない。 biodone() をコールした後に、ドライバが bp を参照すると、パニック が起きることになる。 NOTES 完了ルーチンの代理を指定するために buf(9S) 構造体の b_iodone フィールドを 使用するドライバは、 b_iodone フィールドの変更の前にその値をセーブすべき であり、バッファをリリースするために biodone() をコールする前に、以前の値を リストアすべきである。 SunOS 5.7 Last change: 23 Apr 1996 2 (4-12). buf(9S)について Data Structures for Drivers buf(9S) NAME buf - ブロック I/O データ転送構造体 SYNOPSIS #include #include INTERFACE LEVEL Architecture independent level 1 (DDI/DKI). DESCRIPTION buf 構造体はブロック I/O 転送用の基本的なデータ構造体である。 各ブロック I/O 転送は、関連付けられたバッファヘッダを持つ。 ヘッダはバッファの コントロールとステータス情報の全てを収めている。 ドライバ用として、バッファ ヘッダポインタは、ブロックドライバの strategy(9E) ルーチンへの唯一の引数で ある。 ドライバへの書き込み時、buf 構造体のサイズにディペンドしない。 バッファヘッダは同時に複数のリストにリンクされるかもしれない点に注意する事 は重要である。 この理由により、バッファヘッダのほとんどのメンバはドライバ によって変更され得ない。 バッファヘッダがドライバのワークリストのひとつに なっている時でさえ変更され得ない。 バッファヘッダは、バッファ化されないシステムあるいはブロックドライバ用の 物理 I/O によって使われることもある。 この場合、バッファはメモリの中に ロックされているユーザデータスペースの部分を記述する。 ブロックドライバはブロックリクエストをチェーンすることが多い。 これによって デバイスの全体のスループットは最高になる。 buf 構造体の av_forw や av_back メンバはチェーンされたブロックリクエストのためのリンクポインタとして機能 できる。 STRUCTURE MEMBERS int b_flags; /* Buffer status */ struct buf *av_forw; /* Driver work list link */ struct buf *av_back; /* Driver work list link */ size_t b_bcount; /* # of bytes to transfer */ union { caddr_t b_addr; /* Buffer's virtual address */ } b_un; daddr_t b_blkno; /* Block number on device */ diskaddr_t b_lblkno; /* Expanded block number on device */ size_t b_resid; /* # of bytes not transferred */ size_t b_bufsize; /* size of allocated buffer */ int (*b_iodone)(struct buf *); /* function called */ /* by biodone */ int b_error; /* expanded error field */ void *b_private; /* "opaque" driver private area */ dev_t b_edev; /* expanded dev field */ SunOS 5.7 Last change: 26 Sep 1996 1 Data Structures for Drivers buf(9S) The members of the buffer header available to test or set by a driver are as follows: B_BUSY indicates the buffer is in use. The driver may not change this flag unless it allocated the buffer with getrbuf(9F) and no I/O operation is in pro- gress. B_DONE indicates the data transfer has completed. This flag is read-only. B_ERROR indicates an I/O transfer error. It is set in con- junction with the b_error field. bioerror(9F) should be used in preference to setting the B_ERROR bit. B_PAGEIO indicates the buffer is being used in a paged I/O request. See the description of the b_un.b_addr field for more information. This flag is read- only. B_PHYS indicates the buffer header is being used for phy- sical (direct) I/O to a user data area. See the description of the b_un.b_addr field for more information. This flag is read-only. B_READ indicates data is to be read from the peripheral device into main memory. B_WRITE indicates the data is to be transferred from main memory to the peripheral device. B_WRITE is a pseudo flag and cannot be directly tested; it is only detected as the NOT form of B_READ. b_flags はバッファのステータスをストアし、デバイスを読み出すべきか書き込む べきかをドライバに告げる。 ドライバは b_flags メンバをけっしてクリアしては ならない。 もしクリアしてしまうと、健全なディスクを害してしまうことを含めて 予想できない結果が起り、他のカーネルプロセスが失敗するような事態が起る。 有効なフラッグは以下の通り: av_forw および av_back はドライバがドライバのワークリストの中にバッファを リンクするために使う。 b_bcount はページ化された I/O リクエストおよび非ページ化された I/O リクエス ト両方の転送されるべきバイト数を指定する。 b_un.b_addr は、B_PAGEIO がセットされない限り、I/O リクエストの仮想アドレス である。 B_PHYS がセットされない限りカーネル仮想アドレスである。 B_PHYS が セットされる場合はユーザ仮想アドレスである。 B_PAGEIO がセットされる場合は b_un.b_addr はカーネルプライベートデータを収めている。 B_PHYS と B_PAGEIO SunOS 5.7 Last change: 26 Sep 1996 2 Data Structures for Drivers buf(9S) のどちらかひとつがセットされるかもしれない、あるいは両方ともセットされない かもしれないが、両方ともセットされることはない点に注意。 b_blkno は、デバイスのどの論理ブロックが(デバイスはデバイスナンバによって定 義される)アクセスされるべきであるかを見分ける。 ドライバは、この論理 ブロックナンバをディスクのシリンダ、トラック、セクターのような物理ロケー ションに変換しなければならないかもしれない。 これは32ビット値である。 ドライバは b_blkno あるいは b_lblkno を使うべきであるが、両方を使うべきでは ない。 b_lblkno は、デバイスのどの論理ブロックが(デバイスはデバイスナンバによって 定義される)アクセスされるべきであるかを見分ける。 ドライバは、この論理 ブロックナンバをディスクのシリンダ、トラック、セクターのような物理ロケー ションに変換しなければならないかもしれない。 これは64ビット値である。 ドライバは b_lblkno あるいは b_blkno を使うべきであるが、両方を使うべきでは ない。 b_resid はエラー用のために、転送されなかったバイト数をセットすべきである。 b_bufsize はアロケートされたバッファのサイズを収めている。 b_iodone は、 I/O が完了した時ドライバによってコールされる特定の biodone ルーチンを確認する。 b_error は、ドライバからのリターンコードとして渡されるエラーコードを保持 するかもしれない。 b_error は b_flags メンバの B_ERROR ビットセットに関連 してセットされる。 bioerror(9F) は、b_error フィールドのセッティングに優先 して使われるべきである。 b_private はデバイスドライバのプライベート使用のためのものである。 b_edev は、アクセスされるデバイスのメジャー・デバイス・ナンバとマイナー・ デバイス・ナンバを収めている。 SEE ALSO strategy(9E), aphysio(9F), bioclone(9F), biodone(9F), bioerror(9F), bioinit(9F), clrbuf(9F), getrbuf(9F), physio(9F), iovec(9S), uio(9S) Writing Device Drivers WARNINGS バッファはカーネル内の共有資源である。 ドライバはこの規定で揚げられたメンバ のみを read もしくは write すべきである。 buf 構造体で文書化されていない メンバを使おうとするドライバは、カーネルやデバイスでのデータ破壊の危険を 冒すことになる。 SunOS 5.7 Last change: 26 Sep 1996 3 (4-13). ddi_dma_attr(9S)について Data Structures for Drivers ddi_dma_attr(9S) NAME ddi_dma_attr - DMA attributes 構造体 SYNOPSIS #include INTERFACE LEVEL Solaris DDI specific (Solaris DDI). DESCRIPTION ddi_dma_attr_t 構造体は、DMA 資源をアロケートするのに必要な、デバイスおよび DMA エンジン特定の attributes を記述している。 ドライバは、デバイスが接続 されるバスに関係する特定のバス情報を用いて attributes を拡張しなければなら ないかもしれない。 STRUCTURE MEMBERS uint_t dma_attr_version; /* version number */ uint64_t dma_attr_addr_lo; /* low DMA address range */ uint64_t dma_attr_addr_hi; /* high DMA address range */ uint64_t dma_attr_count_max; /* DMA counter register */ uint64_t dma_attr_align; /* DMA address alignment */ uint_t dma_attr_burstsizes; /* DMA burstsizes */ uint32_t dma_attr_minxfer; /* min effective DMA size */ uint64_t dma_attr_maxxfer; /* max DMA xfer size */ uint64_t dma_attr_seg; /* segment boundary */ int dma_attr_sgllen; /* s/g list length */ uint32_t dma_attr_granular; /* granularity of device */ uint_t dma_attr_flags; /* DMA transfer flags */ dma_attr_version は DMA attribute 構造体のバージョンナンバーをストアする。 これは、DMA_ATTR_V0 にセットされるべきである。 dma_attr_addr_lo および dma_attr_addr_hi フィールドは、デバイスの DMA エン ジンがアクセスできるアドレスレンジを指定する。 dma_attr_addr_lo フィールド は、64-bit 範囲の inclusive lower を記述する。 dma_attr_addr_hi は、64-bit 範囲の inclusive upper を記述する。 システムは、アロケートされた DMA 資源 が指定されたレンジ内に在ることを保証する。 ddi_dma_cookie(9S) を参照。 dma_attr_count_max は、デバイスの DMA カウンタ・レジスタの inclusive upper bound を記述する。 例えば、0xFFFFFF は 24 bit カウンタ・レジスタを用いて DMA エンジンを記述することになる。 オブジェクトのサイズが DMA カウンタ レジスタのサイズを越える場合には、DMA 資源アロケーション関数は、DMA オブジェクトを複数の DMA cookies に分割しなければならない。 dma_attr_align アロケートされる DMA 資源の alignment の必要条件を指定する。 ページ境界での alignment のように、dma_attr_burstsizes あるいは dma_attr_minxfer によって強いられるよりももっと制限される alignment を強制 するのに使うことができる。 SunOS 5.7 Last change: 26 Sep 1996 1 Data Structures for Drivers ddi_dma_attr(9S) ほとんどのドライバは、これを byte alignment であることを示す 1 にセットして いる。 dma_attr_align のみが DMA 資源をアロケートするための alignment 必要条件を 指定することに注意せよ。 ddi_dma_addr_bind_handle(9F) あるいは ddi_dma_buf_bind_handle(9F)に渡されるバッファは制限された alignment (see ddi_dma_mem_alloc(9F)) を持ちそれに耐えなければならない。 dma_attr_burstsizes フィールドはデバイスの DMA エンジンが受け入れることが できる可能なバースト・サイズを記述する。 データサイズのフォーマットは二乗 の項でエンコードされたバイナリーである。 DMA 資源がアロケートされた時、 システムはシステム制限を反映してバースト・サイズ値を変更するかもしれない。 ドライバは DMA エンジンをプログラムするのに、許されたバースト・サイズを使わ なければならない。 ddi_dma_burstsizes(9F)を参照。 dma_attr_minxfer フィールドは、最小の有効な DMA アクセスサイズをバイトの 単位で記述する。 DMA 資源は、I/O の存在および使用や、DMA エンジンとメモリ オブジェクト間の writeバッファ、に関係して変更されるかもしれない。 この フィールドは、 alignment や ddi_dma_mem_alloc(9F)の padding の必要性を決め るために使われる。 dma_attr_maxxfer フィールドは、最大の有効な DMA アクセスサイズをバイトの 単位で記述する。 dma_attr_seg フィールドは、アロケートされた DMA 資源の セグメント境界制限 を指定する。 システムは、オブジェクトが dma_attr_seg によって指定された セグメント境界の全幅で収まらないようなデバイスの DMA 資源をアロケートする。 例えば 0xFFFF の値は64K境界を横切ってはならないことを意味する。 DMA 資源 アロケーション関数は、セグメント境界制限を押し付けるために、DMA オブジェク トを複数の DMA cookies に分割しなければならない。 この場合、scatter-gather I/O あるいは multiple DMA windows を使って転送を行わなければならない。 dma_attr_sgllen フィールドは、デバイスの DMA scatter/gather リストの長さを 記述する。 利用できる値は以下の通り: < 0 デバイス DMA エンジンは、サイズによって制限されない - 例えば、DMA チェインニング = 0 Reserved. = 1 Device DMA engine does not support scatter/gather such as third party DMA. > 1 Device DMA engine uses scatter/gather. SunOS 5.7 Last change: 26 Sep 1996 2 Data Structures for Drivers ddi_dma_attr(9S) dma_attr_sgllen is the maximum number of entries in the list. dma_attr_granular フィールドは、デバイス転送サイズの塊をバイトの単位で記述 する。 システムが DMA 資源をアロケートする時、一つのセグメント・サイズは デバイスの塊の倍数である。 あるいは、もし dma_attr_sgllen がウインドウ内 で 1 よりも大きいならば、セグメントのサブグループのサイズの合計はデバイスの 塊の倍数である。 DMA 資源を必要とするすべてのドライバは、デバイス転送サイズの塊の倍数でなけ ればならない。 dma_attr_flags フィールドは、以下のようにセットできる: DDI_DMA_FORCE_PHYSICAL Some platforms, such as SPARC systems,support what is called DVMA (Direct Virtual Memory Access). On these platforms the device is provided with a vir- tual address by the system in order to perform the transfer. In this case, the underlying platform provides an IOMMU which translates accesses to these virtual addresses into the proper physical addresses. Some of these platforms support in addition DMA. DDI_DMA_FORCE_PHYSICAL indicates that the system should return physical rather than virtual I/O addresses if the system supports both. If the system does not support physical DMA, the return value from ddi_dma_alloc_handle(9F) will be DDI_DMA_BADATTR. In this case, the driver has to clear DDI_DMA_FORCE_PHYSICAL and retry the opera- tion. EXAMPLES Example 1: Initializing the ddi_dma_attr_t Structure Assume a device has the following DMA characteristics: o Full 32-bit range addressable o 24-bit DMA counter register o byte alignment o 4 and 8-byte burst sizes support o Minimum effective transfer size of 1 bytes o 64M maximum transfer size limit o Maximum segment size of 32K SunOS 5.7 Last change: 26 Sep 1996 3 Data Structures for Drivers ddi_dma_attr(9S) o 17 scatter/gather list elements o 512 byte device transfer size granularityThe corresponding ddi_dma_attr_t structure would be ini- tialized as follows: static ddi_dma_attr_t dma_attrs = { DMA_ATTR_V0 /* version number */ (uint64_t)0x0, /* low address */ (uint64_t)0xffffffff, /* high address */ (uint64_t)0xffffff, /* DMA counter max */ (uint64_t)0x1 /* alignment */ 0x0c, /* burst sizes */ 0x1, /* minimum transfer size */ (uint64_t)0x3ffffff, /* maximum transfer size */ (uint64_t)0x7fff, /* maximum segment size */ 17, /* scatter/gather list lgth */ 512 /* granularity */ 0 /* DMA flags */ }; SEE ALSO ddi_dma_addr_bind_handle(9F), ddi_dma_alloc_handle(9F), ddi_dma_buf_bind_handle(9F), ddi_dma_burstsizes(9F), ddi_dma_mem_alloc(9F), ddi_dma_nextcookie(9F), ddi_dma_cookie(9S) Writing Device Drivers SunOS 5.7 Last change: 26 Sep 1996 4 (4-14). ddi_dma_buf_bind_handle(9F)について Kernel Functions for Drivers ddi_dma_buf_bind_handle(9F) NAME ddi_dma_buf_bind_handle - DMA ハンドルにシステムバッファを結び付ける SYNOPSIS #include #include int ddi_dma_buf_bind_handle(ddi_dma_handle_t handle, struct buf *bp, uint_t flags, int (*callback)(caddr_t), caddr_t arg, ddi_dma_cookie_t *cookiep, uint_t *ccountp); INTERFACE LEVEL Solaris DDI specific (Solaris DDI). PARAMETERS handle ddi_dma_alloc_handle(9F) コールすることで前もってアロケートされた DMA ハンドル。 bp システム・バッファ構造体(see buf(9S))へのポインタ。 flags 有効なフラッグは次のとおり: DDI_DMA_WRITE 転送方向はメモリからI/Oへ DDI_DMA_READ 転送方向はI/Oからメモリへ DDI_DMA_RDWR read と write 両方 DDI_DMA_REDZONE オブジェクトの終りで MMU レッドゾーンを設置する DDI_DMA_PARTIAL 部分的リソースをアロケート DDI_DMA_CONSISTENT 不連続、ランダム、および小さなブロック転送 DDI_DMA_STREAMING 連続、片方向、ブロックサイズ化、およびブロック並び転送 callback もし、資源が現在利用可能でない場合に後程再コールするための関数 のアドレス。 以下の特別な関数アドレスが使われるかもしれない。 SunOS 5.7 Last change: 27 Jul 1996 1 Kernel Functions for Drivers ddi_dma_buf_bind_handle(9F) DDI_DMA_SLEEP リソースが利用可能になるまで待つ。 DDI_DMA_DONTWAIT リソースが利用可能になるまで待たない。 また、コールバックをスケジュールしない。 arg callback のような関数が指定される場合、コールバック関数に渡される 引数。 cookiep 一番目の ddi_dma_cookie(9S) へのポインタ。 ccountp 成功裏にリターンした時、ccountp はこの DMA オブジェクト用の cookies の数を表している値をポイントする。 DESCRIPTION ddi_dma_buf_bind_handle() は、デバイスがバッファとの間で DMA を行うことが できるようなシステムバッファのための DMA 資源をアロケートする。 DMA 資源は ddi_dma_attr(9S)よって示される、デバイスの DMA attributes をよく考慮して アロケートされる(ddi_dma_alloc_handle(9F)参照)。 ddi_dma_buf_bind_handle() は、cookiepによってポイントされる1番目の DMA cookies に、適切なアドレス、長さ、およびバスタイプを書き込む。 *ccountp に はこの DMA オブジェクトを代表している DMA cookies の数をセットする。 以降 に続くDMA cookies は ddi_dma_nextcookie(9F) を *countp-1回コールすることに よって取り出されなければならない。 DMA 転送が完了した時、ドライバは ddi_dma_unbind_handle(9F) をコールして システム DMA リソースを解放すべきである。 flags 引数はマッピングルーチンの情報を収めている。 DDI_DMA_WRITE, DDI_DMA_READ, DDI_DMA_RDWR これらのフラッグは、行おうとしている DMA 転送の方向を記述する。 DDI_DMA_STREAMING This flag should be set if the device is doing sequential, unidirectional, block-sized, and block-aligned transfers to or from memory. The alignment and padding constraints specified by the minxfer and burstsizes fields in the DMA attribute structure, ddi_dma_attr(9S) (see ddi_dma_alloc_handle(9F)) is used to allocate the most effective hardware support for large transfers. SunOS 5.7 Last change: 27 Jul 1996 2 Kernel Functions for Drivers ddi_dma_buf_bind_handle(9F) DDI_DMA_CONSISTENT このフラッグは、デバイスがメモリをランダムにアクセスする場合に         あるいは ddi_dma_sync(9F) を使う同期のステップが可能な限り有効         であることが必要な場合にセットされるべきである。 デバイスとドライ バ間で情報交換のために使われる I/O パラメータブロックは、 DDI_DMA_CONSISTENT を使ってアロケートされるべきである。 DDI_DMA_REDZONE If this flag is set, the system attempts to estab- lish a protected red zone after the object. The DMA resource allocation functions do not guarantee the success of this request as some implementa- tions may not have the hardware ability to support a red zone. DDI_DMA_PARTIAL Setting this flag indicates the caller can accept resources for part of the object. That is, if the size of the object exceeds the resources avail- able, only resources for a portion of the object are allocated. The system indicates this condition returning status DDI_DMA_PARTIAL_MAP. At a later point, the caller can use ddi_dma_getwin(9F) to change the valid portion of the object for which resources are allocated. If resources were allo- cated for only part of the object, ddi_dma_addr_bind_handle() returns resources for the first DMA window. Even when DDI_DMA_PARTIAL is set, the system may decide to allocate resources for the entire object (less overhead) in which case DDI_DMA_MAPPED is returned. コールバック関数、callbackは、callerが利用できないでいる資源の実現の ためにどのように処理したいかを表示している。 callback が DDI_DMA_DONTWAIT にセットされる場合は、アロケーションが失敗した場合、caller は手当てをしない し、caller はアロケーションの失敗を適切に処理することができる。 callback が DDI_DMA_SLEEPにセットされる場合は、資源が利用可能になるのを待つような アロケーションルーチンを使用することを望んでいる。 他の値がセットされる場合 で、DMA リソースアロケーションが失敗した場合、この値は、リソースが利用可能 になった時に後程コールすべき関数のアドレスであるとみなされる。 指定された 関数がコールされた時、引数として arg が渡される。 指定された callback 関数 は、 DDI_DMA_CALLBACK_RUNOUT あるいは DDI_DMA_CALLBACK_DONE のどちらかで リターンしなければならない。 DDI_DMA_CALLBACK_RUNOUT は、DMA 資源をアロケー トするために callback 関数が試みたが、失敗に終わったことを表している。 この場合、callback 関数は後程コールするためにリストに戻される。 DDI_DMA_CALLBACK_DONE は、DMA 資源のアロケーションが成功したか、もしくは ドライバがそれ以上のリトライを望まないことを示している。 SunOS 5.7 Last change: 27 Jul 1996 3 Kernel Functions for Drivers ddi_dma_buf_bind_handle(9F) callback 関数は、割り込み実行環境でコールされる。 それで、割り込み実行環境 からアクセス可能なシステム関数だけが利用可能である。 callback 関数は、 critical な資源、データ構造体、キュー、etc を保護するために必要なステップ は何でもしなければならない。 RETURN VALUES ddi_dma_buf_bind_handle() のリターン: DDI_DMA_MAPPED 完全なオブジェクト用の資源が、成功裏にアロケートされた。 DDI_DMA_PARTIAL_MAP オブジェクトの一部が成功裏にアロケートされた。 これは、flags に DDI_DMA_PARTIAL フラッグがセットされて、部分的な転送が許される時 には受け入れられる。 DDI_DMA_INUSE Another I/O transaction is using the DMA handle. DDI_DMA_NORESOURCES No resources are available at the present time. DDI_DMA_NOMAPPING The object cannot be reached by the device requesting the resources. DDI_DMA_TOOBIG The object is too big. A request of this size can never be satisfied on this particular system. The maximum size varies depending on machine and con- figuration. CONTEXT callback が DDI_DMA_SLEEP にセットされる時以外は、ddi_dma_buf_bind_handle() は、ユーザ、カーネル、割り込み実行環境からコールすることができる。 callback が DDI_DMA_SLEEP にセットされる時には、ユーザ、カーネル実行環境からのみ コールすることができる。 SEE ALSO ddi_dma_addr_bind_handle(9F), ddi_dma_alloc_handle(9F), ddi_dma_free_handle(9F), ddi_dma_getwin(9F), ddi_dma_nextcookie(9F), ddi_dma_sync(9F), ddi_dma_unbind_handle(9F), buf(9S), ddi_dma_attr(9S), ddi_dma_cookie(9S) Writing Device Drivers NOTES SunOS 5.7 Last change: 27 Jul 1996 4 Kernel Functions for Drivers ddi_dma_buf_bind_handle(9F) ドライバが DDI_DMA_PARTIAL フラッグを用いてパーシャル・マッピングを許す場合 には、それぞれのウィンドウの cookies の数は、ddi_dma_attr(9S) 構造体の dma_attr_sgllen フィールドで指定したドライバの scatter/gather リストの サイズを越えるかもしれない。 この場合、DMA ウィンドウを構成している 各 cookies のセットは、全ての局面で ddi_dma_attr(9S) 構造体に記述された DMA attributes を満足させる。 ドライバは DMA エンジンをセットアップし、 scatter/gather リストに足りるだけの各 cookies のセットで転送を実行すべきで ある。 ddi_dma_getwin(9F) を使って次のウィンドウに進む前に、このウィンドウ 用にたくさんの cookies を用意すべきである。 SunOS 5.7 Last change: 27 Jul 1996 5 (4-15). ddi_dma_cookie(9S)について Data Structures for Drivers ddi_dma_cookie(9S) NAME ddi_dma_cookie - DMA address cookie SYNOPSIS #include INTERFACE LEVEL Solaris DDI specific (Solaris DDI). DESCRIPTION ddi_dma_cookie_t 構造体は、DMA エンジンをプログラムするのに必要な DMA アド レス情報を収めている。 DMA リクエストや DMA ウインドウのためのデバイス特定 の DMA 転送情報を得るために、ddi_dma_getwin(9F)、ddi_dma_addr_bind_handle(9 F)、あるいは ddi_dma_buf_bind_handle(9F) によって書き込まれる。 STRUCTURE MEMBERS uint64_t dmac_laddress; /* 64 bit address */ uint32_t dmac_address; /* 32 bit address */ size_t dmac_size; /* transfer size */ uint_t dmac_type; /* bus specific type bits */ dmac_laddress は、デバイスの DMA エンジンをプログラミングするのに適切な 64ビット I/O アドレスを指定する。 デバイスが64ビット DMA アドレスレジスタを 持つ場合には、ドライバは DMA エンジンをプログラムするのにこのフィールドを 使うべきである。 dmac_address は32ビット I/O アドレスを指定する。 デバイス が32ビット DMA アドレスレジスタを持つ場合には、このフィールドを使うべきであ る。 デバイスがアドレスできる I/O アドレスレンジおよびその他の attributes は ddi_dma_attr(9S) 構造体で指定されなければならない。 dmac_size は、転送の長さをバイトで記述する。 dmac_type は、もし当てられる場合には、バス特有のタイプ・ビットを収めて いる。 例えば、VME バス上のデバイスは、VME アドレス・モディファイア・ ビットはここに置かれる。 SEE ALSO pci(4), sbus(4), sysbus(4), vme(4), ddi_dma_addr_bind_handle(9F), ddi_dma_buf_bind_handle(9F), ddi_dma_getwin(9F), ddi_dma_nextcookie(9F), ddi_dma_attr(9S) Writing Device Drivers SunOS 5.7 Last change: 30 Sep 1996 1 (4-16). ddi_dma_alloc_handle(9F)について Kernel Functions for Drivers ddi_dma_alloc_handle(9F) NAME ddi_dma_alloc_handle - allocate DMA handle SYNOPSIS #include #include int ddi_dma_alloc_handle(dev_info_t *dip, ddi_dma_attr_t *attr, int (*callback) (caddr_t), caddr_t arg, ddi_dma_handle_t *handlep); INTERFACE LEVEL Solaris DDI specific (Solaris DDI). PARAMETERS dip デバイスの dev_info 構造体へのポインタ attr このデバイスの DMA attribute 構造体へのポインタ(ddi_dma_attr(9S) を参照) callback 現在、資源が利用できない場合に、後でコールバックするための関数の アドレス。 以下の特別な関数アドレスが使われるかもしれない。 DDI_DMA_SLEEP 資源が利用できるようになるまで待つ。 DDI_DMA_DONTWAIT 資源が利用できるようになるまで待たない、またコール バックをスケジュールすることもしない。 arg もしそのようなものが特定されているならば、コールバック関数に 渡される引数。 handlep 初期化されるべき DMA ハンドルへのポインタ。 DESCRIPTION ddi_dma_alloc_handle() は新しい DMA ハンドルをアロケートする。 DMA ハンドル は、以降で DMA 資源をアロケートするための参照として使われる opaque オブ ジェクトである。 ddi_dma_alloc_handle() はパラメータとして、dip に関連する デバイス情報と ddi_dma_attr(9S) 構造体によって記述される DMA attributes を 受け取る。 ddi_dma_alloc_handle() が成功裏にコールされると、handlep で示さ れるところに値が入れられる。 DMA ハンドルはそれがアロケートされたデバイス でのみ使用されなければならないし、一時に一つの I/O 処理のみが有効である。 コールバック関数、callbackは、コーラーが現在利用できない資源の実現性のため にどうしたいかを示している。 コールバックが DDI_DMA_DONTWAIT にセットされて いる場合には、コーラーはアロケーションが失敗したかどうかについてケアしない そして適切にアロケーション失敗について処理できる。 SunOS 5.7 Last change: 22 Sep 1996 1 Kernel Functions for Drivers ddi_dma_alloc_handle(9F) コールバックが DDI_DMA_SLEEP にセットされている場合には、コーラーは資源が 利用可能になるまで待つアロケーション・ルーチンにしたがっている。 もし、他の 値がセットされていて、DMA資源アロケーションが失敗した場合には、この値は、 資源利用可能になった時に後でコールすべき関数であるとみなされる。 time when resources may become available. When the specified function is called, it is passed arg as an argument. The specified callback function must return either DDI_DMA_CALLBACK_RUNOUT or DDI_DMA_CALLBACK_DONE. DDI_DMA_CALLBACK_RUNOUT indicates that the callback routine attempted to allocate DMA resources but failed to do so, in which case the callback function is put back on a list to be called again later. DDI_DMA_CALLBACK_DONE indicates either success at allocating DMA resources or the driver no longer wishes to retry. The callback function is called in interrupt context. There- fore, only system functions that are accessible from inter- rupt context is available. The callback function must take whatever steps necessary to protect its critical resources, data structures, queues, and so forth. When a DMA handle is no longer needed, ddi_dma_free_handle(9F) must be called to free the handle. RETURN VALUES ddi_dma_alloc_handle() returns: DDI_SUCCESS Successfully allocated a new DMA handle. DDI_DMA_BADATTR The attributes specified in the ddi_dma_attr(9S) structure make it impossible for the system to allocate potential DMA resources. DDI_DMA_NORESOURCES No resources are available. CONTEXT ddi_dma_alloc_handle() can be called from user, kernel, or interrupt context, except when callback is set to DDI_DMA_SLEEP, in which case it can be called from user or kernel context only. SEE ALSO ddi_dma_addr_bind_handle(9F), ddi_dma_buf_bind_handle(9F), ddi_dma_burstsizes(9F), ddi_dma_free_handle(9F), ddi_dma_unbind_handle(9F), ddi_dma_attr(9S) Writing Device Drivers SunOS 5.7 Last change: 22 Sep 1996 2 (4-17). vme(4)について onl50t[52]% man -s 4 vme No entry for vme in section(s) 4 of the manual. onl50t[53]% (5). デバッグ (5-1). データ構造体の修正 camacドライバプログラムのデータ構造体が一部仕様からはずれている。 修正 再コンパイルして実行する。 : static struct cb_ops cc_cb_ops = { cc_open, /* open */ cc_close, /* close */ nodev, /* strategy (not block device) */ nodev, /* print (no print routine) */ nodev, /* dump (no dump routine) */ nodev, /* read (no read routine; write-only device */ cc_write, /* write */ cc_ioctl, /* ioctl */ nodev, /* devmap (no devmap routine) */ nodev, /* mmap (no mmap routine) */ nodev, /* segmap (no segmap routine) */ nochpoll, /* poll (no chpoll routine) */ ddi_prop_op, /* cb_prop_op */ 0, /* streamtab */ /* E.Inoue /* begin */ D_NEW | D_MP */ /* Driver comaptibility flag */ D_NEW | D_MP | D_64BIT, /* Driver comaptibility flag */ CB_REV, /* cb_rev */ nodev, /* async I/O read entry point */ nodev /* async I/O write entry point */ /* end */ }; struct dev_ops cc_ops = { DEVO_REV, /* devo_rev, */ 0, /* refcnt */ cc_getinfo, /* info */ cc_identify, /* identify */ cc_probe, /* probe */ cc_attach, /* attach */ cc_detach, /* detach */ nodev, /* reset (device reset routine) */ &cc_cb_ops, /* driver operations */ /* E.Inoue (struct bus_ops *)0, */ /* bus operations */ NULL, /* bus operations */ NULL /* devo_power */ }; : onl50t[51]% 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 >1 Input n a f >3 0 0 MODE=1 N= 3 A= 0 F= 0 len= 1 lenr= 1 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 1 0 MODE=1 N= 3 A= 1 F= 0 len= 1 lenr= 1 error= 0(Hex) Data( 1)= 3 0x 3(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 >555 MODE=1 N= 3 A= 0 F=16 len= 1 lenr= 0 error= 0(Hex) Data( 1)= 555 0x 22B(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 0 ここでフリーズした。 May 17 14:15:03 onl50t unix: CAMAC device driver V1.4x, 1991-1993 by Y.TAKEUCHI (T.I.T.) May 17 14:15:50 onl50t unix: NOTICE: cc_write enter: May 17 14:15:50 onl50t May 17 14:15:50 onl50t unix: NOTICE: cc_write enter: May 17 14:15:50 onl50t May 17 14:15:50 onl50t unix: NOTICE: cc_write enter: May 17 14:15:50 onl50t May 17 14:15:50 onl50t unix: NOTICE: cc_write enter: May 17 14:15:50 onl50t May 17 14:15:50 onl50t unix: NOTICE: cc_write enter: May 17 14:15:50 onl50t May 17 14:15:50 onl50t unix: NOTICE: cc_write enter: May 17 14:15:50 onl50t May 17 14:15:54 onl50t unix: NOTICE: cc_write enter: May 17 14:15:54 onl50t May 17 14:15:54 onl50t unix: NOTICE: cc_write: CC_CMD_DOBLOCK enter: May 17 14:15:54 onl50t May 17 14:15:54 onl50t unix: NOTICE: cc_write: cc->kreg->donv = 0xffff May 17 14:15:54 onl50t May 17 14:15:54 onl50t unix: NOTICE: cc_write: cc->kreg->csr = 0xa0 May 17 14:15:54 onl50t May 17 14:15:54 onl50t unix: NOTICE: camac_b: read: call physio --- uio = 0x411 940 May 17 14:15:54 onl50t May 17 14:15:54 onl50t unix: NOTICE: cc_strategy: mode = 0x2a May 17 14:15:54 onl50t May 17 14:15:54 onl50t unix: NOTICE: cc_strategy: naf = 0x600 May 17 14:15:54 onl50t May 17 14:15:54 onl50t unix: NOTICE: cc_strategy: wc = 0x1 May 17 14:15:54 onl50t May 17 14:15:54 onl50t unix: NOTICE: cc_strategy: check1. May 17 14:15:54 onl50t May 17 14:15:54 onl50t unix: NOTICE: cc_strategy: check2. May 17 14:15:54 onl50t May 17 14:15:54 onl50t unix: NOTICE: cc_strategy: dma_addr = 0x588 May 17 14:15:54 onl50t May 17 14:15:54 onl50t unix: NOTICE: cc_strategy: check3. --- start DMA May 17 14:15:54 onl50t May 17 14:15:54 onl50t unix: NOTICE: cc_intr: enter intrrupt: cc->kreg->csr = 0 x80 May 17 14:15:54 onl50t May 17 14:15:54 onl50t unix: NOTICE: cc_intr: wc = 0x0 May 17 14:15:54 onl50t May 17 14:15:54 onl50t unix: NOTICE: cc_intr: CC_INT_DONE: step02. May 17 14:15:54 onl50t unix: NOTICE: cc_intr: CC_INT_EMPTY: step02. May 17 14:15:54 onl50t unix: NOTICE: cc_intr: CC_INT_ABORT: step02. May 17 14:15:54 onl50t unix: NOTICE: cc_intr: cc->executing_dma_flag != 0: step 03. May 17 14:15:54 onl50t unix: NOTICE: cc_intr: cc->interrupt != 0: step04. May 17 14:15:54 onl50t unix: NOTICE: cc_intr: exit intrrupt: cc->kreg->csr = 0x 80 May 17 14:15:54 onl50t May 17 14:15:54 onl50t unix: NOTICE: cc_strategy: check4. --- return cc_strateg y May 17 14:15:54 onl50t May 17 14:15:54 onl50t unix: NOTICE: camac_b: read: physio return value = 0x0 May 17 14:15:54 onl50t May 17 14:15:54 onl50t unix: NOTICE: camac_b: read: cc->kreg->csr = 0x80 May 17 14:15:54 onl50t May 17 14:15:54 onl50t unix: NOTICE: cc_write: return camac_b(). May 17 14:15:54 onl50t May 17 14:15:54 onl50t unix: NOTICE: cc_write: cc->interrupt = 0xe May 17 14:15:54 onl50t May 17 14:15:54 onl50t unix: NOTICE: cc_write: cc->kreg->donv = 0xffff May 17 14:15:54 onl50t May 17 14:15:54 onl50t unix: NOTICE: cc_write: cc->kreg->csr = 0x80 May 17 14:15:54 onl50t onl50t console login: onl50t console login: onl50t console login: May 17 14:16:17 onl50t unix: NOTICE: cc_write enter: May 17 14:16:17 onl50t May 17 14:16:17 onl50t unix: NOTICE: cc_write: CC_CMD_DOBLOCK enter: May 17 14:16:17 onl50t May 17 14:16:17 onl50t unix: NOTICE: cc_write: cc->kreg->donv = 0xffff May 17 14:16:17 onl50t May 17 14:16:17 onl50t unix: NOTICE: cc_write: cc->kreg->csr = 0x80 May 17 14:16:17 onl50t May 17 14:16:17 onl50t unix: NOTICE: camac_b: read: call physio --- uio = 0x411 940 May 17 14:16:17 onl50t May 17 14:16:17 onl50t unix: NOTICE: cc_strategy: mode = 0x2a May 17 14:16:17 onl50t May 17 14:16:17 onl50t unix: NOTICE: cc_strategy: naf = 0x620 May 17 14:16:17 onl50t May 17 14:16:17 onl50t unix: NOTICE: cc_strategy: wc = 0x1 May 17 14:16:17 onl50t May 17 14:16:17 onl50t unix: NOTICE: cc_strategy: check1. May 17 14:16:17 onl50t May 17 14:16:17 onl50t unix: NOTICE: cc_strategy: check2. May 17 14:16:17 onl50t May 17 14:16:17 onl50t unix: NOTICE: cc_strategy: dma_addr = 0x588 May 17 14:16:17 onl50t May 17 14:16:17 onl50t unix: NOTICE: cc_strategy: check3. --- start DMA May 17 14:16:17 onl50t May 17 14:16:17 onl50t unix: NOTICE: cc_intr: enter intrrupt: cc->kreg->csr = 0 x80 May 17 14:16:17 onl50t May 17 14:16:17 onl50t unix: NOTICE: cc_intr: wc = 0x0 May 17 14:16:17 onl50t May 17 14:16:17 onl50t unix: NOTICE: cc_intr: CC_INT_DONE: step02. May 17 14:16:17 onl50t unix: NOTICE: cc_intr: CC_INT_EMPTY: step02. May 17 14:16:17 onl50t unix: NOTICE: cc_intr: CC_INT_ABORT: step02. May 17 14:16:17 onl50t unix: NOTICE: cc_intr: cc->executing_dma_flag != 0: step 03. May 17 14:16:17 onl50t unix: NOTICE: cc_intr: cc->interrupt != 0: step04. May 17 14:16:17 onl50t unix: NOTICE: cc_intr: exit intrrupt: cc->kreg->csr = 0x 80 May 17 14:16:17 onl50t May 17 14:16:17 onl50t unix: NOTICE: cc_strategy: check4. --- return cc_strateg y May 17 14:16:17 onl50t May 17 14:16:17 onl50t unix: NOTICE: camac_b: read: physio return value = 0x0 May 17 14:16:17 onl50t May 17 14:16:17 onl50t unix: NOTICE: camac_b: read: cc->kreg->csr = 0x80 May 17 14:16:17 onl50t May 17 14:16:17 onl50t unix: NOTICE: cc_write: return camac_b(). May 17 14:16:17 onl50t May 17 14:16:17 onl50t unix: NOTICE: cc_write: cc->interrupt = 0xe May 17 14:16:17 onl50t May 17 14:16:17 onl50t unix: NOTICE: cc_write: cc->kreg->donv = 0xffff May 17 14:16:17 onl50t May 17 14:16:17 onl50t unix: NOTICE: cc_write: cc->kreg->csr = 0x80 May 17 14:16:17 onl50t onl50t console login: onl50t console login: onl50t console login: onl50t console login: May 17 14:16:32 onl50t unix: NOTICE: cc_write enter: May 17 14:16:32 onl50t May 17 14:16:32 onl50t unix: NOTICE: cc_write: CC_CMD_DOBLOCK enter: May 17 14:16:32 onl50t May 17 14:16:32 onl50t unix: NOTICE: cc_write: cc->kreg->donv = 0xffff May 17 14:16:32 onl50t May 17 14:16:32 onl50t unix: NOTICE: cc_write: cc->kreg->csr = 0x80 May 17 14:16:32 onl50t May 17 14:16:32 onl50t unix: NOTICE: camac_b: write: call physio --- uio = 0x41 1940 May 17 14:16:32 onl50t May 17 14:16:32 onl50t unix: NOTICE: cc_strategy: mode = 0x2a May 17 14:16:32 onl50t May 17 14:16:32 onl50t unix: NOTICE: cc_strategy: naf = 0x610 May 17 14:16:32 onl50t May 17 14:16:32 onl50t unix: NOTICE: cc_strategy: wc = 0x1 May 17 14:16:32 onl50t May 17 14:16:32 onl50t unix: NOTICE: cc_strategy: check1. May 17 14:16:32 onl50t May 17 14:16:32 onl50t unix: NOTICE: cc_strategy: check2. May 17 14:16:32 onl50t May 17 14:16:32 onl50t unix: NOTICE: cc_strategy: dma_addr = 0x588 May 17 14:16:32 onl50t May 17 14:16:32 onl50t unix: NOTICE: cc_strategy: check3. --- start DMA May 17 14:16:32 onl50t May 17 14:16:32 onl50t unix: NOTICE: cc_intr: enter intrrupt: cc->kreg->csr = 0 x461 May 17 14:16:32 onl50t May 17 14:16:32 onl50t unix: NOTICE: cc_intr: wc = 0x1 May 17 14:16:32 onl50t May 17 14:16:32 onl50t unix: NOTICE: cc_intr: CC_INT_EMPTY: step02. May 17 14:16:32 onl50t unix: NOTICE: cc_intr: CC_INT_ABORT: step02. May 17 14:16:32 onl50t unix: NOTICE: cc_intr: cc->executing_dma_flag != 0: step 03. May 17 14:16:32 onl50t unix: NOTICE: cc_intr: cc->interrupt != 0: step04. May 17 14:16:32 onl50t unix: NOTICE: cc_intr: exit intrrupt: cc->kreg->csr = 0x 461 May 17 14:16:32 onl50t May 17 14:16:32 onl50t unix: NOTICE: cc_strategy: check4. --- return cc_strateg y May 17 14:16:32 onl50t May 17 14:16:32 onl50t unix: NOTICE: camac_b: write: physio return value = 0x0 May 17 14:16:32 onl50t May 17 14:16:32 onl50t unix: NOTICE: camac_b: write: cc->kreg->csr = 0x461 May 17 14:16:32 onl50t May 17 14:16:32 onl50t unix: NOTICE: cc_write: return camac_b(). May 17 14:16:32 onl50t May 17 14:16:32 onl50t unix: NOTICE: cc_write: cc->interrupt = 0xe May 17 14:16:32 onl50t May 17 14:16:32 onl50t unix: NOTICE: cc_write: cc->kreg->donv = 0xffff May 17 14:16:32 onl50t May 17 14:16:32 onl50t unix: NOTICE: cc_write: cc->kreg->csr = 0x461 May 17 14:16:32 onl50t onl50t console login: onl50t console login: onl50t console login: May 17 14:16:48 onl50t unix: NOTICE: cc_write enter: May 17 14:16:48 onl50t May 17 14:16:48 onl50t unix: NOTICE: cc_write: CC_CMD_DOBLOCK enter: May 17 14:16:48 onl50t May 17 14:16:48 onl50t unix: NOTICE: cc_write: cc->kreg->donv = 0xffff May 17 14:16:48 onl50t May 17 14:16:48 onl50t unix: NOTICE: cc_write: cc->kreg->csr = 0x461 May 17 14:16:48 onl50t May 17 14:16:48 onl50t unix: NOTICE: camac_b: read: call physio --- uio = 0x411 940 May 17 14:16:48 onl50t May 17 14:16:48 onl50t unix: NOTICE: cc_strategy: mode = 0x2a May 17 14:16:48 onl50t May 17 14:16:48 onl50t unix: NOTICE: cc_strategy: naf = 0x600 May 17 14:16:48 onl50t May 17 14:16:48 onl50t unix: NOTICE: cc_strategy: wc = 0x1 May 17 14:16:48 onl50t May 17 14:16:48 onl50t unix: NOTICE: cc_strategy: check1. May 17 14:16:48 onl50t May 17 14:16:48 onl50t unix: NOTICE: cc_strategy: check2. May 17 14:16:48 onl50t May 17 14:16:48 onl50t unix: NOTICE: cc_strategy: dma_addr = 0x588 May 17 14:16:48 onl50t May 17 14:16:48 onl50t unix: NOTICE: cc_strategy: check3. --- start DMA May 17 14:16:48 onl50t May 17 14:16:48 onl50t unix: NOTICE: cc_strategy: check4. --- return cc_strateg y May 17 14:16:48 onl50t BAD TRAP: cpu=0 type=0x31 rp=0x2a100053880 addr=0x0 mmu_fsr=0x0 BAD TRAP occurred in module "unix" due to a NULL pointer dereference. sched: trap type = 0x31 pid=0, pc=0x10036564, sp=0x2a100053121, tstate=0x1606, context=0x0 g1-g7: 2a100053d60, 1041ef68, 0, 8, 30000573ed8, 0, 2a100053d60 Begin traceback... sp = 2a100053121 Called from 10074cbc, fp=2a1000531d1, args=98 0 20 10423600 300000d16b8 0 Called from 100ebd00, fp=2a100053281, args=30000033000 17fc69d 30000033038 1 800 0000000000000 30000034520 Called from 1002e110, fp=2a100053351, args=3000002bf68 0 10000 30000573eb2 30000 573eb0 30000573ea8 Called from 100ebb70, fp=0, args=30000573e80 0 0 0 0 0 End traceback... panic[cpu0]/thread=2a100053d60: trap syncing file systems...panic[cpu0]/thread=2a100057d60: panic sync timeout dumping to /dev/dsk/c0t3d0s3, offset 31260672 100% done: 4585 pages dumped, compression ratio 3.70, dump succeeded rebooting... Resetting ... : 症状に変化無し。 (5-2). DMA 見直し 2917 の DMA コントローラは、アドレス・レジスタが32ビット長で、データ・ レジスタも32ビット長(16ビットモードおよび、24ビットモード)である。 従って、システム側で設定する DMA 資源も32ビット用にすべきである。 : static struct cb_ops cc_cb_ops = { cc_open, /* open */ cc_close, /* close */ nodev, /* strategy (not block device) */ nodev, /* print (no print routine) */ nodev, /* dump (no dump routine) */ nodev, /* read (no read routine; write-only device */ cc_write, /* write */ cc_ioctl, /* ioctl */ nodev, /* devmap (no devmap routine) */ nodev, /* mmap (no mmap routine) */ nodev, /* segmap (no segmap routine) */ nochpoll, /* poll (no chpoll routine) */ ddi_prop_op, /* cb_prop_op */ 0, /* streamtab */ /* begin */ D_NEW | D_MP, /* Driver comaptibility flag */ /* E.Inoue D_NEW | D_MP | D_64BIT, */ /* Driver comaptibility flag */ CB_REV, /* cb_rev */ nodev, /* async I/O read entry point */ nodev /* async I/O write entry point */ /* end */ }; : onl50t[66]% 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 >1 Input n a f >3 0 0 MODE=1 N= 3 A= 0 F= 0 len= 1 lenr= 1 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 1 0 MODE=1 N= 3 A= 1 F= 0 len= 1 lenr= 1 error= 0(Hex) Data( 1)= 3 0x 3(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 >5 MODE=1 N= 3 A= 0 F=16 len= 1 lenr= 0 error= 0(Hex) Data( 1)= 5 0x 5(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 0 Freeze May 19 16:27:50 onl50t unix: CAMAC device driver V1.4x, 1991-1993 by Y.TAKEUCHI (T.I.T.) May 19 16:28:25 onl50t unix: NOTICE: cc_write enter: May 19 16:28:25 onl50t May 19 16:28:25 onl50t unix: NOTICE: cc_write enter: May 19 16:28:25 onl50t May 19 16:28:25 onl50t unix: NOTICE: cc_write enter: May 19 16:28:25 onl50t May 19 16:28:25 onl50t unix: NOTICE: cc_write enter: May 19 16:28:25 onl50t May 19 16:28:25 onl50t unix: NOTICE: cc_write enter: May 19 16:28:25 onl50t May 19 16:28:25 onl50t unix: NOTICE: cc_write enter: May 19 16:28:25 onl50t onl50t console login: onl50t console login: onl50t console login: May 19 16:28:32 onl50t unix: NOTICE: cc_write enter: May 19 16:28:32 onl50t May 19 16:28:32 onl50t unix: NOTICE: cc_write: CC_CMD_DOBLOCK enter: May 19 16:28:32 onl50t May 19 16:28:32 onl50t unix: NOTICE: cc_write: cc->kreg->donv = 0xffff May 19 16:28:32 onl50t May 19 16:28:32 onl50t unix: NOTICE: cc_write: cc->kreg->csr = 0xa0 May 19 16:28:32 onl50t May 19 16:28:32 onl50t unix: NOTICE: in: 0x4e4588 2 1 42 0 0 May 19 16:28:32 onl50t unix: NOTICE: camac_b: read: call physio --- uio = 0x383 940 May 19 16:28:32 onl50t May 19 16:28:32 onl50t unix: NOTICE: cc_strategy: mode = 0x2a May 19 16:28:32 onl50t May 19 16:28:32 onl50t unix: NOTICE: cc_strategy: naf = 0x600 May 19 16:28:32 onl50t May 19 16:28:32 onl50t unix: NOTICE: cc_strategy: wc = 0x1 May 19 16:28:32 onl50t May 19 16:28:32 onl50t unix: NOTICE: cc_strategy: check1. May 19 16:28:32 onl50t May 19 16:28:32 onl50t unix: NOTICE: cc_strategy: check2. May 19 16:28:32 onl50t May 19 16:28:32 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_address i s 4 bytes May 19 16:28:32 onl50t May 19 16:28:32 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_size is 8 bytes May 19 16:28:32 onl50t May 19 16:28:32 onl50t unix: NOTICE: cc_strategy: dma_addr = 4 bytes May 19 16:28:32 onl50t May 19 16:28:32 onl50t unix: NOTICE: cc_strategy: dma_addr = 0x588 May 19 16:28:32 onl50t May 19 16:28:32 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_address = 0x588 May 19 16:28:32 onl50t May 19 16:28:32 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_laddress = 0x588 May 19 16:28:32 onl50t May 19 16:28:32 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_size = 0x 2 May 19 16:28:32 onl50t May 19 16:28:32 onl50t unix: NOTICE: cc_strategy: read: cc->kreg->maclo = 0x588 May 19 16:28:32 onl50t May 19 16:28:32 onl50t unix: NOTICE: cc_strategy: read: cc->kreg->machi = 0x0 May 19 16:28:32 onl50t May 19 16:28:32 onl50t unix: NOTICE: cc_strategy: check3. --- start DMA May 19 16:28:32 onl50t May 19 16:28:32 onl50t unix: NOTICE: cc_intr: enter intrrupt: cc->kreg->csr = 0 x80 May 19 16:28:32 onl50t May 19 16:28:32 onl50t unix: NOTICE: cc_intr: wc = 0x0 May 19 16:28:32 onl50t May 19 16:28:32 onl50t unix: NOTICE: cc_intr: CC_INT_DONE: step02. May 19 16:28:32 onl50t unix: NOTICE: cc_intr: CC_INT_EMPTY: step02. May 19 16:28:32 onl50t unix: NOTICE: cc_intr: CC_INT_ABORT: step02. May 19 16:28:32 onl50t unix: NOTICE: cc_intr: cc->executing_dma_flag != 0: step 03. May 19 16:28:32 onl50t unix: NOTICE: cc_intr: cc->interrupt != 0: step04. May 19 16:28:32 onl50t unix: NOTICE: cc_intr: exit intrrupt: cc->kreg->csr = 0x 80 May 19 16:28:32 onl50t May 19 16:28:32 onl50t unix: NOTICE: cc_strategy: check4. --- return cc_strateg y May 19 16:28:32 onl50t May 19 16:28:32 onl50t unix: NOTICE: camac_b: read: physio return value = 0x0 May 19 16:28:32 onl50t May 19 16:28:32 onl50t unix: NOTICE: camac_b: read: cc->kreg->csr = 0x80 May 19 16:28:32 onl50t May 19 16:28:32 onl50t unix: NOTICE: out: 0 0 40 0 2 May 19 16:28:32 onl50t unix: NOTICE: cc_write: return camac_b(). May 19 16:28:32 onl50t May 19 16:28:32 onl50t unix: NOTICE: cc_write: cc->interrupt = 0xe May 19 16:28:32 onl50t May 19 16:28:32 onl50t unix: NOTICE: cc_write: cc->kreg->donv = 0xffff May 19 16:28:32 onl50t May 19 16:28:32 onl50t unix: NOTICE: cc_write: cc->kreg->csr = 0x80 May 19 16:28:32 onl50t onl50t console login: onl50t console login: onl50t console login: May 19 16:28:52 onl50t unix: NOTICE: cc_write enter: May 19 16:28:52 onl50t May 19 16:28:52 onl50t unix: NOTICE: cc_write: CC_CMD_DOBLOCK enter: May 19 16:28:52 onl50t May 19 16:28:52 onl50t unix: NOTICE: cc_write: cc->kreg->donv = 0xffff May 19 16:28:52 onl50t May 19 16:28:52 onl50t unix: NOTICE: cc_write: cc->kreg->csr = 0x80 May 19 16:28:52 onl50t May 19 16:28:52 onl50t unix: NOTICE: in: 0x4e4588 2 1 42 0 0 May 19 16:28:52 onl50t unix: NOTICE: camac_b: read: call physio --- uio = 0x383 940 May 19 16:28:52 onl50t May 19 16:28:52 onl50t unix: NOTICE: cc_strategy: mode = 0x2a May 19 16:28:52 onl50t May 19 16:28:52 onl50t unix: NOTICE: cc_strategy: naf = 0x620 May 19 16:28:52 onl50t May 19 16:28:52 onl50t unix: NOTICE: cc_strategy: wc = 0x1 May 19 16:28:52 onl50t May 19 16:28:52 onl50t unix: NOTICE: cc_strategy: check1. May 19 16:28:52 onl50t May 19 16:28:52 onl50t unix: NOTICE: cc_strategy: check2. May 19 16:28:52 onl50t May 19 16:28:52 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_address i s 4 bytes May 19 16:28:52 onl50t May 19 16:28:52 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_size is 8 bytes May 19 16:28:52 onl50t May 19 16:28:52 onl50t unix: NOTICE: cc_strategy: dma_addr = 4 bytes May 19 16:28:52 onl50t May 19 16:28:52 onl50t unix: NOTICE: cc_strategy: dma_addr = 0x588 May 19 16:28:52 onl50t May 19 16:28:52 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_address = 0x588 May 19 16:28:52 onl50t May 19 16:28:52 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_laddress = 0x588 May 19 16:28:52 onl50t May 19 16:28:52 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_size = 0x 2 May 19 16:28:52 onl50t May 19 16:28:52 onl50t unix: NOTICE: cc_strategy: read: cc->kreg->maclo = 0x588 May 19 16:28:52 onl50t May 19 16:28:52 onl50t unix: NOTICE: cc_strategy: read: cc->kreg->machi = 0x0 May 19 16:28:52 onl50t May 19 16:28:52 onl50t unix: NOTICE: cc_strategy: check3. --- start DMA May 19 16:28:52 onl50t May 19 16:28:52 onl50t unix: NOTICE: cc_intr: enter intrrupt: cc->kreg->csr = 0 x80 May 19 16:28:52 onl50t May 19 16:28:52 onl50t unix: NOTICE: cc_intr: wc = 0x0 May 19 16:28:52 onl50t May 19 16:28:52 onl50t unix: NOTICE: cc_intr: CC_INT_DONE: step02. May 19 16:28:52 onl50t unix: NOTICE: cc_intr: CC_INT_EMPTY: step02. May 19 16:28:52 onl50t unix: NOTICE: cc_intr: CC_INT_ABORT: step02. May 19 16:28:52 onl50t unix: NOTICE: cc_intr: cc->executing_dma_flag != 0: step 03. May 19 16:28:52 onl50t unix: NOTICE: cc_intr: cc->interrupt != 0: step04. May 19 16:28:52 onl50t unix: NOTICE: cc_intr: exit intrrupt: cc->kreg->csr = 0x 80 May 19 16:28:52 onl50t May 19 16:28:52 onl50t unix: NOTICE: cc_strategy: check4. --- return cc_strateg y May 19 16:28:52 onl50t May 19 16:28:52 onl50t unix: NOTICE: camac_b: read: physio return value = 0x0 May 19 16:28:52 onl50t May 19 16:28:52 onl50t unix: NOTICE: camac_b: read: cc->kreg->csr = 0x80 May 19 16:28:52 onl50t May 19 16:28:52 onl50t unix: NOTICE: out: 0 0 40 0 2 May 19 16:28:52 onl50t unix: NOTICE: cc_write: return camac_b(). May 19 16:28:52 onl50t May 19 16:28:52 onl50t unix: NOTICE: cc_write: cc->interrupt = 0xe May 19 16:28:52 onl50t May 19 16:28:52 onl50t unix: NOTICE: cc_write: cc->kreg->donv = 0xffff May 19 16:28:52 onl50t May 19 16:28:52 onl50t unix: NOTICE: cc_write: cc->kreg->csr = 0x80 May 19 16:28:52 onl50t onl50t console login: onl50t console login: onl50t console login: May 19 16:29:02 onl50t unix: NOTICE: cc_write enter: May 19 16:29:02 onl50t May 19 16:29:02 onl50t unix: NOTICE: cc_write: CC_CMD_DOBLOCK enter: May 19 16:29:02 onl50t May 19 16:29:02 onl50t unix: NOTICE: cc_write: cc->kreg->donv = 0xffff May 19 16:29:02 onl50t May 19 16:29:02 onl50t unix: NOTICE: cc_write: cc->kreg->csr = 0x80 May 19 16:29:02 onl50t May 19 16:29:02 onl50t unix: NOTICE: in: 0x4e4588 2 1 42 0 0 May 19 16:29:02 onl50t unix: NOTICE: camac_b: write: call physio --- uio = 0x38 3940 May 19 16:29:02 onl50t May 19 16:29:02 onl50t unix: NOTICE: cc_strategy: mode = 0x2a May 19 16:29:02 onl50t May 19 16:29:02 onl50t unix: NOTICE: cc_strategy: naf = 0x610 May 19 16:29:02 onl50t May 19 16:29:02 onl50t unix: NOTICE: cc_strategy: wc = 0x1 May 19 16:29:02 onl50t May 19 16:29:02 onl50t unix: NOTICE: cc_strategy: check1. May 19 16:29:02 onl50t May 19 16:29:02 onl50t unix: NOTICE: cc_strategy: check2. May 19 16:29:02 onl50t May 19 16:29:02 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_address i s 4 bytes May 19 16:29:02 onl50t May 19 16:29:02 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_size is 8 bytes May 19 16:29:02 onl50t May 19 16:29:02 onl50t unix: NOTICE: cc_strategy: dma_addr = 4 bytes May 19 16:29:02 onl50t May 19 16:29:02 onl50t unix: NOTICE: cc_strategy: dma_addr = 0x588 May 19 16:29:02 onl50t May 19 16:29:02 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_address = 0x588 May 19 16:29:02 onl50t May 19 16:29:02 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_laddress = 0x588 May 19 16:29:02 onl50t May 19 16:29:02 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_size = 0x 2 May 19 16:29:02 onl50t May 19 16:29:02 onl50t unix: NOTICE: cc_strategy: check3. --- start DMA May 19 16:29:02 onl50t May 19 16:29:02 onl50t unix: NOTICE: cc_intr: enter intrrupt: cc->kreg->csr = 0 x461 May 19 16:29:02 onl50t May 19 16:29:02 onl50t unix: NOTICE: cc_intr: wc = 0x1 May 19 16:29:02 onl50t May 19 16:29:02 onl50t unix: NOTICE: cc_intr: CC_INT_EMPTY: step02. May 19 16:29:02 onl50t unix: NOTICE: cc_intr: CC_INT_ABORT: step02. May 19 16:29:02 onl50t unix: NOTICE: cc_intr: cc->executing_dma_flag != 0: step 03. May 19 16:29:02 onl50t unix: NOTICE: cc_intr: cc->interrupt != 0: step04. May 19 16:29:02 onl50t unix: NOTICE: cc_intr: exit intrrupt: cc->kreg->csr = 0x 461 May 19 16:29:02 onl50t May 19 16:29:02 onl50t unix: NOTICE: cc_strategy: check4. --- return cc_strateg y May 19 16:29:02 onl50t May 19 16:29:02 onl50t unix: NOTICE: camac_b: write: physio return value = 0x0 May 19 16:29:02 onl50t May 19 16:29:02 onl50t unix: NOTICE: camac_b: write: cc->kreg->csr = 0x461 May 19 16:29:02 onl50t May 19 16:29:02 onl50t unix: NOTICE: out: 0 0 40 0 2 May 19 16:29:02 onl50t unix: NOTICE: cc_write: return camac_b(). May 19 16:29:02 onl50t May 19 16:29:02 onl50t unix: NOTICE: cc_write: cc->interrupt = 0xe May 19 16:29:02 onl50t May 19 16:29:02 onl50t unix: NOTICE: cc_write: cc->kreg->donv = 0xffff May 19 16:29:02 onl50t May 19 16:29:02 onl50t unix: NOTICE: cc_write: cc->kreg->csr = 0x461 May 19 16:29:02 onl50t onl50t console login: onl50t console login: onl50t console login: May 19 16:29:19 onl50t unix: NOTICE: cc_write enter: May 19 16:29:19 onl50t May 19 16:29:19 onl50t unix: NOTICE: cc_write: CC_CMD_DOBLOCK enter: May 19 16:29:19 onl50t May 19 16:29:19 onl50t unix: NOTICE: cc_write: cc->kreg->donv = 0xffff May 19 16:29:19 onl50t May 19 16:29:19 onl50t unix: NOTICE: cc_write: cc->kreg->csr = 0x461 May 19 16:29:19 onl50t May 19 16:29:19 onl50t unix: NOTICE: in: 0x4e4588 2 1 42 0 0 May 19 16:29:19 onl50t unix: NOTICE: camac_b: read: call physio --- uio = 0x383 940 May 19 16:29:19 onl50t May 19 16:29:19 onl50t unix: NOTICE: cc_strategy: mode = 0x2a May 19 16:29:19 onl50t May 19 16:29:19 onl50t unix: NOTICE: cc_strategy: naf = 0x600 May 19 16:29:19 onl50t May 19 16:29:19 onl50t unix: NOTICE: cc_strategy: wc = 0x1 May 19 16:29:19 onl50t May 19 16:29:19 onl50t unix: NOTICE: cc_strategy: check1. May 19 16:29:19 onl50t May 19 16:29:19 onl50t unix: NOTICE: cc_strategy: check2. May 19 16:29:19 onl50t May 19 16:29:19 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_address i s 4 bytes May 19 16:29:19 onl50t May 19 16:29:19 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_size is 8 bytes May 19 16:29:19 onl50t May 19 16:29:19 onl50t unix: NOTICE: cc_strategy: dma_addr = 4 bytes May 19 16:29:19 onl50t May 19 16:29:19 onl50t unix: NOTICE: cc_strategy: dma_addr = 0x588 May 19 16:29:19 onl50t May 19 16:29:19 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_address = 0x588 May 19 16:29:19 onl50t May 19 16:29:19 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_laddress = 0x588 May 19 16:29:19 onl50t May 19 16:29:19 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_size = 0x 2 May 19 16:29:19 onl50t May 19 16:29:19 onl50t unix: NOTICE: cc_strategy: read: cc->kreg->maclo = 0x588 May 19 16:29:19 onl50t May 19 16:29:19 onl50t unix: NOTICE: cc_strategy: read: cc->kreg->machi = 0x0 May 19 16:29:19 onl50t May 19 16:29:19 onl50t unix: NOTICE: cc_strategy: check3. --- start DMA May 19 16:29:19 onl50t May 19 16:29:19 onl50t unix: NOTICE: cc_strategy: check4. --- return cc_strateg y May 19 16:29:19 onl50t BAD TRAP: cpu=0 type=0x31 rp=0x2a10004d880 addr=0x0 mmu_fsr=0x0 BAD TRAP occurred in module "unix" due to a NULL pointer dereference. sched: trap type = 0x31 pid=0, pc=0x10036564, sp=0x2a10004d121, tstate=0xf0001602, context=0x0 g1-g7: 2a10004dd60, 1041ef68, 0, 8, 30000573ed8, 37000520, 2a10004dd60 Begin traceback... sp = 2a10004d121 Called from 10074cbc, fp=2a10004d1d1, args=98 0 20 10423600 300000d16b8 0 Called from 100ebd00, fp=2a10004d281, args=30000033000 e1d00 30000033038 1 80000 00000000000 30000034838 Called from 1002e110, fp=2a10004d351, args=3000002bfa8 0 10000 30000573eb2 30000 573eb0 30000573ea8 Called from 100ebb70, fp=0, args=30000573e80 0 0 0 0 0 End traceback... panic[cpu0]/thread=2a10004dd60: trap syncing file systems...panic[cpu0]/thread=2a100057d60: panic sync timeout dumping to /dev/dsk/c0t3d0s3, offset 31260672 100% done: 4456 pages dumped, compression ratio 3.47, dump succeeded rebooting... Resetting ... : 症状に変化無し。 (5-3). DMA 見直し(その2) "Solaris 64-bit Developer Guide"より参照 Extra padding may be added to a structure by the compiler to meet alignment requirements as 'long' and pointer fields grow to 64 bits for LP64. In the 64-bit environments, all types of structures are aligned to at least the size of the largest quantity within them. A simple rule for repacking a structure is to move the 'long' and ponter fields to the begining of the structure and rearrange the rest of the fields usually but not always in decending order of size, depending on how well they can be packed. For example, struct bar { int i; long j; int k; char *p; }; /* sizeof (struct bar) = 32 */ struct bar { char *p; long j; int i; int k; }; /* sizeof (struct bar) = 24 */ ここまで。 これに合わせて、ポインターおよび long を構造体の前の部分に配置し直してみ る。 現在の症状は、ブロック転送write時に DMAバッファが空であるという割り込み がかかっているが、ほんとうに空なのかどうかを確認してみる。 onl50t[43]% vi cc.h : struct cc_message { u_short *ptr_data; u_short *ptr_qx; struct cc_iosb *ptr_iosb; char *klname; u_short command; u_short mode; u_short naf; }; : onl50t[44]% onl50t[44]% 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 >1 Input n a f >3 1 0 *buf = 0x0, *(buf+1) = 0x0, *(buf+2) = 0x0, *(buf+3) = 0x0 *buf = 0x3, *(buf+1) = 0x0, *(buf+2) = 0x0, *(buf+3) = 0x0 MODE=1 N= 3 A= 1 F= 0 len= 1 lenr= 1 error= 0(Hex) Data( 1)= 3 0x 3(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 >5 *buf = 0x5, *(buf+1) = 0x0, *(buf+2) = 0x0, *(buf+3) = 0x0 *buf = 0x5, *(buf+1) = 0x0, *(buf+2) = 0x0, *(buf+3) = 0x0 MODE=1 N= 3 A= 0 F=16 len= 1 lenr= 0 error= 0(Hex) Data( 1)= 5 0x 5(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 0 *buf = 0x0, *(buf+1) = 0x0, *(buf+2) = 0x0, *(buf+3) = 0x0 Freeze May 25 13:47:23 onl50t unix: CAMAC device driver V1.4x, 1991-1993 by Y.TAKEUCHI (T.I.T.) May 25 13:48:17 onl50t unix: NOTICE: cc_write: cc->kreg->csr = 0xa0 May 25 13:48:17 onl50t May 25 13:48:17 onl50t unix: NOTICE: cc_write: CC_CMD_DOBLOCK: iov->iov_base = 0x4e46e8 May 25 13:48:17 onl50t May 25 13:48:17 onl50t unix: NOTICE: cc_write: CC_CMD_DOBLOCK: contents of iov- >iov_base = 0x0 May 25 13:48:17 onl50t May 25 13:48:17 onl50t unix: NOTICE: in: 0x4e46e8 2 1 42 0 0 May 25 13:48:17 onl50t unix: NOTICE: camac_b: read: call physio --- uio = 0x2ef 940 May 25 13:48:17 onl50t May 25 13:48:17 onl50t unix: NOTICE: cc_strategy: mode = 0x2a May 25 13:48:17 onl50t May 25 13:48:17 onl50t unix: NOTICE: cc_strategy: naf = 0x620 May 25 13:48:17 onl50t May 25 13:48:17 onl50t unix: NOTICE: cc_strategy: wc = 0x1 May 25 13:48:17 onl50t May 25 13:48:17 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_address i s 4 bytes May 25 13:48:17 onl50t May 25 13:48:17 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_size is 8 bytes May 25 13:48:17 onl50t May 25 13:48:17 onl50t unix: NOTICE: cc_strategy: dma_addr = 4 bytes May 25 13:48:17 onl50t May 25 13:48:17 onl50t unix: NOTICE: cc_strategy: dma_addr = 0x6e8 May 25 13:48:17 onl50t May 25 13:48:17 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_address = 0x6e8 May 25 13:48:17 onl50t May 25 13:48:17 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_laddress = 0x6e8 May 25 13:48:17 onl50t May 25 13:48:17 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_size = 0x 2 May 25 13:48:17 onl50t May 25 13:48:17 onl50t unix: NOTICE: cc_strategy: contents of cc->dma_cookie.dm ac_address =0x0, 0x0, 0x0, 0x0 May 25 13:48:17 onl50t May 25 13:48:17 onl50t unix: NOTICE: cc_strategy: read: cc->kreg->maclo = 0x6e8 May 25 13:48:17 onl50t May 25 13:48:17 onl50t unix: NOTICE: cc_strategy: read: cc->kreg->machi = 0x0 May 25 13:48:17 onl50t May 25 13:48:17 onl50t unix: NOTICE: cc_intr: enter intrrupt: cc->kreg->csr = 0 x80 May 25 13:48:17 onl50t May 25 13:48:17 onl50t unix: NOTICE: cc_intr: wc = 0x0 May 25 13:48:17 onl50t May 25 13:48:17 onl50t unix: NOTICE: cc_intr: cc->dma_cookie.dmac_address = 0x6 e8 May 25 13:48:17 onl50t May 25 13:48:17 onl50t unix: NOTICE: cc_intr: contents of cc->dma_cookie.dmac_a ddress =0x0, 0x0, 0x0, 0x0 May 25 13:48:17 onl50t May 25 13:48:17 onl50t unix: NOTICE: cc->kreg->maclo = 0x6ea May 25 13:48:17 onl50t May 25 13:48:17 onl50t unix: NOTICE: cc->kreg->machi = 0x0 May 25 13:48:17 onl50t May 25 13:48:17 onl50t unix: NOTICE: cc_intr: CC_INT_DONE: step02. May 25 13:48:17 onl50t unix: NOTICE: cc_intr: CC_INT_EMPTY: step02. May 25 13:48:17 onl50t unix: NOTICE: cc_intr: CC_INT_ABORT: step02. May 25 13:48:17 onl50t unix: NOTICE: cc_intr: exit intrrupt: cc->kreg->csr = 0x 80 May 25 13:48:17 onl50t May 25 13:48:17 onl50t unix: NOTICE: camac_b: read: cc->kreg->csr = 0x80 May 25 13:48:17 onl50t May 25 13:48:17 onl50t unix: NOTICE: out: 269119772 0 40 0 2 May 25 13:48:17 onl50t unix: NOTICE: cc_write: cc->interrupt = 0xe May 25 13:48:17 onl50t May 25 13:48:17 onl50t unix: NOTICE: cc_write: cc->kreg->donv = 0xffff May 25 13:48:17 onl50t May 25 13:48:17 onl50t unix: NOTICE: cc_write: cc->kreg->csr = 0x80 May 25 13:48:17 onl50t onl50t console login: onl50t console login: onl50t console login: May 25 13:52:06 onl50t unix: NOTICE: cc_write: cc->kreg-> csr = 0x80 May 25 13:52:06 onl50t May 25 13:52:06 onl50t unix: NOTICE: cc_write: CC_CMD_DOBLOCK: iov->iov_base = 0x4e46e8 May 25 13:52:06 onl50t May 25 13:52:06 onl50t unix: NOTICE: cc_write: CC_CMD_DOBLOCK: contents of iov- >iov_base = 0x5 May 25 13:52:06 onl50t May 25 13:52:06 onl50t unix: NOTICE: in: 0x4e46e8 2 1 42 0 0 May 25 13:52:06 onl50t unix: NOTICE: camac_b: write: call physio --- uio = 0x2e f940 May 25 13:52:06 onl50t May 25 13:52:06 onl50t unix: NOTICE: cc_strategy: mode = 0x2a May 25 13:52:06 onl50t May 25 13:52:06 onl50t unix: NOTICE: cc_strategy: naf = 0x610 May 25 13:52:06 onl50t May 25 13:52:06 onl50t unix: NOTICE: cc_strategy: wc = 0x1 May 25 13:52:06 onl50t May 25 13:52:06 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_address i s 4 bytes May 25 13:52:06 onl50t May 25 13:52:06 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_size is 8 bytes May 25 13:52:06 onl50t May 25 13:52:06 onl50t unix: NOTICE: cc_strategy: dma_addr = 4 bytes May 25 13:52:06 onl50t May 25 13:52:06 onl50t unix: NOTICE: cc_strategy: dma_addr = 0x6e8 May 25 13:52:06 onl50t May 25 13:52:06 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_address = 0x6e8 May 25 13:52:06 onl50t May 25 13:52:06 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_laddress = 0x6e8 May 25 13:52:06 onl50t May 25 13:52:06 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_size = 0x 2 May 25 13:52:06 onl50t May 25 13:52:06 onl50t unix: NOTICE: cc_strategy: contents of cc->dma_cookie.dm ac_address =0x5, 0x0, 0x0, 0x0 May 25 13:52:06 onl50t May 25 13:52:06 onl50t unix: NOTICE: cc_intr: enter intrrupt: cc->kreg->csr = 0 x461 May 25 13:52:06 onl50t May 25 13:52:06 onl50t unix: NOTICE: cc_intr: wc = 0x1 May 25 13:52:06 onl50t May 25 13:52:06 onl50t unix: NOTICE: cc_intr: cc->dma_cookie.dmac_address = 0x6 e8 May 25 13:52:06 onl50t May 25 13:52:06 onl50t unix: NOTICE: cc_intr: contents of cc->dma_cookie.dmac_a ddress =0x5, 0x0, 0x0, 0x0 May 25 13:52:06 onl50t May 25 13:52:06 onl50t unix: NOTICE: cc->kreg->maclo = 0x6e8 May 25 13:52:06 onl50t May 25 13:52:06 onl50t unix: NOTICE: cc->kreg->machi = 0x0 May 25 13:52:06 onl50t May 25 13:52:06 onl50t unix: NOTICE: cc_intr: CC_INT_EMPTY: step02. May 25 13:52:06 onl50t unix: NOTICE: cc_intr: CC_INT_ABORT: step02. May 25 13:52:06 onl50t unix: NOTICE: cc_intr: exit intrrupt: cc->kreg->csr = 0x 461 May 25 13:52:06 onl50t May 25 13:52:06 onl50t unix: NOTICE: camac_b: write: cc->kreg->csr = 0x461 May 25 13:52:06 onl50t May 25 13:52:06 onl50t unix: NOTICE: out: 269119772 0 40 0 2 May 25 13:52:06 onl50t unix: NOTICE: cc_write: cc->interrupt = 0xe May 25 13:52:06 onl50t May 25 13:52:06 onl50t unix: NOTICE: cc_write: cc->kreg->donv = 0xffff May 25 13:52:06 onl50t May 25 13:52:06 onl50t unix: NOTICE: cc_write: cc->kreg->csr = 0x461 May 25 13:52:06 onl50t onl50t console login: onl50t console login: onl50t console login: May 25 13:53:21 onl50t unix: NOTICE: cc_write: cc->kreg-> csr = 0x461 May 25 13:53:21 onl50t May 25 13:53:21 onl50t unix: NOTICE: cc_write: CC_CMD_DOBLOCK: iov->iov_base = 0x4e46e8 May 25 13:53:21 onl50t May 25 13:53:21 onl50t unix: NOTICE: cc_write: CC_CMD_DOBLOCK: contents of iov- >iov_base = 0x0 May 25 13:53:21 onl50t May 25 13:53:21 onl50t unix: NOTICE: in: 0x4e46e8 2 1 42 0 0 May 25 13:53:21 onl50t unix: NOTICE: camac_b: read: call physio --- uio = 0x2ef 940 May 25 13:53:21 onl50t May 25 13:53:21 onl50t unix: NOTICE: cc_strategy: mode = 0x2a May 25 13:53:21 onl50t May 25 13:53:21 onl50t unix: NOTICE: cc_strategy: naf = 0x600 May 25 13:53:21 onl50t May 25 13:53:21 onl50t unix: NOTICE: cc_strategy: wc = 0x1 May 25 13:53:21 onl50t May 25 13:53:21 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_address i s 4 bytes May 25 13:53:21 onl50t May 25 13:53:21 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_size is 8 bytes May 25 13:53:21 onl50t May 25 13:53:21 onl50t unix: NOTICE: cc_strategy: dma_addr = 4 bytes May 25 13:53:21 onl50t May 25 13:53:21 onl50t unix: NOTICE: cc_strategy: dma_addr = 0x6e8 May 25 13:53:21 onl50t May 25 13:53:21 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_address = 0x6e8 May 25 13:53:21 onl50t May 25 13:53:21 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_laddress = 0x6e8 May 25 13:53:21 onl50t May 25 13:53:21 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_size = 0x 2 May 25 13:53:21 onl50t May 25 13:53:21 onl50t unix: NOTICE: cc_strategy: contents of cc->dma_cookie.dm ac_address =0x0, 0x0, 0x0, 0x0 May 25 13:53:21 onl50t May 25 13:53:21 onl50t unix: NOTICE: cc_strategy: read: cc->kreg->maclo = 0x6e8 May 25 13:53:21 onl50t May 25 13:53:21 onl50t unix: NOTICE: cc_strategy: read: cc->kreg->machi = 0x0 May 25 13:53:21 onl50t BAD TRAP: cpu=0 type=0x31 rp=0x2a10004d880 addr=0x0 mmu_fsr=0x0 BAD TRAP occurred in module "unix" due to a NULL pointer dereference. sched: trap type = 0x31 pid=0, pc=0x10036564, sp=0x2a10004d121, tstate=0xf0001606, context=0x0 g1-g7: 2a10004dd60, 1041ef68, 0, 8, 30000573ed8, 0, 2a10004dd60 Begin traceback... sp = 2a10004d121 Called from 10074cbc, fp=2a10004d1d1, args=98 0 20 10423600 300000d16b8 0 Called from 100ebd00, fp=2a10004d281, args=30000033000 18667 30000033038 1 80000 00000000000 30000034370 Called from 1002e110, fp=2a10004d351, args=3000002bfa8 0 10000 30000573eb2 30000 573eb0 30000573ea8 Called from 100ebb70, fp=0, args=30000573e80 0 0 0 0 0 End traceback... panic[cpu0]/thread=2a10004dd60: trap syncing file systems... done panic[cpu0]/thread=2a100057d60: panic sync timeout dumping to /dev/dsk/c0t3d0s3, offset 31260672 100% done: 4165 pages dumped, compression ratio 3.58, dump succeeded rebooting... Resetting ... : ブロック転送writeを実行時、DMA開始直前にcc->dma_cookie.dmac_addressを 読んで確認したところでは、cam2プログラムから渡した値が正しくセットされて いる。 空ではない。 一方、ブロック転送readを実行時、done の割り込みが かかった時に、DMA資源を解放する前にcc->dma_cookie.dmac_addressを読んで 確認したところでは、camacから読み出したはずのデータはゼロになっている。 しかし、DMAが完了した後 cam2プログラムにはcamacからのデータが正しく 渡されている。 1. 1回目のブロック転送 naf=3,1,0 を実行した。 DMA開始前の 2917 の DMAアドレスレジスタの値は 0x6e8 で、done による割り込み時の 2917 の DMAアドレスレジスタの値は 0x6ea になっており、2917 の ワードカウントレジスタの値はDMA開始前が 1 だったのが done による割り込み時の 2917 の ワードカウントレジスタの 値は 0 になっている。つまり、2バイト長のデータが1回だけ、camac から DMAバッファへ書かれている。 2. 2回目のブロック転送 naf=3,0,16、data=5 を実行した。 DMA をスタートすると、camac から割り 込みがかかる。 この割り込みは "DMA Buffer Empty" によるものであり、 DMA 完了によるものではない。 割り込みがかかった時点で確認したところ、 2917 のワードカウントレジスタの値はDMA開始前と同じ値 1 のままで、 2917 の DMAアドレスレジスタの値はDMA開始前と同じ値 0x6e8 のままで ある。 DMA転送は全く行われていない。 2917 の csr レジスタの DMAビット および GOビットはセットされたままになっており、DMAコントローラは DMA を続行中であることを示している。 3. 3回目のブロック転送 naf=3,0,0 を実行した。 この実行によってシステム・クラッシュが起きて いる。 上記の項2で示したように DMAコントローラは DMA を続行中であり 完了していない。 この状態で新たな DMA転送を実行しようとしたために システム・クラッシュを起こしてしまった。 このデバッグでは何も意味のな いステップである。 (5-4). DMA 見直し(その3) 現在の slavewindow の設定は、A24スペースで、開始アドレスが0で、ウインド ウ・サイズが 1MBの設定になっている。 onl50t# pwd /platform/sun4u/kernel/drv onl50t# ls -l VM* -rw-r----- 1 root other 164240 Feb 21 16:12 VME -rw-r----- 1 root other 2888 Apr 20 16:12 VME.conf -rw-r----- 1 root other 2850 Feb 21 16:12 VME.conf.org onl50t# chmod ugo+x VME onl50t# chgrp sys VME* onl50t# ls -l VME* -rwxr-x--x 1 root sys 164240 Feb 21 16:12 VME -rw-r----- 1 root sys 2888 Apr 20 16:12 VME.conf -rw-r----- 1 root sys 2850 Feb 21 16:12 VME.conf.org onl50t# onl50t# vi VME.conf : # slavewin=0x000000,0x100000,0x00020000 ############################################################################### # slavewin=0x000000,0x100000,0x01020000 pamc=0x10, 0x11 ; ~ : "VME.conf" 64 lines, 2888 characters onl50t# これを A32スペースにして、開始アドレスが0、ウインドウ・サイズ 1MBの設定 にしてみる。 onl50t# pwd /platform/sun4u/kernel/drv onl50t# ls -l V* -rwxr-x--x 1 root sys 164240 Feb 21 16:12 VME -rw-r----- 1 root sys 2888 May 26 15:01 VME.conf -rw-r----- 1 root sys 2850 Feb 21 16:12 VME.conf.org onl50t# vi VME.conf : # #slavewin=0x000000,0x100000,0x01020000 slavewin=0x000000,0x100000,0x01040000 pamc=0x10, 0x11 ; : "VME.conf" 65 lines, 2927 characters onl50t# onl50t# /usr/sbin/shutdown -i0 -g0 Shutdown started. Fri May 26 16:14:06 JST 2000 Do you want to continue? (y or n): y : 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 Boot device: /pci@1f,0/scsi@4/disk@3,0:a File and args: -r 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=0x304061f configuring network interfaces: hme0. Hostname: onl50t 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 system is coming up. Please wait. checking ufs filesystems /dev/rdsk/c0t3d0s7: is clean. 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. May 26 16:16:41 onl50t savecore: reboot after panic: trap System dump time: Fri May 26 14:17:13 2000 savecore: not enough space in /var/crash/onl50t (9 MB avail, 33 MB needed) May 26 16:16:41 onl50t savecore: not enough space in /var/crash/onl50t (9 MB ava il, 33 MB needed) Print services started. volume management starting. The system is ready. onl50t console login: ここでブロック転送 write時の AMコードを "拡張特権データアクセス"の 0x0D にしてみる。 onl50t[41]% 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 >1 Input n a f >3 0 0 <--- 2917 RESET Button. *buf = 0x0, *(buf+1) = 0x0, *(buf+2) = 0x0, *(buf+3) = 0x0 *buf = 0x0, *(buf+1) = 0x0, *(buf+2) = 0x0, *(buf+3) = 0x0 MODE=1 N= 3 A= 0 F= 0 len= 1 lenr= 1 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 >5 *buf = 0x5, *(buf+1) = 0x0, *(buf+2) = 0x0, *(buf+3) = 0x0 Freeze System reboot May 26 16:23:25 onl50t unix: CAMAC device driver V1.4x, 1991-1993 by Y.TAKEUCHI (T.I.T.) May 26 16:24:05 onl50t unix: NOTICE: cc_write: cc->kreg->csr = 0xa0 May 26 16:24:05 onl50t May 26 16:24:05 onl50t unix: NOTICE: cc_write: CC_CMD_DOBLOCK: iov->iov_base = 0x4e46e8 May 26 16:24:05 onl50t May 26 16:24:05 onl50t unix: NOTICE: cc_write: CC_CMD_DOBLOCK: contents of iov- >iov_base = 0x0 May 26 16:24:05 onl50t May 26 16:24:05 onl50t unix: NOTICE: in: 0x4e46e8 2 1 42 0 0 May 26 16:24:05 onl50t unix: NOTICE: camac_b: read: call physio --- uio = 0x4c7 940 May 26 16:24:05 onl50t May 26 16:24:05 onl50t unix: NOTICE: cc_strategy: mode = 0x2a May 26 16:24:05 onl50t May 26 16:24:05 onl50t unix: NOTICE: cc_strategy: naf = 0x600 May 26 16:24:05 onl50t May 26 16:24:05 onl50t unix: NOTICE: cc_strategy: wc = 0x1 May 26 16:24:05 onl50t May 26 16:24:05 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_address i s 4 bytes May 26 16:24:05 onl50t May 26 16:24:05 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_size is 8 bytes May 26 16:24:05 onl50t May 26 16:24:05 onl50t unix: NOTICE: cc_strategy: dma_addr = 4 bytes May 26 16:24:05 onl50t May 26 16:24:05 onl50t unix: NOTICE: cc_strategy: dma_addr = 0x6e8 May 26 16:24:05 onl50t May 26 16:24:05 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_address = 0x6e8 May 26 16:24:05 onl50t May 26 16:24:05 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_laddress = 0x6e8 May 26 16:24:05 onl50t May 26 16:24:05 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_size = 0x 2 May 26 16:24:05 onl50t May 26 16:24:05 onl50t unix: NOTICE: cc_strategy: contents of cc->dma_cookie.dm ac_address =0x0, 0x0, 0x0, 0x0 May 26 16:24:05 onl50t May 26 16:24:05 onl50t unix: NOTICE: cc_strategy: read: cc->kreg->maclo = 0x6e8 May 26 16:24:05 onl50t May 26 16:24:05 onl50t unix: NOTICE: cc_strategy: read: cc->kreg->machi = 0x0 May 26 16:24:05 onl50t May 26 16:24:19 onl50t unix: NOTICE: cc_intr: enter intrrupt: cc->kreg->csr = 0 x0 May 26 16:24:19 onl50t May 26 16:24:19 onl50t unix: NOTICE: cc_intr: wc = 0x1 May 26 16:24:19 onl50t May 26 16:24:19 onl50t unix: NOTICE: cc_intr: cc->dma_cookie.dmac_address = 0x6 e8 May 26 16:24:19 onl50t May 26 16:24:19 onl50t unix: NOTICE: cc_intr: contents of cc->dma_cookie.dmac_a ddress =0x0, 0x0, 0x0, 0x0 May 26 16:24:19 onl50t May 26 16:24:19 onl50t unix: NOTICE: cc->kreg->maclo = 0x6f5 May 26 16:24:19 onl50t May 26 16:24:19 onl50t unix: NOTICE: cc->kreg->machi = 0x0 May 26 16:24:19 onl50t May 26 16:24:19 onl50t unix: NOTICE: cc_intr: CC_INT_EMPTY: step02. May 26 16:24:19 onl50t unix: NOTICE: cc_intr: CC_INT_ABORT: step02. May 26 16:24:19 onl50t unix: NOTICE: cc_intr: exit intrrupt: cc->kreg->csr = 0x 0 May 26 16:24:19 onl50t May 26 16:24:19 onl50t unix: NOTICE: camac_b: read: cc->kreg->csr = 0x0 May 26 16:24:19 onl50t May 26 16:24:19 onl50t unix: NOTICE: out: 269119772 0 40 0 2 May 26 16:24:19 onl50t unix: NOTICE: cc_write: cc->interrupt = 0xc May 26 16:24:19 onl50t May 26 16:24:19 onl50t unix: NOTICE: cc_write: cc->kreg->donv = 0xff00 May 26 16:24:19 onl50t May 26 16:24:19 onl50t unix: NOTICE: cc_write: cc->kreg->csr = 0x0 May 26 16:24:19 onl50t onl50t console login: onl50t console login: onl50t console login: onl50t console login: May 26 16:24:46 onl50t unix: NOTICE: cc_write: cc->kreg-> csr = 0x80 May 26 16:24:46 onl50t May 26 16:24:46 onl50t unix: NOTICE: cc_write: CC_CMD_DOBLOCK: iov->iov_base = 0x4e46e8 May 26 16:24:46 onl50t May 26 16:24:46 onl50t unix: NOTICE: cc_write: CC_CMD_DOBLOCK: contents of iov- >iov_base = 0x5 May 26 16:24:46 onl50t May 26 16:24:46 onl50t unix: NOTICE: in: 0x4e46e8 2 1 42 0 0 May 26 16:24:46 onl50t unix: NOTICE: camac_b: write: call physio --- uio = 0x4c 7940 May 26 16:24:46 onl50t May 26 16:24:46 onl50t unix: NOTICE: cc_strategy: mode = 0x2a May 26 16:24:46 onl50t May 26 16:24:46 onl50t unix: NOTICE: cc_strategy: naf = 0x610 May 26 16:24:46 onl50t May 26 16:24:46 onl50t unix: NOTICE: cc_strategy: wc = 0x1 May 26 16:24:46 onl50t May 26 16:24:46 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_address i s 4 bytes May 26 16:24:46 onl50t May 26 16:24:46 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_size is 8 bytes May 26 16:24:46 onl50t May 26 16:24:46 onl50t unix: NOTICE: cc_strategy: dma_addr = 4 bytes May 26 16:24:46 onl50t May 26 16:24:46 onl50t unix: NOTICE: cc_strategy: dma_addr = 0x6e8 May 26 16:24:46 onl50t May 26 16:24:46 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_address = 0x6e8 May 26 16:24:46 onl50t May 26 16:24:46 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_laddress = 0x6e8 May 26 16:24:46 onl50t May 26 16:24:46 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_size = 0x 2 May 26 16:24:46 onl50t May 26 16:24:46 onl50t unix: NOTICE: cc_strategy: contents of cc->dma_cookie.dm ac_address =0x5, 0x0, 0x0, 0x0 May 26 16:24:46 onl50t BAD TRAP: cpu=0 type=0x31 rp=0x2a100053880 addr=0x0 mmu_fsr=0x0 BAD TRAP occurred in module "unix" due to a NULL pointer dereference. sched: trap type = 0x31 pid=0, pc=0x10036564, sp=0x2a100053121, tstate=0x1602, context=0x0 g1-g7: 2a100053d60, 1041ef68, 0, 8, 30000573ed8, 0, 2a100053d60 Begin traceback... sp = 2a100053121 Called from 10074cbc, fp=2a1000531d1, args=98 0 20 10423600 30000aef5c0 0 Called from 100ebd00, fp=2a100053281, args=30000033000 cf1a 30000033038 1 800000 0000000000 30000034908 Called from 1002e110, fp=2a100053351, args=3000002bf88 0 10000 30000573eb2 30000 573eb0 30000573ea8 Called from 100ebb70, fp=0, args=30000573e80 0 0 0 0 0 End traceback... panic[cpu0]/thread=2a100053d60: trap syncing file systems...panic[cpu0]/thread=2a100057d60: panic sync timeout dumping to /dev/dsk/c0t3d0s3, offset 31260672 100% done: 4185 pages dumped, compression ratio 3.57, dump succeeded rebooting... Resetting ... : A32スペースでは全くアクセスできない。 元のA24スペースに戻してシステムを ブートし直した。 (5-5). DMA 見直し(その4) A24スペース, AMコード3F で実行してみる。 onl50t[40]% 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 >1 Input n a f >3 0 16 Input data >3 *buf = 0x3, *(buf+1) = 0x0, *(buf+2) = 0x0, *(buf+3) = 0x0 *buf = 0x3, *(buf+1) = 0x0, *(buf+2) = 0x0, *(buf+3) = 0x0 MODE=1 N= 3 A= 0 F=16 len= 1 lenr= 0 error= 0(Hex) Data( 1)= 3 0x 3(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 0 *buf = 0x0, *(buf+1) = 0x0, *(buf+2) = 0x0, *(buf+3) = 0x0 Freeze May 29 10:12:56 onl50t unix: CAMAC device driver V1.4x, 1991-1993 by Y.TAKEUCHI (T.I.T.) May 29 10:13:48 onl50t unix: NOTICE: cc_write: cc->kreg->csr = 0xa0 May 29 10:13:48 onl50t May 29 10:13:48 onl50t unix: NOTICE: cc_write: CC_CMD_DOBLOCK: iov->iov_base = 0x4e46e8 May 29 10:13:48 onl50t May 29 10:13:48 onl50t unix: NOTICE: cc_write: CC_CMD_DOBLOCK: contents of iov- >iov_base = 0x3 May 29 10:13:48 onl50t May 29 10:13:48 onl50t unix: NOTICE: in: 0x4e46e8 2 1 42 0 0 May 29 10:13:48 onl50t unix: NOTICE: camac_b: write: call physio --- uio = 0x3e f940 May 29 10:13:48 onl50t May 29 10:13:48 onl50t unix: NOTICE: cc_strategy: mode = 0x2a May 29 10:13:48 onl50t May 29 10:13:48 onl50t unix: NOTICE: cc_strategy: naf = 0x610 May 29 10:13:48 onl50t May 29 10:13:48 onl50t unix: NOTICE: cc_strategy: wc = 0x1 May 29 10:13:48 onl50t May 29 10:13:48 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_address i s 4 bytes May 29 10:13:48 onl50t May 29 10:13:48 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_size is 8 bytes May 29 10:13:48 onl50t May 29 10:13:48 onl50t unix: NOTICE: cc_strategy: dma_addr = 4 bytes May 29 10:13:48 onl50t May 29 10:13:48 onl50t unix: NOTICE: cc_strategy: dma_addr = 0x6e8 May 29 10:13:48 onl50t May 29 10:13:48 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_address = 0x6e8 May 29 10:13:48 onl50t May 29 10:13:48 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_laddress = 0x6e8 May 29 10:13:48 onl50t May 29 10:13:48 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_size = 0x 2 May 29 10:13:48 onl50t May 29 10:13:48 onl50t unix: NOTICE: cc_strategy: contents of cc->dma_cookie.dm ac_address =0x3, 0x0, 0x0, 0x0 May 29 10:13:48 onl50t May 29 10:13:48 onl50t unix: NOTICE: cc_intr: enter intrrupt: cc->kreg->csr = 0 x461 May 29 10:13:48 onl50t May 29 10:13:48 onl50t unix: NOTICE: cc_intr: wc = 0x1 May 29 10:13:48 onl50t May 29 10:13:48 onl50t unix: NOTICE: cc_intr: cc->dma_cookie.dmac_address = 0x6 e8 May 29 10:13:48 onl50t May 29 10:13:48 onl50t unix: NOTICE: cc_intr: contents of cc->dma_cookie.dmac_a ddress =0x3, 0x0, 0x0, 0x0 May 29 10:13:48 onl50t May 29 10:13:48 onl50t unix: NOTICE: cc->kreg->maclo = 0x6e8 May 29 10:13:48 onl50t May 29 10:13:48 onl50t unix: NOTICE: cc->kreg->machi = 0x0 May 29 10:13:48 onl50t May 29 10:13:48 onl50t unix: NOTICE: cc_intr: CC_INT_EMPTY: step02. May 29 10:13:48 onl50t unix: NOTICE: cc_intr: CC_INT_ABORT: step02. May 29 10:13:48 onl50t unix: NOTICE: cc_intr: exit intrrupt: cc->kreg->csr = 0x 461 May 29 10:13:48 onl50t May 29 10:13:48 onl50t unix: NOTICE: camac_b: write: cc->kreg->csr = 0x461 May 29 10:13:48 onl50t May 29 10:13:48 onl50t unix: NOTICE: out: 269119772 0 40 0 2 May 29 10:13:48 onl50t unix: NOTICE: cc_write: cc->interrupt = 0xc May 29 10:13:48 onl50t May 29 10:13:48 onl50t unix: NOTICE: cc_write: cc->kreg->donv = 0xffff May 29 10:13:48 onl50t May 29 10:13:48 onl50t unix: NOTICE: cc_write: cc->kreg->csr = 0x461 May 29 10:13:48 onl50t A24スペース, AMコード3E で実行してみる。 onl50t[40]% 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 >1 Input n a f >3 0 16 Input data >3 *buf = 0x3, *(buf+1) = 0x0, *(buf+2) = 0x0, *(buf+3) = 0x0 *buf = 0x3, *(buf+1) = 0x0, *(buf+2) = 0x0, *(buf+3) = 0x0 MODE=1 N= 3 A= 0 F=16 len= 1 lenr= 0 error= 0(Hex) Data( 1)= 3 0x 3(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 0 *buf = 0x0, *(buf+1) = 0x0, *(buf+2) = 0x0, *(buf+3) = 0x0 Freeze May 29 10:24:50 onl50t unix: CAMAC device driver V1.4x, 1991-1993 by Y.TAKEUCHI (T.I.T.) May 29 10:25:36 onl50t unix: NOTICE: cc_write: cc->kreg->csr = 0xa0 May 29 10:25:36 onl50t May 29 10:25:36 onl50t unix: NOTICE: cc_write: CC_CMD_DOBLOCK: iov->iov_base = 0x4e46e8 May 29 10:25:36 onl50t May 29 10:25:36 onl50t unix: NOTICE: cc_write: CC_CMD_DOBLOCK: contents of iov- >iov_base = 0x3 May 29 10:25:36 onl50t May 29 10:25:36 onl50t unix: NOTICE: in: 0x4e46e8 2 1 42 0 0 May 29 10:25:36 onl50t unix: NOTICE: camac_b: write: call physio --- uio = 0x1e 5940 May 29 10:25:36 onl50t May 29 10:25:36 onl50t unix: NOTICE: cc_strategy: mode = 0x2a May 29 10:25:36 onl50t May 29 10:25:36 onl50t unix: NOTICE: cc_strategy: naf = 0x610 May 29 10:25:36 onl50t May 29 10:25:36 onl50t unix: NOTICE: cc_strategy: wc = 0x1 May 29 10:25:36 onl50t May 29 10:25:36 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_address i s 4 bytes May 29 10:25:36 onl50t May 29 10:25:36 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_size is 8 bytes May 29 10:25:36 onl50t May 29 10:25:36 onl50t unix: NOTICE: cc_strategy: dma_addr = 4 bytes May 29 10:25:36 onl50t May 29 10:25:36 onl50t unix: NOTICE: cc_strategy: dma_addr = 0x6e8 May 29 10:25:36 onl50t May 29 10:25:36 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_address = 0x6e8 May 29 10:25:36 onl50t May 29 10:25:36 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_laddress = 0x6e8 May 29 10:25:36 onl50t May 29 10:25:36 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_size = 0x 2 May 29 10:25:36 onl50t May 29 10:25:36 onl50t unix: NOTICE: cc_strategy: contents of cc->dma_cookie.dm ac_address =0x3, 0x0, 0x0, 0x0 May 29 10:25:36 onl50t May 29 10:25:36 onl50t unix: NOTICE: cc_intr: enter intrrupt: cc->kreg->csr = 0 x461 May 29 10:25:36 onl50t May 29 10:25:36 onl50t unix: NOTICE: cc_intr: wc = 0x1 May 29 10:25:36 onl50t May 29 10:25:36 onl50t unix: NOTICE: cc_intr: cc->dma_cookie.dmac_address = 0x6 e8 May 29 10:25:36 onl50t May 29 10:25:36 onl50t unix: NOTICE: cc_intr: contents of cc->dma_cookie.dmac_a ddress =0x3, 0x0, 0x0, 0x0 May 29 10:25:36 onl50t May 29 10:25:36 onl50t unix: NOTICE: cc->kreg->maclo = 0x6e8 May 29 10:25:36 onl50t May 29 10:25:36 onl50t unix: NOTICE: cc->kreg->machi = 0x0 May 29 10:25:36 onl50t May 29 10:25:36 onl50t unix: NOTICE: cc_intr: CC_INT_EMPTY: step02. May 29 10:25:36 onl50t unix: NOTICE: cc_intr: CC_INT_ABORT: step02. May 29 10:25:36 onl50t unix: NOTICE: cc_intr: exit intrrupt: cc->kreg->csr = 0x 461 May 29 10:25:36 onl50t May 29 10:25:36 onl50t unix: NOTICE: camac_b: write: cc->kreg->csr = 0x461 May 29 10:25:36 onl50t May 29 10:25:36 onl50t unix: NOTICE: out: 269119772 0 40 0 2 May 29 10:25:36 onl50t unix: NOTICE: cc_write: cc->interrupt = 0xc May 29 10:25:36 onl50t May 29 10:25:36 onl50t unix: NOTICE: cc_write: cc->kreg->donv = 0xffff May 29 10:25:36 onl50t May 29 10:25:36 onl50t unix: NOTICE: cc_write: cc->kreg->csr = 0x461 May 29 10:25:36 onl50t 元々の設定は A24スペース, AMコード3D である。 この設定では正しく動作 しないことはすでに解っているので、ここではやらない。 AMコード3C は予約 コードなので使用されていない。 A24スペース, AMコード3B で実行してみる onl50t[40]% 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 >1 Input n a f >3 0 16 Input data >3 *buf = 0x3, *(buf+1) = 0x0, *(buf+2) = 0x0, *(buf+3) = 0x0 *buf = 0x3, *(buf+1) = 0x0, *(buf+2) = 0x0, *(buf+3) = 0x0 MODE=1 N= 3 A= 0 F=16 len= 1 lenr= 0 error= 0(Hex) Data( 1)= 3 0x 3(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 0 *buf = 0x0, *(buf+1) = 0x0, *(buf+2) = 0x0, *(buf+3) = 0x0 Freeze May 29 10:37:29 onl50t unix: CAMAC device driver V1.4x, 1991-1993 by Y.TAKEUCHI (T.I.T.) May 29 10:38:20 onl50t unix: NOTICE: cc_write: cc->kreg->csr = 0xa0 May 29 10:38:20 onl50t May 29 10:38:20 onl50t unix: NOTICE: cc_write: CC_CMD_DOBLOCK: iov->iov_base = 0x4e46e8 May 29 10:38:20 onl50t May 29 10:38:20 onl50t unix: NOTICE: cc_write: CC_CMD_DOBLOCK: contents of iov- >iov_base = 0x3 May 29 10:38:20 onl50t May 29 10:38:20 onl50t unix: NOTICE: in: 0x4e46e8 2 1 42 0 0 May 29 10:38:20 onl50t unix: NOTICE: camac_b: write: call physio --- uio = 0x3b 7940 May 29 10:38:20 onl50t May 29 10:38:20 onl50t unix: NOTICE: cc_strategy: mode = 0x2a May 29 10:38:20 onl50t May 29 10:38:20 onl50t unix: NOTICE: cc_strategy: naf = 0x610 May 29 10:38:20 onl50t May 29 10:38:20 onl50t unix: NOTICE: cc_strategy: wc = 0x1 May 29 10:38:20 onl50t May 29 10:38:20 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_address i s 4 bytes May 29 10:38:20 onl50t May 29 10:38:20 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_size is 8 bytes May 29 10:38:20 onl50t May 29 10:38:20 onl50t unix: NOTICE: cc_strategy: dma_addr = 4 bytes May 29 10:38:20 onl50t May 29 10:38:20 onl50t unix: NOTICE: cc_strategy: dma_addr = 0x6e8 May 29 10:38:20 onl50t May 29 10:38:20 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_address = 0x6e8 May 29 10:38:20 onl50t May 29 10:38:20 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_laddress = 0x6e8 May 29 10:38:20 onl50t May 29 10:38:20 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_size = 0x 2 May 29 10:38:20 onl50t May 29 10:38:20 onl50t unix: NOTICE: cc_strategy: contents of cc->dma_cookie.dm ac_address =0x3, 0x0, 0x0, 0x0 May 29 10:38:20 onl50t May 29 10:38:20 onl50t unix: NOTICE: cc_intr: enter intrrupt: cc->kreg->csr = 0 x461 May 29 10:38:20 onl50t May 29 10:38:20 onl50t unix: NOTICE: cc_intr: wc = 0x1 May 29 10:38:20 onl50t May 29 10:38:20 onl50t unix: NOTICE: cc_intr: cc->dma_cookie.dmac_address = 0x6 e8 May 29 10:38:20 onl50t May 29 10:38:20 onl50t unix: NOTICE: cc_intr: contents of cc->dma_cookie.dmac_a ddress =0x3, 0x0, 0x0, 0x0 May 29 10:38:20 onl50t May 29 10:38:20 onl50t unix: NOTICE: cc->kreg->maclo = 0x6e8 May 29 10:38:20 onl50t May 29 10:38:20 onl50t unix: NOTICE: cc->kreg->machi = 0x0 May 29 10:38:20 onl50t May 29 10:38:20 onl50t unix: NOTICE: cc_intr: CC_INT_EMPTY: step02. May 29 10:38:20 onl50t unix: NOTICE: cc_intr: CC_INT_ABORT: step02. May 29 10:38:20 onl50t unix: NOTICE: cc_intr: exit intrrupt: cc->kreg->csr = 0x 461 May 29 10:38:20 onl50t May 29 10:38:20 onl50t unix: NOTICE: camac_b: write: cc->kreg->csr = 0x461 May 29 10:38:20 onl50t May 29 10:38:20 onl50t unix: NOTICE: out: 269119772 0 40 0 2 May 29 10:38:20 onl50t unix: NOTICE: cc_write: cc->interrupt = 0xc May 29 10:38:20 onl50t May 29 10:38:20 onl50t unix: NOTICE: cc_write: cc->kreg->donv = 0xffff May 29 10:38:20 onl50t May 29 10:38:20 onl50t unix: NOTICE: cc_write: cc->kreg->csr = 0x461 May 29 10:38:20 onl50t onl50t console login: A24スペース, AMコード3A で実行してみる onl50t[40]% 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 >1 Input n a f >3 0 16 Input data >3 *buf = 0x3, *(buf+1) = 0x0, *(buf+2) = 0x0, *(buf+3) = 0x0 *buf = 0x3, *(buf+1) = 0x0, *(buf+2) = 0x0, *(buf+3) = 0x0 MODE=1 N= 3 A= 0 F=16 len= 1 lenr= 0 error= 0(Hex) Data( 1)= 3 0x 3(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 0 *buf = 0x0, *(buf+1) = 0x0, *(buf+2) = 0x0, *(buf+3) = 0x0 Freeze May 29 13:32:11 onl50t unix: CAMAC device driver V1.4x, 1991-1993 by Y.TAKEUCHI (T.I.T.) May 29 13:33:02 onl50t unix: NOTICE: cc_write: cc->kreg->csr = 0xa0 May 29 13:33:02 onl50t May 29 13:33:02 onl50t unix: NOTICE: cc_write: CC_CMD_DOBLOCK: iov->iov_base = 0x4e46e8 May 29 13:33:02 onl50t May 29 13:33:02 onl50t unix: NOTICE: cc_write: CC_CMD_DOBLOCK: contents of iov- >iov_base = 0x3 May 29 13:33:02 onl50t May 29 13:33:02 onl50t unix: NOTICE: in: 0x4e46e8 2 1 42 0 0 May 29 13:33:02 onl50t unix: NOTICE: camac_b: write: call physio --- uio = 0x3f 9940 May 29 13:33:02 onl50t May 29 13:33:02 onl50t unix: NOTICE: cc_strategy: mode = 0x2a May 29 13:33:02 onl50t May 29 13:33:02 onl50t unix: NOTICE: cc_strategy: naf = 0x610 May 29 13:33:02 onl50t May 29 13:33:02 onl50t unix: NOTICE: cc_strategy: wc = 0x1 May 29 13:33:02 onl50t May 29 13:33:02 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_address i s 4 bytes May 29 13:33:02 onl50t May 29 13:33:02 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_size is 8 bytes May 29 13:33:02 onl50t May 29 13:33:02 onl50t unix: NOTICE: cc_strategy: dma_addr = 4 bytes May 29 13:33:02 onl50t May 29 13:33:02 onl50t unix: NOTICE: cc_strategy: dma_addr = 0x6e8 May 29 13:33:02 onl50t May 29 13:33:02 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_address = 0x6e8 May 29 13:33:02 onl50t May 29 13:33:02 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_laddress = 0x6e8 May 29 13:33:02 onl50t May 29 13:33:02 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_size = 0x 2 May 29 13:33:02 onl50t May 29 13:33:02 onl50t unix: NOTICE: cc_strategy: contents of cc->dma_cookie.dm ac_address =0x3, 0x0, 0x0, 0x0 May 29 13:33:02 onl50t May 29 13:33:02 onl50t unix: NOTICE: cc_intr: enter intrrupt: cc->kreg->csr = 0 x461 May 29 13:33:02 onl50t May 29 13:33:02 onl50t unix: NOTICE: cc_intr: wc = 0x1 May 29 13:33:02 onl50t May 29 13:33:02 onl50t unix: NOTICE: cc_intr: cc->dma_cookie.dmac_address = 0x6 e8 May 29 13:33:02 onl50t May 29 13:33:02 onl50t unix: NOTICE: cc_intr: contents of cc->dma_cookie.dmac_a ddress =0x3, 0x0, 0x0, 0x0 May 29 13:33:02 onl50t May 29 13:33:02 onl50t unix: NOTICE: cc->kreg->maclo = 0x6e8 May 29 13:33:02 onl50t May 29 13:33:02 onl50t unix: NOTICE: cc->kreg->machi = 0x0 May 29 13:33:02 onl50t May 29 13:33:02 onl50t unix: NOTICE: cc_intr: CC_INT_EMPTY: step02. May 29 13:33:02 onl50t unix: NOTICE: cc_intr: CC_INT_ABORT: step02. May 29 13:33:02 onl50t unix: NOTICE: cc_intr: exit intrrupt: cc->kreg->csr = 0x 461 May 29 13:33:02 onl50t May 29 13:33:02 onl50t unix: NOTICE: camac_b: write: cc->kreg->csr = 0x461 May 29 13:33:02 onl50t May 29 13:33:02 onl50t unix: NOTICE: out: 269119772 0 40 0 2 May 29 13:33:02 onl50t unix: NOTICE: cc_write: cc->interrupt = 0xc May 29 13:33:02 onl50t May 29 13:33:02 onl50t unix: NOTICE: cc_write: cc->kreg->donv = 0xffff May 29 13:33:02 onl50t May 29 13:33:02 onl50t unix: NOTICE: cc_write: cc->kreg->csr = 0x461 May 29 13:33:02 onl50t onl50t console login: onl50t console login: onl50t console login: May 29 13:39:25 onl50t unix: NOTICE: cc_write: cc->kreg-> csr = 0x461 May 29 13:39:25 onl50t May 29 13:39:25 onl50t unix: NOTICE: cc_write: CC_CMD_DOBLOCK: iov->iov_base = 0x4e46e8 May 29 13:39:25 onl50t May 29 13:39:25 onl50t unix: NOTICE: cc_write: CC_CMD_DOBLOCK: contents of iov- >iov_base = 0x0 May 29 13:39:25 onl50t May 29 13:39:25 onl50t unix: NOTICE: in: 0x4e46e8 2 1 42 0 0 May 29 13:39:25 onl50t unix: NOTICE: camac_b: read: call physio --- uio = 0x3f9 940 May 29 13:39:25 onl50t May 29 13:39:25 onl50t unix: NOTICE: cc_strategy: mode = 0x2a May 29 13:39:25 onl50t May 29 13:39:25 onl50t unix: NOTICE: cc_strategy: naf = 0x600 May 29 13:39:25 onl50t May 29 13:39:25 onl50t unix: NOTICE: cc_strategy: wc = 0x1 May 29 13:39:25 onl50t May 29 13:39:25 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_address i s 4 bytes May 29 13:39:25 onl50t May 29 13:39:25 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_size is 8 bytes May 29 13:39:25 onl50t May 29 13:39:25 onl50t unix: NOTICE: cc_strategy: dma_addr = 4 bytes May 29 13:39:25 onl50t May 29 13:39:25 onl50t unix: NOTICE: cc_strategy: dma_addr = 0x6e8 May 29 13:39:25 onl50t May 29 13:39:25 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_address = 0x6e8 May 29 13:39:25 onl50t May 29 13:39:25 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_laddress = 0x6e8 May 29 13:39:25 onl50t May 29 13:39:25 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_size = 0x 2 May 29 13:39:25 onl50t May 29 13:39:25 onl50t unix: NOTICE: cc_strategy: contents of cc->dma_cookie.dm ac_address =0x0, 0x0, 0x0, 0x0 May 29 13:39:25 onl50t May 29 13:39:25 onl50t unix: NOTICE: cc_strategy: read: cc->kreg->maclo = 0x6e8 May 29 13:39:25 onl50t May 29 13:39:25 onl50t unix: NOTICE: cc_strategy: read: cc->kreg->machi = 0x0 May 29 13:39:25 onl50t BAD TRAP: cpu=0 type=0x31 rp=0x2a100053880 addr=0x0 mmu_fsr=0x0 BAD TRAP occurred in module "unix" due to a NULL pointer dereference. sched: trap type = 0x31 pid=0, pc=0x10036564, sp=0x2a100053121, tstate=0xf0001607, context=0x0 g1-g7: 2a100053d60, 1041ef68, 0, 8, 30000573ed8, 0, 2a100053d60 Begin traceback... sp = 2a100053121 Called from 10074cbc, fp=2a1000531d1, args=98 0 20 10423600 300000d16b8 0 Called from 100ebd00, fp=2a100053281, args=30000033000 106115 30000033038 1 8000 000000000000 300000348e0 Called from 1002e110, fp=2a100053351, args=3000002bf48 0 10000 30000573eb2 30000 573eb0 30000573ea8 Called from 100ebb70, fp=0, args=30000573e80 0 0 0 0 0 End traceback... panic[cpu0]/thread=2a100053d60: trap syncing file systems...panic[cpu0]/thread=2a100057d60: panic sync timeout dumping to /dev/dsk/c0t3d0s3, offset 31260672 100% done: 4142 pages dumped, compression ratio 3.57, dump succeeded rebooting... Resetting ... : A24スペース, AMコード39 で実行してみる onl50t[40]% 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 >1 Input n a f >3 0 16 Input data >3 *buf = 0x3, *(buf+1) = 0x0, *(buf+2) = 0x0, *(buf+3) = 0x0 *buf = 0x3, *(buf+1) = 0x0, *(buf+2) = 0x0, *(buf+3) = 0x0 MODE=1 N= 3 A= 0 F=16 len= 1 lenr= 0 error= 0(Hex) Data( 1)= 3 0x 3(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 0 *buf = 0x0, *(buf+1) = 0x0, *(buf+2) = 0x0, *(buf+3) = 0x0 Freeze May 29 13:48:28 onl50t unix: CAMAC device driver V1.4x, 1991-1993 by Y.TAKEUCHI (T.I.T.) May 29 13:49:33 onl50t unix: NOTICE: cc_write: cc->kreg->csr = 0xa0 May 29 13:49:33 onl50t May 29 13:49:33 onl50t unix: NOTICE: cc_write: CC_CMD_DOBLOCK: iov->iov_base = 0x4e46e8 May 29 13:49:33 onl50t May 29 13:49:33 onl50t unix: NOTICE: cc_write: CC_CMD_DOBLOCK: contents of iov- >iov_base = 0x3 May 29 13:49:33 onl50t May 29 13:49:33 onl50t unix: NOTICE: in: 0x4e46e8 2 1 42 0 0 May 29 13:49:33 onl50t unix: NOTICE: camac_b: write: call physio --- uio = 0x3c 3940 May 29 13:49:33 onl50t May 29 13:49:33 onl50t unix: NOTICE: cc_strategy: mode = 0x2a May 29 13:49:33 onl50t May 29 13:49:33 onl50t unix: NOTICE: cc_strategy: naf = 0x610 May 29 13:49:33 onl50t May 29 13:49:33 onl50t unix: NOTICE: cc_strategy: wc = 0x1 May 29 13:49:33 onl50t May 29 13:49:33 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_address i s 4 bytes May 29 13:49:33 onl50t May 29 13:49:33 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_size is 8 bytes May 29 13:49:33 onl50t May 29 13:49:33 onl50t unix: NOTICE: cc_strategy: dma_addr = 4 bytes May 29 13:49:33 onl50t May 29 13:49:33 onl50t unix: NOTICE: cc_strategy: dma_addr = 0x6e8 May 29 13:49:33 onl50t May 29 13:49:33 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_address = 0x6e8 May 29 13:49:33 onl50t May 29 13:49:33 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_laddress = 0x6e8 May 29 13:49:33 onl50t May 29 13:49:33 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_size = 0x 2 May 29 13:49:33 onl50t May 29 13:49:33 onl50t unix: NOTICE: cc_strategy: contents of cc->dma_cookie.dm ac_address =0x3, 0x0, 0x0, 0x0 May 29 13:49:33 onl50t May 29 13:49:33 onl50t unix: NOTICE: cc_intr: enter intrrupt: cc->kreg->csr = 0 x461 May 29 13:49:33 onl50t May 29 13:49:33 onl50t unix: NOTICE: cc_intr: wc = 0x1 May 29 13:49:33 onl50t May 29 13:49:33 onl50t unix: NOTICE: cc_intr: cc->dma_cookie.dmac_address = 0x6 e8 May 29 13:49:33 onl50t May 29 13:49:33 onl50t unix: NOTICE: cc_intr: contents of cc->dma_cookie.dmac_a ddress =0x3, 0x0, 0x0, 0x0 May 29 13:49:33 onl50t May 29 13:49:33 onl50t unix: NOTICE: cc->kreg->maclo = 0x6e8 May 29 13:49:33 onl50t May 29 13:49:33 onl50t unix: NOTICE: cc->kreg->machi = 0x0 May 29 13:49:33 onl50t May 29 13:49:33 onl50t unix: NOTICE: cc_intr: CC_INT_EMPTY: step02. May 29 13:49:33 onl50t unix: NOTICE: cc_intr: CC_INT_ABORT: step02. May 29 13:49:33 onl50t unix: NOTICE: cc_intr: exit intrrupt: cc->kreg->csr = 0x 461 May 29 13:49:33 onl50t May 29 13:49:33 onl50t unix: NOTICE: camac_b: write: cc->kreg->csr = 0x461 May 29 13:49:33 onl50t May 29 13:49:33 onl50t unix: NOTICE: out: 269119772 0 40 0 2 May 29 13:49:33 onl50t unix: NOTICE: cc_write: cc->interrupt = 0xc May 29 13:49:33 onl50t May 29 13:49:33 onl50t unix: NOTICE: cc_write: cc->kreg->donv = 0xffff May 29 13:49:33 onl50t May 29 13:49:33 onl50t unix: NOTICE: cc_write: cc->kreg->csr = 0x461 May 29 13:49:33 onl50t onl50t console login: onl50t console login: (5-5). DMA 見直し(その5) 割り込みがかかった時に、uio->uio_iov->iov_baseアドレスの内容を確認して みる。 onl50t[39]% 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 >1 Input n a f >3 1 0 *buf = 0x0, *(buf+1) = 0x0, *(buf+2) = 0x0, *(buf+3) = 0x0 *buf = 0x3, *(buf+1) = 0x0, *(buf+2) = 0x0, *(buf+3) = 0x0 MODE=1 N= 3 A= 1 F= 0 len= 1 lenr= 1 error= 0(Hex) Data( 1)= 3 0x 3(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 >5 *buf = 0x5, *(buf+1) = 0x0, *(buf+2) = 0x0, *(buf+3) = 0x0 *buf = 0x5, *(buf+1) = 0x0, *(buf+2) = 0x0, *(buf+3) = 0x0 MODE=1 N= 3 A= 0 F=16 len= 1 lenr= 0 error= 0(Hex) Data( 1)= 5 0x 5(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 0 *buf = 0x0, *(buf+1) = 0x0, *(buf+2) = 0x0, *(buf+3) = 0x0 Freeze May 30 14:23:57 onl50t unix: CAMAC device driver V1.4x, 1991-1993 by Y.TAKEUCHI (T.I.T.) May 30 14:24:37 onl50t unix: NOTICE: cc_write: cc->kreg->csr = 0xa0 May 30 14:24:37 onl50t May 30 14:24:37 onl50t unix: NOTICE: cc_write: CC_CMD_DOBLOCK: iov->iov_base = 0x4e46e8 May 30 14:24:37 onl50t May 30 14:24:37 onl50t unix: NOTICE: cc_write: CC_CMD_DOBLOCK: contents of iov- >iov_base = 0x0 May 30 14:24:37 onl50t May 30 14:24:37 onl50t unix: NOTICE: in: 0x4e46e8 2 1 42 0 0 May 30 14:24:37 onl50t unix: NOTICE: camac_b: read: call physio --- uio = 0x1c9 940 May 30 14:24:37 onl50t May 30 14:24:37 onl50t unix: NOTICE: cc_strategy: mode = 0x2a May 30 14:24:37 onl50t May 30 14:24:37 onl50t unix: NOTICE: cc_strategy: naf = 0x620 May 30 14:24:37 onl50t May 30 14:24:37 onl50t unix: NOTICE: cc_strategy: wc = 0x1 May 30 14:24:37 onl50t May 30 14:24:37 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_address i s 4 bytes May 30 14:24:37 onl50t May 30 14:24:37 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_size is 8 bytes May 30 14:24:37 onl50t May 30 14:24:37 onl50t unix: NOTICE: cc_strategy: dma_addr = 4 bytes May 30 14:24:37 onl50t May 30 14:24:37 onl50t unix: NOTICE: cc_strategy: dma_addr = 0x6e8 May 30 14:24:37 onl50t May 30 14:24:37 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_address = 0x6e8 May 30 14:24:37 onl50t May 30 14:24:37 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_laddress = 0x6e8 May 30 14:24:37 onl50t May 30 14:24:37 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_size = 0x 2 May 30 14:24:37 onl50t May 30 14:24:37 onl50t unix: NOTICE: cc_strategy: contents of cc->dma_cookie.dm ac_address =0x0, 0x0, 0x0, 0x0 May 30 14:24:37 onl50t May 30 14:24:37 onl50t unix: NOTICE: cc_strategy: read: cc->kreg->maclo = 0x6e8 May 30 14:24:37 onl50t May 30 14:24:37 onl50t unix: NOTICE: cc_strategy: read: cc->kreg->machi = 0x0 May 30 14:24:37 onl50t May 30 14:24:37 onl50t unix: NOTICE: cc_intr: enter intrrupt: cc->kreg->csr = 0 x80 May 30 14:24:37 onl50t May 30 14:24:37 onl50t unix: NOTICE: cc_intr: wc = 0x0 May 30 14:24:37 onl50t May 30 14:24:37 onl50t unix: NOTICE: in: 0x4e46e8 2 1 42 0 0 May 30 14:24:37 onl50t unix: NOTICE: cc_intr: cc->dma_cookie.dmac_address = 0x6 e8 May 30 14:24:37 onl50t May 30 14:24:37 onl50t unix: NOTICE: cc_intr: contents of cc->dma_cookie.dmac_a ddress =0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 May 30 14:24:37 onl50t May 30 14:24:37 onl50t unix: NOTICE: cc->kreg->maclo = 0x6ea May 30 14:24:37 onl50t May 30 14:24:37 onl50t unix: NOTICE: cc->kreg->machi = 0x0 May 30 14:24:37 onl50t May 30 14:24:37 onl50t unix: NOTICE: cc_intr: contents of uio->uio_iov->iov_bas e =0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 May 30 14:24:37 onl50t May 30 14:24:37 onl50t unix: NOTICE: cc_intr: CC_INT_DONE: step02. May 30 14:24:37 onl50t unix: NOTICE: cc_intr: CC_INT_EMPTY: step02. May 30 14:24:37 onl50t unix: NOTICE: cc_intr: CC_INT_ABORT: step02. May 30 14:24:37 onl50t unix: NOTICE: cc_intr: exit intrrupt: cc->kreg->csr = 0x 80 May 30 14:24:37 onl50t May 30 14:24:37 onl50t unix: NOTICE: camac_b: read: cc->kreg->csr = 0x80 May 30 14:24:37 onl50t May 30 14:24:37 onl50t unix: NOTICE: out: 269119772 0 40 0 2 May 30 14:24:37 onl50t unix: NOTICE: cc_write: cc->interrupt = 0xe May 30 14:24:37 onl50t May 30 14:24:37 onl50t unix: NOTICE: cc_write: cc->kreg->donv = 0xffff May 30 14:24:37 onl50t May 30 14:24:37 onl50t unix: NOTICE: cc_write: cc->kreg->csr = 0x80 May 30 14:24:37 onl50t onl50t console login: onl50t console login: onl50t console login: onl50t console login: onl50t console login: May 30 14:24:50 onl50t unix: NOTICE: cc_write: cc->kreg-> csr = 0x80 May 30 14:24:50 onl50t May 30 14:24:50 onl50t unix: NOTICE: cc_write: CC_CMD_DOBLOCK: iov->iov_base = 0x4e46e8 May 30 14:24:50 onl50t May 30 14:24:50 onl50t unix: NOTICE: cc_write: CC_CMD_DOBLOCK: contents of iov- >iov_base = 0x5 May 30 14:24:50 onl50t May 30 14:24:50 onl50t unix: NOTICE: in: 0x4e46e8 2 1 42 0 0 May 30 14:24:50 onl50t unix: NOTICE: camac_b: write: call physio --- uio = 0x1c 9940 May 30 14:24:50 onl50t May 30 14:24:50 onl50t unix: NOTICE: cc_strategy: mode = 0x2a May 30 14:24:50 onl50t May 30 14:24:50 onl50t unix: NOTICE: cc_strategy: naf = 0x610 May 30 14:24:50 onl50t May 30 14:24:50 onl50t unix: NOTICE: cc_strategy: wc = 0x1 May 30 14:24:50 onl50t May 30 14:24:50 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_address i s 4 bytes May 30 14:24:50 onl50t May 30 14:24:50 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_size is 8 bytes May 30 14:24:50 onl50t May 30 14:24:50 onl50t unix: NOTICE: cc_strategy: dma_addr = 4 bytes May 30 14:24:50 onl50t May 30 14:24:50 onl50t unix: NOTICE: cc_strategy: dma_addr = 0x6e8 May 30 14:24:50 onl50t May 30 14:24:50 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_address = 0x6e8 May 30 14:24:50 onl50t May 30 14:24:50 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_laddress = 0x6e8 May 30 14:24:50 onl50t May 30 14:24:50 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_size = 0x 2 May 30 14:24:50 onl50t May 30 14:24:50 onl50t unix: NOTICE: cc_strategy: contents of cc->dma_cookie.dm ac_address =0x5, 0x0, 0x0, 0x0 May 30 14:24:50 onl50t May 30 14:24:50 onl50t unix: NOTICE: cc_strategy: write: cc->kreg->maclo = 0x6e 8 May 30 14:24:50 onl50t May 30 14:24:50 onl50t unix: NOTICE: cc_strategy: write: cc->kreg->machi = 0x0 May 30 14:24:50 onl50t May 30 14:24:50 onl50t unix: NOTICE: cc_intr: enter intrrupt: cc->kreg->csr = 0 x461 May 30 14:24:50 onl50t May 30 14:24:50 onl50t unix: NOTICE: cc_intr: wc = 0x1 May 30 14:24:50 onl50t May 30 14:24:50 onl50t unix: NOTICE: in: 0x4e46e8 2 1 42 0 0 May 30 14:24:50 onl50t unix: NOTICE: cc_intr: cc->dma_cookie.dmac_address = 0x6 e8 May 30 14:24:50 onl50t May 30 14:24:50 onl50t unix: NOTICE: cc_intr: contents of cc->dma_cookie.dmac_a ddress =0x5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 May 30 14:24:50 onl50t May 30 14:24:50 onl50t unix: NOTICE: cc->kreg->maclo = 0x6e8 May 30 14:24:50 onl50t May 30 14:24:50 onl50t unix: NOTICE: cc->kreg->machi = 0x0 May 30 14:24:50 onl50t May 30 14:24:50 onl50t unix: NOTICE: cc_intr: contents of uio->uio_iov->iov_bas e =0x5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 May 30 14:24:50 onl50t May 30 14:24:50 onl50t unix: NOTICE: cc_intr: CC_INT_EMPTY: step02. May 30 14:24:50 onl50t unix: NOTICE: cc_intr: CC_INT_ABORT: step02. May 30 14:24:50 onl50t unix: NOTICE: cc_intr: exit intrrupt: cc->kreg->csr = 0x 461 May 30 14:24:50 onl50t May 30 14:24:50 onl50t unix: NOTICE: camac_b: write: cc->kreg->csr = 0x461 May 30 14:24:50 onl50t May 30 14:24:50 onl50t unix: NOTICE: out: 269119772 0 40 0 2 May 30 14:24:50 onl50t unix: NOTICE: cc_write: cc->interrupt = 0xe May 30 14:24:50 onl50t May 30 14:24:50 onl50t unix: NOTICE: cc_write: cc->kreg->donv = 0xffff May 30 14:24:50 onl50t May 30 14:24:50 onl50t unix: NOTICE: cc_write: cc->kreg->csr = 0x461 May 30 14:24:50 onl50t onl50t console login: onl50t console login: onl50t console login: onl50t console login: onl50t console login: May 30 14:25:02 onl50t unix: NOTICE: cc_write: cc->kreg-> csr = 0x461 May 30 14:25:02 onl50t May 30 14:25:02 onl50t unix: NOTICE: cc_write: CC_CMD_DOBLOCK: iov->iov_base = 0x4e46e8 May 30 14:25:02 onl50t May 30 14:25:02 onl50t unix: NOTICE: cc_write: CC_CMD_DOBLOCK: contents of iov- >iov_base = 0x0 May 30 14:25:02 onl50t May 30 14:25:02 onl50t unix: NOTICE: in: 0x4e46e8 2 1 42 0 0 May 30 14:25:02 onl50t unix: NOTICE: camac_b: read: call physio --- uio = 0x1c9 940 May 30 14:25:02 onl50t May 30 14:25:02 onl50t unix: NOTICE: cc_strategy: mode = 0x2a May 30 14:25:02 onl50t May 30 14:25:02 onl50t unix: NOTICE: cc_strategy: naf = 0x600 May 30 14:25:02 onl50t May 30 14:25:02 onl50t unix: NOTICE: cc_strategy: wc = 0x1 May 30 14:25:02 onl50t May 30 14:25:02 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_address i s 4 bytes May 30 14:25:02 onl50t May 30 14:25:02 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_size is 8 bytes May 30 14:25:02 onl50t May 30 14:25:02 onl50t unix: NOTICE: cc_strategy: dma_addr = 4 bytes May 30 14:25:02 onl50t May 30 14:25:02 onl50t unix: NOTICE: cc_strategy: dma_addr = 0x6e8 May 30 14:25:02 onl50t May 30 14:25:02 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_address = 0x6e8 May 30 14:25:02 onl50t May 30 14:25:02 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_laddress = 0x6e8 May 30 14:25:02 onl50t May 30 14:25:02 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_size = 0x 2 May 30 14:25:02 onl50t May 30 14:25:02 onl50t unix: NOTICE: cc_strategy: contents of cc->dma_cookie.dm ac_address =0x0, 0x0, 0x0, 0x0 May 30 14:25:02 onl50t May 30 14:25:02 onl50t unix: NOTICE: cc_strategy: read: cc->kreg->maclo = 0x6e8 May 30 14:25:02 onl50t May 30 14:25:02 onl50t unix: NOTICE: cc_strategy: read: cc->kreg->machi = 0x0 May 30 14:25:02 onl50t BAD TRAP: cpu=0 type=0x31 rp=0x2a100053880 addr=0x0 mmu_fsr=0x0 BAD TRAP occurred in module "unix" due to a NULL pointer dereference. sched: trap type = 0x31 pid=0, pc=0x10036564, sp=0x2a100053121, tstate=0xf0001601, context=0x0 g1-g7: 2a100053d60, 1041ef68, 0, 8, 30000573ed8, 0, 2a100053d60 Begin traceback... sp = 2a100053121 Called from 10074cbc, fp=2a1000531d1, args=98 0 20 10423600 300000d16b8 0 Called from 100ebd00, fp=2a100053281, args=30000033000 136e4 30000033038 1 80000 00000000000 30000034758 Called from 1002e110, fp=2a100053351, args=3000002bf68 0 10000 30000573eb2 30000 573eb0 30000573ea8 Called from 100ebb70, fp=0, args=30000573e80 0 0 0 0 0 End traceback... panic[cpu0]/thread=2a100053d60: trap syncing file systems...panic[cpu0]/thread=2a100057d60: panic sync timeout dumping to /dev/dsk/c0t3d0s3, offset 31260672 100% done: 4165 pages dumped, compression ratio 3.58, dump succeeded rebooting... Resetting ... : (A). ブロック転送 read (camac --> メモリへのDMA) DMA開始後 cc->dma_cookie.dmac_address = 0x6e8 へ書き込んだ データは、done直後のDMA資源解放前に確認すると、 uio->uio_iov->iov_base のアドレスへ正しく送られている。 この時、cc->dma_cookie.dmac_address を読んでもデータは見えない。 (B). ブロック転送 write (メモリ --> camacへのDMA) DMA開始後、"DMA buffer Empty" の割り込みがかかった時、 cc->dma_cookie.dmac_address を読むと、cam2プログラムで指定した writeデータが正しく見える。 この時、uio->uio_iov->iov_base の アドレスを読むと、cam2プログラムで指定したwriteデータが正しく 見える。 しかし、2917 のDMAコントローラからは空に見えている ようだ。 (5-6). DMA 見直し(その5) SPARC CPU-50t、Soalris2.6 で cam2 を実行した時のcc->dma_cookie.dmac_ address を見てみる。 Executing last command: boot -r Boot device: /pci@1f,0/scsi@4/disk@3,0:a File and args: -r 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: hme0 hme1. Hostname: onl50t Configuring the /devices directory FRCvme V2.3.1 VME Nexus ( Universe) NOTICE: VME: slavewin at vme=0x0, size=0x100000 space=0x302061f CAMAC device driver V1.4x, 1991-1993 by Y.TAKEUCHI (T.I.T.) cc0 at vme0: vme16d16 0xff00 VME level 4 vector 0xff sparc ipl 7 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 ufs filesystems /dev/rdsk/c0t3d0s5: is clean. /dev/rdsk/c0t3d0s4: is clean. /dev/rdsk/c0t3d0s7: is clean. /dev/rdsk/c0t3d0s3: is clean. checking for crash dump... add net default: gateway ICCFP1 NIS domainname is kek.jp starting rpc services: rpcbind keyserv done. Setting netmask of hme0 to 255.255.248.0 SUNW,hme1: Link Down - cable problem? Setting default interface for multicast: add net 224.0.0.0: gateway onl50t syslog service starting. Print services started. starting Kana-Kanji converters: cssd. volume management starting. Wnn6: Key License Server started.... Nihongo Multi Client Server (Wnn6 R2.30) Finished Reading Files The system is ready. onl50t console login: onl50t[52]% cam2 Input transfer mode (1:word 2:long word) >1 Input loop >1 Input mode (0:QSTOP 1:QIGNORE 2:QREPEAT 3:QSCAN) >1 Input data counts >1 Input n a f >3 1 0 MODE=1 N= 3 A= 1 F= 0 len= 1 lenr= 1 error= 0(Hex) Data( 1)= 3 0x 3(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) Note: Nonstandard floating-point mode enabled See the Numerical Computation Guide, ieee_sun(3M) onl50t[53]% cam2 Input transfer mode (1:word 2:long word) >1 Input loop >1 Input mode (0:QSTOP 1:QIGNORE 2:QREPEAT 3:QSCAN) >1 Input data counts >1 Input n a f >3 0 16 Input data >5 MODE=1 N= 3 A= 0 F=16 len= 1 lenr= 0 error= 0(Hex) Data( 1)= 5 0x 5(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) Note: Nonstandard floating-point mode enabled See the Numerical Computation Guide, ieee_sun(3M) onl50t[54]% 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 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 NOTICE: in: 0x3f5418 2 1 26 0 0 NOTICE: cc_strategy: debug step04-1. --- dma_addr = 0x1418 NOTICE: in: 0x3f5418 2 1 26 0 0 NOTICE: cc_strategy: debug step04-1. --- dma_addr = 0x1418 (5-7). DMA 見直し(その6) 大量のデータをブロック転送 write して様子をみてみる。 onl50t[40]% cam2 Input transfer mode (1:word 2:long word) >1 Input loop >1 Input mode (0:QSTOP 1:QIGNORE 2:QREPEAT 3:QSCAN) >1 Input data counts >56000 Input n a f >3 1 0 *buf = 0x0, *(buf+1) = 0x0, *(buf+2) = 0x0, *(buf+3) = 0x0 Freeze Jun 8 13:05:34 onl50t unix: NOTICE: cc_write: cc->kreg-> csr = 0xa0 Jun 8 13:05:34 onl50t Jun 8 13:05:34 onl50t unix: NOTICE: cc_write: CC_CMD_DOBLOCK: iov->iov_base = 0x4e46e8 Jun 8 13:05:34 onl50t Jun 8 13:05:34 onl50t unix: NOTICE: cc_write: CC_CMD_DOBLOCK: contents of iov- >iov_base = 0x0 Jun 8 13:05:34 onl50t Jun 8 13:05:34 onl50t unix: NOTICE: in: 0x4e46e8 112000 1 112040 0 0 Jun 8 13:05:34 onl50t unix: NOTICE: camac_b: read: call physio --- uio = 0x27d 940 Jun 8 13:05:34 onl50t Jun 8 13:05:34 onl50t unix: NOTICE: cc_strategy: mode = 0x2a Jun 8 13:05:34 onl50t Jun 8 13:05:34 onl50t unix: NOTICE: cc_strategy: naf = 0x620 Jun 8 13:05:34 onl50t Jun 8 13:05:34 onl50t unix: NOTICE: cc_strategy: wc = 0xdac0 Jun 8 13:05:34 onl50t Jun 8 13:05:34 onl50t unix: NOTICE: cc_strategy: cc->bp->b_flags = 0x200069 Jun 8 13:05:34 onl50t Jun 8 13:05:34 onl50t unix: NOTICE: cc_strategy: cc->bp->b_un.b_addr = 0x4e46e 8 Jun 8 13:05:34 onl50t Jun 8 13:05:34 onl50t unix: NOTICE: cc_strategy: cc->bp->b_bufsize = 0x0 Jun 8 13:05:34 onl50t Jun 8 13:05:34 onl50t unix: WARNING: cc_strategy: ddi_dma_buf_bind_handle faile d. ret= 1 ddi_dma_buf_bind_handle()関数がエラーになってしまった。 チェック。 onl50t[38]% pwd /usr/include/sys onl50t[39]% grep DDI_DMA_MAPPED * ddidmareq.h:#define DDI_DMA_MAPPED 0 sunddi.h: * memory object. This function returns DDI_DMA_MAPPED if the sunddi.h: * return value of DDI_DMA_PARTIAL_MAP instead of DDI_DMA_MAPPED. onl50t[40]% vi ddidmareq.h : /* * succeeded in satisfying request */ #define DDI_DMA_MAPPED 0 : /* * Succeeded in mapping a portion of the request. */ #define DDI_DMA_PARTIAL_MAP 1 : /* * A DMA handle is already used for a DMA */ #define DDI_DMA_INUSE -9 : /* * No resources to map request. */ #define DDI_DMA_NORESOURCES -1 /* * Can't establish a mapping to the specified object * (no specific reason). */ #define DDI_DMA_NOMAPPING -2 /* * The request is too big to be mapped. */ #define DDI_DMA_TOOBIG -3 : onl50t[41]% (5-8). DMA 見直し(その7) VME.conf、cc_dma_attr の設定を以下の状態にして実行してみる。 slavewin=0x000000,0x100000,0x01020000 pamc=0x10, 0x11 ; static ddi_dma_attr_t cc_dma_attr = { DMA_ATTR_V0, /* dma_attr_version */ (uint64_t)0x0, /* dma_attr_addr_lo */ (uint64_t)0xffffffff, /* dma_attr_addr_hi */ (uint64_t)0xffffffff, /* dma_attr_count_max */ (uint64_t)0x4, /* dma_attr_align */ /* 0xffff, */ /* dma_attr_burstsizes */ DEFAULT_BURSTSIZE | BURST32, /* dma_attr_burstsizes */ 0x4, /* dma_attr_minxfer */ (uint64_t)0xffff, /* dma_attr_maxxfer */ (uint64_t)0xffffff, /* dma_attr_seg */ 17, /* dma_attr_sgllen */ 512, /* dma_attr_granular */ 0, /* dma_attr_flags */ }; 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[37]% (5-8-1). ブロック転送 read を実行 1回目のブロック転送 read: スイッチレジスタの値を 0x3 に設定しておいて、3DMAワードを read した。 2回目のブロック転送 read: スイッチレジスタの値を 0x2 に設定しておいて、2DMAワードを read した。 onl50t[37]% cam2 Input transfer mode (1:word 2:long word) >1 Input loop >1 Input mode (0:QSTOP 1:QIGNORE 2:QREPEAT 3:QSCAN) >1 Input data counts >3 Input n a f >3 1 0 *buf = 0x0, *(buf+1) = 0x0, *(buf+2) = 0x0, *(buf+3) = 0x0 *buf = 0x3, *(buf+1) = 0x3, *(buf+2) = 0x3, *(buf+3) = 0x0 MODE=1 N= 3 A= 1 F= 0 len= 3 lenr= 3 error= 0(Hex) Data( 1)= 3 0x 3(Hex) Data( 2)= 3 0x 3(Hex) Data( 3)= 3 0x 3(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) Note: Nonstandard floating-point mode enabled See the Numerical Computation Guide, ieee_sun(3M) onl50t[38]% cam2 Input transfer mode (1:word 2:long word) >1 Input loop >1 Input mode (0:QSTOP 1:QIGNORE 2:QREPEAT 3:QSCAN) >1 Input data counts >2 Input n a f >3 1 0 *buf = 0x0, *(buf+1) = 0x0, *(buf+2) = 0x0, *(buf+3) = 0x0 *buf = 0x2, *(buf+1) = 0x2, *(buf+2) = 0x0, *(buf+3) = 0x0 MODE=1 N= 3 A= 1 F= 0 len= 2 lenr= 2 error= 0(Hex) Data( 1)= 2 0x 2(Hex) Data( 2)= 2 0x 2(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) Note: Nonstandard floating-point mode enabled See the Numerical Computation Guide, ieee_sun(3M) onl50t[39]% onl50t console login: Jun 9 14:31:59 onl50t unix: CAMAC device driver V1.4x, 19 91-1993 by Y.TAKEUCHI (T.I.T.) Jun 9 14:32:18 onl50t unix: NOTICE: cc_write: cc->kreg->csr = 0xa0 Jun 9 14:32:18 onl50t Jun 9 14:32:18 onl50t unix: NOTICE: cc_write: CC_CMD_DOBLOCK: iov->iov_base = 0x4e46e8 Jun 9 14:32:18 onl50t Jun 9 14:32:18 onl50t unix: NOTICE: cc_write: CC_CMD_DOBLOCK: contents of iov- >iov_base = 0x0 Jun 9 14:32:18 onl50t Jun 9 14:32:18 onl50t unix: NOTICE: in: 0x4e46e8 6 1 46 0 0 Jun 9 14:32:18 onl50t unix: NOTICE: camac_b: read: call physio --- uio = 0x369 940 Jun 9 14:32:18 onl50t Jun 9 14:32:18 onl50t unix: NOTICE: cc_strategy: mode = 0x2a Jun 9 14:32:18 onl50t Jun 9 14:32:18 onl50t unix: NOTICE: cc_strategy: naf = 0x620 Jun 9 14:32:18 onl50t Jun 9 14:32:18 onl50t unix: NOTICE: cc_strategy: wc = 0x3 Jun 9 14:32:18 onl50t Jun 9 14:32:18 onl50t unix: NOTICE: cc_strategy: cc->ccount = 0x1 Jun 9 14:32:18 onl50t Jun 9 14:32:18 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_address i s 4 bytes Jun 9 14:32:18 onl50t Jun 9 14:32:18 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_size is 8 bytes Jun 9 14:32:18 onl50t Jun 9 14:32:18 onl50t unix: NOTICE: cc_strategy: dma_addr = 4 bytes Jun 9 14:32:18 onl50t Jun 9 14:32:18 onl50t unix: NOTICE: cc_strategy: dma_addr = 0x6e8 Jun 9 14:32:18 onl50t Jun 9 14:32:18 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_address = 0x6e8 Jun 9 14:32:18 onl50t Jun 9 14:32:18 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_laddress = 0x6e8 Jun 9 14:32:18 onl50t Jun 9 14:32:18 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_size = 0x 6 Jun 9 14:32:18 onl50t Jun 9 14:32:18 onl50t unix: NOTICE: cc_strategy: contents of cc->dma_cookie.dm ac_address =0x0, 0x0, 0x0, 0x0 Jun 9 14:32:18 onl50t Jun 9 14:32:18 onl50t unix: NOTICE: cc_strategy: read: cc->kreg->maclo = 0x6e8 Jun 9 14:32:18 onl50t Jun 9 14:32:18 onl50t unix: NOTICE: cc_strategy: read: cc->kreg->machi = 0x0 Jun 9 14:32:18 onl50t Jun 9 14:32:18 onl50t unix: NOTICE: cc_intr: enter intrrupt: cc->kreg->csr = 0 x80 Jun 9 14:32:18 onl50t Jun 9 14:32:18 onl50t unix: NOTICE: cc_intr: cc->kreg->mtc(wc) = 0x0 Jun 9 14:32:18 onl50t Jun 9 14:32:18 onl50t unix: NOTICE: cc_intr: 0x4e46e8 6 1 46 0 0 Jun 9 14:32:18 onl50t unix: NOTICE: cc_intr: cc->dma_cookie.dmac_address = 0x6 e8 Jun 9 14:32:18 onl50t Jun 9 14:32:18 onl50t unix: NOTICE: cc_intr: contents of cc->dma_cookie.dmac_a ddress =0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 Jun 9 14:32:18 onl50t Jun 9 14:32:18 onl50t unix: NOTICE: cc_intr: cc->kreg->maclo = 0x6ee Jun 9 14:32:18 onl50t Jun 9 14:32:18 onl50t unix: NOTICE: cc_intr: cc->kreg->machi = 0x0 Jun 9 14:32:18 onl50t Jun 9 14:32:18 onl50t unix: NOTICE: cc_intr: contents of uio->uio_iov->iov_bas e =0x3, 0x3, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 Jun 9 14:32:18 onl50t Jun 9 14:32:18 onl50t unix: NOTICE: cc_intr: CC_INT_DONE: step02. Jun 9 14:32:18 onl50t unix: NOTICE: cc_intr: CC_INT_EMPTY: step02. Jun 9 14:32:18 onl50t unix: NOTICE: cc_intr: CC_INT_ABORT: step02. Jun 9 14:32:18 onl50t unix: NOTICE: cc_intr: exit intrrupt: cc->kreg->csr = 0x 80 Jun 9 14:32:18 onl50t Jun 9 14:32:18 onl50t unix: NOTICE: camac_b: read: cc->kreg->csr = 0x80 Jun 9 14:32:18 onl50t Jun 9 14:32:18 onl50t unix: NOTICE: out: 269119772 0 40 0 6 Jun 9 14:32:18 onl50t unix: NOTICE: camac_b: cc->len = 0x3, cc->k->mtc = 0x0 Jun 9 14:32:18 onl50t Jun 9 14:32:18 onl50t unix: NOTICE: cc_write: cc->interrupt = 0xe Jun 9 14:32:18 onl50t Jun 9 14:32:18 onl50t unix: NOTICE: cc_write: cc->kreg->donv = 0xffff Jun 9 14:32:18 onl50t Jun 9 14:32:18 onl50t unix: NOTICE: cc_write: cc->kreg->csr = 0x80 Jun 9 14:32:18 onl50t onl50t console login: onl50t console login: onl50t console login: onl50t console login: onl50t console login: onl50t console login: onl50t console login: Jun 9 14:33:13 onl50t unix: NOTICE: cc_write: cc->kreg-> csr = 0xa0 Jun 9 14:33:13 onl50t Jun 9 14:33:13 onl50t unix: NOTICE: cc_write: CC_CMD_DOBLOCK: iov->iov_base = 0x4e46e8 Jun 9 14:33:13 onl50t Jun 9 14:33:13 onl50t unix: NOTICE: cc_write: CC_CMD_DOBLOCK: contents of iov- >iov_base = 0x0 Jun 9 14:33:13 onl50t Jun 9 14:33:13 onl50t unix: NOTICE: in: 0x4e46e8 4 1 44 0 0 Jun 9 14:33:13 onl50t unix: NOTICE: camac_b: read: call physio --- uio = 0x369 940 Jun 9 14:33:13 onl50t Jun 9 14:33:13 onl50t unix: NOTICE: cc_strategy: mode = 0x2a Jun 9 14:33:13 onl50t Jun 9 14:33:13 onl50t unix: NOTICE: cc_strategy: naf = 0x620 Jun 9 14:33:13 onl50t Jun 9 14:33:13 onl50t unix: NOTICE: cc_strategy: wc = 0x2 Jun 9 14:33:13 onl50t Jun 9 14:33:13 onl50t unix: NOTICE: cc_strategy: cc->ccount = 0x1 Jun 9 14:33:13 onl50t Jun 9 14:33:13 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_address i s 4 bytes Jun 9 14:33:13 onl50t Jun 9 14:33:13 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_size is 8 bytes Jun 9 14:33:13 onl50t Jun 9 14:33:13 onl50t unix: NOTICE: cc_strategy: dma_addr = 4 bytes Jun 9 14:33:13 onl50t Jun 9 14:33:13 onl50t unix: NOTICE: cc_strategy: dma_addr = 0x6e8 Jun 9 14:33:13 onl50t Jun 9 14:33:13 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_address = 0x6e8 Jun 9 14:33:13 onl50t Jun 9 14:33:13 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_laddress = 0x6e8 Jun 9 14:33:13 onl50t Jun 9 14:33:13 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_size = 0x 4 Jun 9 14:33:13 onl50t Jun 9 14:33:13 onl50t unix: NOTICE: cc_strategy: contents of cc->dma_cookie.dm ac_address =0x0, 0x0, 0x3, 0x0 Jun 9 14:33:13 onl50t Jun 9 14:33:13 onl50t unix: NOTICE: cc_strategy: read: cc->kreg->maclo = 0x6e8 Jun 9 14:33:13 onl50t Jun 9 14:33:13 onl50t unix: NOTICE: cc_strategy: read: cc->kreg->machi = 0x0 Jun 9 14:33:13 onl50t Jun 9 14:33:13 onl50t unix: NOTICE: cc_intr: enter intrrupt: cc->kreg->csr = 0 x80 Jun 9 14:33:13 onl50t Jun 9 14:33:13 onl50t unix: NOTICE: cc_intr: cc->kreg->mtc(wc) = 0x0 Jun 9 14:33:13 onl50t Jun 9 14:33:13 onl50t unix: NOTICE: cc_intr: 0x4e46e8 4 1 44 0 0 Jun 9 14:33:13 onl50t unix: NOTICE: cc_intr: cc->dma_cookie.dmac_address = 0x6 e8 Jun 9 14:33:13 onl50t Jun 9 14:33:13 onl50t unix: NOTICE: cc_intr: contents of cc->dma_cookie.dmac_a ddress =0x0, 0x0, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 Jun 9 14:33:13 onl50t Jun 9 14:33:13 onl50t unix: NOTICE: cc_intr: cc->kreg->maclo = 0x6ec Jun 9 14:33:13 onl50t Jun 9 14:33:13 onl50t unix: NOTICE: cc_intr: cc->kreg->machi = 0x0 Jun 9 14:33:13 onl50t Jun 9 14:33:13 onl50t unix: NOTICE: cc_intr: contents of uio->uio_iov->iov_bas e =0x2, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 Jun 9 14:33:13 onl50t Jun 9 14:33:13 onl50t unix: NOTICE: cc_intr: CC_INT_DONE: step02. Jun 9 14:33:13 onl50t unix: NOTICE: cc_intr: CC_INT_EMPTY: step02. Jun 9 14:33:13 onl50t unix: NOTICE: cc_intr: CC_INT_ABORT: step02. Jun 9 14:33:13 onl50t unix: NOTICE: cc_intr: exit intrrupt: cc->kreg->csr = 0x 80 Jun 9 14:33:13 onl50t Jun 9 14:33:13 onl50t unix: NOTICE: camac_b: read: cc->kreg->csr = 0x80 Jun 9 14:33:13 onl50t Jun 9 14:33:13 onl50t unix: NOTICE: out: 269119772 0 40 0 4 Jun 9 14:33:13 onl50t unix: NOTICE: camac_b: cc->len = 0x2, cc->k->mtc = 0x0 Jun 9 14:33:13 onl50t Jun 9 14:33:13 onl50t unix: NOTICE: cc_write: cc->interrupt = 0xe Jun 9 14:33:13 onl50t Jun 9 14:33:13 onl50t unix: NOTICE: cc_write: cc->kreg->donv = 0xffff Jun 9 14:33:13 onl50t Jun 9 14:33:13 onl50t unix: NOTICE: cc_write: cc->kreg->csr = 0x80 Jun 9 14:33:13 onl50t (5-8-2). ブロック転送 write を実行 1回目のブロック転送 write: writeデータを 0x5 に設定しておいて、3DMAワードを write した。 2回目のブロック転送 write: writeデータを 0x7 に設定しておいて、2DMAワードを write した。 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[40]% onl50t[40]% cam2 Input transfer mode (1:word 2:long word) >1 Input loop >1 Input mode (0:QSTOP 1:QIGNORE 2:QREPEAT 3:QSCAN) >1 Input data counts >3 Input n a f >3 0 16 Input data >5 *buf = 0x5, *(buf+1) = 0x5, *(buf+2) = 0x5, *(buf+3) = 0x0 *buf = 0x5, *(buf+1) = 0x5, *(buf+2) = 0x5, *(buf+3) = 0x0 MODE=1 N= 3 A= 0 F=16 len= 3 lenr= 3 error= 0(Hex) Data( 1)= 5 0x 5(Hex) Data( 2)= 5 0x 5(Hex) Data( 3)= 5 0x 5(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) Note: Nonstandard floating-point mode enabled See the Numerical Computation Guide, ieee_sun(3M) onl50t[41]% onl50t[41]% cam2 Input transfer mode (1:word 2:long word) >1 Input loop >1 Input mode (0:QSTOP 1:QIGNORE 2:QREPEAT 3:QSCAN) >1 Input data counts >2 Input n a f >3 0 16 Input data >7 *buf = 0x7, *(buf+1) = 0x7, *(buf+2) = 0x0, *(buf+3) = 0x0 *buf = 0x7, *(buf+1) = 0x7, *(buf+2) = 0x0, *(buf+3) = 0x0 MODE=1 N= 3 A= 0 F=16 len= 2 lenr= 2 error= 0(Hex) Data( 1)= 7 0x 7(Hex) Data( 2)= 7 0x 7(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) Note: Nonstandard floating-point mode enabled See the Numerical Computation Guide, ieee_sun(3M) onl50t[42]% Jun 9 14:52:55 onl50t unix: CAMAC device driver V1.4x, 1991-1993 by Y.TAKEUCHI (T.I.T.) Jun 9 14:54:16 onl50t unix: NOTICE: cc_write: cc->kreg->csr = 0xa0 Jun 9 14:54:16 onl50t Jun 9 14:54:16 onl50t unix: NOTICE: cc_write: CC_CMD_DOBLOCK: iov->iov_base = 0x4e46e8 Jun 9 14:54:16 onl50t Jun 9 14:54:16 onl50t unix: NOTICE: cc_write: CC_CMD_DOBLOCK: contents of iov- >iov_base = 0x5 Jun 9 14:54:16 onl50t Jun 9 14:54:16 onl50t unix: NOTICE: in: 0x4e46e8 6 1 46 0 0 Jun 9 14:54:16 onl50t unix: NOTICE: camac_b: write: call physio --- uio = 0x36 9940 Jun 9 14:54:16 onl50t Jun 9 14:54:16 onl50t unix: NOTICE: cc_strategy: mode = 0x2a Jun 9 14:54:16 onl50t Jun 9 14:54:16 onl50t unix: NOTICE: cc_strategy: naf = 0x610 Jun 9 14:54:16 onl50t Jun 9 14:54:16 onl50t unix: NOTICE: cc_strategy: wc = 0x3 Jun 9 14:54:16 onl50t Jun 9 14:54:16 onl50t unix: NOTICE: cc_strategy: cc->ccount = 0x1 Jun 9 14:54:16 onl50t Jun 9 14:54:16 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_address i s 4 bytes Jun 9 14:54:16 onl50t Jun 9 14:54:16 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_size is 8 bytes Jun 9 14:54:16 onl50t Jun 9 14:54:16 onl50t unix: NOTICE: cc_strategy: dma_addr = 4 bytes Jun 9 14:54:16 onl50t Jun 9 14:54:16 onl50t unix: NOTICE: cc_strategy: dma_addr = 0x6e8 Jun 9 14:54:16 onl50t Jun 9 14:54:16 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_address = 0x6e8 Jun 9 14:54:16 onl50t Jun 9 14:54:16 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_laddress = 0x6e8 Jun 9 14:54:16 onl50t Jun 9 14:54:16 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_size = 0x 6 Jun 9 14:54:16 onl50t Jun 9 14:54:16 onl50t unix: NOTICE: cc_strategy: contents of cc->dma_cookie.dm ac_address =0x5, 0x0, 0x0, 0x0 Jun 9 14:54:16 onl50t Jun 9 14:54:16 onl50t unix: NOTICE: cc_strategy: write: cc->kreg->maclo = 0x6e 8 Jun 9 14:54:16 onl50t Jun 9 14:54:16 onl50t unix: NOTICE: cc_strategy: write: cc->kreg->machi = 0x0 Jun 9 14:54:16 onl50t Jun 9 14:54:16 onl50t unix: NOTICE: cc_intr: enter intrrupt: cc->kreg->csr = 0 xa0 Jun 9 14:54:16 onl50t Jun 9 14:54:16 onl50t unix: NOTICE: cc_intr: cc->kreg->mtc(wc) = 0x0 Jun 9 14:54:16 onl50t Jun 9 14:54:16 onl50t unix: NOTICE: cc_intr: 0x4e46e8 6 1 46 0 0 Jun 9 14:54:16 onl50t unix: NOTICE: cc_intr: cc->dma_cookie.dmac_address = 0x6 e8 Jun 9 14:54:16 onl50t Jun 9 14:54:16 onl50t unix: NOTICE: cc_intr: contents of cc->dma_cookie.dmac_a ddress =0x5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 Jun 9 14:54:16 onl50t Jun 9 14:54:16 onl50t unix: NOTICE: cc_intr: cc->kreg->maclo = 0x6ee Jun 9 14:54:16 onl50t Jun 9 14:54:16 onl50t unix: NOTICE: cc_intr: cc->kreg->machi = 0x0 Jun 9 14:54:16 onl50t Jun 9 14:54:16 onl50t unix: NOTICE: cc_intr: contents of uio->uio_iov->iov_bas e =0x5, 0x5, 0x5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 Jun 9 14:54:16 onl50t Jun 9 14:54:16 onl50t unix: NOTICE: cc_intr: CC_INT_DONE: step02. Jun 9 14:54:16 onl50t unix: NOTICE: cc_intr: CC_INT_EMPTY: step02. Jun 9 14:54:16 onl50t unix: NOTICE: cc_intr: CC_INT_ABORT: step02. Jun 9 14:54:16 onl50t unix: NOTICE: cc_intr: exit intrrupt: cc->kreg->csr = 0x a0 Jun 9 14:54:16 onl50t Jun 9 14:54:16 onl50t unix: NOTICE: camac_b: write: cc->kreg->csr = 0xa0 Jun 9 14:54:16 onl50t Jun 9 14:54:16 onl50t unix: NOTICE: out: 269119772 0 40 0 6 Jun 9 14:54:16 onl50t unix: NOTICE: camac_b: cc->len = 0x3, cc->k->mtc = 0x0 Jun 9 14:54:16 onl50t Jun 9 14:54:16 onl50t unix: NOTICE: cc_write: cc->interrupt = 0xe Jun 9 14:54:16 onl50t Jun 9 14:54:16 onl50t unix: NOTICE: cc_write: cc->kreg->donv = 0xffff Jun 9 14:54:16 onl50t Jun 9 14:54:16 onl50t unix: NOTICE: cc_write: cc->kreg->csr = 0xa0 Jun 9 14:54:16 onl50t onl50t console login: onl50t console login: onl50t console login: onl50t console login: onl50t console login: onl50t console login: Jun 9 14:54:55 onl50t unix: NOTICE: cc_write: cc->kreg-> csr = 0xa0 Jun 9 14:54:55 onl50t Jun 9 14:54:55 onl50t unix: NOTICE: cc_write: CC_CMD_DOBLOCK: iov->iov_base = 0x4e46e8 Jun 9 14:54:55 onl50t Jun 9 14:54:55 onl50t unix: NOTICE: cc_write: CC_CMD_DOBLOCK: contents of iov- >iov_base = 0x7 Jun 9 14:54:55 onl50t Jun 9 14:54:55 onl50t unix: NOTICE: in: 0x4e46e8 4 1 44 0 0 Jun 9 14:54:55 onl50t unix: NOTICE: camac_b: write: call physio --- uio = 0x36 9940 Jun 9 14:54:55 onl50t Jun 9 14:54:55 onl50t unix: NOTICE: cc_strategy: mode = 0x2a Jun 9 14:54:55 onl50t Jun 9 14:54:55 onl50t unix: NOTICE: cc_strategy: naf = 0x610 Jun 9 14:54:55 onl50t Jun 9 14:54:55 onl50t unix: NOTICE: cc_strategy: wc = 0x2 Jun 9 14:54:55 onl50t Jun 9 14:54:55 onl50t unix: NOTICE: cc_strategy: cc->ccount = 0x1 Jun 9 14:54:55 onl50t Jun 9 14:54:55 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_address i s 4 bytes Jun 9 14:54:55 onl50t Jun 9 14:54:55 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_size is 8 bytes Jun 9 14:54:55 onl50t Jun 9 14:54:55 onl50t unix: NOTICE: cc_strategy: dma_addr = 4 bytes Jun 9 14:54:55 onl50t Jun 9 14:54:55 onl50t unix: NOTICE: cc_strategy: dma_addr = 0x6e8 Jun 9 14:54:55 onl50t Jun 9 14:54:55 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_address = 0x6e8 Jun 9 14:54:55 onl50t Jun 9 14:54:55 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_laddress = 0x6e8 Jun 9 14:54:55 onl50t Jun 9 14:54:55 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_size = 0x 4 Jun 9 14:54:55 onl50t Jun 9 14:54:55 onl50t unix: NOTICE: cc_strategy: contents of cc->dma_cookie.dm ac_address =0x7, 0x0, 0x5, 0x0 Jun 9 14:54:55 onl50t Jun 9 14:54:55 onl50t unix: NOTICE: cc_strategy: write: cc->kreg->maclo = 0x6e 8 Jun 9 14:54:55 onl50t Jun 9 14:54:55 onl50t unix: NOTICE: cc_strategy: write: cc->kreg->machi = 0x0 Jun 9 14:54:55 onl50t Jun 9 14:54:55 onl50t unix: NOTICE: cc_intr: enter intrrupt: cc->kreg->csr = 0 xa0 Jun 9 14:54:55 onl50t Jun 9 14:54:55 onl50t unix: NOTICE: cc_intr: cc->kreg->mtc(wc) = 0x0 Jun 9 14:54:55 onl50t Jun 9 14:54:55 onl50t unix: NOTICE: cc_intr: 0x4e46e8 4 1 44 0 0 Jun 9 14:54:55 onl50t unix: NOTICE: cc_intr: cc->dma_cookie.dmac_address = 0x6 e8 Jun 9 14:54:55 onl50t Jun 9 14:54:55 onl50t unix: NOTICE: cc_intr: contents of cc->dma_cookie.dmac_a ddress =0x7, 0x0, 0x5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 Jun 9 14:54:55 onl50t Jun 9 14:54:55 onl50t unix: NOTICE: cc_intr: cc->kreg->maclo = 0x6ec Jun 9 14:54:55 onl50t Jun 9 14:54:55 onl50t unix: NOTICE: cc_intr: cc->kreg->machi = 0x0 Jun 9 14:54:55 onl50t Jun 9 14:54:55 onl50t unix: NOTICE: cc_intr: contents of uio->uio_iov->iov_bas e =0x7, 0x7, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 Jun 9 14:54:55 onl50t Jun 9 14:54:55 onl50t unix: NOTICE: cc_intr: CC_INT_DONE: step02. Jun 9 14:54:55 onl50t unix: NOTICE: cc_intr: CC_INT_EMPTY: step02. Jun 9 14:54:55 onl50t unix: NOTICE: cc_intr: CC_INT_ABORT: step02. Jun 9 14:54:55 onl50t unix: NOTICE: cc_intr: exit intrrupt: cc->kreg->csr = 0x a0 Jun 9 14:54:55 onl50t Jun 9 14:54:55 onl50t unix: NOTICE: camac_b: write: cc->kreg->csr = 0xa0 Jun 9 14:54:55 onl50t Jun 9 14:54:55 onl50t unix: NOTICE: out: 269119772 0 40 0 4 Jun 9 14:54:55 onl50t unix: NOTICE: camac_b: cc->len = 0x2, cc->k->mtc = 0x0 Jun 9 14:54:55 onl50t Jun 9 14:54:55 onl50t unix: NOTICE: cc_write: cc->interrupt = 0xe Jun 9 14:54:55 onl50t Jun 9 14:54:55 onl50t unix: NOTICE: cc_write: cc->kreg->donv = 0xffff Jun 9 14:54:55 onl50t Jun 9 14:54:55 onl50t unix: NOTICE: cc_write: cc->kreg->csr = 0xa0 Jun 9 14:54:55 onl50t (5-8-3). ブロック転送 write を実行 1回目のブロック転送 write: writeデータを 0x5 に設定しておいて、1DMAワードを write した。 2回目のブロック転送 write: writeデータを 0x7 に設定しておいて、2DMAワード write した。 onl50t[40]% cam2 Input transfer mode (1:word 2:long word) >1 Input loop >1 Input mode (0:QSTOP 1:QIGNORE 2:QREPEAT 3:QSCAN) >1 Input data counts >1 Input n a f >3 0 16 Input data >5 *buf = 0x5, *(buf+1) = 0x0, *(buf+2) = 0x0, *(buf+3) = 0x0 *buf = 0x5, *(buf+1) = 0x0, *(buf+2) = 0x0, *(buf+3) = 0x0 MODE=1 N= 3 A= 0 F=16 len= 1 lenr= 0 error= 0(Hex) Data( 1)= 5 0x 5(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) Note: Nonstandard floating-point mode enabled See the Numerical Computation Guide, ieee_sun(3M) onl50t[41]% onl50t[41]% cam2 Input transfer mode (1:word 2:long word) >1 Input loop >1 Input mode (0:QSTOP 1:QIGNORE 2:QREPEAT 3:QSCAN) >1 Input data counts >2 Input n a f >3 0 16 Input data >7 *buf = 0x7, *(buf+1) = 0x7, *(buf+2) = 0x0, *(buf+3) = 0x0 *buf = 0x7, *(buf+1) = 0x7, *(buf+2) = 0x0, *(buf+3) = 0x0 MODE=1 N= 3 A= 0 F=16 len= 2 lenr= 2 error= 0(Hex) Data( 1)= 7 0x 7(Hex) Data( 2)= 7 0x 7(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) Note: Nonstandard floating-point mode enabled See the Numerical Computation Guide, ieee_sun(3M) onl50t[42]% Jun 9 16:44:19 onl50t unix: CAMAC device driver V1.4x, 1991-1993 by Y.TAKEUCHI (T.I.T.) Jun 9 16:45:20 onl50t unix: NOTICE: cc_write: cc->kreg->csr = 0xa0 Jun 9 16:45:20 onl50t Jun 9 16:45:20 onl50t unix: NOTICE: cc_write: CC_CMD_DOBLOCK: iov->iov_base = 0x4e46e8 Jun 9 16:45:20 onl50t Jun 9 16:45:20 onl50t unix: NOTICE: cc_write: CC_CMD_DOBLOCK: contents of iov- >iov_base = 0x5 Jun 9 16:45:20 onl50t Jun 9 16:45:20 onl50t unix: NOTICE: in: 0x4e46e8 2 1 42 0 0 Jun 9 16:45:20 onl50t unix: NOTICE: camac_b: write: call physio --- uio = 0x39 3940 Jun 9 16:45:20 onl50t Jun 9 16:45:20 onl50t unix: NOTICE: cc_strategy: mode = 0x2a Jun 9 16:45:20 onl50t Jun 9 16:45:20 onl50t unix: NOTICE: cc_strategy: naf = 0x610 Jun 9 16:45:20 onl50t Jun 9 16:45:20 onl50t unix: NOTICE: cc_strategy: wc = 0x1 Jun 9 16:45:20 onl50t Jun 9 16:45:20 onl50t unix: NOTICE: cc_strategy: cc->ccount = 0x1 Jun 9 16:45:20 onl50t Jun 9 16:45:20 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_address i s 4 bytes Jun 9 16:45:20 onl50t Jun 9 16:45:20 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_size is 8 bytes Jun 9 16:45:20 onl50t Jun 9 16:45:20 onl50t unix: NOTICE: cc_strategy: dma_addr = 4 bytes Jun 9 16:45:20 onl50t Jun 9 16:45:20 onl50t unix: NOTICE: cc_strategy: dma_addr = 0x6e8 Jun 9 16:45:20 onl50t Jun 9 16:45:20 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_address = 0x6e8 Jun 9 16:45:20 onl50t Jun 9 16:45:20 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_laddress = 0x6e8 Jun 9 16:45:20 onl50t Jun 9 16:45:20 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_size = 0x 2 Jun 9 16:45:20 onl50t Jun 9 16:45:20 onl50t unix: NOTICE: cc_strategy: contents of cc->dma_cookie.dm ac_address =0x5, 0x0, 0x0, 0x0 Jun 9 16:45:20 onl50t Jun 9 16:45:20 onl50t unix: NOTICE: cc_strategy: write: cc->kreg->maclo = 0x6e 8 Jun 9 16:45:20 onl50t Jun 9 16:45:20 onl50t unix: NOTICE: cc_strategy: write: cc->kreg->machi = 0x0 Jun 9 16:45:20 onl50t Jun 9 16:45:20 onl50t unix: NOTICE: cc_intr: enter intrrupt: cc->kreg->csr = 0 x461 Jun 9 16:45:20 onl50t Jun 9 16:45:20 onl50t unix: NOTICE: cc_intr: cc->kreg->mtc(wc) = 0x1 Jun 9 16:45:20 onl50t Jun 9 16:45:20 onl50t unix: NOTICE: cc_intr: 0x4e46e8 2 1 42 0 0 Jun 9 16:45:20 onl50t unix: NOTICE: cc_intr: cc->dma_cookie.dmac_address = 0x6 e8 Jun 9 16:45:20 onl50t Jun 9 16:45:20 onl50t unix: NOTICE: cc_intr: contents of cc->dma_cookie.dmac_a ddress =0x5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 Jun 9 16:45:20 onl50t Jun 9 16:45:20 onl50t unix: NOTICE: cc_intr: cc->kreg->maclo = 0x6e8 Jun 9 16:45:20 onl50t Jun 9 16:45:20 onl50t unix: NOTICE: cc_intr: cc->kreg->machi = 0x0 Jun 9 16:45:20 onl50t Jun 9 16:45:20 onl50t unix: NOTICE: cc_intr: contents of uio->uio_iov->iov_bas e =0x5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 Jun 9 16:45:20 onl50t Jun 9 16:45:20 onl50t unix: NOTICE: cc_intr: CC_INT_EMPTY: step02. Jun 9 16:45:20 onl50t unix: NOTICE: cc_intr: CC_INT_ABORT: step02. Jun 9 16:45:20 onl50t unix: NOTICE: cc_intr: exit intrrupt: cc->kreg->csr = 0x 461 Jun 9 16:45:20 onl50t Jun 9 16:45:20 onl50t unix: NOTICE: camac_b: write: cc->kreg->csr = 0x461 Jun 9 16:45:20 onl50t Jun 9 16:45:20 onl50t unix: NOTICE: out: 269119772 0 40 0 2 Jun 9 16:45:20 onl50t unix: NOTICE: camac_b: cc->len = 0x1, cc->k->mtc = 0x1 Jun 9 16:45:20 onl50t Jun 9 16:45:20 onl50t unix: NOTICE: cc_write: cc->interrupt = 0xc Jun 9 16:45:20 onl50t Jun 9 16:45:20 onl50t unix: NOTICE: cc_write: cc->kreg->donv = 0xffff Jun 9 16:45:20 onl50t Jun 9 16:45:20 onl50t unix: NOTICE: cc_write: cc->kreg->csr = 0x461 Jun 9 16:45:20 onl50t onl50t console login: onl50t console login: onl50t console login: onl50t console login: onl50t console login: onl50t console login: Jun 9 16:45:58 onl50t unix: NOTICE: cc_write: cc->kreg-> csr = 0xa0 Jun 9 16:45:58 onl50t Jun 9 16:45:58 onl50t unix: NOTICE: cc_write: CC_CMD_DOBLOCK: iov->iov_base = 0x4e46e8 Jun 9 16:45:58 onl50t Jun 9 16:45:58 onl50t unix: NOTICE: cc_write: CC_CMD_DOBLOCK: contents of iov- >iov_base = 0x7 Jun 9 16:45:58 onl50t Jun 9 16:45:58 onl50t unix: NOTICE: in: 0x4e46e8 4 1 44 0 0 Jun 9 16:45:58 onl50t unix: NOTICE: camac_b: write: call physio --- uio = 0x39 3940 Jun 9 16:45:58 onl50t Jun 9 16:45:58 onl50t unix: NOTICE: cc_strategy: mode = 0x2a Jun 9 16:45:58 onl50t Jun 9 16:45:58 onl50t unix: NOTICE: cc_strategy: naf = 0x610 Jun 9 16:45:58 onl50t Jun 9 16:45:58 onl50t unix: NOTICE: cc_strategy: wc = 0x2 Jun 9 16:45:58 onl50t Jun 9 16:45:58 onl50t unix: NOTICE: cc_strategy: cc->ccount = 0x1 Jun 9 16:45:58 onl50t Jun 9 16:45:58 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_address i s 4 bytes Jun 9 16:45:58 onl50t Jun 9 16:45:58 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_size is 8 bytes Jun 9 16:45:58 onl50t Jun 9 16:45:58 onl50t unix: NOTICE: cc_strategy: dma_addr = 4 bytes Jun 9 16:45:58 onl50t Jun 9 16:45:58 onl50t unix: NOTICE: cc_strategy: dma_addr = 0x6e8 Jun 9 16:45:58 onl50t Jun 9 16:45:58 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_address = 0x6e8 Jun 9 16:45:58 onl50t Jun 9 16:45:58 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_laddress = 0x6e8 Jun 9 16:45:58 onl50t Jun 9 16:45:58 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_size = 0x 4 Jun 9 16:45:58 onl50t Jun 9 16:45:58 onl50t unix: NOTICE: cc_strategy: contents of cc->dma_cookie.dm ac_address =0x7, 0x0, 0x0, 0x0 Jun 9 16:45:58 onl50t Jun 9 16:45:58 onl50t unix: NOTICE: cc_strategy: write: cc->kreg->maclo = 0x6e 8 Jun 9 16:45:58 onl50t Jun 9 16:45:58 onl50t unix: NOTICE: cc_strategy: write: cc->kreg->machi = 0x0 Jun 9 16:45:58 onl50t Jun 9 16:45:58 onl50t unix: NOTICE: cc_intr: enter intrrupt: cc->kreg->csr = 0 xa0 Jun 9 16:45:58 onl50t Jun 9 16:45:58 onl50t unix: NOTICE: cc_intr: cc->kreg->mtc(wc) = 0x0 Jun 9 16:45:58 onl50t Jun 9 16:45:58 onl50t unix: NOTICE: cc_intr: 0x4e46e8 4 1 44 0 0 Jun 9 16:45:58 onl50t unix: NOTICE: cc_intr: cc->dma_cookie.dmac_address = 0x6 e8 Jun 9 16:45:58 onl50t Jun 9 16:45:58 onl50t unix: NOTICE: cc_intr: contents of cc->dma_cookie.dmac_a ddress =0x7, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 Jun 9 16:45:58 onl50t Jun 9 16:45:58 onl50t unix: NOTICE: cc_intr: cc->kreg->maclo = 0x6ec Jun 9 16:45:58 onl50t Jun 9 16:45:58 onl50t unix: NOTICE: cc_intr: cc->kreg->machi = 0x0 Jun 9 16:45:58 onl50t Jun 9 16:45:58 onl50t unix: NOTICE: cc_intr: contents of uio->uio_iov->iov_bas e =0x7, 0x7, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 Jun 9 16:45:58 onl50t Jun 9 16:45:58 onl50t unix: NOTICE: cc_intr: CC_INT_DONE: step02. Jun 9 16:45:58 onl50t unix: NOTICE: cc_intr: CC_INT_EMPTY: step02. Jun 9 16:45:58 onl50t unix: NOTICE: cc_intr: CC_INT_ABORT: step02. Jun 9 16:45:58 onl50t unix: NOTICE: cc_intr: exit intrrupt: cc->kreg->csr = 0x a0 Jun 9 16:45:58 onl50t Jun 9 16:45:58 onl50t unix: NOTICE: camac_b: write: cc->kreg->csr = 0xa0 Jun 9 16:45:58 onl50t Jun 9 16:45:58 onl50t unix: NOTICE: out: 269119772 0 40 0 4 Jun 9 16:45:58 onl50t unix: NOTICE: camac_b: cc->len = 0x2, cc->k->mtc = 0x0 Jun 9 16:45:58 onl50t Jun 9 16:45:58 onl50t unix: NOTICE: cc_write: cc->interrupt = 0xe Jun 9 16:45:58 onl50t Jun 9 16:45:58 onl50t unix: NOTICE: cc_write: cc->kreg->donv = 0xffff Jun 9 16:45:58 onl50t Jun 9 16:45:58 onl50t unix: NOTICE: cc_write: cc->kreg->csr = 0xa0 Jun 9 16:45:58 onl50t (5-8-4). ブロック転送 write を実行 ブロック転送 write で書いたデータが指定した通りに書けているかどうか確認 するために、データバッファの値を先頭から、1、2、3、4、....と変化する値 にして転送してみた。 1回目のブロック転送 write: 3DMAワードを write した。 2回目のブロック転送 write: 2DMAワードを write した。 3回目のブロック転送 write: 1DMAワードを write した。 onl50t[105]% vi cc64.c : static ddi_dma_attr_t cc_dma_attr = { DMA_ATTR_V0, /* dma_attr_version */ (uint64_t)0x0, /* dma_attr_addr_lo */ (uint64_t)0xffffffff, /* dma_attr_addr_hi */ (uint64_t)0xffffffff, /* dma_attr_count_max */ (uint64_t)0x4, /* dma_attr_align */ /* 0xffff, */ /* dma_attr_burstsizes */ DEFAULT_BURSTSIZE | BURST32, /* dma_attr_burstsizes */ /* 0x4, */ /* dma_attr_minxfer */ 0x1, (uint64_t)0xffff, /* dma_attr_maxxfer */ (uint64_t)0xffffff, /* dma_attr_seg */ /* 17, */ /* dma_attr_sgllen */ 1, 512, /* dma_attr_granular */ 0, /* dma_attr_flags */ }; : onl50t[106]% onl50t[106]% vi cam2a.f : do 200 j = 1, len if (nword .eq. 1) then CCC ndats(j) = dat ndats(j) = j else CCC ndat(j) = dat ndat(j) = j endif 200 continue : "cam2a.f" 84 lines, 2387 characters onl50t[107]% make -f Makefile-a clean \rm -f cc cc64 *.o libcamac.a cam1 cam2 cam2a cam3 *~ core onl50t[108]% make -f Makefile-a ./script/cc_build.sh [Building for sun4u] rm -f cc.o cc -xarch=v9 -O -c camlib.c -o camlib.o -I. cc -xarch=v9 -O -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 -xarch=v9 -O cam1.c -o cam1 -I. -L. -lcamac f77 -xarch=v9 -fast -O3 -u cam2.f -o cam2 -I. -L. -lcamac cam2.f: MAIN: cc -xarch=v9 -O cam3.c -o cam3 -I. -L. -lcamac f77 -xarch=v9 -fast -O3 -u cam2a.f -o cam2a -I. -L. -lcamac cam2a.f: MAIN: onl50t[109]% 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[111]% cam2a Input transfer mode (1:word 2:long word) >1 Input loop >1 Input mode (0:QSTOP 1:QIGNORE 2:QREPEAT 3:QSCAN) >1 Input data counts >3 Input n a f >3 0 16 Input data >7 *buf = 0x1, *(buf+1) = 0x2, *(buf+2) = 0x3, *(buf+3) = 0x0 *buf = 0x1, *(buf+1) = 0x2, *(buf+2) = 0x3, *(buf+3) = 0x0 MODE=1 N= 3 A= 0 F=16 len= 3 lenr= 3 error= 0(Hex) Data( 1)= 1 0x 1(Hex) Data( 2)= 2 0x 2(Hex) Data( 3)= 3 0x 3(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) Note: Nonstandard floating-point mode enabled See the Numerical Computation Guide, ieee_sun(3M) onl50t[112]% cam2a Input transfer mode (1:word 2:long word) >1 Input loop >1 Input mode (0:QSTOP 1:QIGNORE 2:QREPEAT 3:QSCAN) >1 Input data counts >2 Input n a f >3 0 16 Input data >7 *buf = 0x1, *(buf+1) = 0x2, *(buf+2) = 0x0, *(buf+3) = 0x0 *buf = 0x1, *(buf+1) = 0x2, *(buf+2) = 0x0, *(buf+3) = 0x0 MODE=1 N= 3 A= 0 F=16 len= 2 lenr= 2 error= 0(Hex) Data( 1)= 1 0x 1(Hex) Data( 2)= 2 0x 2(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) Note: Nonstandard floating-point mode enabled See the Numerical Computation Guide, ieee_sun(3M) onl50t[113]% onl50t[113]% cam2a Input transfer mode (1:word 2:long word) >1 Input loop >1 Input mode (0:QSTOP 1:QIGNORE 2:QREPEAT 3:QSCAN) >1 Input data counts >1 Input n a f >3 0 16 Input data >7 *buf = 0x1, *(buf+1) = 0x0, *(buf+2) = 0x0, *(buf+3) = 0x0 *buf = 0x1, *(buf+1) = 0x0, *(buf+2) = 0x0, *(buf+3) = 0x0 MODE=1 N= 3 A= 0 F=16 len= 1 lenr= 0 error= 0(Hex) Data( 1)= 1 0x 1(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) Note: Nonstandard floating-point mode enabled See the Numerical Computation Guide, ieee_sun(3M) onl50t[114]% Jun 12 09:32:22 onl50t unix: CAMAC device driver V1.4x, 1991-1993 by Y.TAKEUCHI (T.I.T.) Jun 12 09:33:11 onl50t unix: NOTICE: cc_write: cc->kreg-> csr = 0xa0 Jun 12 09:33:11 onl50t Jun 12 09:33:11 onl50t unix: NOTICE: cc_write: CC_CMD_DOBLOCK: iov->iov_base = 0x4e46e8 Jun 12 09:33:11 onl50t Jun 12 09:33:11 onl50t unix: NOTICE: cc_write: CC_CMD_DOBLOCK: contents of iov- >iov_base = 0x1 Jun 12 09:33:11 onl50t Jun 12 09:33:11 onl50t unix: NOTICE: in: 0x4e46e8 6 1 46 0 0 Jun 12 09:33:11 onl50t unix: NOTICE: camac_b: write: call physio --- uio = 0x40 b940 Jun 12 09:33:11 onl50t Jun 12 09:33:11 onl50t unix: NOTICE: cc_strategy: mode = 0x2a Jun 12 09:33:11 onl50t Jun 12 09:33:11 onl50t unix: NOTICE: cc_strategy: naf = 0x610 Jun 12 09:33:11 onl50t Jun 12 09:33:11 onl50t unix: NOTICE: cc_strategy: wc = 0x3 Jun 12 09:33:11 onl50t Jun 12 09:33:11 onl50t unix: NOTICE: cc_strategy: cc->ccount = 0x1 Jun 12 09:33:11 onl50t Jun 12 09:33:11 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_address i s 4 bytes Jun 12 09:33:11 onl50t Jun 12 09:33:11 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_size is 8 bytes Jun 12 09:33:11 onl50t Jun 12 09:33:11 onl50t unix: NOTICE: cc_strategy: dma_addr = 4 bytes Jun 12 09:33:11 onl50t Jun 12 09:33:11 onl50t unix: NOTICE: cc_strategy: dma_addr = 0x6e8 Jun 12 09:33:11 onl50t Jun 12 09:33:11 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_address = 0x6e8 Jun 12 09:33:11 onl50t Jun 12 09:33:11 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_laddress = 0x6e8 Jun 12 09:33:11 onl50t Jun 12 09:33:11 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_size = 0x 6 Jun 12 09:33:11 onl50t Jun 12 09:33:11 onl50t unix: NOTICE: cc_strategy: contents of cc->dma_cookie.dm ac_address =0x1, 0x0, 0x0, 0x0 Jun 12 09:33:11 onl50t Jun 12 09:33:11 onl50t unix: NOTICE: cc_strategy: write: cc->kreg->maclo = 0x6e 8 Jun 12 09:33:11 onl50t Jun 12 09:33:11 onl50t unix: NOTICE: cc_strategy: write: cc->kreg->machi = 0x0 Jun 12 09:33:11 onl50t Jun 12 09:33:11 onl50t unix: NOTICE: cc_intr: enter intrrupt: cc->kreg->csr = 0 xa0 Jun 12 09:33:11 onl50t Jun 12 09:33:11 onl50t unix: NOTICE: cc_intr: cc->kreg->mtc(wc) = 0x0 Jun 12 09:33:11 onl50t Jun 12 09:33:11 onl50t unix: NOTICE: cc_intr: 0x4e46e8 6 1 46 0 0 Jun 12 09:33:11 onl50t unix: NOTICE: cc_intr: cc->dma_cookie.dmac_address = 0x6 e8 Jun 12 09:33:11 onl50t Jun 12 09:33:11 onl50t unix: NOTICE: cc_intr: contents of cc->dma_cookie.dmac_a ddress =0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 Jun 12 09:33:11 onl50t Jun 12 09:33:11 onl50t unix: NOTICE: cc_intr: cc->kreg->maclo = 0x6ee Jun 12 09:33:11 onl50t Jun 12 09:33:11 onl50t unix: NOTICE: cc_intr: cc->kreg->machi = 0x0 Jun 12 09:33:11 onl50t Jun 12 09:33:11 onl50t unix: NOTICE: cc_intr: contents of uio->uio_iov->iov_bas e =0x1, 0x2, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 Jun 12 09:33:11 onl50t Jun 12 09:33:11 onl50t unix: NOTICE: cc_intr: CC_INT_DONE: step02. Jun 12 09:33:11 onl50t unix: NOTICE: cc_intr: CC_INT_EMPTY: step02. Jun 12 09:33:11 onl50t unix: NOTICE: cc_intr: CC_INT_ABORT: step02. Jun 12 09:33:11 onl50t unix: NOTICE: cc_intr: exit intrrupt: cc->kreg->csr = 0x a0 Jun 12 09:33:11 onl50t Jun 12 09:33:11 onl50t unix: NOTICE: camac_b: write: cc->kreg->csr = 0xa0 Jun 12 09:33:11 onl50t Jun 12 09:33:11 onl50t unix: NOTICE: out: 269119772 0 40 0 6 Jun 12 09:33:11 onl50t unix: NOTICE: camac_b: cc->len = 0x3, cc->k->mtc = 0x0 Jun 12 09:33:11 onl50t Jun 12 09:33:11 onl50t unix: NOTICE: cc_write: cc->interrupt = 0xe Jun 12 09:33:11 onl50t Jun 12 09:33:11 onl50t unix: NOTICE: cc_write: cc->kreg->donv = 0xffff Jun 12 09:33:11 onl50t Jun 12 09:33:11 onl50t unix: NOTICE: cc_write: cc->kreg->csr = 0xa0 Jun 12 09:33:11 onl50t onl50t console login: onl50t console login: onl50t console login: onl50t console login: onl50t console login: onl50t console login: Jun 12 09:34:16 onl50t unix: NOTICE: cc_write: cc->kreg-> csr = 0xa0 Jun 12 09:34:16 onl50t Jun 12 09:34:16 onl50t unix: NOTICE: cc_write: CC_CMD_DOBLOCK: iov->iov_base = 0x4e46e8 Jun 12 09:34:16 onl50t Jun 12 09:34:16 onl50t unix: NOTICE: cc_write: CC_CMD_DOBLOCK: contents of iov- >iov_base = 0x1 Jun 12 09:34:16 onl50t Jun 12 09:34:16 onl50t unix: NOTICE: in: 0x4e46e8 4 1 44 0 0 Jun 12 09:34:16 onl50t unix: NOTICE: camac_b: write: call physio --- uio = 0x40 b940 Jun 12 09:34:16 onl50t Jun 12 09:34:16 onl50t unix: NOTICE: cc_strategy: mode = 0x2a Jun 12 09:34:16 onl50t Jun 12 09:34:16 onl50t unix: NOTICE: cc_strategy: naf = 0x610 Jun 12 09:34:16 onl50t Jun 12 09:34:16 onl50t unix: NOTICE: cc_strategy: wc = 0x2 Jun 12 09:34:16 onl50t Jun 12 09:34:16 onl50t unix: NOTICE: cc_strategy: cc->ccount = 0x1 Jun 12 09:34:16 onl50t Jun 12 09:34:16 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_address i s 4 bytes Jun 12 09:34:16 onl50t Jun 12 09:34:16 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_size is 8 bytes Jun 12 09:34:16 onl50t Jun 12 09:34:16 onl50t unix: NOTICE: cc_strategy: dma_addr = 4 bytes Jun 12 09:34:16 onl50t Jun 12 09:34:16 onl50t unix: NOTICE: cc_strategy: dma_addr = 0x6e8 Jun 12 09:34:16 onl50t Jun 12 09:34:16 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_address = 0x6e8 Jun 12 09:34:16 onl50t Jun 12 09:34:16 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_laddress = 0x6e8 Jun 12 09:34:16 onl50t Jun 12 09:34:16 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_size = 0x 4 Jun 12 09:34:16 onl50t Jun 12 09:34:16 onl50t unix: NOTICE: cc_strategy: contents of cc->dma_cookie.dm ac_address =0x1, 0x0, 0x3, 0x0 Jun 12 09:34:16 onl50t Jun 12 09:34:16 onl50t unix: NOTICE: cc_strategy: write: cc->kreg->maclo = 0x6e 8 Jun 12 09:34:16 onl50t Jun 12 09:34:16 onl50t unix: NOTICE: cc_strategy: write: cc->kreg->machi = 0x0 Jun 12 09:34:16 onl50t Jun 12 09:34:16 onl50t unix: NOTICE: cc_intr: enter intrrupt: cc->kreg->csr = 0 xa0 Jun 12 09:34:16 onl50t Jun 12 09:34:16 onl50t unix: NOTICE: cc_intr: cc->kreg->mtc(wc) = 0x0 Jun 12 09:34:16 onl50t Jun 12 09:34:16 onl50t unix: NOTICE: cc_intr: 0x4e46e8 4 1 44 0 0 Jun 12 09:34:16 onl50t unix: NOTICE: cc_intr: cc->dma_cookie.dmac_address = 0x6 e8 Jun 12 09:34:16 onl50t Jun 12 09:34:16 onl50t unix: NOTICE: cc_intr: contents of cc->dma_cookie.dmac_a ddress =0x1, 0x0, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 Jun 12 09:34:16 onl50t Jun 12 09:34:16 onl50t unix: NOTICE: cc_intr: cc->kreg->maclo = 0x6ec Jun 12 09:34:16 onl50t Jun 12 09:34:16 onl50t unix: NOTICE: cc_intr: cc->kreg->machi = 0x0 Jun 12 09:34:16 onl50t Jun 12 09:34:16 onl50t unix: NOTICE: cc_intr: contents of uio->uio_iov->iov_bas e =0x1, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 Jun 12 09:34:16 onl50t Jun 12 09:34:16 onl50t unix: NOTICE: cc_intr: CC_INT_DONE: step02. Jun 12 09:34:16 onl50t unix: NOTICE: cc_intr: CC_INT_EMPTY: step02. Jun 12 09:34:16 onl50t unix: NOTICE: cc_intr: CC_INT_ABORT: step02. Jun 12 09:34:16 onl50t unix: NOTICE: cc_intr: exit intrrupt: cc->kreg->csr = 0x a0 Jun 12 09:34:16 onl50t Jun 12 09:34:16 onl50t unix: NOTICE: camac_b: write: cc->kreg->csr = 0xa0 Jun 12 09:34:16 onl50t Jun 12 09:34:16 onl50t unix: NOTICE: out: 269119772 0 40 0 4 Jun 12 09:34:16 onl50t unix: NOTICE: camac_b: cc->len = 0x2, cc->k->mtc = 0x0 Jun 12 09:34:16 onl50t Jun 12 09:34:16 onl50t unix: NOTICE: cc_write: cc->interrupt = 0xe Jun 12 09:34:16 onl50t Jun 12 09:34:16 onl50t unix: NOTICE: cc_write: cc->kreg->donv = 0xffff Jun 12 09:34:16 onl50t Jun 12 09:34:16 onl50t unix: NOTICE: cc_write: cc->kreg->csr = 0xa0 Jun 12 09:34:16 onl50t onl50t console login: onl50t console login: onl50t console login: onl50t console login: Jun 12 09:35:44 onl50t unix: NOTICE: cc_write: cc->kreg-> csr = 0xa0 Jun 12 09:35:44 onl50t Jun 12 09:35:44 onl50t unix: NOTICE: cc_write: CC_CMD_DOBLOCK: iov->iov_base = 0x4e46e8 Jun 12 09:35:44 onl50t Jun 12 09:35:44 onl50t unix: NOTICE: cc_write: CC_CMD_DOBLOCK: contents of iov- >iov_base = 0x1 Jun 12 09:35:44 onl50t Jun 12 09:35:44 onl50t unix: NOTICE: in: 0x4e46e8 2 1 42 0 0 Jun 12 09:35:44 onl50t unix: NOTICE: camac_b: write: call physio --- uio = 0x40 b940 Jun 12 09:35:44 onl50t Jun 12 09:35:44 onl50t unix: NOTICE: cc_strategy: mode = 0x2a Jun 12 09:35:44 onl50t Jun 12 09:35:44 onl50t unix: NOTICE: cc_strategy: naf = 0x610 Jun 12 09:35:44 onl50t Jun 12 09:35:44 onl50t unix: NOTICE: cc_strategy: wc = 0x1 Jun 12 09:35:44 onl50t Jun 12 09:35:44 onl50t unix: NOTICE: cc_strategy: cc->ccount = 0x1 Jun 12 09:35:44 onl50t Jun 12 09:35:44 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_address i s 4 bytes Jun 12 09:35:44 onl50t Jun 12 09:35:44 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_size is 8 bytes Jun 12 09:35:44 onl50t Jun 12 09:35:44 onl50t unix: NOTICE: cc_strategy: dma_addr = 4 bytes Jun 12 09:35:44 onl50t Jun 12 09:35:44 onl50t unix: NOTICE: cc_strategy: dma_addr = 0x6e8 Jun 12 09:35:44 onl50t Jun 12 09:35:44 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_address = 0x6e8 Jun 12 09:35:44 onl50t Jun 12 09:35:44 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_laddress = 0x6e8 Jun 12 09:35:44 onl50t Jun 12 09:35:44 onl50t unix: NOTICE: cc_strategy: cc->dma_cookie.dmac_size = 0x 2 Jun 12 09:35:44 onl50t Jun 12 09:35:44 onl50t unix: NOTICE: cc_strategy: contents of cc->dma_cookie.dm ac_address =0x1, 0x0, 0x0, 0x0 Jun 12 09:35:44 onl50t Jun 12 09:35:44 onl50t unix: NOTICE: cc_strategy: write: cc->kreg->maclo = 0x6e 8 Jun 12 09:35:44 onl50t Jun 12 09:35:44 onl50t unix: NOTICE: cc_strategy: write: cc->kreg->machi = 0x0 Jun 12 09:35:44 onl50t Jun 12 09:35:44 onl50t unix: NOTICE: cc_intr: enter intrrupt: cc->kreg->csr = 0 x461 Jun 12 09:35:44 onl50t Jun 12 09:35:44 onl50t unix: NOTICE: cc_intr: cc->kreg->mtc(wc) = 0x1 Jun 12 09:35:44 onl50t Jun 12 09:35:44 onl50t unix: NOTICE: cc_intr: 0x4e46e8 2 1 42 0 0 Jun 12 09:35:44 onl50t unix: NOTICE: cc_intr: cc->dma_cookie.dmac_address = 0x6 e8 Jun 12 09:35:44 onl50t Jun 12 09:35:44 onl50t unix: NOTICE: cc_intr: contents of cc->dma_cookie.dmac_a ddress =0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 Jun 12 09:35:44 onl50t Jun 12 09:35:44 onl50t unix: NOTICE: cc_intr: cc->kreg->maclo = 0x6e8 Jun 12 09:35:44 onl50t Jun 12 09:35:44 onl50t unix: NOTICE: cc_intr: cc->kreg->machi = 0x0 Jun 12 09:35:44 onl50t Jun 12 09:35:44 onl50t unix: NOTICE: cc_intr: contents of uio->uio_iov->iov_bas e =0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 Jun 12 09:35:44 onl50t Jun 12 09:35:44 onl50t unix: NOTICE: cc_intr: CC_INT_EMPTY: step02. Jun 12 09:35:44 onl50t unix: NOTICE: cc_intr: CC_INT_ABORT: step02. Jun 12 09:35:44 onl50t unix: NOTICE: cc_intr: exit intrrupt: cc->kreg->csr = 0x 461 Jun 12 09:35:44 onl50t Jun 12 09:35:44 onl50t unix: NOTICE: camac_b: write: cc->kreg->csr = 0x461 Jun 12 09:35:44 onl50t Jun 12 09:35:44 onl50t unix: NOTICE: out: 269119772 0 40 0 2 Jun 12 09:35:44 onl50t unix: NOTICE: camac_b: cc->len = 0x1, cc->k->mtc = 0x1 Jun 12 09:35:44 onl50t Jun 12 09:35:44 onl50t unix: NOTICE: cc_write: cc->interrupt = 0xe Jun 12 09:35:44 onl50t Jun 12 09:35:44 onl50t unix: NOTICE: cc_write: cc->kreg->donv = 0xffff Jun 12 09:35:44 onl50t Jun 12 09:35:44 onl50t unix: NOTICE: cc_write: cc->kreg->csr = 0x461 Jun 12 09:35:44 onl50t ---xxxx (6). 考察 (6-1). camac ドライバを64ビット対応にするために Solaris7は、32ビットおよび64ビットのアーキテクチャを完全にサポートする ように設計されている。 32ビットアプリケーションは、int、long および ポインタが32ビットである ILP32データ型モデルに基いている。 64ビット アプリケーションは、LP64データ型モデルに基いている。 LP64データ型モデル では、longとポインタは64ビットで、他の基本データ型はILP32と同じである。 カーネルは64ビットデータ構造を内部的に使用する LP64データ型モデルの オブジェクトである。 32ビットアプリケーションは32ビットライブラリとリンクする必要があり、 64ビットアプリケーションは64ビットライブラリとリンクする必要がある。 静的ライブラリとして提供されている64ビットライブラリはない。 32ビットデバイスドライバは、64ビットオペレーティングシステムでは使用 できないため、32ビットデバイスドライバは64ビットオブジェクトとして 再コンパイルしなければならない。 64ビットデバイスドライバは、32ビットと 64ビットの両方のアプリケーションをサポートしなければならない。 基本デバイスドライバモデル、つまりDDI(Device Driver Interface)で サポートされているインターフェースに変更はない。 必要な作業は、LP64 データ型モデルの環境で適切となるようにコードを修正することである。 (6-2). DMA の手順考察 camacブロック転送は、2917上のDMA エンジンを使って行う。 これは、2917上 のDMA エンジンを使う "BUS-Master DMA" である。 システム側の転送アドレス とカウント数はDMA クッキーで得られたものを 2917 に渡して使っている。 DMA クッキーは、DMA エンジンがデバイスから(へ)そこに(から)データを転送 できるような連続したメモリ片を表現している。 システムはDMA attribute構造 体の情報を使ってメモリの配置を行い、ターゲットのアライメントを行う。 以下の手順でドライバはバスマスタDMA を実行する。 1. DMA attributesを記述する。 これは、デバイスがバッファにアクセスでき   ることを確実にする。 2. DMAハンドルをアロケートする。 3. メモリにDMAオブジェクトをロックする(physio(9F)を参照) 4. オブジェクト用にDMA資源をアロケートする。 5. デバイス上のDMAエンジンをプログラムしてスタートさせる(これはデバイス   固有である)。 転送が完了した時、バスマスタ動作を続ける。 6. 必要とされるオブジェクトの同期を行う。 7. DMA資源を開放する。 8. DMAハンドルをフリーにする。 DMA attributes はbuilt-in attributesやDMAエンジンの制限を記述する。  以下の事項が含まれる:   o デバイスがアクセスできるアドレスの制限   o 最大転送数 o アドレス並びの制約 システムがアロケートしたDMA資源を、デバイスのDMAエンジンが確実にアクセス できるようにするために、デバイスドライバはddi_dma_attr(9S)構造体を使って DMAエンジンの制限をシステムに知らせなければならない。  <<< 2917 の関連事項 >>> 2917 の DMA エンジンのアドレスレジスタには "Memory Address Counter Register" が使われる。 メモリ・アドレス・カウンタ・レジスタ(MACHI および MACLO)は32ビットレジス タである。 ここにはDMA 転送の開始アドレスをプログラムする。 カウンタの 下位24ビットのみがDMA コントローラに実装される。 32ビット動作が望まれる 場合には、上位 8ビットを "Address Modifier Register" の中にプログラム することができる。 2つの16ビットMemory Address Counter はDMA 転送の 開始前にロードされなければならない。 "Memory Address Counter Register" のレジスタ・レイアウトは以下の通り: Memory Address Counter High (MACHI) +-------------------------------+---------------------------------+ |A24 <-- Count High --> A24|A23 <-- Counter Mid-High --> A16| +-------------------------------+---------------------------------+ Memory Address Counter Low (MACLO) +-------------------------------+---------------------------------+ |A15 <-- Count Mid-Low --> A08|A07 <-- Counter Low --> A00| +-------------------------------+---------------------------------+ camac ドライバプログラムの、cc_strategy()ルーチンを見ると、 : ddi_put16(cc->kreg_handle, &cc->kreg->maclo, (uint16_t)dma_addr & 0xFFFF ); /* Set DMA base address */ ddi_put16(cc->kreg_handle, &cc->kreg->machi, (uint16_t)dma_addr >> 16); ddi_put16(cc->kreg_handle, &cc->kreg->amr, CC_AMR_INIT); /* Set VME AM code */ : となっている。ここで、CC_AMR_INIT は onl50t[41]% grep CC_AMR_INIT *.h k2917.h:#define CC_AMR_INIT 0x007D onl50t[42]% である。 Address Modifier Register ビット割り当ては以下のようになって いる。 つまり、cc_strategy()ルーチンの中ではメモリ・アドレス・カウンタ・ レジスタの上位8ビット用としてのアドレス・データは全てゼロに設定されて いる。 2917 の DMA エンジンのアドレスレジスタ長は32ビットである。 Address Modifier Register +---------------+---------------+---+---+---+----+----+---+---+---+ |A31 A24|N/U LWD AM5 AM4 | AM3 AM2 AM1 AM0| +---------------+---------------+---+---+---+----+----+---+---+---+ ---xxxx(ここまでやった。 継続中) (6). DMAで使用されるバッファについて調べる (6-1). uio構造体に注目して調べる ---xxxx(ここまでやった。 継続中) (6). 関連するman (6-4). copyin(9F)について 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 (6-5). copyout(9F)について Kernel Functions for Drivers copyout(9F) NAME copyout - copy data from a driver to a user program SYNOPSIS #include #include int copyout(const void *driverbuf, void *userbuf, size_t cn); INTERFACE LEVEL Architecture independent level 1 (DDI/DKI). PARAMETERS driverbuf Source address in the driver from which the data is transferred. userbuf Destination address in the user program to which the data is transferred. cn Number of bytes moved. DESCRIPTION copyout() copies data from driver buffers to user data space. 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 algorithm according to address alignment. RETURN VALUES Under normal conditions a 0 is returned to indicate 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 copyout() can be called from user context only. SunOS 5.7 Last change: 1 May 1996 1 Kernel Functions for Drivers copyout(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 con- dition (line 17), the driver copies the current device register 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 (copyout(rp, arg, sizeof(struct device))) 19 return(EFAULT); 20 break; 21 ... 22 } 23 ... 24 } SEE ALSO ioctl(9E), bcopy(9F), copyin(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_copyout(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 (6-8). timeout(9F)について Kernel Functions for Drivers timeout(9F) NAME timeout - execute a function after a specified length of time SYNOPSIS #include #include timeout_id_t timeout(void (* func)(void *), void *arg, clock_t ticks); INTERFACE LEVEL Architecture independent level 1 (DDI/DKI). PARAMETERS func Kernel function to invoke when the time increment expires. arg Argument to the function. ticks Number of clock ticks to wait before the function is called. DESCRIPTION The timeout() function schedules the specified function to be called after a specified time interval. The exact time interval over which the timeout takes effect cannot be guaranteed, but the value given is a close approximation. The function called by timeout() must adhere to the same restrictions as a driver soft interrupt handler. The function called by timeout() is run in interrupt context and must not sleep or call other functions which may sleep. RETURN VALUES timeout() returns an opaque non-zero timeout identifier that can be passed to untimeout(9F) to cancel the request. CONTEXT timeout() can be called from user or interrupt context. EXAMPLES Example 1: Using timeout() In the following example, the device driver has issued an IO request and is waiting for the device to respond. If the device does not respond within 5 seconds, the device driver will print out an error message to the console. static void xxtimeout_handler(void *arg) SunOS 5.7 Last change: 19 Feb 1998 1 Kernel Functions for Drivers timeout(9F) { struct xxstate *xsp = (struct xxstate *)arg; mutex_enter(>lock); cv_signal(>cv); xsp->flags |= TIMED_OUT; mutex_exit(>lock); xsp->timeout_id = 0; } static uint_t xxintr(caddr_t arg) { struct xxstate *xsp = (struct xxstate *)arg; . . . mutex_enter(>lock); /* Service interrupt */ cv_signal(>cv); mutex_exit(>lock); if (xsp->timeout_id != 0) { (void) untimeout(xsp->timeout_id); xsp->timeout_id = 0; } return(DDI_INTR_CLAIMED); } static void xxcheckcond(struct xxstate *xsp) { . . . xsp->timeout_id = timeout(xxtimeout_handler, xsp, 5 * drv_usectohz(1000000)); mutex_enter(>lock); while (/* Waiting for interrupt or timeout*/) cv_wait(>cv, >lock); if (xsp->flags & TIMED_OUT) cmn_err(CE_WARN, "Device not responding"); . . . mutex_exit(>lock); . SunOS 5.7 Last change: 19 Feb 1998 2 Kernel Functions for Drivers timeout(9F) . . } SEE ALSO bufcall(9F), delay(9F), untimeout(9F) Writing Device Drivers SunOS 5.7 Last change: 19 Feb 1998 3 (8). データの受け渡しについて ユーザスレッドがドライバのwrite(9E)ルーチンへデータを渡すのにuio(9S)構造 体を使って行う。 ユーザスペースからカーネルスペースへデータをコピーする にはcopyin(9F)を使い、カーネルスペースからユーザスペースへデータをコピー するにはcopyout(9F)を使う。 この時、uio(9S)構造体が形成され、uio(9S)構造 体でアロケーテトされたiovec(9S)構造体でバッファのアドレスおよび転送長が 指定される。 char buffer[] = "python"; count = write(fd, buffer, strlen(buffer) + 1); typedef struct uio { iovec_t *uio_iov; /* pointer to array of iovecs */ int uio_iovcnt; /* number of iovecs */ lloff_t _uio_offset; /* file offset */ uio_seg_t uio_segflg; /* address space (kernel or user) */ short uio_fmode; /* file mode flags */ lldaddr_t _uio_limit; /* u-limit (maximum "block" offset) */ ssize_t uio_resid; /* residual count */ } uio_t; #define uio_loffset _uio_offset._f #if !defined(_LP64) #define uio_offset _uio_offset._p._l #else #define uio_offset uio_loffset #endif #define uio_llimit _uio_limit._f #if !defined(_LP64) #define uio_limit _uio_limit._p._l #else #define uio_limit uio_llimit #endif /* * I/O parameter information. A uio structure describes the I/O which * is to be performed by an operation. Typically the data movement will * be performed by a routine such as uiomove(), which updates the uio * structure to reflect what was done. */ #if defined(_XPG4_2) typedef struct iovec { void *iov_base; size_t iov_len; } iovec_t; #else typedef struct iovec { caddr_t iov_base; #if defined(_LP64) size_t iov_len; #else long iov_len; #endif } iovec_t; #endif /* defined(_XPG4_2) */ #if defined(_SYSCALL32) /* Kernel's view of user ILP32 iovec struct */ typedef struct iovec32 { caddr32_t iov_base; int32_t iov_len; } iovec32_t; #endif /* _SYSCALL32 */ ---xxxx(ここまでやった。 継続中) --- (6). セクション (6-1). サブセクション (6-1-1). サブサブセクション