crosvm/sys_util
Chirantan Ekbote fec86cc3ae poll_token_derive: Calculate variant bits without sizeof_val
Calculate the number of bits necessary to represent the enum variant
using the next_power_of_two() and trailing_zeros() functions from the
primitive usize type.

Also add a test to ensure that the returned value is correct when there
is only one variant in the enum.

BUG=none
TEST=unit tests

Change-Id: Ibd15efd4f06e17a74489fee04ff19aca0dde68b2
Signed-off-by: Chirantan Ekbote <chirantan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/959624
Reviewed-by: Zach Reizner <zachr@chromium.org>
2018-03-20 00:00:28 -07:00
..
poll_token_derive poll_token_derive: Calculate variant bits without sizeof_val 2018-03-20 00:00:28 -07:00
src crosvm/plugin: refactor poll loop to use PollContext 2018-03-08 19:28:52 -08:00
build.rs fix compiler errors and warnings 2017-08-30 13:04:16 -07:00
Cargo.toml sys_util: custom derive for PollToken 2018-03-07 16:54:46 -08:00
sock_ctrl_msg.c fix armv7a and aarch64 build errors and warnings 2017-09-01 12:39:18 -07:00