soc/intel/common/acpi: Fix ACPI Namespace lookup failure, AE_ALREADY_EXISTS issue
[coreboot.git] / src / include / uuid.h
blob0209055e9ebcc1e4008537e9507eba3633bd2b8a
1 /*
2 * This file is part of the coreboot project.
4 * Copyright (C) 2010, Intel Corp. Huang Ying <ying.huang@intel.com>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
16 #ifndef _UUID_H_
17 #define _UUID_H_
19 #include <string.h>
21 typedef struct {
22 uint8_t b[16];
23 } __packed guid_t;
25 #define GUID_INIT(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7) \
26 ((guid_t) \
27 {{ (a) & 0xff, ((a) >> 8) & 0xff, ((a) >> 16) & 0xff, ((a) >> 24) & 0xff, \
28 (b) & 0xff, ((b) >> 8) & 0xff, \
29 (c) & 0xff, ((c) >> 8) & 0xff, \
30 (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) } })
32 static inline int guidcmp(const guid_t *guid1, const guid_t *guid2)
34 return memcmp(guid1, guid2, sizeof(guid_t));
37 static inline guid_t *guidcpy(guid_t *dest, const guid_t *src)
39 return (guid_t *)memcpy(dest, src, sizeof(guid_t));
42 #endif /* _UUID_H_ */