[DICE] Compilation error with two flexpages

Clermont, Nicolas nicolas.clermont at eads.com
Wed Aug 1 14:49:12 CEST 2007


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. 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 ? Could it be a bug in DICE ? Is it permitted to
use one in-flexpage and one out-flexpage for the same function ? Is there
something special to do ?
 
Thanks,
 
-- 
nico




More information about the l4-hackers mailing list