[okl4-developer] question on "string" and "smallstring" support
Kalamkar, Dhiraj D
dhiraj.d.kalamkar at intel.com
Tue Jul 22 19:23:17 EST 2008
Hi JC,
I had faced similar problem in past and to fix those I modified few template files in tools/magpie directory.
Apply attached patch from okl4 base directory using
patch -p0 < smallstring.patch
I am not sure patch attached will work for prototype
smallstring retreive_string(void);
but it will work for prototype
void retreive_string(out smallstring str);
See if it helps.
Thanks,
Dhiraj
-----Original Message-----
From: developer-bounces at okl4.org [mailto:developer-bounces at okl4.org] On Behalf Of Jean-Christophe DUBOIS
Sent: Tuesday, July 22, 2008 12:09 PM
To: Geoffrey Lee
Cc: developer at okl4.org
Subject: Re: [okl4-developer] question on "string" and "smallstring" support
Le Tuesday 22 July 2008 05:33:00 Geoffrey Lee, vous avez écrit :
> On Thu, Jul 17, 2008 at 11:53:53AM +0200, Jean-Christophe DUBOIS wrote:
> > Hum ... I am not sure that even the smallstring would work with the
> > latest OKL4 release.
> >
> > The smallstring type is understood by magpie ans the code seems to be
> > correctly generated but the smallstring type seems to be just missing
> > from OKL4 header files. Therefore no compilation is possible.
> >
> > Was smallstring "removed" on purpose or is this a mistake?
>
> When Magpie generates the C header files it turns it into a char
> pointer. Hence, there is no "smallstring" type in the OKL4 header
> files, for example.
Well there must be a bug then because this is only partially true. For example
here is the IDL4 file:
===============================================
import "iguana/types.h";
[uuid(45)]
interface hello_
{
void store_string(in smallstring text);
smallstring retreive_string(void);
};
===============================================
And here is an extract of the generated server header file
(./build/iguana/object/libs_hello/include/interfaces/hello_serverdecls.h):
===============================================
....
/* Prototype for the function which implements this service. Implement this.
*/
smallstring hello__retreive_string_impl(L4_ThreadId_t caller,
idl4_server_environment *env);
/* Reply-only function, for callbacks. */
static inline void hello__retreive_string_reply(CORBA_Object _client ,
smallstring __return );static inline void
hello__retreive_string_reply(CORBA_Object _client , smallstring __return )
{
byte *mr = (void *)L4_MRStart();
/* Marshal */
mr_varptr = &mr[4];
mr_varptr = magpie_marshal_smallstring(__return, mr_varptr);
/* Return number of return MRs used */
/* Number of registers used depends on length of variable-length
portion */
*((L4_Word_t *)(void *)(&mr[0])) = ((L4_Word_t)(mr_varptr - mr) /
sizeof(L4_Word_t));
/* send message */
L4_MsgLoad((L4_Msg_t *)mr);
L4_Reply(_client);
}
...
===================================================
And obviously there is no "definition" for "smallstring" to be found anywhere.
Also could you give a status on the "struct" or "string" support in IDL4
files?
Thanks
JC
> Have a look at the generated header files. If you are building
> for the Iguana environment they will likely be in build/iguana/object.
>
> -gl
_______________________________________________
Developer mailing list
Developer at okl4.org
https://lists.okl4.org/mailman/listinfo/developer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smallstring.patch
Type: application/octet-stream
Size: 3010 bytes
Desc: smallstring.patch
Url : http://lists.okl4.org/pipermail/developer/attachments/20080722/fed26bbf/attachment-0001.obj
More information about the Developer
mailing list