aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/include/mconsole.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /arch/um/include/mconsole.h
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'arch/um/include/mconsole.h')
-rw-r--r--arch/um/include/mconsole.h103
1 files changed, 103 insertions, 0 deletions
diff --git a/arch/um/include/mconsole.h b/arch/um/include/mconsole.h
new file mode 100644
index 000000000000..9fbe3083fdd8
--- /dev/null
+++ b/arch/um/include/mconsole.h
@@ -0,0 +1,103 @@
1/*
2 * Copyright (C) 2001 Lennert Buytenhek (buytenh@gnu.org)
3 * Copyright (C) 2001, 2002 Jeff Dike (jdike@karaya.com)
4 * Licensed under the GPL
5 */
6
7#ifndef __MCONSOLE_H__
8#define __MCONSOLE_H__
9
10#ifndef __KERNEL__
11#include <stdint.h>
12#define u32 uint32_t
13#endif
14
15#define MCONSOLE_MAGIC (0xcafebabe)
16#define MCONSOLE_MAX_DATA (512)
17#define MCONSOLE_VERSION 2
18
19struct mconsole_request {
20 u32 magic;
21 u32 version;
22 u32 len;
23 char data[MCONSOLE_MAX_DATA];
24};
25
26struct mconsole_reply {
27 u32 err;
28 u32 more;
29 u32 len;
30 char data[MCONSOLE_MAX_DATA];
31};
32
33struct mconsole_notify {
34 u32 magic;
35 u32 version;
36 enum { MCONSOLE_SOCKET, MCONSOLE_PANIC, MCONSOLE_HANG,
37 MCONSOLE_USER_NOTIFY } type;
38 u32 len;
39 char data[MCONSOLE_MAX_DATA];
40};
41
42struct mc_request;
43
44enum mc_context { MCONSOLE_INTR, MCONSOLE_PROC };
45
46struct mconsole_command
47{
48 char *command;
49 void (*handler)(struct mc_request *req);
50 enum mc_context context;
51};
52
53struct mc_request
54{
55 int len;
56 int as_interrupt;
57
58 int originating_fd;
59 int originlen;
60 unsigned char origin[128]; /* sockaddr_un */
61
62 struct mconsole_request request;
63 struct mconsole_command *cmd;
64};
65
66extern char mconsole_socket_name[];
67
68extern int mconsole_unlink_socket(void);
69extern int mconsole_reply(struct mc_request *req, char *reply, int err,
70 int more);
71
72extern void mconsole_version(struct mc_request *req);
73extern void mconsole_help(struct mc_request *req);
74extern void mconsole_halt(struct mc_request *req);
75extern void mconsole_reboot(struct mc_request *req);
76extern void mconsole_config(struct mc_request *req);
77extern void mconsole_remove(struct mc_request *req);
78extern void mconsole_sysrq(struct mc_request *req);
79extern void mconsole_cad(struct mc_request *req);
80extern void mconsole_stop(struct mc_request *req);
81extern void mconsole_go(struct mc_request *req);
82extern void mconsole_log(struct mc_request *req);
83extern void mconsole_proc(struct mc_request *req);
84
85extern int mconsole_get_request(int fd, struct mc_request *req);
86extern int mconsole_notify(char *sock_name, int type, const void *data,
87 int len);
88extern char *mconsole_notify_socket(void);
89extern void lock_notify(void);
90extern void unlock_notify(void);
91
92#endif
93
94/*
95 * Overrides for Emacs so that we follow Linus's tabbing style.
96 * Emacs will notice this stuff at the end of the file and automatically
97 * adjust the settings for this buffer only. This must remain at the end
98 * of the file.
99 * ---------------------------------------------------------------------------
100 * Local variables:
101 * c-file-style: "linux"
102 * End:
103 */