Path: blob/master/arch/um/include/shared/mconsole.h
10819 views
/*1* Copyright (C) 2001 Lennert Buytenhek ([email protected])2* Copyright (C) 2001 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)3* Licensed under the GPL4*/56#ifndef __MCONSOLE_H__7#define __MCONSOLE_H__89#ifndef __KERNEL__10#include <stdint.h>11#define u32 uint32_t12#endif1314#include "sysdep/ptrace.h"1516#define MCONSOLE_MAGIC (0xcafebabe)17#define MCONSOLE_MAX_DATA (512)18#define MCONSOLE_VERSION 21920struct mconsole_request {21u32 magic;22u32 version;23u32 len;24char data[MCONSOLE_MAX_DATA];25};2627struct mconsole_reply {28u32 err;29u32 more;30u32 len;31char data[MCONSOLE_MAX_DATA];32};3334struct mconsole_notify {35u32 magic;36u32 version;37enum { MCONSOLE_SOCKET, MCONSOLE_PANIC, MCONSOLE_HANG,38MCONSOLE_USER_NOTIFY } type;39u32 len;40char data[MCONSOLE_MAX_DATA];41};4243struct mc_request;4445enum mc_context { MCONSOLE_INTR, MCONSOLE_PROC };4647struct mconsole_command48{49char *command;50void (*handler)(struct mc_request *req);51enum mc_context context;52};5354struct mc_request55{56int len;57int as_interrupt;5859int originating_fd;60unsigned int originlen;61unsigned char origin[128]; /* sockaddr_un */6263struct mconsole_request request;64struct mconsole_command *cmd;65struct uml_pt_regs regs;66};6768extern char mconsole_socket_name[];6970extern int mconsole_unlink_socket(void);71extern int mconsole_reply_len(struct mc_request *req, const char *reply,72int len, int err, int more);73extern int mconsole_reply(struct mc_request *req, const char *str, int err,74int more);7576extern void mconsole_version(struct mc_request *req);77extern void mconsole_help(struct mc_request *req);78extern void mconsole_halt(struct mc_request *req);79extern void mconsole_reboot(struct mc_request *req);80extern void mconsole_config(struct mc_request *req);81extern void mconsole_remove(struct mc_request *req);82extern void mconsole_sysrq(struct mc_request *req);83extern void mconsole_cad(struct mc_request *req);84extern void mconsole_stop(struct mc_request *req);85extern void mconsole_go(struct mc_request *req);86extern void mconsole_log(struct mc_request *req);87extern void mconsole_proc(struct mc_request *req);88extern void mconsole_stack(struct mc_request *req);8990extern int mconsole_get_request(int fd, struct mc_request *req);91extern int mconsole_notify(char *sock_name, int type, const void *data,92int len);93extern char *mconsole_notify_socket(void);94extern void lock_notify(void);95extern void unlock_notify(void);9697#endif9899100