include/linux/libnvdimm.h
Source file repositories/reference/linux-study-clean/include/linux/libnvdimm.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/libnvdimm.h- Extension
.h- Size
- 10222 bytes
- Lines
- 332
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/io.hlinux/sizes.hlinux/spinlock.hlinux/types.hlinux/uuid.h
Detected Declarations
struct badrange_entrystruct badrangestruct nvdimmstruct nvdimm_bus_descriptorstruct attribute_groupstruct device_nodestruct modulestruct nvdimm_bus_descriptorstruct nd_cmd_descstruct nd_interleave_setstruct nd_mapping_descstruct biostruct resourcestruct nd_regionstruct nd_region_descstruct devicestruct nvdimm_key_datastruct nvdimm_security_opsstruct nvdimm_bus_fw_opsstruct nvdimm_fw_opsstruct kobjectstruct nvdimm_busenum nvdimm_security_bitsenum nvdimm_passphrase_typeenum nvdimm_fwa_stateenum nvdimm_fwa_triggerenum nvdimm_fwa_capabilityenum nvdimm_fwa_resultfunction nvdimm_ctlfunction arch_wb_cache_pmem
Annotated Snippet
struct badrange_entry {
u64 start;
u64 length;
struct list_head list;
};
struct badrange {
struct list_head list;
spinlock_t lock;
};
enum {
/* unarmed memory devices may not persist writes */
NDD_UNARMED = 1,
/* locked memory devices should not be accessed */
NDD_LOCKED = 2,
/* memory under security wipes should not be accessed */
NDD_SECURITY_OVERWRITE = 3,
/* tracking whether or not there is a pending device reference */
NDD_WORK_PENDING = 4,
/* dimm supports namespace labels */
NDD_LABELING = 6,
/*
* dimm contents have changed requiring invalidation of CPU caches prior
* to activation of a region that includes this device
*/
NDD_INCOHERENT = 7,
/* dimm provider wants synchronous registration by __nvdimm_create() */
NDD_REGISTER_SYNC = 8,
/* need to set a limit somewhere, but yes, this is likely overkill */
ND_IOCTL_MAX_BUFLEN = SZ_4M,
ND_CMD_MAX_ELEM = 5,
ND_CMD_MAX_ENVELOPE = 256,
ND_MAX_MAPPINGS = 32,
/* region flag indicating to direct-map persistent memory by default */
ND_REGION_PAGEMAP = 0,
/*
* Platform ensures entire CPU store data path is flushed to pmem on
* system power loss.
*/
ND_REGION_PERSIST_CACHE = 1,
/*
* Platform provides mechanisms to automatically flush outstanding
* write data from memory controler to pmem on system power loss.
* (ADR)
*/
ND_REGION_PERSIST_MEMCTRL = 2,
/* Platform provides asynchronous flush mechanism */
ND_REGION_ASYNC = 3,
/* Region was created by CXL subsystem */
ND_REGION_CXL = 4,
/* mark newly adjusted resources as requiring a label update */
DPA_RESOURCE_ADJUSTED = 1 << 0,
};
struct nvdimm;
struct nvdimm_bus_descriptor;
typedef int (*ndctl_fn)(struct nvdimm_bus_descriptor *nd_desc,
struct nvdimm *nvdimm, unsigned int cmd, void *buf,
unsigned int buf_len, int *cmd_rc);
struct attribute_group;
struct device_node;
struct module;
struct nvdimm_bus_descriptor {
const struct attribute_group **attr_groups;
unsigned long cmd_mask;
unsigned long dimm_family_mask;
unsigned long bus_family_mask;
struct module *module;
char *provider_name;
struct device_node *of_node;
ndctl_fn ndctl;
int (*flush_probe)(struct nvdimm_bus_descriptor *nd_desc);
int (*clear_to_send)(struct nvdimm_bus_descriptor *nd_desc,
struct nvdimm *nvdimm, unsigned int cmd, void *data);
const struct nvdimm_bus_fw_ops *fw_ops;
};
struct nd_cmd_desc {
int in_num;
int out_num;
u32 in_sizes[ND_CMD_MAX_ELEM];
int out_sizes[ND_CMD_MAX_ELEM];
Annotation
- Immediate include surface: `linux/io.h`, `linux/sizes.h`, `linux/spinlock.h`, `linux/types.h`, `linux/uuid.h`.
- Detected declarations: `struct badrange_entry`, `struct badrange`, `struct nvdimm`, `struct nvdimm_bus_descriptor`, `struct attribute_group`, `struct device_node`, `struct module`, `struct nvdimm_bus_descriptor`, `struct nd_cmd_desc`, `struct nd_interleave_set`.
- Atlas domain: Core OS / Core Kernel Interface.
- 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.