bsd: make hash.h includeable from both C and C++ code

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
bsd: extract get_clockcycles() declaration to a header

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
bsd: reorder fields of struct random_adaptor to match initialization order

This is needed to make initializers using field designators work when
randomdev_soft.c is converted to C++. gcc-4.8 produces an error when
such initializers are used in a different order than the one from
struct definition.

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
bsd: C++'ify source files realted to entropy harvesting

These files need to be converted so that a constructor to struct
harvest can be added.

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
lockfree: align ring_spsc.emplace() to the STL standard

In STL emplace() constructs an element in place, passing its arguments
to the constructor. This change makes ring_spsc.emplace() and
unordered_ring_mpsc.emplace() behave the same.

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
core: move unordered_ring_mpsc.hh form osv/ to lockfree/

That's where all lock-free data structures are now.

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>