Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
sync with head.
  • Loading branch information
yamt committed Dec 13, 2007
1 parent 10dc1ac commit ba518d9
Show file tree
Hide file tree
Showing 237 changed files with 1,933 additions and 2,092 deletions.
3 changes: 2 additions & 1 deletion sys/arch/README
@@ -1,4 +1,4 @@
$NetBSD: README,v 1.47 2007/11/28 20:50:10 ad Exp $ $NetBSD: README,v 1.47.4.1 2007/12/13 05:05:12 yamt Exp $


acorn26: Acorn ARM2- and ARM3-based machines (arm, 20000509) acorn26: Acorn ARM2- and ARM3-based machines (arm, 20000509)
acorn32: Acorn computers Ltd. ARM 6/7/SA based machines (arm, 20011118) acorn32: Acorn computers Ltd. ARM 6/7/SA based machines (arm, 20011118)
Expand Down Expand Up @@ -27,6 +27,7 @@ hpcsh: Hitachi SuperH(TM) based handheld PCs (sh3, 20010117)
i386: Intel/AMD etc. x86 processor line (i386, 19930321) i386: Intel/AMD etc. x86 processor line (i386, 19930321)
ibmnws: IBM Network Station Thin Clients (powerpc, -) ibmnws: IBM Network Station Thin Clients (powerpc, -)
iyonix: Castle Technology xscale based workstations (arm, 20040713) iyonix: Castle Technology xscale based workstations (arm, 20040713)
landisk: SH4 processor based NAS appliances by I-O DATA (sh3)
luna68k: LUNA product line of OMRON Tateishi Electric (m68k, 20000105) luna68k: LUNA product line of OMRON Tateishi Electric (m68k, 20000105)
mac68k: Apple Macintosh (m68k, 19930929) mac68k: Apple Macintosh (m68k, 19930929)
macppc: Apple Power Macintosh and clones (powerpc, 19980515) macppc: Apple Power Macintosh and clones (powerpc, 19980515)
Expand Down
8 changes: 4 additions & 4 deletions sys/arch/amd64/amd64/identcpu.c
@@ -1,4 +1,4 @@
/* $NetBSD: identcpu.c,v 1.31 2007/11/22 16:16:42 bouyer Exp $ */ /* $NetBSD: identcpu.c,v 1.31.4.1 2007/12/13 05:05:13 yamt Exp $ */


/* /*
* Copyright (c) 2003 Wasabi Systems, Inc. * Copyright (c) 2003 Wasabi Systems, Inc.
Expand Down Expand Up @@ -36,7 +36,7 @@
*/ */


#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.31 2007/11/22 16:16:42 bouyer Exp $"); __KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.31.4.1 2007/12/13 05:05:13 yamt Exp $");


#include "opt_enhanced_speedstep.h" #include "opt_enhanced_speedstep.h"
#include "opt_intel_coretemp.h" #include "opt_intel_coretemp.h"
Expand Down Expand Up @@ -152,8 +152,8 @@ identifycpu(struct cpu_info *ci)
x86_print_cacheinfo(ci); x86_print_cacheinfo(ci);


#ifdef POWERNOW_K8 #ifdef POWERNOW_K8
if (CPUID2FAMILY(ci->ci_signature) == 15 && if (cpu_vendor == CPUVENDOR_AMD &&
(cpu_model[0] == 'A' || cpu_model[0] == 'O') && CPUID2FAMILY(ci->ci_signature) == 15 &&
powernow_probe(ci)) powernow_probe(ci))
k8_powernow_init(); k8_powernow_init();
#endif #endif
Expand Down
12 changes: 10 additions & 2 deletions sys/arch/arm/arm/arm_machdep.c
@@ -1,4 +1,4 @@
/* $NetBSD: arm_machdep.c,v 1.15 2007/04/22 08:29:55 dsl Exp $ */ /* $NetBSD: arm_machdep.c,v 1.15.24.1 2007/12/13 05:05:13 yamt Exp $ */


