From f1da2c3860e301527d56a1ef0b56c649ee7c4b1b Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Sat, 15 Jul 2000 03:32:22 +0000 Subject: Merge with Linux 2.4.0-test5-pre1. This works again on Origin UP. The IP22 cache bugs which are plaguing some machines are still unfixed. --- arch/sparc64/solaris/socksys.c | 3 +++ arch/sparc64/solaris/timod.c | 37 ++++++++++--------------------------- 2 files changed, 13 insertions(+), 27 deletions(-) (limited to 'arch/sparc64/solaris') diff --git a/arch/sparc64/solaris/socksys.c b/arch/sparc64/solaris/socksys.c index 9a2556bbc..01595faee 100644 --- a/arch/sparc64/solaris/socksys.c +++ b/arch/sparc64/solaris/socksys.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -118,6 +119,7 @@ static int socksys_release(struct inode * inode, struct file * filp) struct T_primsg *it; /* XXX: check this */ + lock_kernel(); sock = (struct sol_socket_struct *)filp->private_data; SOLDD(("sock release %016lx(%016lx)\n", sock, filp)); it = sock->pfirst; @@ -131,6 +133,7 @@ static int socksys_release(struct inode * inode, struct file * filp) filp->private_data = NULL; SOLDD(("socksys_release %016lx\n", sock)); mykfree((char*)sock); + unlock_kernel(); return 0; } diff --git a/arch/sparc64/solaris/timod.c b/arch/sparc64/solaris/timod.c index 37f38c75b..946b20fae 100644 --- a/arch/sparc64/solaris/timod.c +++ b/arch/sparc64/solaris/timod.c @@ -1,4 +1,4 @@ -/* $Id: timod.c,v 1.7 2000/06/09 07:35:30 davem Exp $ +/* $Id: timod.c,v 1.9 2000/07/12 23:21:02 davem Exp $ * timod.c: timod emulation. * * Copyright (C) 1998 Patrik Rak (prak3264@ss1000.ms.mff.cuni.cz) @@ -15,6 +15,7 @@ #include #include #include +#include #include #include @@ -619,22 +620,6 @@ int timod_putmsg(unsigned int fd, char *ctl_buf, int ctl_len, return -EINVAL; } -/* copied directly from fs/select.c */ - -static void free_wait(poll_table * p) -{ - struct poll_table_entry * entry = p->entry + p->nr; - - SOLD("entry"); - while (p->nr > 0) { - p->nr--; - entry--; - remove_wait_queue(entry->wait_address,&entry->wait); - } - SOLD("done"); -} - - int timod_getmsg(unsigned int fd, char *ctl_buf, int ctl_maxlen, s32 *ctl_len, char *data_buf, int data_maxlen, s32 *data_len, int *flags_p) { @@ -670,14 +655,8 @@ int timod_getmsg(unsigned int fd, char *ctl_buf, int ctl_maxlen, s32 *ctl_len, } if (!(filp->f_flags & O_NONBLOCK)) { poll_table wait_table, *wait; - struct poll_table_entry *entry; - SOLD("getting poll_table"); - entry = (struct poll_table_entry *)__get_free_page(GFP_KERNEL); - if (!entry) - return -ENOMEM; - SOLD("got one"); - wait_table.nr = 0; - wait_table.entry = entry; + + poll_initwait(&wait_table); wait = &wait_table; for(;;) { SOLD("loop"); @@ -705,13 +684,17 @@ int timod_getmsg(unsigned int fd, char *ctl_buf, int ctl_maxlen, s32 *ctl_len, SOLD("avoiding lockup"); break ; } + if(wait_table.error) { + SOLD("wait-table error"); + poll_freewait(&wait_table); + return wait_table.error; + } SOLD("scheduling"); schedule(); } SOLD("loop done"); current->state = TASK_RUNNING; - free_wait(&wait_table); - free_page((unsigned long)entry); + poll_freewait(&wait_table); if (signal_pending(current)) { SOLD("signal pending"); return -EINTR; -- cgit v1.2.3