ia64/xen-unstable

changeset 3059:e907065a5bc7

bitkeeper revision 1.1159.179.9 (419ddf886a46T8xvzkjG72ORjFtMaw)

g/c unmodified file.
author cl349@arcadians.cl.cam.ac.uk
date Fri Nov 19 11:56:56 2004 +0000 (2004-11-19)
parents a51f762f794a
children f81923f8591f
files .rootkeys linux-2.6.10-rc2-xen-sparse/arch/xen/i386/kernel/irq.c
line diff
     1.1 --- a/.rootkeys	Fri Nov 19 11:55:20 2004 +0000
     1.2 +++ b/.rootkeys	Fri Nov 19 11:56:56 2004 +0000
     1.3 @@ -142,7 +142,6 @@ 40f56238XDtHSijkAFlbv1PT8Bhw_Q linux-2.6
     1.4  40f56238bnvciAuyzAiMkdzGErYt1A linux-2.6.10-rc2-xen-sparse/arch/xen/i386/kernel/head.S
     1.5  40f58a0d31M2EkuPbG94ns_nOi0PVA linux-2.6.10-rc2-xen-sparse/arch/xen/i386/kernel/i386_ksyms.c
     1.6  40faa751_zbZlAmLyQgCXdYekVFdWA linux-2.6.10-rc2-xen-sparse/arch/xen/i386/kernel/ioport.c
     1.7 -40f562382aC3_Gt4RG-4ZsfvDRUg3Q linux-2.6.10-rc2-xen-sparse/arch/xen/i386/kernel/irq.c
     1.8  40f56238ue3YRsK52HG7iccNzP1AwQ linux-2.6.10-rc2-xen-sparse/arch/xen/i386/kernel/ldt.c
     1.9  4107adf1cNtsuOxOB4T6paAoY2R2PA linux-2.6.10-rc2-xen-sparse/arch/xen/i386/kernel/pci-dma.c
    1.10  40f56238a8iOVDEoostsbun_sy2i4g linux-2.6.10-rc2-xen-sparse/arch/xen/i386/kernel/process.c
     2.1 --- a/linux-2.6.10-rc2-xen-sparse/arch/xen/i386/kernel/irq.c	Fri Nov 19 11:55:20 2004 +0000
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,258 +0,0 @@
     2.4 -/*
     2.5 - *	linux/arch/i386/kernel/irq.c
     2.6 - *
     2.7 - *	Copyright (C) 1992, 1998 Linus Torvalds, Ingo Molnar
     2.8 - *
     2.9 - * This file contains the lowest level x86-specific interrupt
    2.10 - * entry, irq-stacks and irq statistics code. All the remaining
    2.11 - * irq logic is done by the generic kernel/irq/ code and
    2.12 - * by the x86-specific irq controller code. (e.g. i8259.c and
    2.13 - * io_apic.c.)
    2.14 - */
    2.15 -
    2.16 -#include <asm/uaccess.h>
    2.17 -#include <linux/module.h>
    2.18 -#include <linux/seq_file.h>
    2.19 -#include <linux/interrupt.h>
    2.20 -#include <linux/kernel_stat.h>
    2.21 -
    2.22 -#ifndef CONFIG_X86_LOCAL_APIC
    2.23 -/*
    2.24 - * 'what should we do if we get a hw irq event on an illegal vector'.
    2.25 - * each architecture has to answer this themselves.
    2.26 - */
    2.27 -void ack_bad_irq(unsigned int irq)
    2.28 -{
    2.29 -	printk("unexpected IRQ trap at vector %02x\n", irq);
    2.30 -}
    2.31 -#endif
    2.32 -
    2.33 -#ifdef CONFIG_4KSTACKS
    2.34 -/*
    2.35 - * per-CPU IRQ handling contexts (thread information and stack)
    2.36 - */
    2.37 -union irq_ctx {
    2.38 -	struct thread_info      tinfo;
    2.39 -	u32                     stack[THREAD_SIZE/sizeof(u32)];
    2.40 -};
    2.41 -
    2.42 -static union irq_ctx *hardirq_ctx[NR_CPUS];
    2.43 -static union irq_ctx *softirq_ctx[NR_CPUS];
    2.44 -#endif
    2.45 -
    2.46 -/*
    2.47 - * do_IRQ handles all normal device IRQ's (the special
    2.48 - * SMP cross-CPU interrupts have their own specific
    2.49 - * handlers).
    2.50 - */
    2.51 -fastcall unsigned int do_IRQ(struct pt_regs *regs)
    2.52 -{	
    2.53 -	/* high bits used in ret_from_ code */
    2.54 -	int irq = regs->orig_eax & 0xff;
    2.55 -#ifdef CONFIG_4KSTACKS
    2.56 -	union irq_ctx *curctx, *irqctx;
    2.57 -	u32 *isp;
    2.58 -#endif
    2.59 -
    2.60 -	irq_enter();
    2.61 -#ifdef CONFIG_DEBUG_STACKOVERFLOW
    2.62 -	/* Debugging check for stack overflow: is there less than 1KB free? */
    2.63 -	{
    2.64 -		long esp;
    2.65 -
    2.66 -		__asm__ __volatile__("andl %%esp,%0" :
    2.67 -					"=r" (esp) : "0" (THREAD_SIZE - 1));
    2.68 -		if (unlikely(esp < (sizeof(struct thread_info) + STACK_WARN))) {
    2.69 -			printk("do_IRQ: stack overflow: %ld\n",
    2.70 -				esp - sizeof(struct thread_info));
    2.71 -			dump_stack();
    2.72 -		}
    2.73 -	}
    2.74 -#endif
    2.75 -
    2.76 -#ifdef CONFIG_4KSTACKS
    2.77 -
    2.78 -	curctx = (union irq_ctx *) current_thread_info();
    2.79 -	irqctx = hardirq_ctx[smp_processor_id()];
    2.80 -
    2.81 -	/*
    2.82 -	 * this is where we switch to the IRQ stack. However, if we are
    2.83 -	 * already using the IRQ stack (because we interrupted a hardirq
    2.84 -	 * handler) we can't do that and just have to keep using the
    2.85 -	 * current stack (which is the irq stack already after all)
    2.86 -	 */
    2.87 -	if (curctx != irqctx) {
    2.88 -		int arg1, arg2, ebx;
    2.89 -
    2.90 -		/* build the stack frame on the IRQ stack */
    2.91 -		isp = (u32*) ((char*)irqctx + sizeof(*irqctx));
    2.92 -		irqctx->tinfo.task = curctx->tinfo.task;
    2.93 -		irqctx->tinfo.previous_esp = current_stack_pointer;
    2.94 -
    2.95 -		asm volatile(
    2.96 -			"       xchgl   %%ebx,%%esp      \n"
    2.97 -			"       call    __do_IRQ         \n"
    2.98 -			"       movl   %%ebx,%%esp      \n"
    2.99 -			: "=a" (arg1), "=d" (arg2), "=b" (ebx)
   2.100 -			:  "0" (irq),   "1" (regs),  "2" (isp)
   2.101 -			: "memory", "cc", "ecx"
   2.102 -		);
   2.103 -	} else
   2.104 -#endif
   2.105 -		__do_IRQ(irq, regs);
   2.106 -
   2.107 -	irq_exit();
   2.108 -
   2.109 -	return 1;
   2.110 -}
   2.111 -
   2.112 -#ifdef CONFIG_4KSTACKS
   2.113 -
   2.114 -/*
   2.115 - * These should really be __section__(".bss.page_aligned") as well, but
   2.116 - * gcc's 3.0 and earlier don't handle that correctly.
   2.117 - */
   2.118 -static char softirq_stack[NR_CPUS * THREAD_SIZE]
   2.119 -		__attribute__((__aligned__(THREAD_SIZE)));
   2.120 -
   2.121 -static char hardirq_stack[NR_CPUS * THREAD_SIZE]
   2.122 -		__attribute__((__aligned__(THREAD_SIZE)));
   2.123 -
   2.124 -/*
   2.125 - * allocate per-cpu stacks for hardirq and for softirq processing
   2.126 - */
   2.127 -void irq_ctx_init(int cpu)
   2.128 -{
   2.129 -	union irq_ctx *irqctx;
   2.130 -
   2.131 -	if (hardirq_ctx[cpu])
   2.132 -		return;
   2.133 -
   2.134 -	irqctx = (union irq_ctx*) &hardirq_stack[cpu*THREAD_SIZE];
   2.135 -	irqctx->tinfo.task              = NULL;
   2.136 -	irqctx->tinfo.exec_domain       = NULL;
   2.137 -	irqctx->tinfo.cpu               = cpu;
   2.138 -	irqctx->tinfo.preempt_count     = HARDIRQ_OFFSET;
   2.139 -	irqctx->tinfo.addr_limit        = MAKE_MM_SEG(0);
   2.140 -
   2.141 -	hardirq_ctx[cpu] = irqctx;
   2.142 -
   2.143 -	irqctx = (union irq_ctx*) &softirq_stack[cpu*THREAD_SIZE];
   2.144 -	irqctx->tinfo.task              = NULL;
   2.145 -	irqctx->tinfo.exec_domain       = NULL;
   2.146 -	irqctx->tinfo.cpu               = cpu;
   2.147 -	irqctx->tinfo.preempt_count     = SOFTIRQ_OFFSET;
   2.148 -	irqctx->tinfo.addr_limit        = MAKE_MM_SEG(0);
   2.149 -
   2.150 -	softirq_ctx[cpu] = irqctx;
   2.151 -
   2.152 -	printk("CPU %u irqstacks, hard=%p soft=%p\n",
   2.153 -		cpu,hardirq_ctx[cpu],softirq_ctx[cpu]);
   2.154 -}
   2.155 -
   2.156 -extern asmlinkage void __do_softirq(void);
   2.157 -
   2.158 -asmlinkage void do_softirq(void)
   2.159 -{
   2.160 -	unsigned long flags;
   2.161 -	struct thread_info *curctx;
   2.162 -	union irq_ctx *irqctx;
   2.163 -	u32 *isp;
   2.164 -
   2.165 -	if (in_interrupt())
   2.166 -		return;
   2.167 -
   2.168 -	local_irq_save(flags);
   2.169 -
   2.170 -	if (local_softirq_pending()) {
   2.171 -		curctx = current_thread_info();
   2.172 -		irqctx = softirq_ctx[smp_processor_id()];
   2.173 -		irqctx->tinfo.task = curctx->task;
   2.174 -		irqctx->tinfo.previous_esp = current_stack_pointer;
   2.175 -
   2.176 -		/* build the stack frame on the softirq stack */
   2.177 -		isp = (u32*) ((char*)irqctx + sizeof(*irqctx));
   2.178 -
   2.179 -		asm volatile(
   2.180 -			"       xchgl   %%ebx,%%esp     \n"
   2.181 -			"       call    __do_softirq    \n"
   2.182 -			"       movl    %%ebx,%%esp     \n"
   2.183 -			: "=b"(isp)
   2.184 -			: "0"(isp)
   2.185 -			: "memory", "cc", "edx", "ecx", "eax"
   2.186 -		);
   2.187 -	}
   2.188 -
   2.189 -	local_irq_restore(flags);
   2.190 -}
   2.191 -
   2.192 -EXPORT_SYMBOL(do_softirq);
   2.193 -#endif
   2.194 -
   2.195 -/*
   2.196 - * Interrupt statistics:
   2.197 - */
   2.198 -
   2.199 -atomic_t irq_err_count;
   2.200 -
   2.201 -/*
   2.202 - * /proc/interrupts printing:
   2.203 - */
   2.204 -
   2.205 -int show_interrupts(struct seq_file *p, void *v)
   2.206 -{
   2.207 -	int i = *(loff_t *) v, j;
   2.208 -	struct irqaction * action;
   2.209 -	unsigned long flags;
   2.210 -
   2.211 -	if (i == 0) {
   2.212 -		seq_printf(p, "           ");
   2.213 -		for (j=0; j<NR_CPUS; j++)
   2.214 -			if (cpu_online(j))
   2.215 -				seq_printf(p, "CPU%d       ",j);
   2.216 -		seq_putc(p, '\n');
   2.217 -	}
   2.218 -
   2.219 -	if (i < NR_IRQS) {
   2.220 -		spin_lock_irqsave(&irq_desc[i].lock, flags);
   2.221 -		action = irq_desc[i].action;
   2.222 -		if (!action)
   2.223 -			goto skip;
   2.224 -		seq_printf(p, "%3d: ",i);
   2.225 -#ifndef CONFIG_SMP
   2.226 -		seq_printf(p, "%10u ", kstat_irqs(i));
   2.227 -#else
   2.228 -		for (j = 0; j < NR_CPUS; j++)
   2.229 -			if (cpu_online(j))
   2.230 -				seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
   2.231 -#endif
   2.232 -		seq_printf(p, " %14s", irq_desc[i].handler->typename);
   2.233 -		seq_printf(p, "  %s", action->name);
   2.234 -
   2.235 -		for (action=action->next; action; action = action->next)
   2.236 -			seq_printf(p, ", %s", action->name);
   2.237 -
   2.238 -		seq_putc(p, '\n');
   2.239 -skip:
   2.240 -		spin_unlock_irqrestore(&irq_desc[i].lock, flags);
   2.241 -	} else if (i == NR_IRQS) {
   2.242 -		seq_printf(p, "NMI: ");
   2.243 -		for (j = 0; j < NR_CPUS; j++)
   2.244 -			if (cpu_online(j))
   2.245 -				seq_printf(p, "%10u ", nmi_count(j));
   2.246 -		seq_putc(p, '\n');
   2.247 -#ifdef CONFIG_X86_LOCAL_APIC
   2.248 -		seq_printf(p, "LOC: ");
   2.249 -		for (j = 0; j < NR_CPUS; j++)
   2.250 -			if (cpu_online(j))
   2.251 -				seq_printf(p, "%10u ",
   2.252 -					irq_stat[j].apic_timer_irqs);
   2.253 -		seq_putc(p, '\n');
   2.254 -#endif
   2.255 -		seq_printf(p, "ERR: %10u\n", atomic_read(&irq_err_count));
   2.256 -#if defined(CONFIG_X86_IO_APIC)
   2.257 -		seq_printf(p, "MIS: %10u\n", atomic_read(&irq_mis_count));
   2.258 -#endif
   2.259 -	}
   2.260 -	return 0;
   2.261 -}