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

[Minios-devel] [UNIKRAFT PATCH 6/6] include/uk: adapt bitmap.h for Unikraft


  • To: minios-devel@xxxxxxxxxxxxx
  • From: Costin Lupu <costin.lupu@xxxxxxxxx>
  • Date: Fri, 3 Aug 2018 13:58:37 +0300
  • Cc: florian.schmidt@xxxxxxxxx, simon.kuenzer@xxxxxxxxx, yuri.volchkov@xxxxxxxxx
  • Delivery-date: Fri, 03 Aug 2018 10:58:53 +0000
  • Ironport-phdr: 9a23:6fazRhf9O7ctaAv4laWqZcbzlGMj4u6mDksu8pMizoh2WeGdxcW5YB7h7PlgxGXEQZ/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/hfaph605b0Aczw9Rf55VOCrEAOv3zXFX9tMfEAR85Ngy0wvvoCMlm24MYR22AHquZP7nJvlOS+O0vPvGGZJUJtzblN/gl+/nugGcimV8ceKmp2p0XZGq7HvR7PUqZZ3vtjckbEWoRuAoxUvDliFmYXjFIfXq9Qb887CkhCI26FYfDWpytgLuZ0Sa7A51WfGFGBkqSEXfvc4WLR/cMaCGVIs9/iTEEU6auRJMl1R60rwD20aRoLveHshEf4Jfi0tly/KjfmA8/8RRwDt+ByCedQmcymXkHFBEs26Uqiktm1laFmYxlm+EQQddU/O9IVEE+KIbB5+dhTcjvUETbeYHaGx6dXty6DGRpHZoKyNgUbhMlFg==
  • List-id: Mini-os development list <minios-devel.lists.xenproject.org>

1) Add SPDX license identifier
2) Include Unikraft header
3) Fix checkpatch issues

Signed-off-by: Costin Lupu <costin.lupu@xxxxxxxxx>
---
 include/uk/bitmap.h | 32 +++++++++++++++++---------------
 1 file changed, 17 insertions(+), 15 deletions(-)

diff --git a/include/uk/bitmap.h b/include/uk/bitmap.h
index c323e42..13178b6 100644
--- a/include/uk/bitmap.h
+++ b/include/uk/bitmap.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
 /*
  * Copyright (c) 2013-2017 Mellanox Technologies, Ltd.
  * All rights reserved.
@@ -29,7 +30,7 @@
 #ifndef _LINUX_BITMAP_H_
 #define        _LINUX_BITMAP_H_
 
-#include <linux/bitops.h>
+#include <uk/bitops.h>
 
 static inline void
 bitmap_zero(unsigned long *addr, const unsigned int size)
@@ -138,9 +139,9 @@ bitmap_clear(unsigned long *map, unsigned int start, int nr)
 
 static inline unsigned int
 bitmap_find_next_zero_area_off(const unsigned long *map,
-    const unsigned int size, unsigned int start,
-    unsigned int nr, unsigned int align_mask,
-    unsigned int align_offset)
+       const unsigned int size, unsigned int start,
+       unsigned int nr, unsigned int align_mask,
+       unsigned int align_offset)
 {
        unsigned int index;
        unsigned int end;
@@ -149,7 +150,8 @@ bitmap_find_next_zero_area_off(const unsigned long *map,
 retry:
        index = find_next_zero_bit(map, size, start);
 
-       index = (((index + align_offset) + align_mask) & ~align_mask) - 
align_offset;
+       index = (((index + align_offset) + align_mask) & ~align_mask) -
+               align_offset;
 
        end = index + nr;
        if (end > size)
@@ -165,11 +167,11 @@ retry:
 
 static inline unsigned int
 bitmap_find_next_zero_area(const unsigned long *map,
-    const unsigned int size, unsigned int start,
-    unsigned int nr, unsigned int align_mask)
+       const unsigned int size, unsigned int start,
+       unsigned int nr, unsigned int align_mask)
 {
        return (bitmap_find_next_zero_area_off(map, size,
-           start, nr, align_mask, 0));
+               start, nr, align_mask, 0));
 }
 
 static inline int
@@ -182,7 +184,7 @@ bitmap_find_free_region(unsigned long *bitmap, int bits, 
int order)
                if (!linux_reg_op(bitmap, pos, order, REG_OP_ISFREE))
                        continue;
                linux_reg_op(bitmap, pos, order, REG_OP_ALLOC);
-               return (pos);
+               return pos;
        }
        return (-ENOMEM);
 }
@@ -193,7 +195,7 @@ bitmap_allocate_region(unsigned long *bitmap, int pos, int 
order)
        if (!linux_reg_op(bitmap, pos, order, REG_OP_ISFREE))
                return (-EBUSY);
        linux_reg_op(bitmap, pos, order, REG_OP_ALLOC);
-       return (0);
+       return 0;
 }
 
 static inline void
@@ -223,7 +225,7 @@ bitmap_weight(unsigned long *addr, const unsigned int size)
 
 static inline int
 bitmap_equal(const unsigned long *pa,
-    const unsigned long *pb, unsigned size)
+       const unsigned long *pb, unsigned int size)
 {
        const unsigned int end = BIT_WORD(size);
        const unsigned int tail = size & (BITS_PER_LONG - 1);
@@ -245,7 +247,7 @@ bitmap_equal(const unsigned long *pa,
 
 static inline void
 bitmap_complement(unsigned long *dst, const unsigned long *src,
-    const unsigned int size)
+       const unsigned int size)
 {
        const unsigned int end = BITS_TO_LONGS(size);
        unsigned int i;
@@ -256,7 +258,7 @@ bitmap_complement(unsigned long *dst, const unsigned long 
*src,
 
 static inline void
 bitmap_or(unsigned long *dst, const unsigned long *src1,
-    const unsigned long *src2, const unsigned int size)
+       const unsigned long *src2, const unsigned int size)
 {
        const unsigned int end = BITS_TO_LONGS(size);
        unsigned int i;
@@ -267,7 +269,7 @@ bitmap_or(unsigned long *dst, const unsigned long *src1,
 
 static inline void
 bitmap_and(unsigned long *dst, const unsigned long *src1,
-    const unsigned long *src2, const unsigned int size)
+       const unsigned long *src2, const unsigned int size)
 {
        const unsigned int end = BITS_TO_LONGS(size);
        unsigned int i;
@@ -278,7 +280,7 @@ bitmap_and(unsigned long *dst, const unsigned long *src1,
 
 static inline void
 bitmap_xor(unsigned long *dst, const unsigned long *src1,
-    const unsigned long *src2, const unsigned int size)
+       const unsigned long *src2, const unsigned int size)
 {
        const unsigned int end = BITS_TO_LONGS(size);
        unsigned int i;
-- 
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®.