<p>Patrick Georgi <strong>merged</strong> this change.</p><p><a href="https://review.coreboot.org/28467">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  build bot (Jenkins): Verified
  Martin Roth: Looks good to me, approved

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">src/include: Introduce guid_t type<br><br>Duplicate the guid_t and GUID_INIT framework from the Linux<br>driver.  Adapt it for coreboot, and create supporting copy<br>and compare functions.<br><br>Change-Id: Ia1cd7a1f0e0f900858830e1a6a7e2bbbe272fa30<br>Signed-off-by: Marshall Dawson <marshalldawson3rd@gmail.com><br>Reviewed-on: https://review.coreboot.org/28467<br>Tested-by: build bot (Jenkins) <no-reply@coreboot.org><br>Reviewed-by: Martin Roth <martinroth@google.com><br>---<br>A src/include/uuid.h<br>1 file changed, 42 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/include/uuid.h b/src/include/uuid.h</span><br><span>new file mode 100644</span><br><span>index 0000000..0209055</span><br><span>--- /dev/null</span><br><span>+++ b/src/include/uuid.h</span><br><span>@@ -0,0 +1,42 @@</span><br><span style="color: hsl(120, 100%, 40%);">+/*</span><br><span style="color: hsl(120, 100%, 40%);">+ * This file is part of the coreboot project.</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * Copyright (C) 2010, Intel Corp. Huang Ying <ying.huang@intel.com></span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * This program is free software; you can redistribute it and/or modify</span><br><span style="color: hsl(120, 100%, 40%);">+ * it under the terms of the GNU General Public License as published by</span><br><span style="color: hsl(120, 100%, 40%);">+ * the Free Software Foundation; version 2 of the License.</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * This program is distributed in the hope that it will be useful,</span><br><span style="color: hsl(120, 100%, 40%);">+ * but WITHOUT ANY WARRANTY; without even the implied warranty of</span><br><span style="color: hsl(120, 100%, 40%);">+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span><br><span style="color: hsl(120, 100%, 40%);">+ * GNU General Public License for more details.</span><br><span style="color: hsl(120, 100%, 40%);">+ */</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+#ifndef _UUID_H_</span><br><span style="color: hsl(120, 100%, 40%);">+#define _UUID_H_</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+#include <string.h></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+typedef struct {</span><br><span style="color: hsl(120, 100%, 40%);">+     uint8_t b[16];</span><br><span style="color: hsl(120, 100%, 40%);">+} __packed guid_t;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+#define GUID_INIT(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7)                \</span><br><span style="color: hsl(120, 100%, 40%);">+((guid_t)                                                            \</span><br><span style="color: hsl(120, 100%, 40%);">+{{ (a) & 0xff, ((a) >> 8) & 0xff, ((a) >> 16) & 0xff, ((a) >> 24) & 0xff, \</span><br><span style="color: hsl(120, 100%, 40%);">+   (b) & 0xff, ((b) >> 8) & 0xff,                                       \</span><br><span style="color: hsl(120, 100%, 40%);">+   (c) & 0xff, ((c) >> 8) & 0xff,                                      \</span><br><span style="color: hsl(120, 100%, 40%);">+   (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) } })</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+static inline int guidcmp(const guid_t *guid1, const guid_t *guid2)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+   return memcmp(guid1, guid2, sizeof(guid_t));</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+static inline guid_t *guidcpy(guid_t *dest, const guid_t *src)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+  return (guid_t *)memcpy(dest, src, sizeof(guid_t));</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+#endif /* _UUID_H_ */</span><br><span></span><br></pre><p>To view, visit <a href="https://review.coreboot.org/28467">change 28467</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://review.coreboot.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://review.coreboot.org/28467"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: coreboot </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: Ia1cd7a1f0e0f900858830e1a6a7e2bbbe272fa30 </div>
<div style="display:none"> Gerrit-Change-Number: 28467 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Marshall Dawson <marshalldawson3rd@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: Marshall Dawson <marshalldawson3rd@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: Martin Roth <martinroth@google.com> </div>
<div style="display:none"> Gerrit-Reviewer: Patrick Georgi <pgeorgi@google.com> </div>
<div style="display:none"> Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org> </div>