2019-06-25 11:12:58 +00:00
|
|
|
/* SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
* Copyright(c) 2010-2014 Intel Corporation
|
2017-04-21 10:43:26 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdio.h>
|
2018-05-15 09:49:22 +00:00
|
|
|
#include <stdint.h>
|
2017-04-21 10:43:26 +00:00
|
|
|
|
2018-05-15 09:49:22 +00:00
|
|
|
#include <rte_prefetch.h>
|
|
|
|
|
|
|
|
#include "test.h"
|
2017-04-21 10:43:26 +00:00
|
|
|
|
|
|
|
/*
|
2018-05-15 09:49:22 +00:00
|
|
|
* Prefetch test
|
|
|
|
* =============
|
|
|
|
*
|
|
|
|
* - Just test that the macro can be called and validate the compilation.
|
|
|
|
* The test always return success.
|
2017-04-21 10:43:26 +00:00
|
|
|
*/
|
|
|
|
|
2018-05-15 09:49:22 +00:00
|
|
|
static int
|
|
|
|
test_prefetch(void)
|
2017-04-21 10:43:26 +00:00
|
|
|
{
|
2022-09-02 04:40:05 +00:00
|
|
|
int a = 0;
|
2018-05-15 09:49:22 +00:00
|
|
|
|
|
|
|
rte_prefetch0(&a);
|
|
|
|
rte_prefetch1(&a);
|
|
|
|
rte_prefetch2(&a);
|
|
|
|
|
2021-02-05 08:48:47 +00:00
|
|
|
rte_prefetch0_write(&a);
|
|
|
|
rte_prefetch1_write(&a);
|
|
|
|
rte_prefetch2_write(&a);
|
|
|
|
|
|
|
|
rte_cldemote(&a);
|
|
|
|
|
2017-04-21 10:43:26 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2018-05-15 09:49:22 +00:00
|
|
|
|
|
|
|
REGISTER_TEST_COMMAND(prefetch_autotest, test_prefetch);
|