Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 40255
b: refs/heads/master
c: 3a51237
h: refs/heads/master
i:
  40253: 5c474c4
  40251: 51fd005
  40247: 698ce35
  40239: 3fa5a29
  40223: 4fbd5fd
  40191: 2c6f516
v: v3
  • Loading branch information
Al Viro authored and Linus Torvalds committed Oct 25, 2006
1 parent f52e3f7 commit 970dea9
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6c50444723f2e6487b3377450f90d813a88e6c31
refs/heads/master: 3a51237dc11efe283b40ea0248f4e26ab935dbd1
23 changes: 17 additions & 6 deletions trunk/arch/um/drivers/mconsole_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ static irqreturn_t mconsole_interrupt(int irq, void *dev_id)
/* long to avoid size mismatch warnings from gcc */
long fd;
struct mconsole_entry *new;
struct mc_request req;
static struct mc_request req; /* that's OK */

fd = (long) dev_id;
while (mconsole_get_request(fd, &req)){
Expand All @@ -91,6 +91,7 @@ static irqreturn_t mconsole_interrupt(int irq, void *dev_id)
mconsole_reply(&req, "Out of memory", 1, 0);
else {
new->request = req;
new->request.regs = get_irq_regs()->regs;
list_add(&new->list, &mc_requests);
}
}
Expand Down Expand Up @@ -314,9 +315,21 @@ void mconsole_stop(struct mc_request *req)
{
deactivate_fd(req->originating_fd, MCONSOLE_IRQ);
os_set_fd_block(req->originating_fd, 1);
mconsole_reply(req, "", 0, 0);
while(mconsole_get_request(req->originating_fd, req)){
if(req->cmd->handler == mconsole_go) break;
mconsole_reply(req, "stopped", 0, 0);
while (mconsole_get_request(req->originating_fd, req)) {
if (req->cmd->handler == mconsole_go)
break;
if (req->cmd->handler == mconsole_stop) {
mconsole_reply(req, "Already stopped", 1, 0);
continue;
}
if (req->cmd->handler == mconsole_sysrq) {
struct pt_regs *old_regs;
old_regs = set_irq_regs((struct pt_regs *)&req->regs);
mconsole_sysrq(req);
set_irq_regs(old_regs);
continue;
}
(*req->cmd->handler)(req);
}
os_set_fd_block(req->originating_fd, 0);
Expand Down Expand Up @@ -673,9 +686,7 @@ static void with_console(struct mc_request *req, void (*proc)(void *),
static void sysrq_proc(void *arg)
{
char *op = arg;
struct pt_regs *old_regs = set_irq_regs(&current->thread.regs);
handle_sysrq(*op, NULL);
set_irq_regs(old_regs);
}

void mconsole_sysrq(struct mc_request *req)
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/um/drivers/mconsole_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <sys/un.h>
#include <unistd.h>
#include "user.h"
#include "sysdep/ptrace.h"
#include "mconsole.h"
#include "umid.h"
#include "user_util.h"
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/um/include/mconsole.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ struct mc_request

struct mconsole_request request;
struct mconsole_command *cmd;
union uml_pt_regs regs;
};

extern char mconsole_socket_name[];
Expand Down

0 comments on commit 970dea9

Please sign in to comment.