1*837d542aSEvan Quan /*
2*837d542aSEvan Quan  * Copyright 2016 Advanced Micro Devices, Inc.
3*837d542aSEvan Quan  *
4*837d542aSEvan Quan  * Permission is hereby granted, free of charge, to any person obtaining a
5*837d542aSEvan Quan  * copy of this software and associated documentation files (the "Software"),
6*837d542aSEvan Quan  * to deal in the Software without restriction, including without limitation
7*837d542aSEvan Quan  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8*837d542aSEvan Quan  * and/or sell copies of the Software, and to permit persons to whom the
9*837d542aSEvan Quan  * Software is furnished to do so, subject to the following conditions:
10*837d542aSEvan Quan  *
11*837d542aSEvan Quan  * The above copyright notice and this permission notice shall be included in
12*837d542aSEvan Quan  * all copies or substantial portions of the Software.
13*837d542aSEvan Quan  *
14*837d542aSEvan Quan  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15*837d542aSEvan Quan  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16*837d542aSEvan Quan  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
17*837d542aSEvan Quan  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18*837d542aSEvan Quan  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19*837d542aSEvan Quan  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20*837d542aSEvan Quan  * OTHER DEALINGS IN THE SOFTWARE.
21*837d542aSEvan Quan  *
22*837d542aSEvan Quan  */
23*837d542aSEvan Quan 
24*837d542aSEvan Quan #ifndef _PP_ENDIAN_H_
25*837d542aSEvan Quan #define _PP_ENDIAN_H_
26*837d542aSEvan Quan 
27*837d542aSEvan Quan #define PP_HOST_TO_SMC_UL(X) cpu_to_be32(X)
28*837d542aSEvan Quan #define PP_SMC_TO_HOST_UL(X) be32_to_cpu(X)
29*837d542aSEvan Quan 
30*837d542aSEvan Quan #define PP_HOST_TO_SMC_US(X) cpu_to_be16(X)
31*837d542aSEvan Quan #define PP_SMC_TO_HOST_US(X) be16_to_cpu(X)
32*837d542aSEvan Quan 
33*837d542aSEvan Quan #define CONVERT_FROM_HOST_TO_SMC_UL(X) ((X) = PP_HOST_TO_SMC_UL(X))
34*837d542aSEvan Quan #define CONVERT_FROM_SMC_TO_HOST_UL(X) ((X) = PP_SMC_TO_HOST_UL(X))
35*837d542aSEvan Quan 
36*837d542aSEvan Quan #define CONVERT_FROM_HOST_TO_SMC_US(X) ((X) = PP_HOST_TO_SMC_US(X))
37*837d542aSEvan Quan 
38*837d542aSEvan Quan #endif /* _PP_ENDIAN_H_ */
39