1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2010-2014 Intel Corporation
8 #include <rte_memory.h>
9 #include <rte_common.h>
17 * - Dump the mapped memory. The python-expect script checks that at
18 * least one line is dumped.
20 * - Check that memory size is different than 0.
22 * - Try to read all memory; it should not segfault.
31 const struct rte_memseg *mem;
34 * dump the mapped memory: the python-expect script checks
35 * that at least one line is dumped
37 printf("Dump memory layout\n");
38 rte_dump_physmem_layout(stdout);
40 /* check that memory size is != 0 */
41 s = rte_eal_get_physmem_size();
43 printf("No memory detected\n");
47 /* try to read memory (should not segfault) */
48 mem = rte_eal_get_physmem_layout();
49 for (i = 0; i < RTE_MAX_MEMSEG && mem[i].addr != NULL ; i++) {
52 for (j = 0; j<mem[i].len; j++) {
53 *((volatile uint8_t *) mem[i].addr + j);
60 REGISTER_TEST_COMMAND(memory_autotest, test_memory);