Annotation of Gnu-Mach/i386/i386at/gpl/linux/linux_soft.c, revision 1.1

1.1     ! root        1: /*
        !             2:  * Linux software interrupts.
        !             3:  * Copyright (C) 1995 Shantanu Goel.
        !             4:  *
        !             5:  * This program is free software; you can redistribute it and/or modify
        !             6:  * it under the terms of the GNU General Public License as published by
        !             7:  * the Free Software Foundation; either version 2, or (at your option)
        !             8:  * any later version.
        !             9:  *
        !            10:  * This program is distributed in the hope that it will be useful,
        !            11:  * but WITHOUT ANY WARRANTY; without even the implied warranty of
        !            12:  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
        !            13:  * GNU General Public License for more details.
        !            14:  *
        !            15:  * You should have received a copy of the GNU General Public License
        !            16:  * along with this program; if not, write to the Free Software
        !            17:  * Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
        !            18:  */
        !            19: 
        !            20: /*
        !            21:  *     linux/kernel/softirq.c
        !            22:  *
        !            23:  *     Copyright (C) 1992 Linus Torvalds
        !            24:  */
        !            25: 
        !            26: #include <linux/sched.h>
        !            27: #include <linux/interrupt.h>
        !            28: #include <asm/system.h>
        !            29: #include <asm/bitops.h>
        !            30: 
        !            31: /*
        !            32:  * Mask of pending interrupts.
        !            33:  */
        !            34: unsigned long bh_active = 0;
        !            35: 
        !            36: /*
        !            37:  * Mask of enabled interrupts.
        !            38:  */
        !            39: unsigned long bh_mask = 0;
        !            40: 
        !            41: /*
        !            42:  * List of software interrupt handlers.
        !            43:  */
        !            44: struct bh_struct bh_base[32];
        !            45: 
        !            46: 
        !            47: /*
        !            48:  * Software interrupt handler.
        !            49:  */
        !            50: void
        !            51: linux_soft_intr()
        !            52: {
        !            53:        unsigned long active;
        !            54:        unsigned long mask, left;
        !            55:        struct bh_struct *bh;
        !            56: 
        !            57:        bh = bh_base;
        !            58:        active = bh_active & bh_mask;
        !            59:        for (mask = 1, left = ~0;
        !            60:             left & active; bh++, mask += mask, left += left) {
        !            61:                if (mask & active) {
        !            62:                        void (*fn)(void *);
        !            63: 
        !            64:                        bh_active &= ~mask;
        !            65:                        fn = bh->routine;
        !            66:                        if (fn == 0)
        !            67:                                goto bad_bh;
        !            68:                        (*fn)(bh->data);
        !            69:                }
        !            70:        }
        !            71:        return;
        !            72:  bad_bh:
        !            73:        printf("linux_soft_intr: bad interrupt handler entry 0x%08lx\n", mask);
        !            74: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.