/* /*
* Copyright (c) 2001 Wasabi Systems, Inc. * Copyright (c) 2001 Wasabi Systems, Inc.
Expand Down Expand Up @@ -77,7 +77,7 @@


#include <sys/param.h> #include <sys/param.h>


__KERNEL_RCSID(0, "$NetBSD: arm_machdep.c,v 1.15 2007/04/22 08:29:55 dsl Exp $"); __KERNEL_RCSID(0, "$NetBSD: arm_machdep.c,v 1.15.24.1 2007/12/13 05:05:13 yamt Exp $");


#include <sys/exec.h> #include <sys/exec.h>
#include <sys/proc.h> #include <sys/proc.h>
Expand All @@ -86,6 +86,7 @@ __KERNEL_RCSID(0, "$NetBSD: arm_machdep.c,v 1.15 2007/04/22 08:29:55 dsl Exp $")
#include <sys/pool.h> #include <sys/pool.h>
#include <sys/ucontext.h> #include <sys/ucontext.h>
#include <sys/evcnt.h> #include <sys/evcnt.h>
#include <sys/cpu.h>


#include <arm/cpufunc.h> #include <arm/cpufunc.h>


Expand Down Expand Up @@ -179,3 +180,10 @@ startlwp(void *arg)


userret(l); userret(l);
} }

bool
cpu_intr_p(void)
{

return curcpu()->ci_idepth != 0;
}
3 changes: 2 additions & 1 deletion sys/arch/arm/include/cpu.h
@@ -1,4 +1,4 @@
/* $NetBSD: cpu.h,v 1.47 2007/10/17 19:53:41 garbled Exp $ */ /* $NetBSD: cpu.h,v 1.47.6.1 2007/12/13 05:05:13 yamt Exp $ */


/* /*
* Copyright (c) 1994-1996 Mark Brinicombe. * Copyright (c) 1994-1996 Mark Brinicombe.
Expand Down Expand Up @@ -220,6 +220,7 @@ struct cpu_info {
int32_t ci_mtx_count; int32_t ci_mtx_count;
int ci_mtx_oldspl; int ci_mtx_oldspl;
int ci_want_resched; int ci_want_resched;
int ci_idepth;
#ifdef MULTIPROCESSOR #ifdef MULTIPROCESSOR
MP_CPU_INFO_MEMBERS MP_CPU_INFO_MEMBERS
#endif #endif
Expand Down
87 changes: 19 additions & 68 deletions sys/arch/arm/xscale/becc_icu.c
@@ -1,4 +1,4 @@
/* $NetBSD: becc_icu.c,v 1.7 2006/11/24 21:20:05 wiz Exp $ */ /* $NetBSD: becc_icu.c,v 1.7.42.1 2007/12/13 05:05:13 yamt Exp $ */


/* /*
* Copyright (c) 2002 Wasabi Systems, Inc. * Copyright (c) 2002 Wasabi Systems, Inc.
Expand Down Expand Up @@ -40,7 +40,7 @@
*/ */


#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: becc_icu.c,v 1.7 2006/11/24 21:20:05 wiz Exp $"); __KERNEL_RCSID(0, "$NetBSD: becc_icu.c,v 1.7.42.1 2007/12/13 05:05:13 yamt Exp $");


#ifndef EVBARM_SPL_NOINLINE #ifndef EVBARM_SPL_NOINLINE
#define EVBARM_SPL_NOINLINE #define EVBARM_SPL_NOINLINE
Expand All @@ -49,12 +49,11 @@ __KERNEL_RCSID(0, "$NetBSD: becc_icu.c,v 1.7 2006/11/24 21:20:05 wiz Exp $");
#include <sys/param.h> #include <sys/param.h>
#include <sys/systm.h> #include <sys/systm.h>
#include <sys/malloc.h> #include <sys/malloc.h>
#include <sys/bus.h>
#include <sys/intr.h>


#include <uvm/uvm_extern.h> #include <uvm/uvm_extern.h>


#include <machine/bus.h>
#include <machine/intr.h>

#include <arm/cpufunc.h> #include <arm/cpufunc.h>


#include <arm/xscale/beccreg.h> #include <arm/xscale/beccreg.h>
Expand Down Expand Up @@ -195,72 +194,18 @@ becc_intr_calculate_masks(void)


becc_imask[IPL_NONE] = 0; becc_imask[IPL_NONE] = 0;


/*
* Initialize the soft interrupt masks to block themselves.
* Note they all come in at the same physical IRQ.
*/
becc_imask[IPL_SOFT] = (1U << ICU_SOFT);
becc_imask[IPL_SOFTCLOCK] = (1U << ICU_SOFT);
becc_imask[IPL_SOFTNET] = (1U << ICU_SOFT);
becc_imask[IPL_SOFTSERIAL] = (1U << ICU_SOFT);

/*
* splsoftclock() is the only interface that users of the
* generic software interrupt facility have to block their
* soft intrs, so splsoftclock() must also block IPL_SOFT.
*/
becc_imask[IPL_SOFTCLOCK] |= becc_imask[IPL_SOFT];

