⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 via.c

📁 这个linux源代码是很全面的~基本完整了~使用c编译的~由于时间问题我没有亲自测试~但就算用来做参考资料也是非常好的
💻 C
字号:
/* * VIA chipset irq handling * * This file is subject to the terms and conditions of the GNU General Public * License.  See the file "COPYING" in the main directory of this archive * for more details. * * Copyright (C) 1996, 1997 by Ralf Baechle * Copyright (C) 2001 by Liam Davies (ldavies@agile.tv) * */#include <linux/kernel.h>#include <asm/cobalt/cobalt.h>#include <asm/ptrace.h>#include <asm/io.h>#include <asm/mipsregs.h>extern void do_IRQ(int irq, struct pt_regs * regs);asmlinkage void via_irq(struct pt_regs *regs){	char mstat, sstat;	/* Read Master Status */	outb(0x0C, 0x20);	mstat = inb(0x20);	if (mstat < 0) {		mstat &= 0x7f;		if (mstat != 2) {			do_IRQ(mstat, regs);			outb(mstat | 0x20, 0x20);		} else {			sstat = inb(0xA0);			/* Slave interrupt */			outb(0x0C, 0xA0);			sstat = inb(0xA0);			if (sstat < 0) {				do_IRQ((sstat + 8) & 0x7f, regs);				outb(0x22, 0x20);				outb((sstat & 0x7f) | 0x20, 0xA0);			} else {				printk("Spurious slave interrupt...\n");			}		}	} else		printk("Spurious master interrupt...");}#define GALILEO_INTCAUSE	0xb4000c18#define GALILEO_T0EXP		0x00000100asmlinkage void galileo_irq(struct pt_regs *regs){	unsigned long irq_src = *((unsigned long *) GALILEO_INTCAUSE);	/* Check for timer irq ... */	if (irq_src & GALILEO_T0EXP) {		/* Clear the int line */		*((volatile unsigned long *) GALILEO_INTCAUSE) = 0;		do_IRQ(COBALT_TIMER_IRQ, regs);	} else		printk("Spurious Galileo interrupt...\n");}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -