blob: b106f4d8473696d5a9e07dcba6211105766bcaa0 [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001/*
2 * Copyright: (C) Copyright 2015 Marvell International Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * publishhed by the Free Software Foundation.
7 *
8 * Author: Yan Markman (ymarkman@marvell.com)
9 *
10 * Utilities for ramdump.c debug capability extension:
11 * - Kernel-RO CRC16 check and reporting on panic
12 */
13
14#ifndef _RAMDUMP_UTIL_H
15#define _RAMDUMP_UTIL_H
16
17
18/* Configuration */
19#define RAMDUMP_PHASE_1_1 /* allow KO's to work with older kernel */
20#define RAMDUMP_RDI /* allow detecting RDI interface is present */
21
22/* EXPORT from ramdump.c; "internal" between ramdump and ramdump_util */
23extern unsigned ramdump_level;
24/* 0: do not request ramdump at all
25 * 1: for panic only, ignore User-Space fatal signals and modems
26 * (used on "reboot" Graceful Shutdown)
27 * 2: always ramdump
28 * >2: same as 2, just for better debug
29 */
30#define RAMDUMP_LEVEL_PANIC_ONLY 1
31#define RAMDUMP_LEVEL_FULL 2
32#define RAMDUMP_LEVEL_FULL_IN_ADVANCE 3
33
34int get_kernel_text_crc16_valid(void); /* returns:
35*** 0 if OK, -1 if bad-crc, -2 if not accounted */
36int get_kernel_text_crc16_threaded_req(void); /* runs on thread */
37u16 get_kernel_text_crc16_on_panic(void); /* has huge blocking latency */
38void ramdump_ignore_fatal_signals(int on_shutdown);
39
40#endif/*_RAMDUMP_UTIL_H*/