summaryrefslogtreecommitdiff
path: root/sys/compat/linuxkpi/common/include/linux/kmsg_dump.h
blob: 25f96b304f59fac254167c9c7a7576f79285b967 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
 * SPDX-License-Identifier: BSD-2-Clause
 *
 * Copyright (c) 2025-2026 The FreeBSD Foundation
 * Copyright (c) 2025-2026 Jean-Sébastien Pédron <dumbbell@FreeBSD.org>
 *
 * This software was developed by Jean-Sébastien Pédron under sponsorship
 * from the FreeBSD Foundation.
 */

#ifndef _LINUXKPI_LINUX_KMSG_DUMP_H_
#define	_LINUXKPI_LINUX_KMSG_DUMP_H_

#include <linux/errno.h>
#include <linux/list.h>

#include <linux/kernel.h> /* For pr_debug() */

enum kmsg_dump_reason {
	KMSG_DUMP_UNDEF,
	KMSG_DUMP_PANIC,
	KMSG_DUMP_OOPS,
	KMSG_DUMP_EMERG,
	KMSG_DUMP_SHUTDOWN,
	KMSG_DUMP_MAX
};

struct kmsg_dumper {
	struct list_head list;
	void (*dump)(struct kmsg_dumper *dumper, enum kmsg_dump_reason reason);
	enum kmsg_dump_reason max_reason;
	bool registered;
};

static inline int
kmsg_dump_register(struct kmsg_dumper *dumper)
{
	pr_debug("TODO");

	return (-EINVAL);
}

static inline int
kmsg_dump_unregister(struct kmsg_dumper *dumper)
{
	pr_debug("TODO");

	return (-EINVAL);
}

#endif