[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] [UNIKRAFT PATCH v2 5/6] include/essentials: Add ARRAY_SIZE macro


  • To: minios-devel@xxxxxxxxxxxxx
  • From: Costin Lupu <costin.lupu@xxxxxxxxx>
  • Date: Thu, 28 Jun 2018 15:38:34 +0300
  • Cc: simon.kuenzer@xxxxxxxxx, sharan.santhanam@xxxxxxxxx, yuri.volchkov@xxxxxxxxx
  • Delivery-date: Thu, 28 Jun 2018 12:38:47 +0000
  • Ironport-phdr: 9a23:Cv0UuBc6FeajjZFXMaKp0RiklGMj4u6mDksu8pMizoh2WeGdxcW5Yh7h7PlgxGXEQZ/co6odzbaO7ea4ASQp2tWoiDg6aptCVhsI2409vjcLJ4q7M3D9N+PgdCcgHc5PBxdP9nC/NlVJSo6lPwWB6nK94iQPFRrhKAF7Ovr6GpLIj8Swyuu+54Dfbx9HiTahYL5+Ngm6oRnMvcQKnIVuLbo8xAHUqXVSYeRWwm1oJVOXnxni48q74YBu/SdNtf8/7sBMSar1cbg2QrxeFzQmLns65Nb3uhnZTAuA/WUTX2MLmRdVGQfF7RX6XpDssivms+d2xSeXMdHqQb0yRD+v6bpgRh31hycdLzM38H/ZhNF+gqxYpxyupRJ/zpXIbI2JLvdyYrnQcc8GSWdHQ81fVzZBAoS5b4YXEecBOv1Yr5X8p1sIsBCwAxSsBPvyyjRVgXL5wao60/89EQHH2gwsBdYOsGnMrNXoL6odTfu1wLPQzTXedPxawy396I/Rfx0nvPqCXqpwfNLMxUQgCg/JlFadpIz/Mz+LyOgAsXKX4uR4We6yhGMrtht9rzuvy8s2lIXEiIwYxkrZ+Sh23oo4I8CzRlRhbt6+CpRQsjmXN45xQsw/XW5loD06yrgauZ6jeygK1Ygnywbfa/OZd4iI5QruVPiUIThihXJlfKiziAqp8US60u38S9K73ExQripCitXMt3YN2ALP6sWfV/dw8Vqt1SyM2g3T8O1IP144mKjBJ5Mv2rIwk4AcsUXHHi/4gkX2i6qWe1049eiv8OTnfrTmppmGO49wlwH+Krkul9ejDuQjKAQOR3Wb9v+m2L35+k31WK9KgeEukqnFrJDaItwWpqu4Aw9T04Yj7A2/Ay6739sGg3kIMlZFdQmDj4joIFHOPOv4Ae2wgluyljdn3ffGPqfuAp/VNHjMjK/hfaph605b0Acz1tBf6IhOCr4bJvL/QFTxu8beDh8lMwy72eDnB8941o4FX2KAHLOWMKfIvlCT/O4gPfSMbpcPuDnhM/gl++LujXghlF8GfKmp2JwXaHaiEvRlPkWWf3zsg9YfHmcQpQc+SvLlh0GGUTFJfHm+Rbwz5iwjAoK8EYjDXpytgKCG3CqjHpxWe3pGClGWHXf2cIWEX+sDaCKRIs9mjDwJTr6hRJE92hGqrgD10KBrIfTJ+n5QiZW20dlz5urI0B0/6zFwJ8CcyH2WCXF5mCUPXTBl8rp4pBlWzUyf0K4wp+FACJQH7PRSTgY8c5rB1/FSAMu0Qh/LOM2OHgX1Cu66CC08G4pii+QFZFxwTo2v
  • 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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.