/*
* splsoftnet() must also block splsoftclock(), since we don't
* want timer-driven network events to occur while we're
* processing incoming packets.
*/
becc_imask[IPL_SOFTNET] |= becc_imask[IPL_SOFTCLOCK];

/* /*
* Enforce a hierarchy that gives "slow" device (or devices with * Enforce a hierarchy that gives "slow" device (or devices with
* limited input buffer space/"real-time" requirements) a better * limited input buffer space/"real-time" requirements) a better
* chance at not dropping data. * chance at not dropping data.
*/ */
becc_imask[IPL_BIO] |= becc_imask[IPL_SOFTNET]; becc_imask[IPL_SOFTCLOCK] = (1U << ICU_SOFT);
becc_imask[IPL_NET] |= becc_imask[IPL_BIO]; becc_imask[IPL_SOFTNET] = (1U << ICU_SOFT);
becc_imask[IPL_SOFTSERIAL] |= becc_imask[IPL_NET]; becc_imask[IPL_SOFTBIO] = (1U << ICU_SOFT);
becc_imask[IPL_TTY] |= becc_imask[IPL_SOFTSERIAL]; becc_imask[IPL_SOFTSERIAL] = (1U << ICU_SOFT);

becc_imask[IPL_VM] |= becc_imask[IPL_SOFTSERIAL];
/* becc_imask[IPL_SCHED] |= becc_imask[IPL_VM];
* splvm() blocks all interrupts that use the kernel memory becc_imask[IPL_HIGH] |= becc_imask[IPL_SCHED];
* allocation facilities.
*/
becc_imask[IPL_VM] |= becc_imask[IPL_TTY];

/*
* Audio devices are not allowed to perform memory allocation
* in their interrupt routines, and they have fairly "real-time"
* requirements, so give them a high interrupt priority.
*/
becc_imask[IPL_AUDIO] |= becc_imask[IPL_VM];

/*
* splclock() must block anything that uses the scheduler.
*/
becc_imask[IPL_CLOCK] |= becc_imask[IPL_AUDIO];

/*
* No separate statclock on the IQ80310.
*/
becc_imask[IPL_STATCLOCK] |= becc_imask[IPL_CLOCK];

/*
* splhigh() must block "everything".
*/
becc_imask[IPL_HIGH] |= becc_imask[IPL_STATCLOCK];

/*
* XXX We need serial drivers to run at the absolute highest priority
* in order to avoid overruns, so serial > high.
*/
becc_imask[IPL_SERIAL] |= becc_imask[IPL_HIGH];


/* /*
* Now compute which IRQs must be blocked when servicing any * Now compute which IRQs must be blocked when servicing any
Expand Down Expand Up @@ -307,15 +252,16 @@ _setsoftintr(int si)
} }


static const int si_to_ipl[SI_NQUEUES] = { static const int si_to_ipl[SI_NQUEUES] = {
IPL_SOFT, /* SI_SOFT */
IPL_SOFTCLOCK, /* SI_SOFTCLOCK */ IPL_SOFTCLOCK, /* SI_SOFTCLOCK */
IPL_SOFTBIO, /* SI_SOFTBIO */
IPL_SOFTNET, /* SI_SOFTNET */ IPL_SOFTNET, /* SI_SOFTNET */
IPL_SOFTSERIAL, /* SI_SOFTSERIAL */ IPL_SOFTSERIAL, /* SI_SOFTSERIAL */
}; };


int int
becc_softint(void *arg) becc_softint(void *arg)
{ {
#ifdef __HAVE_FAST_SOFTINTS
static __cpu_simple_lock_t processing = __SIMPLELOCK_UNLOCKED; static __cpu_simple_lock_t processing = __SIMPLELOCK_UNLOCKED;
uint32_t new, oldirqstate; uint32_t new, oldirqstate;


Expand Down Expand Up @@ -347,6 +293,7 @@ becc_softint(void *arg)
__cpu_simple_unlock(&processing); __cpu_simple_unlock(&processing);


restore_interrupts(oldirqstate); restore_interrupts(oldirqstate);
#endif


return 1; return 1;
} }
Expand Down Expand Up @@ -457,9 +404,11 @@ becc_intr_dispatch(struct irqframe *frame)
struct intrq *iq; struct intrq *iq;
struct intrhand *ih; struct intrhand *ih;
uint32_t oldirqstate, pcpl, irq, ibit, hwpend; uint32_t oldirqstate, pcpl, irq, ibit, hwpend;
struct cpu_info *ci;


