tools/testing/selftests/riscv/mm/mmap_test.h
Source file repositories/reference/linux-study-clean/tools/testing/selftests/riscv/mm/mmap_test.h
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/riscv/mm/mmap_test.h- Extension
.h- Size
- 574 bytes
- Lines
- 24
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: implementation source
- Status
- source implementation candidate
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
Dependency Surface
sys/mman.hsys/resource.hstddef.hstrings.hkselftest_harness.h
Detected Declarations
function memory_layout
Annotated Snippet
#ifndef _TESTCASES_MMAP_TEST_H
#define _TESTCASES_MMAP_TEST_H
#include <sys/mman.h>
#include <sys/resource.h>
#include <stddef.h>
#include <strings.h>
#include "kselftest_harness.h"
#define TOP_DOWN 0
#define BOTTOM_UP 1
#define PROT (PROT_READ | PROT_WRITE)
#define FLAGS (MAP_PRIVATE | MAP_ANONYMOUS)
static inline int memory_layout(void)
{
void *value1 = mmap(NULL, sizeof(int), PROT, FLAGS, 0, 0);
void *value2 = mmap(NULL, sizeof(int), PROT, FLAGS, 0, 0);
return value2 > value1;
}
#endif /* _TESTCASES_MMAP_TEST_H */
Annotation
- Immediate include surface: `sys/mman.h`, `sys/resource.h`, `stddef.h`, `strings.h`, `kselftest_harness.h`.
- Detected declarations: `function memory_layout`.
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.