mirror of
https://passt.top/passt
synced 2025-06-12 18:45:34 +02:00
Fix definitions of SOCKET_MAX, TCP_MAX_CONNS
...and, given that I keep getting this wrong, add a convenience macro, MAX_FROM_BITS(). Signed-off-by: Stefano Brivio <sbrivio@redhat.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
4f523c3276
commit
26a0e4d6ee
4 changed files with 7 additions and 5 deletions
2
util.h
2
util.h
|
@ -40,6 +40,8 @@
|
|||
#define ROUND_DOWN(x, y) ((x) & ~((y) - 1))
|
||||
#define ROUND_UP(x, y) (((x) + (y) - 1) & ~((y) - 1))
|
||||
|
||||
#define MAX_FROM_BITS(n) ((int)((1U << (n)) - 1))
|
||||
|
||||
#define BIT(n) (1UL << (n))
|
||||
#define BITMAP_BIT(n) (BIT((n) % (sizeof(long) * 8)))
|
||||
#define BITMAP_WORD(n) (n / (sizeof(long) * 8))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue