Merge git://oss.sgi.com:8090/xfs/xfs-2.6
[linux-drm-fsl-dcu.git] / arch / um / os-Linux / irq.c
index 3788d4568d3329008aa6706d3dce3acc5eb81b4f..d1b61d474e0a0a535423f74b097b851bf0b05677 100644 (file)
 #include "sigio.h"
 #include "irq_user.h"
 #include "os.h"
+#include "um_malloc.h"
 
+/*
+ * Locked by irq_lock in arch/um/kernel/irq.c.  Changed by os_create_pollfd
+ * and os_free_irq_by_cb, which are called under irq_lock.
+ */
 static struct pollfd *pollfds = NULL;
 static int pollfds_num = 0;
 static int pollfds_size = 0;
@@ -52,17 +57,12 @@ int os_waiting_for_events(struct irq_fd *active_fds)
        return n;
 }
 
-int os_isatty(int fd)
-{
-       return isatty(fd);
-}
-
 int os_create_pollfd(int fd, int events, void *tmp_pfd, int size_tmpfds)
 {
        if (pollfds_num == pollfds_size) {
                if (size_tmpfds <= pollfds_size * sizeof(pollfds[0])) {
                        /* return min size needed for new pollfds area */
-                       return((pollfds_size + 1) * sizeof(pollfds[0]));
+                       return (pollfds_size + 1) * sizeof(pollfds[0]);
                }
 
                if (pollfds != NULL) {
@@ -137,22 +137,19 @@ void os_set_pollfd(int i, int fd)
 
 void os_set_ioignore(void)
 {
-       set_handler(SIGIO, SIG_IGN, 0, -1);
+       signal(SIGIO, SIG_IGN);
 }
 
 void init_irq_signals(int on_sigstack)
 {
-       __sighandler_t h;
        int flags;
 
        flags = on_sigstack ? SA_ONSTACK : 0;
-       if (timer_irq_inited)
-               h = (__sighandler_t)alarm_handler;
-       else
-               h = boot_timer_handler;
 
-       set_handler(SIGVTALRM, h, flags | SA_RESTART,
-                   SIGUSR1, SIGIO, SIGWINCH, SIGALRM, -1);
+       set_handler(SIGVTALRM, (__sighandler_t) alarm_handler,
+                   flags | SA_RESTART, SIGUSR1, SIGIO, SIGWINCH, SIGALRM, -1);
+       set_handler(SIGALRM, (__sighandler_t) alarm_handler,
+                   flags | SA_RESTART, SIGUSR1, SIGIO, SIGWINCH, SIGALRM, -1);
        set_handler(SIGIO, (__sighandler_t) sig_handler, flags | SA_RESTART,
                    SIGUSR1, SIGIO, SIGWINCH, SIGALRM, SIGVTALRM, -1);
        signal(SIGWINCH, SIG_IGN);