summaryrefslogtreecommitdiff
path: root/payloads/libpayload/include/endian.h
AgeCommit message (Collapse)Author
2014-08-05libpayload: Change CONFIG_* to CONFIG_LP_* in the kconfig.Gabe Black
When libpayload header files are included in the payload itself, it's possible that the payloads config settings will conflict with the ones in libpayload. It's also possible for the libpayload config settings to conflict with the payloads. To avoid that, the libpayload config settings have _LP_ (for libpayload) added to them. The symbols themselves as defined in the Config.in files are still the same, but the prefix added to them is now CONFIG_LP_ instead of just CONFIG_. Change-Id: Ib8a46d202e7880afdeac7924d69a949bfbcc5f97 Signed-off-by: Gabe Black <gabeblack@google.com> Reviewed-on: https://gerrit.chromium.org/gerrit/65303 Reviewed-by: Stefan Reinauer <reinauer@google.com> Tested-by: Gabe Black <gabeblack@chromium.org> Commit-Queue: Gabe Black <gabeblack@chromium.org> (cherry picked from commit 23e866da20862cace0ed2a67d6fb74056bc9ea9a) Signed-off-by: Isaac Christensen <isaac.christensen@se-eng.com> Reviewed-on: http://review.coreboot.org/6427 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Marc Jones <marc.jones@se-eng.com>
2014-04-26libpayload/endian.h: Provide alignment-agnostic enc/dec bytestreams.Edward O'Callaghan
Alignment-agnostic encode/decode bytestream to/from little/big endian. The le16enc(), le16dec(), le32enc(), le32dec() functions encode and decode integers to/from byte strings on any alignment in big/little endian format. See BYTEORDER(9). Change-Id: I73a174b9c02c467bc60590c5cd894dac58b8683a Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com> Reviewed-on: http://review.coreboot.org/5198 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2013-03-14libpayload: Turn the endian conversion macros into functions.Gabe Black
In their current macro form, any arguments that are expressions will be evaluated multiple times. That can cause problems if they have side effects, and might not even compile if the overall expression is ambiguous, for instance if you pass in foo++. Built with code that previously wouldn't compile because the macros expanded to ambiguous expressions. Change-Id: I378c04d7aff5b4ad40581930ce90e49ba7df1d3e Signed-off-by: Gabe Black <gabeblack@google.com> Reviewed-on: http://review.coreboot.org/2719 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2013-03-13libpayload: Add more parenthesis to the endian conversion macrosGabe Black
There weren't enough parenthesis in the macros so operations might only apply to the last part of an expression passed in as an argument. Change-Id: I5afb406f9409986e45bbbc598bcbd0dd8507ed35 Signed-off-by: Gabe Black <gabeblack@google.com> Reviewed-on: http://review.coreboot.org/2665 Tested-by: build bot (Jenkins) Reviewed-by: Marc Jones <marc.jones@se-eng.com>
2013-03-13libpayloads: Provide BSD/glibc style endian functions.Hung-Te Lin
The functions in endian.h (betoh{l,w,ll} and others) were named differently from the well-known BSD/glibc style endian functions (ex, betoh{16,32,64}). We should provide the BSD/glibc style functions to prevent confusion. Change-Id: Ia3bee481ba7989ac25b79ddb89bc6819d52fd8c3 Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: http://review.coreboot.org/2705 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-11-08Refactor the endianness conversion functions and header files.Gabe Black
The endianness of an architecture is now set up automatically using Kconfig and some common code. The available conversion functions were also expanded to go to or from a particular endianness. Those use the abbreviation le or be for little or big endian. Built for Stumpy and saw coreinfo cbfs support work which uses network byte order. Used the functions which convert to little endian to implement an AHCI driver. The source arch is also little endian, so they were effectively (and successfully) inert. Change-Id: I3a2d2403855b3e0e93fa34f45e8e542b3e5afeac Signed-off-by: Gabe Black <gabeblack@google.com> Reviewed-on: http://review.coreboot.org/1719 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>