(toppers-users 989) Re: シリアルポート管理ブロック初期化はいつ ?
ktakahashi @ vesta.ocn.ne.jp
ktakahashi @ vesta.ocn.ne.jp
2003年 7月 16日 (水) 19:28:45 JST
IKEUCHI Mitsuo (ràõY) <ikeuchi.mitsuo @ jp.panasonic.com>³ñF
ACurW\tgEGAÌ´Æ\µÜ·B
VQÒÅ·ªAæ뵨袵ܷB
spcbÌÀ̪Aspcb_table Å·æËB
[h·éÆ«Éú»³êÄ¢é̪³íÈP[XÅ·ËB
MaÌêA[_[Éâèª éÌŵ天H
Ql̽ßAh8Å·ªAgdbÌ®ìmFðȺɢĨ«Ü·B
(cygwinÈÌÅ\[X̿Ͷ»¯µÄÜ·j
e[uÌAhXÍ@0x50004Ìæ¤Å·B
--------------------
[Administrator @ ONE nserv]$ h8300-hms-gdb jsp.exe
GNU gdb 5.3
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "--host=i686-pc-cygwin --target=h8300-hms"...
(gdb) set machine h8300h
(gdb) set remotebaud 38400
(gdb) target hms /dev/com1
Remote target hms connected to /dev/com1
0x00000000 in ?? ()
(gdb) load
.vectors : 0x00ffc000 .. 0x00ffc100
.text : 0x00400000 .. 0x00415aba
.rodata : 0x00415aba .. 0x0041a7e8
.data : 0x00500000 .. 0x00500e94
Transfer rate: 900064 bits in <1 sec, 1171 bytes/write.
Timeout reading from remote system.
(gdb) cd ..
Working directory /home/Administrator/jsp.
(gdb) cd systask
Working directory /home/Administrator/jsp/systask.
(gdb) p spcb_table
$1 = {{init_flag = 0, hwport = {base = 255}, in_semid = 0, out_semid = 0,
in_read_ptr = 0, in_write_ptr = 0, out_read_ptr = 0, out_write_ptr = 0,
ioctl = 0, send_enabled = 0, ixon_stopped = 0, ixoff_stopped = 0,
ixoff_send = 0 '\0', in_buffer = '\0' <repeats 255 times>,
out_buffer = '\0' <repeats 255 times>}, {init_flag = 0, hwport = {
base = 255}, in_semid = 0, out_semid = 0, in_read_ptr = 0,
in_write_ptr = 0, out_read_ptr = 0, out_write_ptr = 0, ioctl = 0,
send_enabled = 0, ixon_stopped = 0, ixoff_stopped = 0,
ixoff_send = 0 '\0', in_buffer = '\0' <repeats 255 times>,
out_buffer = '\0' <repeats 255 times>}}
(gdb) p &spcb_table
$2 = (SPCB (*)[2]) 0x500004
(gdb) l serial.c:123
118 * EBVElAzEFBVEE
119 *
120 * nv\.zE\EPEbAjATþAqNjAZ.LAqA}c~AþALAjAAAnAABE
121 */
122 ER
123 serial_open(ID portid)
124 {
125 SPCB *spcb;
126 ER ercd;
127
(gdb)
128 if (!(1 <= portid && portid <= NUM_PORT)) {
129 return(E_ID);
130 }
131 spcb = get_spcb(portid);
132
133 if (spcb->init_flag) { /* Xé´EXRAHAzE`E@EeEb */
134 return(E_OK);
135 }
136
137 /*
(gdb) b 133
Breakpoint 1 at 0x4005ee: file serial.c, line 133.
(gdb) c
Continuing.
Breakpoint 1, serial_open (portid=564) at serial.c:133
133 if (spcb->init_flag) { /* Xé´EXRAHAzE`E@EeEb */
(gdb) p spcb
$3 = (SPCB *) 0x500004
(gdb) p *spcb
$4 = {init_flag = 0, hwport = {base = 255}, in_semid = 0, out_semid = 0,
in_read_ptr = 0, in_write_ptr = 0, out_read_ptr = 0, out_write_ptr = 0,
ioctl = 0, send_enabled = 0, ixon_stopped = 0, ixoff_stopped = 0,
ixoff_send = 0 '\0', in_buffer = '\0' <repeats 255 times>,
out_buffer = '\0' <repeats 255 times>}
(gdb) b 128
Breakpoint 2 at 0x4005c6: file serial.c, line 128.
(gdb) d 1
(gdb) c
Continuing.
>
> ràÅ·B
>
> êÙÇOÉu (toppers-users 895) kz_sh4 ÅTv
> vOª®«Ü¹ñvÆ¢¤eðµ½àÌÅ·BÙñÌ
> µi»ª èAܽª©çȢƱëªÅÄ«½ÌÅAܽ
> ¿â³¹Ä¾³¢B
>
> æÌ¿âÅÍAVAoͪ¤Ü¢ÁÄÈ©Á½ÌÅ·ªA
> ±êÍAVA|[gÇubNÌú»tO
> ( SPCB.init_flag ) ª -1 ÉÈÁÄ¢é̪´öÌæ¤Å·B
>
> VAú»Ö serial_initialize() ¨ serial_open() Å
>
> if (spcb->init_flag) { /* ú»Ï©Ì`FbN */
> return(E_OK);
> }
>
> Æ¢¤ªª èÜ·ªAlª -1 ¾ÆA±±Åuú»ÏÝv
> Æ»f³êĵܢܷB»Ì½ßAãX̪¨©µ
> ÈÁÄ¢éæ¤Å·B
>
> ƱëªA SPCB ÏÌú»Í
>
> static SPCB spcb_table[NUM_PORT] = {
> { 0, HWPORT1, SEM_SERIAL1_IN, SEM_SERIAL1_OUT },
> #if NUM_PORT > 1
> { 0, HWPORT2, SEM_SERIAL2_IN, SEM_SERIAL2_OUT },
> #endif
> };
>
> Æ¢¤æ¤ÉsÈíêĨèAÅÍ init_flag = 0 ÉÈÁÄ
> ¢é͸ÈÌÅ·BDZ©Å -1 ÉÏíÁÄ¢éÌ©A»à»à
> ú»ªsÈíêĢȢ̩檩èܹñB
>
> ÇȽ©A¨ª©èÌûª¢çÁµáêÎA²³öè¦È¢Å
> µå¤©B
>
> *********************************************************
> ràõY pi\jbNt@Ng[\
[VY®ïÐ
> *********************************************************
---
ACurW\tgEGA®ïÐ
´a_
650-0045 _Ësæ`9-1
_ËCL
x[VItBX117º
Email:ktakahashi @ vesta.ocn.ne.jp
http://homepage3.nifty.com/ALVS/