]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
um: take mconsole*.h to arch/um/drivers
authorAl Viro <viro@ftp.linux.org.uk>
Thu, 18 Aug 2011 19:08:39 +0000 (20:08 +0100)
committerRichard Weinberger <richard@nod.at>
Wed, 2 Nov 2011 13:15:12 +0000 (14:15 +0100)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
arch/um/drivers/mconsole.h [new file with mode: 0644]
arch/um/drivers/mconsole_kern.h [new file with mode: 0644]
arch/um/include/shared/mconsole.h [deleted file]
arch/um/include/shared/mconsole_kern.h [deleted file]

diff --git a/arch/um/drivers/mconsole.h b/arch/um/drivers/mconsole.h
new file mode 100644 (file)
index 0000000..c139ae1
--- /dev/null
@@ -0,0 +1,98 @@
+/*
+ * Copyright (C) 2001 Lennert Buytenhek (buytenh@gnu.org)
+ * Copyright (C) 2001 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
+ * Licensed under the GPL
+ */
+
+#ifndef __MCONSOLE_H__
+#define __MCONSOLE_H__
+
+#ifndef __KERNEL__
+#include <stdint.h>
+#define u32 uint32_t
+#endif
+
+#include "sysdep/ptrace.h"
+
+#define MCONSOLE_MAGIC (0xcafebabe)
+#define MCONSOLE_MAX_DATA (512)
+#define MCONSOLE_VERSION 2
+
+struct mconsole_request {
+       u32 magic;
+       u32 version;
+       u32 len;
+       char data[MCONSOLE_MAX_DATA];
+};
+
+struct mconsole_reply {
+       u32 err;
+       u32 more;
+       u32 len;
+       char data[MCONSOLE_MAX_DATA];
+};
+
+struct mconsole_notify {
+       u32 magic;
+       u32 version;
+       enum { MCONSOLE_SOCKET, MCONSOLE_PANIC, MCONSOLE_HANG,
+              MCONSOLE_USER_NOTIFY } type;
+       u32 len;
+       char data[MCONSOLE_MAX_DATA];
+};
+
+struct mc_request;
+
+enum mc_context { MCONSOLE_INTR, MCONSOLE_PROC };
+
+struct mconsole_command
+{
+       char *command;
+       void (*handler)(struct mc_request *req);
+       enum mc_context context;
+};
+
+struct mc_request
+{
+       int len;
+       int as_interrupt;
+
+       int originating_fd;
+       unsigned int originlen;
+       unsigned char origin[128];                      /* sockaddr_un */
+
+       struct mconsole_request request;
+       struct mconsole_command *cmd;
+       struct uml_pt_regs regs;
+};
+
+extern char mconsole_socket_name[];
+
+extern int mconsole_unlink_socket(void);
+extern int mconsole_reply_len(struct mc_request *req, const char *reply,
+                             int len, int err, int more);
+extern int mconsole_reply(struct mc_request *req, const char *str, int err,
+                         int more);
+
+extern void mconsole_version(struct mc_request *req);
+extern void mconsole_help(struct mc_request *req);
+extern void mconsole_halt(struct mc_request *req);
+extern void mconsole_reboot(struct mc_request *req);
+extern void mconsole_config(struct mc_request *req);
+extern void mconsole_remove(struct mc_request *req);
+extern void mconsole_sysrq(struct mc_request *req);
+extern void mconsole_cad(struct mc_request *req);
+extern void mconsole_stop(struct mc_request *req);
+extern void mconsole_go(struct mc_request *req);
+extern void mconsole_log(struct mc_request *req);
+extern void mconsole_proc(struct mc_request *req);
+extern void mconsole_stack(struct mc_request *req);
+
+extern int mconsole_get_request(int fd, struct mc_request *req);
+extern int mconsole_notify(char *sock_name, int type, const void *data,
+                          int len);
+extern char *mconsole_notify_socket(void);
+extern void lock_notify(void);
+extern void unlock_notify(void);
+
+#endif
diff --git a/arch/um/drivers/mconsole_kern.h b/arch/um/drivers/mconsole_kern.h
new file mode 100644 (file)
index 0000000..d2fe07e
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2001, 2002 Jeff Dike (jdike@karaya.com)
+ * Licensed under the GPL
+ */
+
+#ifndef __MCONSOLE_KERN_H__
+#define __MCONSOLE_KERN_H__
+
+#include "linux/list.h"
+#include "mconsole.h"
+
+struct mconsole_entry {
+       struct list_head list;
+       struct mc_request request;
+};
+
+/* All these methods are called in process context. */
+struct mc_device {
+       struct list_head list;
+       char *name;
+       int (*config)(char *, char **);
+       int (*get_config)(char *, char *, int, char **);
+       int (*id)(char **, int *, int *);
+       int (*remove)(int, char **);
+};
+
+#define CONFIG_CHUNK(str, size, current, chunk, end) \
+do { \
+       current += strlen(chunk); \
+       if(current >= size) \
+               str = NULL; \
+       if(str != NULL){ \
+               strcpy(str, chunk); \
+               str += strlen(chunk); \
+       } \
+       if(end) \
+               current++; \
+} while(0)
+
+#ifdef CONFIG_MCONSOLE
+
+extern void mconsole_register_dev(struct mc_device *new);
+
+#else
+
+static inline void mconsole_register_dev(struct mc_device *new)
+{
+}
+
+#endif
+
+#endif
diff --git a/arch/um/include/shared/mconsole.h b/arch/um/include/shared/mconsole.h
deleted file mode 100644 (file)
index c139ae1..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright (C) 2001 Lennert Buytenhek (buytenh@gnu.org)
- * Copyright (C) 2001 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
- * Licensed under the GPL
- */
-
-#ifndef __MCONSOLE_H__
-#define __MCONSOLE_H__
-
-#ifndef __KERNEL__
-#include <stdint.h>
-#define u32 uint32_t
-#endif
-
-#include "sysdep/ptrace.h"
-
-#define MCONSOLE_MAGIC (0xcafebabe)
-#define MCONSOLE_MAX_DATA (512)
-#define MCONSOLE_VERSION 2
-
-struct mconsole_request {
-       u32 magic;
-       u32 version;
-       u32 len;
-       char data[MCONSOLE_MAX_DATA];
-};
-
-struct mconsole_reply {
-       u32 err;
-       u32 more;
-       u32 len;
-       char data[MCONSOLE_MAX_DATA];
-};
-
-struct mconsole_notify {
-       u32 magic;
-       u32 version;
-       enum { MCONSOLE_SOCKET, MCONSOLE_PANIC, MCONSOLE_HANG,
-              MCONSOLE_USER_NOTIFY } type;
-       u32 len;
-       char data[MCONSOLE_MAX_DATA];
-};
-
-struct mc_request;
-
-enum mc_context { MCONSOLE_INTR, MCONSOLE_PROC };
-
-struct mconsole_command
-{
-       char *command;
-       void (*handler)(struct mc_request *req);
-       enum mc_context context;
-};
-
-struct mc_request
-{
-       int len;
-       int as_interrupt;
-
-       int originating_fd;
-       unsigned int originlen;
-       unsigned char origin[128];                      /* sockaddr_un */
-
-       struct mconsole_request request;
-       struct mconsole_command *cmd;
-       struct uml_pt_regs regs;
-};
-
-extern char mconsole_socket_name[];
-
-extern int mconsole_unlink_socket(void);
-extern int mconsole_reply_len(struct mc_request *req, const char *reply,
-                             int len, int err, int more);
-extern int mconsole_reply(struct mc_request *req, const char *str, int err,
-                         int more);
-
-extern void mconsole_version(struct mc_request *req);
-extern void mconsole_help(struct mc_request *req);
-extern void mconsole_halt(struct mc_request *req);
-extern void mconsole_reboot(struct mc_request *req);
-extern void mconsole_config(struct mc_request *req);
-extern void mconsole_remove(struct mc_request *req);
-extern void mconsole_sysrq(struct mc_request *req);
-extern void mconsole_cad(struct mc_request *req);
-extern void mconsole_stop(struct mc_request *req);
-extern void mconsole_go(struct mc_request *req);
-extern void mconsole_log(struct mc_request *req);
-extern void mconsole_proc(struct mc_request *req);
-extern void mconsole_stack(struct mc_request *req);
-
-extern int mconsole_get_request(int fd, struct mc_request *req);
-extern int mconsole_notify(char *sock_name, int type, const void *data,
-                          int len);
-extern char *mconsole_notify_socket(void);
-extern void lock_notify(void);
-extern void unlock_notify(void);
-
-#endif
diff --git a/arch/um/include/shared/mconsole_kern.h b/arch/um/include/shared/mconsole_kern.h
deleted file mode 100644 (file)
index d2fe07e..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (C) 2001, 2002 Jeff Dike (jdike@karaya.com)
- * Licensed under the GPL
- */
-
-#ifndef __MCONSOLE_KERN_H__
-#define __MCONSOLE_KERN_H__
-
-#include "linux/list.h"
-#include "mconsole.h"
-
-struct mconsole_entry {
-       struct list_head list;
-       struct mc_request request;
-};
-
-/* All these methods are called in process context. */
-struct mc_device {
-       struct list_head list;
-       char *name;
-       int (*config)(char *, char **);
-       int (*get_config)(char *, char *, int, char **);
-       int (*id)(char **, int *, int *);
-       int (*remove)(int, char **);
-};
-
-#define CONFIG_CHUNK(str, size, current, chunk, end) \
-do { \
-       current += strlen(chunk); \
-       if(current >= size) \
-               str = NULL; \
-       if(str != NULL){ \
-               strcpy(str, chunk); \
-               str += strlen(chunk); \
-       } \
-       if(end) \
-               current++; \
-} while(0)
-
-#ifdef CONFIG_MCONSOLE
-
-extern void mconsole_register_dev(struct mc_device *new);
-
-#else
-
-static inline void mconsole_register_dev(struct mc_device *new)
-{
-}
-
-#endif
-
-#endif