Jul 21, 2000 onl50t: Solaris 2.6 cc ドライバのデバッグ. cc ドライバのデバッグ#04(その4) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (http://www-online.kek.jp/~inoue/CAMAC/ onl50t-sol2.6/Desktop/debug-list-step04.txt) 高エネルギー加速器研究機構 素粒子原子核研究所 物理、オンライングループ 井上 栄二 (1). 現状確認 (A). 株式会社ロジックハウスの白田様より SPARC CPU-50T を借用した。 (B). FORCE,CPU-50(UltraSPARC-IIi 300MHz)、に Solaris2.6 のシステムを インストールした。 (C). /etc の下の各設定、および /export/home の作成をやった。 (D). "Solaris2.6 Hardware: 5/98 SMCC Desktop 日本語版 SPARC版"では ディスクレス・クライアントを設定することはできないことを確認した。 (E). CPU-50T に Solaris2.6用の VMEドライバ、FRCvme-2.3.1 をインストール した。 (F). onl50t に ccドライバをインストールした。 (G). サンプル・プログラムを実行した。 (1). cam1、シングル・アクション 24ビット camac read/write の実行 NG. システムはパニックを起こしてリブートしてしまう。 (2). cam3、camac LAM割り込み処理の実行 NG. システムはパニックを起こしてリブートしてしまう。 (3). cam2、ブロック転送 16ビット read/write の実行 ok. 正常に実行できた。 (4). cam2、ブロック転送 24ビット read/write の実行 ok. 正常に実行できた。 (H). クラッシュ時の savecoreファイルを入手してデバッグを始めた。 (I). cam1プログラムのデバッグ、icc_ioctlルーチンを修正した。 ok. cam1プログラムは正常に実行できた。 (J). cam3プログラムのデバッグを始めた。 camac_s()ルーチンの中で "cc->k->dhr = *dat;" を実行したところでエラーになっている。 message構造体をcc_device構造体の中に入れてみたが改善されない。 (K). cam3プログラムは正常に動作できるようになった。 (L). cam3プログラムのデバッグ時に付加したゴミをはずして最終的な動作確認 をやった。 ok. (M). onl50t 上でデバッグしたcamacドライバをfrc7v-cl2 上で動作確認した。 ok. (N). onl50t 上でデバッグしたcamacドライバを onl7v2、スタンドアロン Solaris2.6 上で動作確認した。 ok. (O). onl50t 上でデバッグしたcamacドライバを frc8vt、ディスクレス・サーバ Solaris2.6 上で動作確認した。 ok. (P). onl50t 上でデバッグしたcamacドライバを onl8v1、スタンドアロン Solaris2.6 上で動作確認した。 ok. (Q). onl50t 上でデバッグしたcamacドライバを onl5v4、スタンドアロン Solaris2.6 上で動作確認した。 ok. (R). スタンドアロン Solaris2.6、onl50t 上で、シングルアクションの実行 速度を測定時に、camac_s()コールを連続実行すると不正割り込みが かかってしまった。 (S). camac_s()コールを連続実行しても不正割り込みはかからないように なった。 ok. -------------------- リスト処理 (A). 公開版のcamacドライバ、"FORCE-50T-sol2.6" を使ってリスト処理の テストを始める。 (B). KEKリスト処理で camacシングルアクション read/write、LAM割り込み 処理、DMA camacブロック転送の現状確認をした。 (C). Kineticリスト処理で camacシングルアクション read の現状確認をした。 (D). KEKリスト処理、Kineticリスト処理両方をとおしてソースプログラム上で 明らかに問題と思われる部分を修正した。 (2). ここでやるべきこと KEKリスト処理でシングルアクション read/write を実行できるようにする。 (3). 現状確認 (3-1). KEKリスト処理でシングルアクション read/write を実行した時の現状 camtest5c をコンパイル&実行(16/24ビットシングルアクション read/write) onl50t[68]% pwd /export/home/onl50t/inoue/CAMAC/Driver/Kit-test/CAMAC-list/FORCE-50T-sol2.6/camlist onl50t[69]% ls Makefile camtest3c.c camtest4single.asm Makefile-bak camtest4.asm camtest4single.asm-org Makefile-bak1 camtest4.obj camtest4single.obj Makefile-single-ok camtest41c.c camtest5c* Makefile.org camtest4c.c camtest5c.bak* camtest10c.c camtest4dma.asm camtest5c.c camtest11c.c camtest4dma.obj camtest5c.c-bak camtest11c.o camtest4etc.asm camtest5c.c-org camtest12c.c camtest4int.asm camtest5c1* camtest13c.c camtest4int.asm-SW camtest5c1.c camtest14c.c camtest4int.asm-SW-bak camtest5c2* camtest1c.c camtest4int.asm-bak camtest5c2.c camtest2c.c camtest4int.asm-org camtestc.c camtest31c.c camtest4int.obj onl50t[70]% cat camtest5c.c /* File name : camtest5c.c * Creation date : July 1992 * Author : Y.Yasu, Online group, Physics department, KEK * Modified : August 1994, Y.Yasu * For HP-RT */ /* System headers */ #include #include /* Local headers */ #include "camlib.h" /* Macros */ #define MAXLENBUF 10000 #define MAXLENLIST 1000 #ifdef HP_RT extern char *sys_errlist[]; #endif /* Functions */ error_exit(status) int status; { #ifdef HP_RT perror(sys_errlist[status]); #else perror((const char *)strerror(status)); #endif exit(status); } /* Main */ main(argc, argv) int argc; char *argv[]; { int status, Error, i; int Lenlis, action; unsigned short List[MAXLENLIST], Buffer[MAXLENBUF], *PtrBuffer; struct cc_iosb Iosb; char Filename[30]; /* strcpy(Filename, "camtest4.obj"); */ strcpy(Filename, "camtest4single.obj"); /* strcpy(Filename, "camtest4dma.obj"); */ if (argc > 1) action = atoi(argv[1]); else action = 0xf; Iosb.s_reg = action; if (status = CAM_Open()) error_exit(status); if (status = CamReaLIST(Filename, List, MAXLENLIST, &Lenlis, &Error)) error_exit(status); printf("CamReaLIST : OK\n"); printf("lenlist = %d\n", Lenlis); printf("list = %x %x %x %x %x\n", List[0], List[1], List[2], List[3]); if (status = CamLisExeWAIt(List, Lenlis, Buffer, MAXLENBUF, &Iosb)) error_exit(status); printf("CamLisExeWAIt : OK\n"); printf("contents of iosb :\n"); printf("iosb.status = %x iosb.ret_length = %x iosb.s_reg = %x ", Iosb.status, Iosb.ret_length, Iosb.s_reg); printf(" iosb.devinfo = %x\n", Iosb.devinfo); printf("contents of buffer :\n"); for( i = 0; i < 12 ;i++) printf("%6x %6x %6x %6x %6x %6x %6x %6x %6x %6x\n", Buffer[10*i+0], Buffer[10*i+1], Buffer[10*i+2], Buffer[10*i+3], Buffer[10*i+4], Buffer[10*i+5], Buffer[10*i+6], Buffer[10*i+7], Buffer[10*i+8], Buffer[10*i+9]); if (status = CAM_Close()) error_exit(status); } onl50t[71]% onl50t[73]% cat camtest4single.asm ; File name : camtest4single.asm ; Creation date : July 1992 ; Author : Y.Yasu, Online group, Physics department, KEK SW equ 3 ; CAMAC SWITCH REGISTER MEM equ 4 ; CAMAC BUFFER MEMORY MOUDLE INT equ 5 ; CAMAC INTERRUPT REGISTER LEN equ 10 ; 10 words ; MOVE #1,A SETCRATE A SETCRATE #0 GENZ GENC SETI REMI ; READ (0,SW,1) READ.l (0,SW,1) READ (0,SW,1),A MOVE A,(PTR)+ READ.l (0,SW,1),A MOVE.l A,(PTR)+ WRITE #0x5555,(16,SW,0) WRITE #0x80081,(16,SW,0) WRITE.l #0x80082,(16,SW,0) WRITE A,(16,SW,0) WRITE.l A,(16,SW,0) ; STOP end onl50t[74]% onl50t[75]% rm camtest5c onl50t[76]% make camtest5c cc -o camtest5c camtest5c.c -I.. -L.. -lcamac onl50t[77]% onl50t[77]% rm camtest4single.obj onl50t[78]% make camtest4single.obj ../camasm/camasm camtest4single.asm CAMASM macro assembler V0.1 --- KEK online group --- Modified by Y.T Oct-1991 onl50t[79]% cat camtest4single.obj 0024 0329 0001 0000 010A 020B 0000 010C 010D 010F 010E 0201 0620 0202 0620 0203 0620 012C 0204 0620 012D 0305 0610 5555 0305 0610 0081 0406 0610 0082 0008 0207 0610 0208 0610 0100 0000 onl50t[80]% onl50t[80]% camtest5c CamReaLIST : OK lenlist = 36 list = 329 1 0 10a ef7a6080 CamLisExeWAIt : OK contents of iosb : iosb.status = fffffff6 iosb.ret_length = 6 iosb.s_reg = f iosb.devinfo = a000a0 contents of buffer : 5555 55 5555 5555 55 5555 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 onl50t[81]% ox555555 とセットされているスイッチレジスタの SA=1 を読み出して アプリケーションバッファに正しく渡されている。 さらにこの値はスイッチ レジスタの SA=0 に書き込まれてスイッチレジスタの LED を正しい値で点灯 させている。 しかし、iosb.status は 0xfffffff6 = -10 になっている。 以前と同じ症状。 (4). cc.cファイルの修正 (4-1). iosb.status をトレースする どの時点で iosb.status = 0xfffffff6 がセットされるのかチェックする。 onl50t[44]% pwd /export/home/onl50t/inoue/CAMAC/Driver/Kit-test/CAMAC-list/FORCE-50T-sol2.6 onl50t[45]% ls Makefile cam3.c-org cc.c-Jul13-2000 cc.h README camasm/ cc.c-Jul13-2000A cc_common.h cam1* camlib.c cc.c-Jul13-2000B cc_config.h cam1.c camlib.h cc.c-Jul14-2000A forlib.c cam2* camlib.o cc.c-Jul14-2000B forlib.o cam2.f camlist/ cc.c-Jul17-2000A k2917.h cam3* camlist-kine/ cc.c-Jul17-2000B libcamac.a cam3.c cc cc.c-org script/ cam3.c-int cc.c cc.conf onl50t[46]% grep CamReaLIST * camlib.h:#define CamReaLIST CRLIST onl50t[47]% grep CRLIST * camlib.c:CRLIST(fname, list, lenlis, retlen, err) camlib.h:#define CamReaLIST CRLIST forlib.c: return CRLIST(fname, list, *lenlis, retlen, err); forlib.c: return CRLIST(fname, list, *lenlis, retlen, err); onl50t[48]% grep CamLisExeWAIt * camlib.h:#define CamLisExeWAIt CLEWAI onl50t[49]% grep CLEWAI * camlib.c:CLEWAI(list, lenlis, buf, lenbuf, iiosb) camlib.h:#define CamLisExeWAIt CLEWAI forlib.c: return CLEWAI(list, *lenlis, buf, *lenbuf, iosb); onl50t[50]% vi camlib.c : CLEWAI(list, lenlis, buf, lenbuf, iiosb) u_short *list, *buf; int lenlis, lenbuf; struct cc_iosb *iiosb; { register int status; message.command = (u_short)CC_CMD_LOADDOLIST; message.ptr_iosb = (struct cc_iosb *)iiosb; vec[0].iov_base = (caddr_t)&message; vec[0].iov_len = sizeof(struct cc_message); vec[1].iov_base = (caddr_t)list; vec[1].iov_len = lenlis * sizeof(u_short); vec[2].iov_base = (caddr_t)buf; vec[2].iov_len = lenbuf * sizeof(u_short); status = writev(cc_path, vec, 3); check_file_pointer(lenlis + iiosb->ret_length); return status; } : CRLIST(fname, list, lenlis, retlen, err) char *fname; u_short *list; int lenlis, *retlen, *err; { register FILE *fp; int size, a, b, c, d; if ((fp = fopen(fname, "r")) == NULL) { *err = EFAULT; return EFAULT; } (void)fscanf(fp, "%X", &size); if (size > lenlis) { *err = -1; return -1; } *retlen = size; while (size > 0) { (void)fscanf(fp, "%X%X%X%X", &a, &b, &c, &d); *list++ = a; *list++ = b; *list++ = c; *list++ = d; size -= 4; } *err = 0; return fclose(fp); } : onl50t[51]% CLEWAI()ルーチンの中では、writev()がコールされている。 cc_write()エント リを調べる。 onl50t[84]% pwd /export/home/onl50t/inoue/CAMAC/Driver/Kit-test/CAMAC-list/FORCE-50T-sol2.6 onl50t[85]% ls Makefile cam3.c-org cc.c-Jul13-2000 cc.h README camasm/ cc.c-Jul13-2000A cc_common.h cam1* camlib.c cc.c-Jul13-2000B cc_config.h cam1.c camlib.h cc.c-Jul14-2000A forlib.c cam2* camlib.o cc.c-Jul14-2000B forlib.o cam2.f camlist/ cc.c-Jul17-2000A k2917.h cam3* camlist-kine/ cc.c-Jul17-2000B libcamac.a cam3.c cc cc.c-org script/ cam3.c-int cc.c cc.conf onl50t[86]% vi cc.c : static int cc_write(dev_t dev, struct uio *uio, cred_t *cred_p) { /* register struct cc_device *cc = &ccdevice[0]; */ register struct cc_device *cc; : /************************* * CAMAC list processing * *************************/ case CC_CMD_LOADLIST: case CC_CMD_LOADDOLIST: cmn_err(CE_NOTE," cc_write: CC_CMD_LOADDOLIST: enter CC_CMD_LOADDOLIST"); iov++; uio->uio_iov++; uio->uio_iovcnt--; cc->ptr_list = (u_short *)iov->iov_base; cc->len_list = iov->iov_len / sizeof(u_short); copyin((caddr_t)cc->ptr_list, (caddr_t)cc->list_area, cc->len_list * sizeof(u_short)); if (cc->message.command == CC_CMD_LOADLIST) break; case CC_CMD_DOLIST: iov++; uio->uio_iov++; uio->uio_iovcnt--; copyin((caddr_t)cc->message.ptr_iosb, (caddr_t)&cc->iosb, sizeof(struct cc_iosb)); cc->ptr_udata_s = cc->ptr_udata = (u_short *)iov->iov_base; cc->len_udata_t = iov->iov_len / sizeof(u_short); cc->len_udata = 0; cc->ptr_list = cc->list_area; /* initialize list pointer */ cc->s_reg = cc->iosb.s_reg; step_count = 0; while (cc->status == CC_STA_OK && cc->cc_sys_status == CC_STA_OK && step_count++ < CC_LIST_MAX_STEP && cc->ptr_list <= (cc->list_area + cc->len_list)) { code = 0x00FF & cc->ptr_list[0]; instruction_call = instruction[code]; /* E.Inoue cc->status = (*instruction_call)(cc); next_instruction(cc); end */ cc->status = (*instruction_call)(unit); next_instruction(unit); } cmn_err(CE_NOTE," cc_write: CC_CMD_LOADDOLIST: without while, cc->status = 0x %x", cc->status); if (step_count >= CC_LIST_MAX_STEP) cc->status = CC_STA_LIST_OVERSTEP; cmn_err(CE_NOTE," cc_write: CC_CMD_LOADDOLIST: without while #2, cc->status = 0x%x", cc->status); /* E.Inoue flush_buf(cc); end */ flush_buf(unit); cc->iosb.status = cc->status; cc->iosb.ret_length = cc->len_udata; cc->iosb.s_reg = cc->s_reg; cc->iosb.devinfo = cc->camac_qx + (cc->camac_qx << 16); copyout((caddr_t)&cc->iosb, (caddr_t)cc->message.ptr_iosb, sizeof(struct cc_iosb)); break; : onl50t[87]% onl50t[90]% make clean \rm -f cc *.o libcamac.a cam1 cam2 cam3 *~ core onl50t[91]% make ./script/cc_build.sh [Building for sun4u] rm -f cc.o cc -O -c camlib.c -o camlib.o -I. cc -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 -O cam1.c -o cam1 -I. -L. -lcamac f77 -fast -O3 -u cam2.f -o cam2 -I. -L. -lcamac cam2.f: MAIN: cc -O cam3.c -o cam3 -I. -L. -lcamac onl50t[92]% 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# KEKリスト処理でシングルアクションを実行する。 状況を分かりやすくする ためにKEKリスト処理ではシングルアクション read を一回だけ実行することに する。 onl50t[96]% pwd /export/home/onl50t/inoue/CAMAC/Driver/Kit-test/CAMAC-list/FORCE-50T-sol2.6/camlist onl50t[97]% ls Makefile camtest3c.c camtest4single.asm Makefile-bak camtest4.asm camtest4single.asm-org Makefile-bak1 camtest4.obj camtest4single.obj Makefile-single-ok camtest41c.c camtest5c* Makefile.org camtest4c.c camtest5c.bak* camtest10c.c camtest4dma.asm camtest5c.c camtest11c.c camtest4dma.obj camtest5c.c-bak camtest11c.o camtest4etc.asm camtest5c.c-org camtest12c.c camtest4int.asm camtest5c1* camtest13c.c camtest4int.asm-SW camtest5c1.c camtest14c.c camtest4int.asm-SW-bak camtest5c2* camtest1c.c camtest4int.asm-bak camtest5c2.c camtest2c.c camtest4int.asm-org camtestc.c camtest31c.c camtest4int.obj onl50t[98]% vi camtest4single.asm ; File name : camtest4single.asm ; Creation date : July 1992 ; Author : Y.Yasu, Online group, Physics department, KEK SW equ 3 ; CAMAC SWITCH REGISTER MEM equ 4 ; CAMAC BUFFER MEMORY MOUDLE INT equ 5 ; CAMAC INTERRUPT REGISTER LEN equ 10 ; 10 words ; MOVE #1,A SETCRATE A SETCRATE #0 GENZ GENC SETI REMI ; READ (0,SW,1) ; READ.l (0,SW,1) ; READ (0,SW,1),A ; MOVE A,(PTR)+ ; READ.l (0,SW,1),A ; MOVE.l A,(PTR)+ ; WRITE #0x5555,(16,SW,0) ; WRITE #0x80081,(16,SW,0) ; WRITE.l #0x80082,(16,SW,0) ; WRITE A,(16,SW,0) ; WRITE.l A,(16,SW,0) ; STOP end "camtest4single.asm" 31 lines, 575 characters onl50t[99]% onl50t[100]% cat camtest4single.obj 000E 0329 0001 0000 010A 020B 0000 010C 010D 010F 010E 0201 0620 0100 0000 0000 0000 onl50t[101]% onl50t[101]% make camtest4single.obj ../camasm/camasm camtest4single.asm CAMASM macro assembler V0.1 --- KEK online group --- Modified by Y.T Oct-1991 onl50t[102]% onl50t[102]% camtest5c CamReaLIST : OK lenlist = 14 list = 329 1 0 10a ef7a6080 CamLisExeWAIt : OK contents of iosb : iosb.status = fffffff6 iosb.ret_length = 1 iosb.s_reg = f iosb.devinfo = 800080 contents of buffer : 5555 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 onl50t[103]% この時のコンソール上のメッセージは以下のとおり。 NOTICE: cc_write: CC_CMD_LOADDOLIST: enter CC_CMD_LOADDOLIST NOTICE: cc_write: CC_CMD_LOADDOLIST: without while, cc->status = 0xfffffff6 NOTICE: cc_write: CC_CMD_LOADDOLIST: without while #2, cc->status = 0xfffffff6 リストコマンドを実行する whileループから抜け出た時にはすでに 0xfffffff6 の cc->status が存在している。 もっと詳しく知るためにwhileループの中で 1コマンド実行毎にチェックしてみる。 : while (cc->status == CC_STA_OK && cc->cc_sys_status == CC_STA_OK && step_count++ < CC_LIST_MAX_STEP && cc->ptr_list <= (cc->list_area + cc->len_list)) { code = 0x00FF & cc->ptr_list[0]; cmn_err(CE_NOTE," cc_write: CC_CMD_LOADDOLIST: in while, code = 0x%x", code) ; instruction_call = instruction[code]; /* E.Inoue cc->status = (*instruction_call)(cc); next_instruction(cc); end */ cc->status = (*instruction_call)(unit); cmn_err(CE_NOTE," cc_write: CC_CMD_LOADDOLIST: in while, cc->status = 0x%x", cc->status); next_instruction(unit); } cmn_err(CE_NOTE," cc_write: CC_CMD_LOADDOLIST: out while, cc->status = 0x%x" , cc->status); if (step_count >= CC_LIST_MAX_STEP) cc->status = CC_STA_LIST_OVERSTEP; cmn_err(CE_NOTE," cc_write: CC_CMD_LOADDOLIST: out while #2, cc->status = 0x %x", cc->status); /* E.Inoue flush_buf(cc); end */ flush_buf(unit); cc->iosb.status = cc->status; cc->iosb.ret_length = cc->len_udata; cc->iosb.s_reg = cc->s_reg; cc->iosb.devinfo = cc->camac_qx + (cc->camac_qx << 16); copyout((caddr_t)&cc->iosb, (caddr_t)cc->message.ptr_iosb, sizeof(struct cc_iosb)); break; : onl50t[57]% camtest5c CamReaLIST : OK lenlist = 14 list = 329 1 0 10a ef7a6080 CamLisExeWAIt : OK contents of iosb : iosb.status = fffffff6 iosb.ret_length = 1 iosb.s_reg = f iosb.devinfo = 8000 80 contents of buffer : 5555 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 onl50t[58]% 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 NOTICE: cc_write: CC_CMD_LOADDOLIST: enter CC_CMD_LOADDOLIST NOTICE: cc_write: CC_CMD_LOADDOLIST: in while, code = 0x29 NOTICE: cc_write: CC_CMD_LOADDOLIST: in while, cc->status = 0x0 NOTICE: cc_write: CC_CMD_LOADDOLIST: in while, code = 0xa NOTICE: cc_write: CC_CMD_LOADDOLIST: in while, cc->status = 0x0 NOTICE: cc_write: CC_CMD_LOADDOLIST: in while, code = 0xb NOTICE: cc_write: CC_CMD_LOADDOLIST: in while, cc->status = 0x0 NOTICE: cc_write: CC_CMD_LOADDOLIST: in while, code = 0xc NOTICE: cc_write: CC_CMD_LOADDOLIST: in while, cc->status = 0x0 NOTICE: cc_write: CC_CMD_LOADDOLIST: in while, code = 0xd NOTICE: cc_write: CC_CMD_LOADDOLIST: in while, cc->status = 0x0 NOTICE: cc_write: CC_CMD_LOADDOLIST: in while, code = 0xf NOTICE: cc_write: CC_CMD_LOADDOLIST: in while, cc->status = 0x0 NOTICE: cc_write: CC_CMD_LOADDOLIST: in while, code = 0xe NOTICE: cc_write: CC_CMD_LOADDOLIST: in while, cc->status = 0x0 NOTICE: cc_write: CC_CMD_LOADDOLIST: in while, code = 0x1 NOTICE: cc_write: CC_CMD_LOADDOLIST: in while, cc->status = 0x0 NOTICE: cc_write: CC_CMD_LOADDOLIST: in while, code = 0x0 NOTICE: cc_write: CC_CMD_LOADDOLIST: in while, cc->status = 0xfffffff6 NOTICE: cc_write: CC_CMD_LOADDOLIST: out while, cc->status = 0xfffffff6 NOTICE: cc_write: CC_CMD_LOADDOLIST: out while #2, cc->status = 0xfffffff6 実行結果を見ると、インストラクション・コードは 0x29、0xa、0xb、0xc、 0xd、0xf、0xe、0x1、0x0 の順に実行されている。 これに対応するルーチン を順に記述すると次の様になる。 (1). コード 0x29 = cc_move32_a (2). コード 0xa = cc_setcrate_a (3). コード 0xb = cc_setcrate (4). コード 0xc = cc_genz (5). コード 0xd = cc_genc (6). コード 0xf = cc_seti (7). コード 0xe = cc_remi (8). コード 0x1 = cc_read16 (9). コード 0x0 = cc_stop cc->status = 0xfffffff6 になったのは、コード 0x0 = cc_stop を実行した 時である。 それ以前の cc_read16 の実行までは全て正常に終了している。 cc.cファイルをチェック。 : /* cc_stop(cc) E.Inoue */ cc_stop(int unit) /* struct cc_device *cc; E.Inoue */ { /* E.Inoue */ struct cc_device *cc; cc = ddi_get_soft_state(cc_state,unit); /* end */ return CC_STA_LIST_STOP; } : cc_stop()ルーチンを見ると、このルーチンがコールされると無条件に 0xfffffff6 = "CC_STA_LIST_STOP" のステータス・コードを返している。 エラーが起きて途中でリストが中断されたためではない。 リスト処理での 正常終了と見て良いようだ。 (4-2). camtest4single.asm を元に戻して実行する 状況を解りやすくするために、現在は camtest4single.asm では camacシングル アクション read を一回だけしか実行していない。 これを元に戻して、いろい ろなシングルアクション read/write を実行してみて動作を確認する。 : ; File name : camtest4single.asm ; Creation date : July 1992 ; Author : Y.Yasu, Online group, Physics department, KEK ; Modified : July 21, 2000 E.Inoue SW equ 3 ; CAMAC SWITCH REGISTER MEM equ 4 ; CAMAC BUFFER MEMORY MOUDLE INT equ 5 ; CAMAC INTERRUPT REGISTER LEN equ 10 ; 10 words ; MOVE #1,A SETCRATE A SETCRATE #0 GENZ GENC SETI REMI ; READ (0,SW,1) READ.l (0,SW,1) READ (0,SW,1),A MOVE A,(PTR)+ READ.l (0,SW,1),A MOVE.l A,(PTR)+ WRITE #0x5555,(16,SW,0) WRITE #0x80081,(16,SW,0) WRITE.l #0x80082,(16,SW,0) WRITE A,(16,SW,0) WRITE.l A,(16,SW,0) ; STOP end : onl50t[135]% rm camtest4single.obj onl50t[136]% make camtest4single.obj ../camasm/camasm camtest4single.asm CAMASM macro assembler V0.1 --- KEK online group --- Modified by Y.T Oct-1991 onl50t[137]% onl50t[137]% camtest5c CamReaLIST : OK lenlist = 36 list = 329 1 0 10a ef7a6080 CamLisExeWAIt : OK contents of iosb : iosb.status = fffffff6 iosb.ret_length = 6 iosb.s_reg = f iosb.devinfo = a000a0 contents of buffer : 5555 55 5555 5555 55 5555 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 onl50t[138]% NOTICE: cc_write: CC_CMD_LOADDOLIST: enter CC_CMD_LOADDOL IST NOTICE: cc_write: CC_CMD_LOADDOLIST: in while, code = 0x29 NOTICE: cc_write: CC_CMD_LOADDOLIST: in while, cc->status = 0x0 NOTICE: cc_write: CC_CMD_LOADDOLIST: in while, code = 0xa NOTICE: cc_write: CC_CMD_LOADDOLIST: in while, cc->status = 0x0 NOTICE: cc_write: CC_CMD_LOADDOLIST: in while, code = 0xb NOTICE: cc_write: CC_CMD_LOADDOLIST: in while, cc->status = 0x0 NOTICE: cc_write: CC_CMD_LOADDOLIST: in while, code = 0xc NOTICE: cc_write: CC_CMD_LOADDOLIST: in while, cc->status = 0x0 NOTICE: cc_write: CC_CMD_LOADDOLIST: in while, code = 0xd NOTICE: cc_write: CC_CMD_LOADDOLIST: in while, cc->status = 0x0 NOTICE: cc_write: CC_CMD_LOADDOLIST: in while, code = 0xf NOTICE: cc_write: CC_CMD_LOADDOLIST: in while, cc->status = 0x0 NOTICE: cc_write: CC_CMD_LOADDOLIST: in while, code = 0xe NOTICE: cc_write: CC_CMD_LOADDOLIST: in while, cc->status = 0x0 NOTICE: cc_write: CC_CMD_LOADDOLIST: in while, code = 0x1 NOTICE: cc_write: CC_CMD_LOADDOLIST: in while, cc->status = 0x0 NOTICE: cc_write: CC_CMD_LOADDOLIST: in while, code = 0x2 NOTICE: cc_write: CC_CMD_LOADDOLIST: in while, cc->status = 0x0 NOTICE: cc_write: CC_CMD_LOADDOLIST: in while, code = 0x3 NOTICE: cc_write: CC_CMD_LOADDOLIST: in while, cc->status = 0x0 NOTICE: cc_write: CC_CMD_LOADDOLIST: in while, code = 0x2c NOTICE: cc_write: CC_CMD_LOADDOLIST: in while, cc->status = 0x0 NOTICE: cc_write: CC_CMD_LOADDOLIST: in while, code = 0x4 NOTICE: cc_write: CC_CMD_LOADDOLIST: in while, cc->status = 0x0 NOTICE: cc_write: CC_CMD_LOADDOLIST: in while, code = 0x2d NOTICE: cc_write: CC_CMD_LOADDOLIST: in while, cc->status = 0x0 NOTICE: cc_write: CC_CMD_LOADDOLIST: in while, code = 0x5 NOTICE: cc_write: CC_CMD_LOADDOLIST: in while, cc->status = 0x0 NOTICE: cc_write: CC_CMD_LOADDOLIST: in while, code = 0x5 NOTICE: cc_write: CC_CMD_LOADDOLIST: in while, cc->status = 0x0 NOTICE: cc_write: CC_CMD_LOADDOLIST: in while, code = 0x6 NOTICE: cc_write: CC_CMD_LOADDOLIST: in while, cc->status = 0x0 NOTICE: cc_write: CC_CMD_LOADDOLIST: in while, code = 0x7 NOTICE: cc_write: CC_CMD_LOADDOLIST: in while, cc->status = 0x0 NOTICE: cc_write: CC_CMD_LOADDOLIST: in while, code = 0x8 NOTICE: cc_write: CC_CMD_LOADDOLIST: in while, cc->status = 0x0 NOTICE: cc_write: CC_CMD_LOADDOLIST: in while, code = 0x0 NOTICE: cc_write: CC_CMD_LOADDOLIST: in while, cc->status = 0xfffffff6 NOTICE: cc_write: CC_CMD_LOADDOLIST: out while, cc->status = 0xfffffff6 NOTICE: cc_write: CC_CMD_LOADDOLIST: out while #2, cc->status = 0xfffffff6 実行結果を確認すると次のようになる。 (1). コード 0x29 = cc_move32_a (2). コード 0xa = cc_setcrate_a (3). コード 0xb = cc_setcrate (4). コード 0xc = cc_genz (5). コード 0xd = cc_genc (6). コード 0xf = cc_seti (7). コード 0xe = cc_remi (8). コード 0x1 = cc_read16 (9). コード 0x2 = cc_read24 (10). コード 0x3 = cc_read16_a (11). コード 0x2c = cc_move16_a_ptr (12). コード 0x4 = cc_read24_a (13). コード 0x2d = cc_move32_a_ptr (14). コード 0x5 = cc_write16 (15). コード 0x5 = cc_write16 (16). コード 0x6 = cc_write24 (17). コード 0x7 = cc_write16_a (18). コード 0x8 = cc_write24_a (19). コード 0x0 = cc_stop この場合もリスト処理は途中で止まったわけではなくて、最後まで実行されて いる。 そして、cc_stop()ルーチンが実行された時に "CC_STA_LIST_STOP" の ステータス・コードを返している。 ok. 正常な実行と見て良い。 ---xxxx ここまでやった(継続中) --- (6). 項目タイトル (6-1). サブ項目タイトル (6-1-1). サブサブ項目タイトル