[Ace-users] Re: [ace-bugs] [ACE] : CDR_Stream : write_8() and read_8() don'tread/write properly on a PXA270 processor

Johnny Willemsen jwillemsen at remedy.nl
Fri Sep 28 10:26:06 CDT 2007


Hi,
 
Thanks for using the PRF form. Could you deliver patches to improve the
current code?
 
Regards,
 
Johnny Willemsen
Remedy IT
Postbus 101
2650 AC  Berkel en Rodenrijs
The Netherlands
www.theaceorb.nl / www.remedy.nl 

*** Integrated compile and test statistics see
http://scoreboard.theaceorb.nl <http://scoreboard.theaceorb.nl/>  ***
*** Commercial service and support for ACE/TAO/CIAO             ***
*** See http://www.theaceorb.nl/en/support.html                 *** 


________________________________

	From: ace-bugs-bounces at cse.wustl.edu
[mailto:ace-bugs-bounces at cse.wustl.edu] On Behalf Of Sebastien Gauthier
	Sent: Friday, September 28, 2007 5:21 PM
	To: ace-bugs at cse.wustl.edu
	Subject: [ace-bugs] [ACE] : CDR_Stream : write_8() and read_8()
don'tread/write properly on a PXA270 processor
	
	
	    TAO VERSION: 1.5.10
	    ACE VERSION: 5.5.10
	
	    HOST MACHINE and OPERATING SYSTEM:
	          Fedora core 3 on x86 PC
	
	    TARGET MACHINE and OPERATING SYSTEM, if different from HOST:
	    COMPILER NAME AND VERSION (AND PATCHLEVEL): 
	
	       gumstix verdex (XScale PXA270
	       )board running linux 2.6.21 , gcc 4.1.1
	
	    THE $ACE_ROOT/ace/config.h FILE [if you use a link to a
platform-
	    specific file, simply state which one]:
	see attached file
	
	    THE $ACE_ROOT/include/makeinclude 
	/platform_macros.GNU FILE [if you
	    use a link to a platform-specific file, simply state which one
	    (unless this isn't used in this case, e.g., with Microsoft
Visual 
	    C++)]:
	
	see attached file
	    CONTENTS OF
$ACE_ROOT/bin/MakeProjectCreator/config/default.features
	    (used by MPC when you generate your own makefiles):
	
	n/a    
	
	    AREA/CLASS/EXAMPLE AFFECTED: 
	
	For example, Param_test of ulonglong with the client or server
running
	on the PXA270, and the other on a Linux-PC
	
	    DOES THE PROBLEM AFFECT:
	        EXECUTION
	
	    SYNOPSIS:
	Wrong conversion to Intel format in ACE_OutputCDR::write_8 () 
	
	
	    DESCRIPTION:
	
	In CDR_Stream.cpp, the following code:
	
	ACE_CDR::Boolean
	ACE_OutputCDR::write_8 (const ACE_CDR::ULongLong *x)
	{
	  char *buf = 0;
	
	  if (this->adjust (ACE_CDR::LONGLONG_SIZE, buf) == 0) 
	    {
	#if defined (__arm__)
	      // Convert to Intel format (12345678 => 56781234)
	      const char *orig = reinterpret_cast<const char *> (x);
	      char *target = buf;
	      register ACE_UINT32 x = 
	        *reinterpret_cast<const ACE_UINT32 *> (orig);
	      register ACE_UINT32 y =
	        *reinterpret_cast<const ACE_UINT32 *> (orig + 4);
	      *reinterpret_cast<ACE_UINT32 *> (target) = y; 
	      *reinterpret_cast<ACE_UINT32 *> (target + 4) = x;
	      return true;
	
	is causing problem because of the unnecessary conversion to Intel
format
	for the PXA270.
	
	The bug is that __arm__ is too generic. The particular architecture
that require the conversion needs to be identified and the directive
replaced with a valid identifier for that architecture. 
	
	The same bug applies to read_8().
	
	Also, the word swap is actually hard-coded, it should be done via
one of the available ACE macros.  
	
	
	    REPEAT BY:
	
	Build TAO using attached configuration files and run Param_test
client or server 
	on a PXA270 and the other on another platform
	
	    SAMPLE FIX/WORKAROUND:
	Knowing the cpu used to test that part of the code initially,
someone could figure
	the correct value to put in the #if defined directive. 




More information about the Ace-users mailing list