ci = curcpu();
ci->ci_idepth++;
pcpl = current_spl_level; pcpl = current_spl_level;

hwpend = becc_icsr_read(); hwpend = becc_icsr_read();


/* /*
Expand Down Expand Up @@ -504,6 +453,8 @@ becc_intr_dispatch(struct irqframe *frame)
becc_set_intrmask(); becc_set_intrmask();
} }


ci->ci_idepth--;

if (becc_ipending & ~pcpl) { if (becc_ipending & ~pcpl) {
intr_enabled |= (becc_ipending & ~pcpl); intr_enabled |= (becc_ipending & ~pcpl);
becc_set_intrmask(); becc_set_intrmask();
Expand Down
6 changes: 3 additions & 3 deletions sys/arch/arm/xscale/becc_timer.c
@@ -1,4 +1,4 @@
/* $NetBSD: becc_timer.c,v 1.11 2007/01/06 16:18:18 christos Exp $ */ /* $NetBSD: becc_timer.c,v 1.11.36.1 2007/12/13 05:05:13 yamt Exp $ */


/* /*
* Copyright (c) 2001, 2002 Wasabi Systems, Inc. * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
Expand Down Expand Up @@ -40,7 +40,7 @@
*/ */


#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: becc_timer.c,v 1.11 2007/01/06 16:18:18 christos Exp $"); __KERNEL_RCSID(0, "$NetBSD: becc_timer.c,v 1.11.36.1 2007/12/13 05:05:13 yamt Exp $");


#include <sys/param.h> #include <sys/param.h>
#include <sys/systm.h> #include <sys/systm.h>
Expand Down Expand Up @@ -163,7 +163,7 @@ cpu_initclocks(void)
BECC_CSR_WRITE(BECC_TSCRA, TSCRx_TE | TSCRx_CM); BECC_CSR_WRITE(BECC_TSCRA, TSCRx_TE | TSCRx_CM);


/* register soft interrupt handler as well */ /* register soft interrupt handler as well */
becc_intr_establish(ICU_SOFT, IPL_SOFT, becc_softint, NULL); becc_intr_establish(ICU_SOFT, IPL_SOFTCLOCK, becc_softint, NULL);


restore_interrupts(oldirqstate); restore_interrupts(oldirqstate);
} }
Expand Down
9 changes: 6 additions & 3 deletions sys/arch/arm/xscale/i80321_icu.c
@@ -1,4 +1,4 @@
/* $NetBSD: i80321_icu.c,v 1.15 2007/12/03 15:33:20 ad Exp $ */ /* $NetBSD: i80321_icu.c,v 1.15.4.1 2007/12/13 05:05:14 yamt Exp $ */


/* /*
* Copyright (c) 2001, 2002, 2006 Wasabi Systems, Inc. * Copyright (c) 2001, 2002, 2006 Wasabi Systems, Inc.
Expand Down Expand Up @@ -36,7 +36,7 @@
*/ */


#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: i80321_icu.c,v 1.15 2007/12/03 15:33:20 ad Exp $"); __KERNEL_RCSID(0, "$NetBSD: i80321_icu.c,v 1.15.4.1 2007/12/13 05:05:14 yamt Exp $");


#ifndef EVBARM_SPL_NOINLINE #ifndef EVBARM_SPL_NOINLINE
#define EVBARM_SPL_NOINLINE #define EVBARM_SPL_NOINLINE
Expand Down Expand Up @@ -451,12 +451,14 @@ i80321_intr_dispatch(struct clockframe *frame)
struct intrq *iq; struct intrq *iq;
struct intrhand *ih; struct intrhand *ih;
int oldirqstate, pcpl, irq, ibit, hwpend; int oldirqstate, pcpl, irq, ibit, hwpend;
struct cpu_info *ci;
#ifdef I80321_HPI_ENABLED #ifdef I80321_HPI_ENABLED
int oldpending; int oldpending;
#endif #endif


ci = curcpu();
ci->ci_idepth++;
pcpl = current_spl_level; pcpl = current_spl_level;

hwpend = i80321_iintsrc_read(); hwpend = i80321_iintsrc_read();


/* /*
Expand Down Expand Up @@ -551,6 +553,7 @@ i80321_intr_dispatch(struct clockframe *frame)
*/ */
hwpend |= ((i80321_ipending & ICU_INT_HWMASK) & ~pcpl); hwpend |= ((i80321_ipending & ICU_INT_HWMASK) & ~pcpl);
} }
ci->ci_idepth--;


