[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Minios-devel] [UNIKRAFT PATCH 5/6] include/essentials: Add ARRAY_SIZE macro
- To: minios-devel@xxxxxxxxxxxxx
- From: Costin Lupu <costin.lupu@xxxxxxxxx>
- Date: Fri, 22 Jun 2018 14:16:55 +0300
- Cc: simon.kuenzer@xxxxxxxxx, sharan.santhanam@xxxxxxxxx, yuri.volchkov@xxxxxxxxx
- Delivery-date: Fri, 22 Jun 2018 11:17:09 +0000
- Ironport-phdr: 9a23:18d6ChCGaJYvAiGRdy1wUyQJP3N1i/DPJgcQr6AfoPdwSPX4ocbcNUDSrc9gkEXOFd2Cra4c1qyO6+jJYi8p2d65qncMcZhBBVcuqP49uEgeOvODElDxN/XwbiY3T4xoXV5h+GynYwAOQJ6tL1LdrWev4jEMBx7xKRR6JvjvGo7Vks+7y/2+94fcbglUhDexe69+IAmrpgjNq8cahpdvJLwswRXTuHtIfOpWxWJsJV2Nmhv3+9m98p1+/SlOovwt78FPX7n0cKQ+VrxYES8pM3sp683xtBnMVhWA630BWWgLiBVIAgzF7BbnXpfttybxq+Rw1DWGMcDwULs5Xymp4aV2Rx/ykCoJNyA3/nzZhMJzi6xUohyhqgdjz4LIeoyZKOBzcr/Bcd4cWGFPXtxRVytEAo6kcYYPCPEBPfpZr4n7ulAAqwa+BRGxBOjyzTJHmnj23bYm0+QgFwHKxgggH88WsHTJt9j6KLwSXfqtzKnV1jrPdelW2TDk5YXObxsvoumMUKptfcfe1EUjDQDIg1WKpYD7IT+Y1P4BvmaD4+Z9Wu+jlnQrpgJxrzS12MshhIfEipgIxl3L6yl0xps+K8eiR05he9GkFYNdtySdN4RrXMwvW3pouCMmyr0evp67YTQKxIwnxxHBb/yHdJCF4gzmVOmLIDd4gGhpd66khxqo6Uig1/bzWtOu0FZNtiZFk9/MuW4R1xHL98SKReZx8l2i1DuPzQzf9P9ILEIumafVM5Ihx6Q/lpsXsUTNBC/2n0D2gbeKeUUj4eio9+XnYrP8qp+YKo90khz+P78ylcykG+g4KhUOUHOB9eSm073v5Vf5T6lSjv0qjqnZt4jXJcEapq6/Ag9V1Z0j5w+iADi4ztQXg30HIUlBeBKGlIjpJ0rOLOr3DPihhVSgijBrx+rJPrf5GJXCMmDDkKv9fbZ680Nc0wozwspF551ODLENOunzVVX3tNzEDh82KQq0zPziCNhm0IMRR36AAquDP6zJq1OH+P8vKfGWZIAJoDb9N+Ql5/n2gH8imF8deK6p3Z0NZHC7A/RpPUOZYHvyjdcbCmoKuBQxQ/DuiFKYSjFffWi9X78k7DEhFI2mFZvDRpyqgLGZ3Ca7A4dWZmFcBlCSFnfoc5mLW/cPaCKVPM9siToEWqa9RI8lzx6hrxX2xKR6LrmcxipNsJPl1d9uouHeixw23Th1FNiGlXGASSdzhGxbaSUx2fVUpldhy1HL9bVgnrQMHttI+/JPFAMnLYP0xPc8E834HBjGKITaAG26S8mrVGliBuk6xMUDNh5w
- List-id: Mini-os development list <minios-devel.lists.xenproject.org>
New definition for retrieving the size for arrays.
Signed-off-by: Costin Lupu <costin.lupu@xxxxxxxxx>
---
include/uk/essentials.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/include/uk/essentials.h b/include/uk/essentials.h
index 1cabb20..f9a7fd1 100644
--- a/include/uk/essentials.h
+++ b/include/uk/essentials.h
@@ -168,6 +168,10 @@ extern "C" {
#define ALIGN_DOWN(v, a) ((v) & ~((a)-1))
#endif
+#ifndef ARRAY_SIZE
+#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
+#endif
+
#ifndef DECONST
#include <uk/arch/types.h>
#define DECONST(t, a) ((t)((__uptr)((const void *)(a))))
--
2.11.0
_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel
|