[Info-vax] QIO Writes to a mailbox
VAXman- at SendSpamHere.ORG
VAXman- at SendSpamHere.ORG
Fri Nov 4 09:40:09 EDT 2011
In article <9d04fe57-942d-478b-83ac-403df39d8835 at t8g2000yql.googlegroups.com>, Steve Bainbridge <stephen_bainbridge at yahoo.co.uk> writes:
>
>> What would be helpful here is more info. =A0In the general sense, the
>> procedures described should work. =A0However, there are too many
>> questions about how the code is written. It is easy to write code at
>> this level that will appear to work properly, yet be incorrect.
>> Please provide environment information (hardware, software versions,
>> programming language etc.) and perhaps a snippet of the code involved.
>>
>> Thanks,
>> Dan
>>
>> DansABRservices @ yahoo . com
>>
>> For proper disclosure, many of us here provide consulting services to
>> assist with problems such as these. Feel free to contact any of us
>> directly for further assistance as quite often, problems such as these
>> require hands on examination.
>
>Dan,
>
>This is on Alpha 4xCPU ES45 running OpenVMS 7.3-2 with the
>applications primarily written in C and Pascal. The fact that it seems
>to work 99.999% of the time suggest to me some sort of timing issue -
>hence I'm keen to find out exactly when the supplied buffer is copied
>by the QIO.
>
>A chunk of code is below, first is the routine for
>f_osi_write_to_mailbox and below that is the actual call to
>f_osi_write_to_mailbox - this is the code in question. I'm not seeing
>the error message "<MBXFWDERR>" in the logs so I'm assuming the QIO
>was queued OK
>
>Regards,
>Steve
>
>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
>=3D=3D=3D=3D=3D=3D=3D=3D=3D
Thanks for posting QUOTED-PUKEABLE such that I had to cleanup your vomit
before I could reply...
>struct ts_return_status f_osi_write_to_mailbox
>(INTEGER vp_qio_or_qiow,
> UNSIGNED vp_event_flag,
> t_channel vp_channel,
> UNSIGNED vp_function_code,
> struct ts_iosb * vp_iosb,
> FUNCTION (const
>vp_ast_address),
> UNSIGNED vp_ast_parameter,
> const ADDRESS vp_buffer_address,
> UNSIGNED vp_buffer_size
>
>{ /* f_osi_write_to_mailbox */
> struct ts_return_status vl_status; /* return status from
>function */
>
> if (vp_qio_or_qiow == C_OSI_NOWAIT)
> vl_status.s_system = sys$qio (vp_event_flag, /*
>event flag number */
> (unsigned short) vp_channel, /*
>channel number */
> (unsigned short) vp_function_code, /*
>function code */
> vp_iosb, /* I/O
------------------------^^^^^^^
And this is checked where???
>status block */
> vp_ast_address, /* AST
>service routine */
> (unsigned long) vp_ast_parameter, /* AST
>parameter */
> (unsigned long) vp_buffer_address, /* P1
>- Dependant */
> (unsigned long) vp_buffer_size, /* P2
>- Upon */
> 0, /* P3
>- Function */
> 0, /* P4
>- Codes */
> 0, /*
>P5 */
> 0); /*
>P6 */
> else
> vl_status.s_system = sys$qiow (vp_event_flag, /*
>event flag number */
> (unsigned short) vp_channel, /*
>channel number */
> (unsigned short) vp_function_code, /*
>function code */
> vp_iosb, /* I/O
------------------------^^^^^^^
And this is checked where???
>status block */
> vp_ast_address, /* AST
>service routine */
> (unsigned long) vp_ast_parameter, /* AST
>parameter */
> (unsigned long) vp_buffer_address, /* P1
>- Dependant */
> (unsigned long) vp_buffer_size, /* P2
>- Upon */
> 0, /* P3
>- Function */
> 0, /* P4
>- Codes */
> 0, /*
>P5 */
> 0); /*
>P6 */
>
> vl_status.s_local =3D vl_status.s_system;
> return (vl_status);
>
>} /* f_osi_write_to_mailbox */
>
>
>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
>=3D=3D=3D=3D=3D=3D=3D=3D=3D
>
>
> /* Forward unknown message type to the specified destination
>process */
> vl_osi_status =3D f_osi_write_to_mailbox (C_OSI_NOWAIT,
> C_FORWARD_MBX_MSG_EF,
> vl_mbx_channel,
> C_OSI_WRITEVBLK,
> &vl_iosb,
> 0,
> 0,
> (CHAR *) vp_mbx_buffer,
> vp_mbx_buffer->s_header.s_msg_size );
>
>
> if ( vl_osi_status.s_local != C_OSI_NORMAL )
> {
> sprintf ( vl_signal_message,
> "<MBXFWDERR> Error sending/forwarding mailbox message %d from
>process %s to process %s.",
> vp_mbx_buffer->s_header.s_msg_type,
> vl_source_process,
> vl_destination_process );
>
> ...
>
> }
>
>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
>=3D=3D=3D=3D=3D=3D=3D=3D=3D
>
I'd lose the event flag and use EFN$C_ENF and use a $QIOW wherein I'd
CHECK the status in the IOSB _OR_ I'd check the IOSB in the AST routine
***ASSUMING*** you allocate a separate one for each $QIO... Oh, and do
not allocate it in the C routine variables... These some off the stack
and will be invalid when the routine returns to caller. Allocate them
with a malloc() or one of the VMS memory allocation routines like the
LIB$GET_VM (which is jacketted by malloc() anyway).
--
VAXman- A Bored Certified VMS Kernel Mode Hacker VAXman(at)TMESIS(dot)ORG
All your spirit rack abuses, come to haunt you back by day.
All your Byzantine excuses, given time, given you away.
More information about the Info-vax
mailing list