/* Check for pendings soft intrs. */ /* Check for pendings soft intrs. */
if ((i80321_ipending & INT_SWMASK) & ~current_spl_level) { if ((i80321_ipending & INT_SWMASK) & ~current_spl_level) {
Expand Down
9 changes: 6 additions & 3 deletions sys/arch/arm/xscale/ixp425_intr.c
@@ -1,4 +1,4 @@
/* $NetBSD: ixp425_intr.c,v 1.16 2007/12/03 15:33:20 ad Exp $ */ /* $NetBSD: ixp425_intr.c,v 1.16.4.1 2007/12/13 05:05:14 yamt Exp $ */


/* /*
* Copyright (c) 2003 * Copyright (c) 2003
Expand Down Expand Up @@ -68,7 +68,7 @@
*/ */


#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ixp425_intr.c,v 1.16 2007/12/03 15:33:20 ad Exp $"); __KERNEL_RCSID(0, "$NetBSD: ixp425_intr.c,v 1.16.4.1 2007/12/13 05:05:14 yamt Exp $");


#ifndef EVBARM_SPL_NOINLINE #ifndef EVBARM_SPL_NOINLINE
#define EVBARM_SPL_NOINLINE #define EVBARM_SPL_NOINLINE
Expand Down Expand Up @@ -438,9 +438,11 @@ ixp425_intr_dispatch(struct clockframe *frame)
struct intrq *iq; struct intrq *iq;
struct intrhand *ih; struct intrhand *ih;
int oldirqstate, pcpl, irq, ibit, hwpend; int oldirqstate, pcpl, irq, ibit, hwpend;
struct cpu_info *ci;


ci = curcpu();
ci->ci_idepth++;
pcpl = current_spl_level; pcpl = current_spl_level;

hwpend = ixp425_irq_read(); hwpend = ixp425_irq_read();


/* /*
Expand Down Expand Up @@ -503,6 +505,7 @@ ixp425_intr_dispatch(struct clockframe *frame)
*/ */
hwpend |= ((ixp425_ipending & IXP425_INT_HWMASK) & ~pcpl); hwpend |= ((ixp425_ipending & IXP425_INT_HWMASK) & ~pcpl);
} }
ci->ci_idepth--;


/* Check for pendings soft intrs. */ /* Check for pendings soft intrs. */
if ((ixp425_ipending & INT_SWMASK) & ~current_spl_level) { if ((ixp425_ipending & INT_SWMASK) & ~current_spl_level) {
Expand Down
9 changes: 7 additions & 2 deletions sys/arch/arm/xscale/pxa2x0_intr.c
@@ -1,4 +1,4 @@
/* $NetBSD: pxa2x0_intr.c,v 1.12 2007/12/03 15:33:20 ad Exp $ */ /* $NetBSD: pxa2x0_intr.c,v 1.12.4.1 2007/12/13 05:05:14 yamt Exp $ */


/* /*
* Copyright (c) 2002 Genetec Corporation. All rights reserved. * Copyright (c) 2002 Genetec Corporation. All rights reserved.
Expand Down Expand Up @@ -39,7 +39,7 @@
*/ */


#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pxa2x0_intr.c,v 1.12 2007/12/03 15:33:20 ad Exp $"); __KERNEL_RCSID(0, "$NetBSD: pxa2x0_intr.c,v 1.12.4.1 2007/12/13 05:05:14 yamt Exp $");


#include <sys/param.h> #include <sys/param.h>
#include <sys/systm.h> #include <sys/systm.h>
Expand Down Expand Up @@ -175,7 +175,10 @@ pxa2x0_irq_handler(void *arg)
uint32_t irqbits; uint32_t irqbits;
int irqno; int irqno;
int saved_spl_level; int saved_spl_level;
struct cpu_info *ci;


ci = curcpu();
ci->ci_idepth++;
saved_spl_level = current_spl_level; saved_spl_level = current_spl_level;


/* get pending IRQs */ /* get pending IRQs */
Expand Down Expand Up @@ -209,6 +212,8 @@ pxa2x0_irq_handler(void *arg)


/* restore spl to that was when this interrupt happen */ /* restore spl to that was when this interrupt happen */
pxa2x0_setipl(saved_spl_level); pxa2x0_setipl(saved_spl_level);

ci->ci_idepth--;


if(softint_pending & intr_mask) if(softint_pending & intr_mask)
pxa2x0_do_pending(); pxa2x0_do_pending();
Expand Down

0 comments on commit ba518d9

Please sign in to comment.