eal: add power management intrinsics
authorLiang Ma <liang.j.ma@intel.com>
Tue, 27 Oct 2020 14:59:02 +0000 (14:59 +0000)
committerThomas Monjalon <thomas@monjalon.net>
Thu, 29 Oct 2020 21:46:31 +0000 (22:46 +0100)
commitcda57d9388c03fc3b363387abc6c995e174604f0
tree6379f04cc2f1cdeeb65dddbc091d755909b9a9f9
parente448a5a9ed817a85d1021a7dff3744be1ac7bcfa
eal: add power management intrinsics

Add two new power management intrinsics, and provide an implementation
in eal/x86 based on UMONITOR/UMWAIT instructions. The instructions
are implemented as raw byte opcodes because there is not yet widespread
compiler support for these instructions.

The power management instructions provide an architecture-specific
function to either wait until a specified TSC timestamp is reached, or
optionally wait until either a TSC timestamp is reached or a memory
location is written to. The monitor function also provides an optional
comparison, to avoid sleeping when the expected write has already
happened, and no more writes are expected.

For more details, please refer to Intel(R) 64 and IA-32 Architectures
Software Developer's Manual, Volume 2.

Signed-off-by: Liang Ma <liang.j.ma@intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: David Christensen <drc@linux.vnet.ibm.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Ruifeng Wang <ruifeng.wang@arm.com>
lib/librte_eal/arm/include/meson.build
lib/librte_eal/arm/include/rte_power_intrinsics.h [new file with mode: 0644]
lib/librte_eal/include/generic/rte_power_intrinsics.h [new file with mode: 0644]
lib/librte_eal/include/meson.build
lib/librte_eal/ppc/include/meson.build
lib/librte_eal/ppc/include/rte_power_intrinsics.h [new file with mode: 0644]
lib/librte_eal/x86/include/meson.build
lib/librte_eal/x86/include/rte_power_intrinsics.h [new file with mode: 0644]