wrong byte swap windows xp pro x64 (amd)

Bug #541294 reported by Jeff Hill
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
EPICS Base
Fix Released
Wishlist
Jeff Hill

Bug Description

From Chris Timossi,

You're right, adding the _M_AMD64 fixed the problem. Thanks. Here's the
diff:

Q:\MKS\mksnt>diff T:\epics\base\src\ca\net_convert.h
T:\epics\base-3.14.8.2\src\ca\net_convert.h
30c30
< #if defined (_M_IX86) || defined (_X86_) || defined (__i386__) ||
defined(_armv4l_) || defined (_X86_64_) || defined (_M_AMD64)
---
 > #if defined (_M_IX86) || defined (_X86_) || defined (__i386__) ||
defined(_armv4l_) || defined (_X86_64_)

Chris

Jeff Hill wrote:
> Hey Chris,
>
> The attached code in base\src\ca\net_convetrt.h might be the source of
> trouble.
>
> We probably need to add both (little endian active if either are set)
> _M_IA64 and _M_AMD64 to the conditional below. Please try installing
> that type of fix and let me know if that worked (send the diffs).
>
> PS: We definitely need to reorganize this part of the source so that
> there is less likelihood of needing to maintain this type of switch.
>
> PPS: Its amazing that no one has found this before you.
>
> Thanks,
>
> Jeff
>
> /*
> * Here are the definitions for architecture dependent byte ordering
> * and floating point format
> */
> #if defined (_M_IX86) || defined (_X86_) || defined (__i386__) ||
> defined(_armv4l_) || defined (_X86_64_)
> # define CA_FLOAT_IEEE
> # define CA_LITTLE_ENDIAN
> #elif defined (VAX)
> # define CA_FLOAT_MIT
> # define CA_LITTLE_ENDIAN
> #elif ( defined (__ALPHA) || defined (__alpha) ) && ( defined (VMS) ||
> defined (__VMS) )
> # define CA_FLOAT_MIT
> # define CA_LITTLE_ENDIAN
> #elif ( defined (__ALPHA) || defined (__alpha) ) && defined (UNIX)
> # define CA_FLOAT_IEEE
> # define CA_LITTLE_ENDIAN
> #else
> # define CA_FLOAT_IEEE
> # define CA_BIG_ENDIAN
> #endif
>
>
>> -----Original Message-----
>> From: Chris Timossi
>> Sent: Thursday, April 20, 2006 10:13 AM
>> To: Jeff Hill
>> Subject: windows xp pro x64 (amd)
>>
>> Hey Jeff,
>>
>> I'm playing around with building CA for x64 build for Windows XP Pro
>> x64 on an AMD processor.
>>
>> I built 3.14.8.2 with VS 2005 and it seems that when I run caget it
>> returns a value that's been byte swapped. Any ideas where I should look?
>>
>> For example, if I get the sample pv that simply counts from 0-9, I
>> see the right value for dbr_char (and string) but the other formats
>> are
>>
> wrong:
>
>> T:\epics\base-3.14.8.2>caget timossi:aiExample
>> currentTime::getCurrentTime(): 41969059.000000 sec time discontinuity
>> detected
>> currentTime::getCurrentTime(): 37831506.000000 sec time discontinuity
>> detected
>> currentTime::getCurrentTime(): 15793279.000000 sec time discontinuity
>> detected
>> currentTime::getCurrentTime(): 37169407.000000 sec time discontinuity
>> detected
>> currentTime::getCurrentTime(): 21735050.000000 sec time discontinuity
>> detected
>> currentTime::getCurrentTime(): 41252791.000000 sec time discontinuity
>> detected
>> timossi:aiExample 3.03865e-319
>> currentTime::getCurrentTime(): 42049374.000000 sec time discontinuity
>> detected
>> currentTime::getCurrentTime(): 42027546.000000 sec time discontinuity
>> detected
>>
>>
>> T:\epics\base-3.14.8.2>caget -d4 timossi:aiExample
>> currentTime::getCurrentTime(): 38324479.000000 sec time discontinuity
>> detected
>> currentTime::getCurrentTime(): 41871988.000000 sec time discontinuity
>> detected
>> currentTime::getCurrentTime(): 21722350.000000 sec time discontinuity
>> detected
>> currentTime::getCurrentTime(): 36448783.000000 sec time discontinuity
>> detected timossi:aiExample
>> Data type: DBR_CHAR (native: DBF_DOUBLE)
>> Element count: 1
>> Value: 7
>> currentTime::getCurrentTime(): 42032606.000000 sec time discontinuity
>> detected
>> currentTime::getCurrentTime(): 41975286.000000 sec time discontinuity
>> detected
>> currentTime::getCurrentTime(): 42027680.000000 sec time discontinuity
>> detected
>>
>

Original Mantis Bug: mantis-261
    http://www.aps.anl.gov/epics/mantis/view_bug_page.php?f_id=261

Tags: ca 3.14
Revision history for this message
Jeff Hill (johill-lanl) wrote :

fixed in R3.14.9

Revision history for this message
Andrew Johnson (anj) wrote :

R3.14.9 Released.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.