From mboxrd@z Thu Jan 1 00:00:00 1970 From: Przemyslaw Marczak Date: Wed, 02 Apr 2014 10:25:56 +0200 Subject: [U-Boot] [PATCH v6 3/6] lib: uuid: add functions to generate UUID version 4 In-Reply-To: <1396426807-30510-3-git-send-email-p.marczak@samsung.com> References: <1396362643-4280-1-git-send-email-p.marczak@samsung.com> <1396426807-30510-1-git-send-email-p.marczak@samsung.com> <1396426807-30510-3-git-send-email-p.marczak@samsung.com> Message-ID: <533BC994.6040201@samsung.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 > Cc: Stephen Warren > Cc: Lukasz Majewski > Cc: trini at 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.marczak at samsung.com