From owner-p4-projects@FreeBSD.ORG Tue Nov 11 18:54:37 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 962A816A4D1; Tue, 11 Nov 2003 18:54:37 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7044816A4CF for ; Tue, 11 Nov 2003 18:54:37 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id C436F43FE9 for ; Tue, 11 Nov 2003 18:54:36 -0800 (PST) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.9/8.12.9) with ESMTP id hAC2saXJ028170 for ; Tue, 11 Nov 2003 18:54:36 -0800 (PST) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.9/8.12.9/Submit) id hAC2saDA028167 for perforce@freebsd.org; Tue, 11 Nov 2003 18:54:36 -0800 (PST) (envelope-from peter@freebsd.org) Date: Tue, 11 Nov 2003 18:54:36 -0800 (PST) Message-Id: <200311120254.hAC2saDA028167@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 42076 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Nov 2003 02:54:38 -0000 http://perforce.freebsd.org/chv.cgi?CH=42076 Change 42076 by peter@peter_daintree on 2003/11/11 18:53:46 move a bunch of td_intr_nesting_level frobbing to C. Affected files ... .. //depot/projects/hammer/sys/amd64/amd64/apic_vector.S#3 edit .. //depot/projects/hammer/sys/amd64/amd64/local_apic.c#17 edit .. //depot/projects/hammer/sys/amd64/amd64/mp_machdep.c#27 edit Differences ... ==== //depot/projects/hammer/sys/amd64/amd64/apic_vector.S#3 (text+ko) ==== @@ -105,9 +105,7 @@ IDTVEC(vec_name) ; \ PUSH_FRAME ; \ movq lapic, %rdx ; /* pointer to local APIC */ \ - movq PCPU(CURTHREAD), %rbx ; \ movl LA_ISR + 16 * (index)(%rdx), %eax ; /* load ISR */ \ - incl TD_INTR_NESTING_LEVEL(%rbx) ; \ bsrl %eax, %eax ; /* index of highset set bit in ISR */ \ jz 2f ; \ addl $(32 * index),%eax ; \ @@ -115,7 +113,6 @@ FAKE_MCOUNT(13*4(%esp)) ; /* XXX avoid double count */ \ movq %rax, %rdi ; /* pass the IRQ */ \ call lapic_handle_intr ; \ - decl TD_INTR_NESTING_LEVEL(%rbx) ; \ MEXITCOUNT ; \ jmp doreti ; \ 2: movl $-1, %eax ; /* send a vector of -1 */ \ @@ -223,10 +220,7 @@ movq lapic, %rdx movl $0, LA_EOI(%rdx) /* End Of Interrupt to APIC */ - movq PCPU(CURTHREAD),%rbx - incl TD_INTR_NESTING_LEVEL(%rbx) call forwarded_hardclock - decl TD_INTR_NESTING_LEVEL(%rbx) MEXITCOUNT jmp doreti @@ -244,10 +238,7 @@ FAKE_MCOUNT(13*4(%esp)) - movq PCPU(CURTHREAD),%rbx - incl TD_INTR_NESTING_LEVEL(%rbx) call forwarded_statclock - decl TD_INTR_NESTING_LEVEL(%rbx) MEXITCOUNT jmp doreti ==== //depot/projects/hammer/sys/amd64/amd64/local_apic.c#17 (text+ko) ==== @@ -468,14 +468,17 @@ lapic_handle_intr(void *cookie, struct intrframe frame) { struct intsrc *isrc; + struct thread *td = curthread; int vec = (uintptr_t)cookie; + td->td_intr_nesting_level++; if (vec == -1) panic("Couldn't get vector from ISR!"); isrc = intr_lookup_source(apic_idt_to_irq(vec)); isrc->is_pic->pic_disable_source(isrc); lapic->eoi = 0; intr_execute_handlers(isrc, &frame); + td->td_intr_nesting_level--; } /* Translate between IDT vectors and IRQ vectors. */ ==== //depot/projects/hammer/sys/amd64/amd64/mp_machdep.c#27 (text+ko) ==== @@ -781,12 +781,15 @@ void forwarded_statclock(struct clockframe frame) { + struct thread *td = curthread; + td->td_intr_nesting_level++; CTR0(KTR_SMP, "forwarded_statclock"); if (profprocs != 0) profclock(&frame); if (pscnt == psdiv) statclock(&frame); + td->td_intr_nesting_level--; } void @@ -814,9 +817,12 @@ void forwarded_hardclock(struct clockframe frame) { + struct thread *td = curthread; + td->td_intr_nesting_level++; CTR0(KTR_SMP, "forwarded_hardclock"); hardclock_process(&frame); + td->td_intr_nesting_level--; } void