Skip to content
Snippets Groups Projects
Commit 476ff289 authored by Jean-Damien Durand's avatar Jean-Damien Durand Committed by Steven Murray
Browse files

ppc64 support

parent a76ad91f
Branches
Tags
No related merge requests found
/*
* $Id: marshall.h,v 1.14 2003/10/31 07:19:16 jdurand Exp $
* $Id: marshall.h,v 1.15 2005/02/22 13:28:13 jdurand Exp $
*/
/*
* @(#)$RCSfile: marshall.h,v $ $Revision: 1.14 $ $Date: 2003/10/31 07:19:16 $ CERN IT-PDP/DM Fabrizio Cane
* @(#)$RCSfile: marshall.h,v $ $Revision: 1.15 $ $Date: 2005/02/22 13:28:13 $ CERN IT-PDP/DM Fabrizio Cane
*/
/*
......@@ -139,7 +139,7 @@ EXTERN_C int DLL_DECL _unmarshall_STRINGN _PROTO((char **, char*, int));
* H Y P E R ( 6 4 B I T S )
*/
#if !defined(__alpha) && !defined(i386) && !defined(_WIN32) && !defined(__ia64__) && !defined(__x86_64)
#if !defined(__alpha) && !defined(i386) && !defined(_WIN32) && !defined(__ia64__) && !defined(__x86_64) && !defined(__ppc64__)
#define marshall_HYPER(ptr,n) { U_HYPER u_ = n; \
LONG n_ = htonl(*((unsigned long *)&(u_))); \
(void) memcpy((ptr),LONGADDR(n_),LONGSIZE); \
......@@ -162,6 +162,29 @@ EXTERN_C int DLL_DECL _unmarshall_STRINGN _PROTO((char **, char*, int));
n = u_; \
}
#else
#if defined(__ppc64__)
#define marshall_HYPER(ptr,n) { U_HYPER u_ = n; \
LONG n_ = htonl(*((U_LONG *)&(u_))); \
(void) memcpy((ptr),LONGADDR(n_),LONGSIZE); \
INC_PTR(ptr,LONGSIZE); \
n_ = htonl(*((U_LONG *)((char *)&(u_)+LONGSIZE))); \
(void) memcpy((ptr),LONGADDR(n_),LONGSIZE); \
INC_PTR(ptr,LONGSIZE); \
}
#define unmarshall_HYPER(ptr,n) { U_HYPER u_; \
LONG n_ = 0; \
(void) memcpy(LONGADDR(n_),(ptr),LONGSIZE); \
*((LONG *)&(u_)) = ntohl((U_LONG)(n_)); \
INC_PTR(ptr,LONGSIZE); \
n_ = 0; \
(void) memcpy(LONGADDR(n_),(ptr),LONGSIZE); \
*((LONG *)((char *)&(u_)+LONGSIZE)) = \
ntohl((U_LONG)(n_)); \
INC_PTR(ptr,LONGSIZE); \
n = u_; \
}
#else
#define marshall_HYPER(ptr,n) { U_HYPER u_ = n; \
LONG n_ = htonl(*((U_LONG *)((char *)&(u_)+LONGSIZE))); \
(void) memcpy((ptr),LONGADDR(n_),LONGSIZE); \
......@@ -184,6 +207,7 @@ EXTERN_C int DLL_DECL _unmarshall_STRINGN _PROTO((char **, char*, int));
n = u_; \
}
#endif
#endif
/*
* O P A Q U E
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment