Skip to content

Commit

Permalink
eal/x86: add write combining store for MSVC
Browse files Browse the repository at this point in the history
MSVC does not support inline assembly. Instead it provides compiler
intrinsics. Provide conditional compile for MSVC for movdiri using the
_directstoreu_u32 intrinsic.

Signed-off-by: Tyler Retzlaff <[email protected]>
  • Loading branch information
Tyler Retzlaff authored and david-marchand committed Jan 29, 2025
1 parent 43fd362 commit feb9fd6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/eal/x86/include/rte_io.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,15 @@ extern "C" {
static __rte_always_inline void
__rte_x86_movdiri(uint32_t value, volatile void *addr)
{
#ifdef RTE_TOOLCHAIN_MSVC
_directstoreu_u32((void *)(uintptr_t)addr, value);
#else
asm volatile(
/* MOVDIRI */
".byte 0x0f, 0x38, 0xf9, 0x02"
:
: "a" (value), "d" (addr));
#endif
}

__rte_experimental
Expand Down

0 comments on commit feb9fd6

Please sign in to comment.