diff options
author | Damjan Marion <dmarion@me.com> | 2020-02-12 20:33:01 +0100 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2020-02-12 21:53:07 +0000 |
commit | e7d89963edaabad59bea24e09d253fddbf04e39f (patch) | |
tree | fa02891f23e94024906f843039609abad4917cad /src/vppinfra/cache.h | |
parent | 9372374f0de1d4b2767bd8c9dbaa868a9975dfaa (diff) |
vppinfra: add clib_prefetch_load and clib_prefetch_store
For people tired of typen CLIB_CACHE_LINE_BYTES....
Type: improvement
Change-Id: I7658a8525ff6e3edc81a29b05a6fda33e537806e
Signed-off-by: Damjan Marion <dmarion@me.com>
Diffstat (limited to 'src/vppinfra/cache.h')
-rw-r--r-- | src/vppinfra/cache.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/vppinfra/cache.h b/src/vppinfra/cache.h index e2c406d8432..04f91e00061 100644 --- a/src/vppinfra/cache.h +++ b/src/vppinfra/cache.h @@ -90,6 +90,18 @@ do { \ #undef _ +static_always_inline void +clib_prefetch_load (void *p) +{ + CLIB_PREFETCH (p, CLIB_CACHE_LINE_BYTES, LOAD); +} + +static_always_inline void +clib_prefetch_store (void *p) +{ + CLIB_PREFETCH (p, CLIB_CACHE_LINE_BYTES, STORE); +} + #endif /* included_clib_cache_h */ |