LIST_HEAD(mc_requests);
-static void mc_work_proc(void *unused)
+void mc_work_proc(void *unused)
{
struct mconsole_entry *req;
unsigned long flags;
+ int done;
- while(!list_empty(&mc_requests)){
+ do {
local_save_flags(flags);
req = list_entry(mc_requests.next, struct mconsole_entry,
list);
list_del(&req->list);
+ done = list_empty(&mc_requests);
local_irq_restore(flags);
req->request.cmd->handler(&req->request);
kfree(req);
- }
+ } while(!done);
}
DECLARE_WORK(mconsole_work, mc_work_proc, NULL);
-static irqreturn_t mconsole_interrupt(int irq, void *dev_id,
- struct pt_regs *regs)
+irqreturn_t mconsole_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{
int fd;
struct mconsole_entry *new;
}
}
}
- if(!list_empty(&mc_requests))
- schedule_work(&mconsole_work);
+ if(!list_empty(&mc_requests)) schedule_work(&mconsole_work);
reactivate_fd(fd, MCONSOLE_IRQ);
return(IRQ_HANDLED);
}
ptr += strlen("sysrq");
while(isspace(*ptr)) ptr++;
- mconsole_reply(req, "", 0, 0);
handle_sysrq(*ptr, ¤t->thread.regs, NULL);
+ mconsole_reply(req, "", 0, 0);
}
#else
void mconsole_sysrq(struct mc_request *req)