Linux 2.6.21-rc3
[linux-2.6/next.git] / arch / um / include / mconsole.h
blob2666815b6af57130cce633c759f0e8d86ebf9d12
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 */
7 #ifndef __MCONSOLE_H__
8 #define __MCONSOLE_H__
10 #ifndef __KERNEL__
11 #include <stdint.h>
12 #define u32 uint32_t
13 #endif
15 #define MCONSOLE_MAGIC (0xcafebabe)
16 #define MCONSOLE_MAX_DATA (512)
17 #define MCONSOLE_VERSION 2
19 struct mconsole_request {
20 u32 magic;
21 u32 version;
22 u32 len;
23 char data[MCONSOLE_MAX_DATA];
26 struct mconsole_reply {
27 u32 err;
28 u32 more;
29 u32 len;
30 char data[MCONSOLE_MAX_DATA];
33 struct 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];
42 struct mc_request;
44 enum mc_context { MCONSOLE_INTR, MCONSOLE_PROC };
46 struct mconsole_command
48 char *command;
49 void (*handler)(struct mc_request *req);
50 enum mc_context context;
53 struct mc_request
55 int len;
56 int as_interrupt;
58 int originating_fd;
59 unsigned int originlen;
60 unsigned char origin[128]; /* sockaddr_un */
62 struct mconsole_request request;
63 struct mconsole_command *cmd;
64 union uml_pt_regs regs;
67 extern char mconsole_socket_name[];
69 extern int mconsole_unlink_socket(void);
70 extern int mconsole_reply_len(struct mc_request *req, const char *reply,
71 int len, int err, int more);
72 extern int mconsole_reply(struct mc_request *req, const char *str, int err,
73 int more);
75 extern void mconsole_version(struct mc_request *req);
76 extern void mconsole_help(struct mc_request *req);
77 extern void mconsole_halt(struct mc_request *req);
78 extern void mconsole_reboot(struct mc_request *req);
79 extern void mconsole_config(struct mc_request *req);
80 extern void mconsole_remove(struct mc_request *req);
81 extern void mconsole_sysrq(struct mc_request *req);
82 extern void mconsole_cad(struct mc_request *req);
83 extern void mconsole_stop(struct mc_request *req);
84 extern void mconsole_go(struct mc_request *req);
85 extern void mconsole_log(struct mc_request *req);
86 extern void mconsole_proc(struct mc_request *req);
87 extern void mconsole_stack(struct mc_request *req);
89 extern int mconsole_get_request(int fd, struct mc_request *req);
90 extern int mconsole_notify(char *sock_name, int type, const void *data,
91 int len);
92 extern char *mconsole_notify_socket(void);
93 extern void lock_notify(void);
94 extern void unlock_notify(void);
96 #endif
99 * Overrides for Emacs so that we follow Linus's tabbing style.
100 * Emacs will notice this stuff at the end of the file and automatically
101 * adjust the settings for this buffer only. This must remain at the end
102 * of the file.
103 * ---------------------------------------------------------------------------
104 * Local variables:
105 * c-file-style: "linux"
106 * End: