[DICE] Compilation error with two flexpages
Ronald Aigner
ra3 at os.inf.tu-dresden.de
Wed Aug 1 17:39:07 CEST 2007
Clermont, Nicolas wrote on 08/01/2007 02:49 PM this:
> Hi everybody,
>
> I am currently playing with flexpages. I have written simple client/server
> application which sends data to each other using flexpages. I have written a
> simple IDL file for the server interface. The first version was the
> following :
>
> library test_server
> {
> interface worker
> {
> int send_data([in] flexpage page,
> [out, max_is(4096)] char reply[]);
> };
> };
>
> The client sends data through the flexpage, and the server replies using
> string ipc. This way the DICE generated code compiles without error, and my
> application works. Then I wanted the server to reply also through a
> flexpage, but another one than the page provided by the client application.
> So I modify my IDL this way :
>
> library test_server
> {
> interface worker
> {
> int send_data([in] flexpage page,
> [out, in] flexpage reply);
> };
> };
>
> I use [out, in] because this way the client can first assign the snd_base
> before sending the request.
Note, that the "reply" parameter will be sent as a flexpage to the
server, that is, the page described by "reply" will be mapped. If you
just want to tell the server the send-base it should use, write smething
like this:
int send_data([in] flexpage page,
[in] unsigned long send_base,
[out] flexpage *reply);
> After modifying my client lib and the component
> function accordingly, I get a compile error in a DICE generated file :
> /home/nico/build-tudos/pkg/test_server/idl/OBJ-x86-l4v2/test_server_worker-s
> erver.c: In function `test_server_worker_wait_any':
> /home/nico/build-tudos/pkg/test_server/idl/OBJ-x86-l4v2/test_server_worker-s
> erver.c:91: error: `_dice_tmp_offset' undeclared (first use in this
> function)
> /home/nico/build-tudos/pkg/test_server/idl/OBJ-x86-l4v2/test_server_worker-s
> erver.c:91: error: (Each undeclared identifier is reported only once
> /home/nico/build-tudos/pkg/test_server/idl/OBJ-x86-l4v2/test_server_worker-s
> erver.c:91: error: for each function it appears in.)
> /home/nico/build-tudos/pkg/test_server/idl/OBJ-x86-l4v2/test_server_worker-s
> erver.c: In function `test_server_worker_reply_and_wait':
> /home/nico/build-tudos/pkg/test_server/idl/OBJ-x86-l4v2/test_server_worker-s
> erver.c:172: error: `_dice_tmp_offset' undeclared (first use in this
> function)
>
> What I see in the generated file :
>
> filter_server_worker_wait_any (...)
> {
> ...
> if (l4_ipc_fpage_received(_dice_result))
> {
> _dice_tmp_offset = 0;
> while ((_dice_msg_buffer->_word._word[0][_dice_tmp_offset++] !=
> 0) && (_dice_msg_buffer->_word._word[0][_dice_tmp_offset++] != 0)) /* empty
> */;
> /* skip zero fpage */
> _dice_tmp_offset += 2;
> _dice_opcode = _dice_msg_buffer->_word._word[0];
> }
> else
> _dice_opcode = _dice_msg_buffer->_word._word[0];
> return _dice_opcode;
> }
>
> The _dice_tmp_offset is not declared, the second error (line 172) is about
> the same thing (it is exactly the same code in reply_and_wait()). So I have
> tried to declare _dice_tmp_offset as an unsigned int, then I have :
> /home/clermont/build-tudos/pkg/filter_server/idl/OBJ-x86-l4v2/filter_server_
> worker-server.c: In function `filter_server_worker_wait_any':
> /home/clermont/build-tudos/pkg/filter_server/idl/OBJ-x86-l4v2/filter_server_
> worker-server.c:92: error: subscripted value is neither array nor pointer
> /home/clermont/build-tudos/pkg/filter_server/idl/OBJ-x86-l4v2/filter_server_
> worker-server.c:92: error: subscripted value is neither array nor pointer
>
> (The line 92 is the one with while(...)). Indeed after looking the code I
> find it really strange, as _word[0] is a register.... More _dice_tmp_offset
> is incremented by two after the while loop and never used after... I really
> don't understand this code...
>
> If I only set the reply flexpage as [in], I have the same behavior...
>
> Am I doing something wrong ?
No.
> Could it be a bug in DICE ?
Yes. Fix attached. Should be in public repository tomorrow.
> Is it permitted to
> use one in-flexpage and one out-flexpage for the same function ?
Yes.
> Is there
> something special to do ?
If you want to receive a flexpage from the server, you will have to set
the IPC flexpage receive window in the client. The Dice generated code
uses the rcv_fpage member in the CORBA_Environment parameter of the
*_call functions to do this. Thus, you have to set this member
appropriately. Per default this member is set to L4_WHOLE_ADDRESS_SPACE
(dice_default_environment).
Thanks for the bug-report, Ron.
--
Mit freundlichen Gruessen / with regards
ra3 @ inf.tu-dresden.de
http://os.inf.tu-dresden.de/~ra3/
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: dice.diff
URL: <http://os.inf.tu-dresden.de/pipermail/l4-hackers/attachments/20070801/647b62e8/attachment-0001.ksh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: OpenPGP digital signature
URL: <http://os.inf.tu-dresden.de/pipermail/l4-hackers/attachments/20070801/647b62e8/attachment-0001.asc>
More information about the l4-hackers
mailing list