Hello,
On 04/02/2014 10:20 AM, Przemyslaw Marczak wrote:
This patch adds support to generate UUID (Universally Unique Identifier)
in version 4 based on RFC4122, which is randomly.
Source: https://www.ietf.org/rfc/rfc4122.txt
Changes:
- new configs:
- CONFIG_LIB_UUID for compile lib/uuid.c
- CONFIG_RANDOM_UUID for functions gen_rand_uuid() and gen_rand_uuid_str()
- add configs dependency to include/config_fallbacks.h for lib uuid.
lib/uuid.c:
- add gen_rand_uuid() - this function writes 16 bytes len binary representation
of UUID v4 to the memory at given address.
- add gen_rand_uuid_str() - this function writes 37 bytes len hexadecimal
ASCII string representation of UUID v4 to the memory at given address.
Signed-off-by: Przemyslaw Marczak <p.marc...@samsung.com>
Cc: Stephen Warren <swar...@nvidia.com>
Cc: Lukasz Majewski <l.majew...@samsung.com>
Cc: tr...@ti.com
---
Changes v2:
- put uuid generation changes in a separate commit
- get_uuid_str() - change name to gen_rand_uuid_str()
- add new function: gen_rand_uuid()
- remove unnecessary '\0' at the end of uuid string
- drop unnecessary error checking
- functions now takes pointers to allocated memory instead of alloc it itself
- add new config option: CONFIG_RANDOM_UUID
Changes v3:
- remove unused UUID_STR_BYTE_LEN
- reword comments
- remove null pointer checking from gen_rand_uuid() and gen_rand_uuid_str()
- remove unneeded memset from gen_rand_uuid()
- undo moving vsprintf.o object in lib/Makefile
- add attribute "packed" to the uuid structure
- gen_rand_uuid(): add endian functions for modify uuid data
- gen_rand_uuid(): use memcpy() to store uuid data into given buffer for avoi
unaligned access issues
- change uuid version and variant masks to proper for use with clrsetbits_*
- add #ifdef CONFIG_RANDOM_UUID to random uuid code for avoid warnings
Changes v4:
- add new parameter to define UUID string format for UUID or GUID which differs
in endianness of first three string blocks.
- add uuid structure and version 4 data to uuid header file
- lib/Makefile: add CONFIG_RAND_UUID dependency to rand.o and uuid.o
Changes v5:
- reword some comments
- introduce config CMD_LIB_UUID, cleanup config dependency
- remove use of typedef uuid_str_t
Changes v6:
- fix indentation in include/config_fallbacks.h
---
I am sending next version because there was an indentation issue in
version 5 of this patch which is fixed now.
Thanks
--
Przemyslaw Marczak
Samsung R&D Institute Poland
Samsung Electronics
p.marc...@samsung.com
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot