From 093a6c67005148ae32a5c9e4553491b9f5c2457b Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Fri, 10 May 2024 07:40:51 +0000
Subject: [PATCH] disable kernel build waring
---
kernel/include/linux/pstore_ram.h | 113 +++++++++++++++++++++++++++-----------------------------
1 files changed, 54 insertions(+), 59 deletions(-)
diff --git a/kernel/include/linux/pstore_ram.h b/kernel/include/linux/pstore_ram.h
index 82ffcac..ad7e88a 100644
--- a/kernel/include/linux/pstore_ram.h
+++ b/kernel/include/linux/pstore_ram.h
@@ -1,17 +1,8 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (C) 2010 Marco Stornelli <marco.stornelli@gmail.com>
* Copyright (C) 2011 Kees Cook <keescook@chromium.org>
* Copyright (C) 2011 Google, Inc.
- *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- * may be copied, distributed, and modified under those terms.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
*/
#ifndef __LINUX_PSTORE_RAM_H__
@@ -22,8 +13,8 @@
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/list.h>
-#include <linux/types.h>
#include <linux/pstore.h>
+#include <linux/types.h>
/*
* Choose whether access to the RAM zone requires locking or not. If a zone
@@ -31,16 +22,14 @@
* PRZ_FLAG_NO_LOCK is used. For all other cases, locking is required.
*/
#define PRZ_FLAG_NO_LOCK BIT(0)
+/*
+ * If a PRZ should only have a single-boot lifetime, this marks it as
+ * getting wiped after its contents get copied out after boot.
+ */
+#define PRZ_FLAG_ZAP_OLD BIT(1)
struct persistent_ram_buffer;
struct rs_control;
-
-struct persistent_ram_buffer {
- uint32_t sig;
- atomic_t start;
- atomic_t size;
- uint8_t data[0];
-};
struct persistent_ram_ecc_info {
int block_size;
@@ -50,16 +39,55 @@
uint16_t *par;
};
+/**
+ * struct persistent_ram_zone - Details of a persistent RAM zone (PRZ)
+ * used as a pstore backend
+ *
+ * @paddr: physical address of the mapped RAM area
+ * @size: size of mapping
+ * @label: unique name of this PRZ
+ * @type: frontend type for this PRZ
+ * @flags: holds PRZ_FLAGS_* bits
+ *
+ * @buffer_lock:
+ * locks access to @buffer "size" bytes and "start" offset
+ * @buffer:
+ * pointer to actual RAM area managed by this PRZ
+ * @buffer_size:
+ * bytes in @buffer->data (not including any trailing ECC bytes)
+ *
+ * @par_buffer:
+ * pointer into @buffer->data containing ECC bytes for @buffer->data
+ * @par_header:
+ * pointer into @buffer->data containing ECC bytes for @buffer header
+ * (i.e. all fields up to @data)
+ * @rs_decoder:
+ * RSLIB instance for doing ECC calculations
+ * @corrected_bytes:
+ * ECC corrected bytes accounting since boot
+ * @bad_blocks:
+ * ECC uncorrectable bytes accounting since boot
+ * @ecc_info:
+ * ECC configuration details
+ *
+ * @old_log:
+ * saved copy of @buffer->data prior to most recent wipe
+ * @old_log_size:
+ * bytes contained in @old_log
+ *
+ */
struct persistent_ram_zone {
phys_addr_t paddr;
size_t size;
void *vaddr;
+ char *label;
+ enum pstore_type_id type;
+ u32 flags;
+
+ raw_spinlock_t buffer_lock;
struct persistent_ram_buffer *buffer;
size_t buffer_size;
- u32 flags;
- raw_spinlock_t buffer_lock;
- /* ECC correction */
char *par_buffer;
char *par_header;
struct rs_control *rs_decoder;
@@ -71,45 +99,9 @@
size_t old_log_size;
};
-struct ramoops_context {
- struct persistent_ram_zone **dprzs; /* Oops dump zones */
- struct persistent_ram_zone *cprz; /* Console zone */
- struct persistent_ram_zone **fprzs; /* Ftrace zones */
- struct persistent_ram_zone *mprz; /* PMSG zone */
-#ifdef CONFIG_PSTORE_BOOT_LOG
- struct persistent_ram_zone **boot_przs; /* BOOT log zones */
-#endif
- phys_addr_t phys_addr;
- unsigned long size;
- unsigned int memtype;
- size_t record_size;
- size_t console_size;
- size_t ftrace_size;
- size_t pmsg_size;
-#ifdef CONFIG_PSTORE_BOOT_LOG
- size_t boot_log_size;
-#endif
- int dump_oops;
- u32 flags;
- struct persistent_ram_ecc_info ecc_info;
- unsigned int max_dump_cnt;
- unsigned int dump_write_cnt;
- /* _read_cnt need clear on ramoops_pstore_open */
- unsigned int dump_read_cnt;
- unsigned int console_read_cnt;
- unsigned int max_ftrace_cnt;
- unsigned int ftrace_read_cnt;
- unsigned int pmsg_read_cnt;
-#ifdef CONFIG_PSTORE_BOOT_LOG
- unsigned int boot_log_read_cnt;
- unsigned int max_boot_log_cnt;
-#endif
- struct pstore_info pstore;
-};
-
struct persistent_ram_zone *persistent_ram_new(phys_addr_t start, size_t size,
u32 sig, struct persistent_ram_ecc_info *ecc_info,
- unsigned int memtype, u32 flags);
+ unsigned int memtype, u32 flags, char *label);
void persistent_ram_free(struct persistent_ram_zone *prz);
void persistent_ram_zap(struct persistent_ram_zone *prz);
@@ -124,6 +116,9 @@
void persistent_ram_free_old(struct persistent_ram_zone *prz);
ssize_t persistent_ram_ecc_string(struct persistent_ram_zone *prz,
char *str, size_t len);
+#ifdef CONFIG_PSTORE_BOOT_LOG
+ssize_t ramoops_pstore_read_for_boot_log(struct pstore_record *record);
+#endif
/*
* Ramoops platform data
@@ -145,7 +140,7 @@
unsigned long boot_log_size;
unsigned long max_boot_log_cnt;
#endif
- int dump_oops;
+ int max_reason;
u32 flags;
struct persistent_ram_ecc_info ecc_info;
};
--
Gitblit v1.6.2