aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/include
diff options
context:
space:
mode:
authorAl Viro <viro@ftp.linux.org.uk>2011-08-18 15:08:39 -0400
committerRichard Weinberger <richard@nod.at>2011-11-02 09:15:12 -0400
commitece67c8697f32699f6977d3d1ae2ae9f7892a913 (patch)
tree8ec42a9262d4f0ed260474edef975945384edb09 /arch/um/include
parent510c72a3cf51c9463db64eb6c21347f4940a202f (diff)
um: take mconsole*.h to arch/um/drivers
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'arch/um/include')
-rw-r--r--arch/um/include/shared/mconsole.h98
-rw-r--r--arch/um/include/shared/mconsole_kern.h52
2 files changed, 0 insertions, 150 deletions
diff --git a/arch/um/include/shared/mconsole.h b/arch/um/include/shared/mconsole.h
deleted file mode 100644
index c139ae1d682..00000000000
--- a/arch/um/include/shared/mconsole.h
+++ /dev/null
@@ -1,98 +0,0 @@
1/*
2 * Copyright (C) 2001 Lennert Buytenhek (buytenh@gnu.org)
3 * Copyright (C) 2001 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.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#include "sysdep/ptrace.h"
16
17#define MCONSOLE_MAGIC (0xcafebabe)
18#define MCONSOLE_MAX_DATA (512)
19#define MCONSOLE_VERSION 2
20
21struct mconsole_request {
22 u32 magic;
23 u32 version;
24 u32 len;
25 char data[MCONSOLE_MAX_DATA];
26};
27
28struct mconsole_reply {
29 u32 err;
30 u32 more;
31 u32 len;
32 char data[MCONSOLE_MAX_DATA];
33};
34
35struct mconsole_notify {
36 u32 magic;
37 u32 version;
38 enum { MCONSOLE_SOCKET, MCONSOLE_PANIC, MCONSOLE_HANG,
39 MCONSOLE_USER_NOTIFY } type;
40 u32 len;
41 char data[MCONSOLE_MAX_DATA];
42};
43
44struct mc_request;
45
46enum mc_context { MCONSOLE_INTR, MCONSOLE_PROC };
47
48struct mconsole_command
49{
50 char *command;
51 void (*handler)(struct mc_request *req);
52 enum mc_context context;
53};
54
55struct mc_request
56{
57 int len;
58 int as_interrupt;
59
60 int originating_fd;
61 unsigned int originlen;
62 unsigned char origin[128]; /* sockaddr_un */
63
64 struct mconsole_request request;
65 struct mconsole_command *cmd;
66 struct uml_pt_regs regs;
67};
68
69extern char mconsole_socket_name[];
70
71extern int mconsole_unlink_socket(void);
72extern int mconsole_reply_len(struct mc_request *req, const char *reply,
73 int len, int err, int more);
74extern int mconsole_reply(struct mc_request *req, const char *str, int err,
75 int more);
76
77extern void mconsole_version(struct mc_request *req);
78extern void mconsole_help(struct mc_request *req);
79extern void mconsole_halt(struct mc_request *req);
80extern void mconsole_reboot(struct mc_request *req);
81extern void mconsole_config(struct mc_request *req);
82extern void mconsole_remove(struct mc_request *req);
83extern void mconsole_sysrq(struct mc_request *req);
84extern void mconsole_cad(struct mc_request *req);
85extern void mconsole_stop(struct mc_request *req);
86extern void mconsole_go(struct mc_request *req);
87extern void mconsole_log(struct mc_request *req);
88extern void mconsole_proc(struct mc_request *req);
89extern void mconsole_stack(struct mc_request *req);
90
91extern int mconsole_get_request(int fd, struct mc_request *req);
92extern int mconsole_notify(char *sock_name, int type, const void *data,
93 int len);
94extern char *mconsole_notify_socket(void);
95extern void lock_notify(void);
96extern void unlock_notify(void);
97
98#endif
diff --git a/arch/um/include/shared/mconsole_kern.h b/arch/um/include/shared/mconsole_kern.h
deleted file mode 100644
index d2fe07e7895..00000000000
--- a/arch/um/include/shared/mconsole_kern.h
+++ /dev/null
@@ -1,52 +0,0 @@
1/*
2 * Copyright (C) 2001, 2002 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL
4 */
5
6#ifndef __MCONSOLE_KERN_H__
7#define __MCONSOLE_KERN_H__
8
9#include "linux/list.h"
10#include "mconsole.h"
11
12struct mconsole_entry {
13 struct list_head list;
14 struct mc_request request;
15};
16
17/* All these methods are called in process context. */
18struct mc_device {
19 struct list_head list;
20 char *name;
21 int (*config)(char *, char **);
22 int (*get_config)(char *, char *, int, char **);
23 int (*id)(char **, int *, int *);
24 int (*remove)(int, char **);
25};
26
27#define CONFIG_CHUNK(str, size, current, chunk, end) \
28do { \
29 current += strlen(chunk); \
30 if(current >= size) \
31 str = NULL; \
32 if(str != NULL){ \
33 strcpy(str, chunk); \
34 str += strlen(chunk); \
35 } \
36 if(end) \
37 current++; \
38} while(0)
39
40#ifdef CONFIG_MCONSOLE
41
42extern void mconsole_register_dev(struct mc_device *new);
43
44#else
45
46static inline void mconsole_register_dev(struct mc_device *new)
47{
48}
49
50#endif
51
52#endif