From owner-p4-projects@FreeBSD.ORG Sat Mar 13 00:44:21 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D82D116A4D0; Sat, 13 Mar 2004 00:44:20 -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 82EDF16A4CE for ; Sat, 13 Mar 2004 00:44:20 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6442243D3F for ; Sat, 13 Mar 2004 00:44:20 -0800 (PST) (envelope-from jmallett@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i2D8iKGe056521 for ; Sat, 13 Mar 2004 00:44:20 -0800 (PST) (envelope-from jmallett@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i2D8iJVp056518 for perforce@freebsd.org; Sat, 13 Mar 2004 00:44:19 -0800 (PST) (envelope-from jmallett@freebsd.org) Date: Sat, 13 Mar 2004 00:44:19 -0800 (PST) Message-Id: <200403130844.i2D8iJVp056518@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jmallett@freebsd.org using -f From: Juli Mallett To: Perforce Change Reviews Subject: PERFORCE change 48879 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: Sat, 13 Mar 2004 08:44:21 -0000 http://perforce.freebsd.org/chv.cgi?CH=48879 Change 48879 by jmallett@jmallett_oingo on 2004/03/13 00:43:45 Attempt to handle interrupts and do some fun with clock ticks. Affected files ... .. //depot/projects/mips/sys/mips/sgimips/machdep_sgimips.c#27 edit Differences ... ==== //depot/projects/mips/sys/mips/sgimips/machdep_sgimips.c#27 (text+ko) ==== @@ -33,8 +33,11 @@ #include #include +#include #include +#include #include +#include #include #include #include @@ -93,7 +96,7 @@ arcs_attach((void *)MIPS_PHYS_TO_KSEG1(0x00001000)); arcs_cnattach(); - bootverbose = 1; /* XXX */ + bootverbose = 1; cpufreq = ARCS_GetEnvironmentVariable("cpufreq"); if (cpufreq == NULL) @@ -145,7 +148,7 @@ * kernel memory. */ if (j > 0 && phys_avail[j - 1] >= kend) - kend = MIPS_PHYS_TO_KSEG0(last); + kend = MIPS_PHYS_TO_KSEG1(last); lpmem += btoc(size); break; case ARCS_Mem_Type_FreeContiguous: @@ -181,16 +184,38 @@ ctob(availmem) / (1024 * 1024)); } -#if notyet void -cpu_intr(u_int32_t status, u_int32_t cause, u_int32_t pc, u_int32_t ipending) +platform_intr(struct trapframe *tf) { - if (ipending & MIPS_HARD_INT_MASK) - (*platform.iointr)(status, cause, pc, ipending); - else - panic("Soft interrupt!?\n"); + static u_register_t next, last; + register_t cause; + + cause = mips_rd_cause(); + + if (cause & MIPS_INT_MASK_5) { + struct clockframe cf; + u_register_t now; + + /* + * Set next clock edge. + */ + if (next == 0) + next = mips_rd_count(); + last = next; + next += curcpu()->ci_cycles_per_hz; + now = mips_rd_count(); + if (last < next) { + while (now > next) + next += curcpu()->ci_cycles_per_hz; + } + mips_wr_compare(next); + cf.sr = tf->tf_regs[TF_SR]; + cf.pc = tf->tf_regs[TF_EPC]; + hardclock(&cf); + } else { + printf("stray intr cause %lx\n", cause); + } } -#endif void platform_configure(void)