diff options
author | Ben Pfaff <blp@nicira.com> | 2015-04-15 15:21:00 -0700 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2015-04-15 16:18:05 -0700 |
commit | 95a92d5a0dab83595b6952fda5932526696f1e4e (patch) | |
tree | 90db3affa50ba141b13f1e9aae61f16bf663d595 /lib/util.h | |
parent | 10b1662bfa8603e90cd0405e3bd0877b62f208bb (diff) | |
download | openvswitch-95a92d5a0dab83595b6952fda5932526696f1e4e.tar.gz |
util: Add more bitwise operations.
To be used in upcoming commits.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
Acked-by: Russell Bryant <rbryant@redhat.com>
Diffstat (limited to 'lib/util.h')
-rw-r--r-- | lib/util.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/util.h b/lib/util.h index 276edb569..55fb50cfb 100644 --- a/lib/util.h +++ b/lib/util.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. + * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -542,11 +542,18 @@ bool bitwise_is_all_zeros(const void *, unsigned int len, unsigned int ofs, unsigned int n_bits); unsigned int bitwise_scan(const void *, unsigned int len, bool target, unsigned int start, unsigned int end); +int bitwise_rscan(const void *, unsigned int len, bool target, + int start, int end); void bitwise_put(uint64_t value, void *dst, unsigned int dst_len, unsigned int dst_ofs, unsigned int n_bits); uint64_t bitwise_get(const void *src, unsigned int src_len, unsigned int src_ofs, unsigned int n_bits); +bool bitwise_get_bit(const void *src, unsigned int len, unsigned int ofs); +void bitwise_put0(void *dst, unsigned int len, unsigned int ofs); +void bitwise_put1(void *dst, unsigned int len, unsigned int ofs); +void bitwise_put_bit(void *dst, unsigned int len, unsigned int ofs, bool); +void bitwise_toggle_bit(void *dst, unsigned int len, unsigned int ofs); void xsleep(unsigned int seconds); |