aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/pstore_ram.h
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2018-11-01 18:11:47 -0400
committerKees Cook <keescook@chromium.org>2018-12-03 19:52:35 -0500
commitc208f7d4b037e1c71e5c839bb5dfcc3e0df19890 (patch)
tree61314678e6a015e0a28f13d4d74ee796afc81588 /include/linux/pstore_ram.h
parentdc80b1ea4cbff1d72ce3d5edaaf1b6602fd7c780 (diff)
pstore/ram: Add kern-doc for struct persistent_ram_zone
The struct persistent_ram_zone wasn't well documented. This adds kern-doc for it. Signed-off-by: Kees Cook <keescook@chromium.org>
Diffstat (limited to 'include/linux/pstore_ram.h')
-rw-r--r--include/linux/pstore_ram.h46
1 files changed, 43 insertions, 3 deletions
diff --git a/include/linux/pstore_ram.h b/include/linux/pstore_ram.h
index 6e94980357d2..5d10ad51c1c4 100644
--- a/include/linux/pstore_ram.h
+++ b/include/linux/pstore_ram.h
@@ -30,6 +30,10 @@
30 * PRZ_FLAG_NO_LOCK is used. For all other cases, locking is required. 30 * PRZ_FLAG_NO_LOCK is used. For all other cases, locking is required.
31 */ 31 */
32#define PRZ_FLAG_NO_LOCK BIT(0) 32#define PRZ_FLAG_NO_LOCK BIT(0)
33/*
34 * If a PRZ should only have a single-boot lifetime, this marks it as
35 * getting wiped after its contents get copied out after boot.
36 */
33#define PRZ_FLAG_ZAP_OLD BIT(1) 37#define PRZ_FLAG_ZAP_OLD BIT(1)
34 38
35struct persistent_ram_buffer; 39struct persistent_ram_buffer;
@@ -43,17 +47,53 @@ struct persistent_ram_ecc_info {
43 uint16_t *par; 47 uint16_t *par;
44}; 48};
45 49
50/**
51 * struct persistent_ram_zone - Details of a persistent RAM zone (PRZ)
52 * used as a pstore backend
53 *
54 * @paddr: physical address of the mapped RAM area
55 * @size: size of mapping
56 * @label: unique name of this PRZ
57 * @flags: holds PRZ_FLAGS_* bits
58 *
59 * @buffer_lock:
60 * locks access to @buffer "size" bytes and "start" offset
61 * @buffer:
62 * pointer to actual RAM area managed by this PRZ
63 * @buffer_size:
64 * bytes in @buffer->data (not including any trailing ECC bytes)
65 *
66 * @par_buffer:
67 * pointer into @buffer->data containing ECC bytes for @buffer->data
68 * @par_header:
69 * pointer into @buffer->data containing ECC bytes for @buffer header
70 * (i.e. all fields up to @data)
71 * @rs_decoder:
72 * RSLIB instance for doing ECC calculations
73 * @corrected_bytes:
74 * ECC corrected bytes accounting since boot
75 * @bad_blocks:
76 * ECC uncorrectable bytes accounting since boot
77 * @ecc_info:
78 * ECC configuration details
79 *
80 * @old_log:
81 * saved copy of @buffer->data prior to most recent wipe
82 * @old_log_size:
83 * bytes contained in @old_log
84 *
85 */
46struct persistent_ram_zone { 86struct persistent_ram_zone {
47 phys_addr_t paddr; 87 phys_addr_t paddr;
48 size_t size; 88 size_t size;
49 void *vaddr; 89 void *vaddr;
50 char *label; 90 char *label;
51 struct persistent_ram_buffer *buffer;
52 size_t buffer_size;
53 u32 flags; 91 u32 flags;
92
54 raw_spinlock_t buffer_lock; 93 raw_spinlock_t buffer_lock;
94 struct persistent_ram_buffer *buffer;
95 size_t buffer_size;
55 96
56 /* ECC correction */
57 char *par_buffer; 97 char *par_buffer;
58 char *par_header; 98 char *par_header;
59 struct rs_control *rs_decoder; 99 struct rs_control *rs_decoder;