aboutsummaryrefslogtreecommitdiff
path: root/lib/test-string_helpers.c
diff options
context:
space:
mode:
authorAlexey Kardashevskiy <[email protected]>2014-09-25 16:39:18 +1000
committerMichael Ellerman <[email protected]>2014-10-03 14:22:34 +1000
commit9410e0185e65394c0c6d046033904b53b97a9423 (patch)
tree5ffb77357f8dd148ad64790fb8ca1f48a1a9feb1 /lib/test-string_helpers.c
parenta7696b36c01316308f2b9f2009ce38cb01fd7a3f (diff)
powerpc/iommu/ddw: Fix endianness
rtas_call() accepts and returns values in CPU endianness. The ddw_query_response and ddw_create_response structs members are defined and treated as BE but as they are passed to rtas_call() as (u32 *) and they get byteswapped automatically, the data is CPU-endian. This fixes ddw_query_response and ddw_create_response definitions and use. of_read_number() is designed to work with device tree cells - it assumes the input is big-endian and returns data in CPU-endian. However due to the ddw_create_response struct fix, create.addr_hi/lo are already CPU-endian so do not byteswap them. ddw_avail is a pointer to the "ibm,ddw-applicable" property which contains 3 cells which are big-endian as it is a device tree. rtas_call() accepts a RTAS token in CPU-endian. This makes use of of_property_read_u32_array to byte swap and avoid the need for a number of be32_to_cpu calls. Cc: [email protected] # v3.13+ Cc: Benjamin Herrenschmidt <[email protected]> [aik: folded Anton's patch with of_property_read_u32_array] Signed-off-by: Alexey Kardashevskiy <[email protected]> Acked-by: Anton Blanchard <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
Diffstat (limited to 'lib/test-string_helpers.c')
0 files changed, 0 insertions, 0 deletions