Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/hpcarm Now that there is a generic SA-11x0 CPU slee...



details:   https://anonhg.NetBSD.org/src/rev/272f280754f2
branches:  trunk
changeset: 521401:272f280754f2
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Wed Jan 30 00:38:55 2002 +0000

description:
Now that there is a generic SA-11x0 CPU sleep routine, use the
shared arm32 cpuswitch.S.

diffstat:

 sys/arch/hpcarm/conf/files.hpcarm  |    3 +-
 sys/arch/hpcarm/hpcarm/cpuswitch.S |  719 -------------------------------------
 2 files changed, 1 insertions(+), 721 deletions(-)

diffs (truncated from 740 to 300 lines):

diff -r 7299975e10c8 -r 272f280754f2 sys/arch/hpcarm/conf/files.hpcarm
--- a/sys/arch/hpcarm/conf/files.hpcarm Wed Jan 30 00:37:18 2002 +0000
+++ b/sys/arch/hpcarm/conf/files.hpcarm Wed Jan 30 00:38:55 2002 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.hpcarm,v 1.33 2001/12/20 01:20:28 thorpej Exp $
+#      $NetBSD: files.hpcarm,v 1.34 2002/01/30 00:38:56 thorpej Exp $
 #
 # First try for arm-specific configuration info
 #
@@ -26,7 +26,6 @@
 
 # Generic MD files
 file   arch/hpcarm/hpcarm/autoconf.c
-file   arch/hpcarm/hpcarm/cpuswitch.S
 file   arch/hpcarm/hpcarm/fault.c
 file   arch/hpcarm/hpcarm/fusu.S
 file   arch/hpcarm/hpcarm/intr.c
diff -r 7299975e10c8 -r 272f280754f2 sys/arch/hpcarm/hpcarm/cpuswitch.S
--- a/sys/arch/hpcarm/hpcarm/cpuswitch.S        Wed Jan 30 00:37:18 2002 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,719 +0,0 @@
-/*     $NetBSD: cpuswitch.S,v 1.3 2002/01/25 19:19:29 thorpej Exp $    */
-
-/*
- * Copyright (c) 1994-1998 Mark Brinicombe.
- * Copyright (c) 1994 Brini.
- * All rights reserved.
- *
- * This code is derived from software written for Brini by Mark Brinicombe
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *     This product includes software developed by Brini.
- * 4. The name of the company nor the name of the author may be used to
- *    endorse or promote products derived from this software without specific
- *    prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY BRINI ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL BRINI OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * RiscBSD kernel project
- *
- * cpuswitch.S
- *
- * cpu switching functions
- *
- * Created      : 15/10/94
- */
-
-#include "opt_armfpe.h"
-
-#include "assym.h"
-#include <machine/param.h>
-#include <machine/cpu.h>
-#include <machine/frame.h>
-#include <machine/asm.h>
-
-#undef IRQdisable
-#undef IRQenable
-
-/*
- * New experimental definitions of IRQdisable and IRQenable
- * These keep FIQ's enabled since FIQ's are special.
- */
-
-#define IRQdisable \
-       mrs     r14, cpsr_all ; \
-       orr     r14, r14, #(I32_bit) ; \
-       msr     cpsr_all, r14 ; \
-
-#define IRQenable \
-       mrs     r14, cpsr_all ; \
-       bic     r14, r14, #(I32_bit) ; \
-       msr     cpsr_all, r14 ; \
-
-/*
- * setrunqueue() and remrunqueue()
- *
- * Functions to add and remove a process for the run queue.
- */
-
-       .text
-
-Lwhichqs:
-       .word   _C_LABEL(sched_whichqs)
-
-Lqs:
-       .word   _C_LABEL(sched_qs)
-
-/*
- * On entry
- *     r0 = process
- */
-
-ENTRY(setrunqueue)
-       /*
-        * Local register usage
-        *      r0 = process
-        *      r1 = queue
-        *      r2 = &qs[queue] and temp
-        *      r3 = temp
-        *      r12 = whichqs
-        */
-#ifdef DIAGNOSTIC
-       ldr     r1, [r0, #(P_BACK)]
-       teq     r1, #0x00000000
-       bne     Lsetrunqueue_erg
-
-       ldr     r1, [r0, #(P_WCHAN)]
-       teq     r1, #0x00000000
-       bne     Lsetrunqueue_erg
-#endif
-
-       /* Get the priority of the queue */
-       ldrb    r1, [r0, #(P_PRIORITY)]
-       mov     r1, r1, lsr #2
-
-       /* Indicate that there is a process on this queue */
-       ldr     r12, Lwhichqs
-       ldr     r2, [r12]
-       mov     r3, #0x00000001
-       mov     r3, r3, lsl r1
-       orr     r2, r2, r3
-       str     r2, [r12]
-
-       /* Get the address of the queue */
-       ldr     r2, Lqs
-       add     r1, r2, r1, lsl # 3
-
-       /* Hook the process in */
-       str     r1, [r0, #(P_FORW)]
-       ldr     r2, [r1, #(P_BACK)]
-
-       str     r0, [r1, #(P_BACK)]
-#ifdef DIAGNOSTIC
-       teq     r2, #0x00000000
-       beq     Lsetrunqueue_erg
-#endif
-       str     r0, [r2, #(P_FORW)]
-       str     r2, [r0, #(P_BACK)]
-
-       mov     pc, lr
-
-#ifdef DIAGNOSTIC
-Lsetrunqueue_erg:
-       mov     r2, r1
-       mov     r1, r0
-       add     r0, pc, #Ltext1 - . - 8
-       bl      _C_LABEL(printf)
-
-       ldr     r2, Lqs
-       ldr     r1, [r2]
-       add     r0, pc, #Ltext2 - . - 8
-       b       _C_LABEL(panic) 
-
-Ltext1:
-       .asciz  "setrunqueue : %08x %08x\n"
-Ltext2:
-       .asciz  "setrunqueue : [qs]=%08x qs=%08x\n"
-       .align  0
-#endif
-
-/*
- * On entry
- *     r0 = process
- */
-
-ENTRY(remrunqueue)
-       /*
-        * Local register usage
-        *      r0 = oldproc
-        *      r1 = queue
-        *      r2 = &qs[queue] and scratch
-        *      r3 = scratch
-        *      r12 = whichqs
-        */
-
-       /* Get the priority of the queue */
-       ldrb    r1, [r0, #(P_PRIORITY)]
-       mov     r1, r1, lsr #2
-
-       /* Unhook the process */
-       ldr     r2, [r0, #(P_FORW)]
-       ldr     r3, [r0, #(P_BACK)]
-
-       str     r3, [r2, #(P_BACK)]
-       str     r2, [r3, #(P_FORW)]
-
-       /* If the queue is now empty clear the queue not empty flag */
-       teq     r2, r3
-
-       /* This could be reworked to avoid the use of r4 */
-       ldreq   r12, Lwhichqs
-       ldreq   r2, [r12]
-       moveq   r3, #0x00000001
-       moveq   r3, r3, lsl r1
-       biceq   r2, r2, r3
-       streq   r2, [r12]
-
-       /* Remove the back pointer for the process */
-       mov     r1, #0x00000000
-       str     r1, [r0, #(P_BACK)]
-
-       mov     pc, lr
-
-
-/*
- * cpuswitch()
- *
- * preforms a process context switch.
- * This function has several entry points
- */
-
-Lcurproc:
-       .word   _C_LABEL(curproc)
-
-Lcurpcb:
-       .word   _C_LABEL(curpcb)
-
-Lwant_resched:
-       .word   _C_LABEL(want_resched)
-
-Lcpufuncs:     
-       .word   _C_LABEL(cpufuncs)
-       
-       .data
-       .global _C_LABEL(curpcb)
-_C_LABEL(curpcb):
-       .word   0x00000000
-       .text
-
-Lblock_userspace_access:
-       .word   _C_LABEL(block_userspace_access)
-
-/* this .align is necessary for the idle mode code below */
-       .align  5
-
-Lsa11x0_idle_mem:
-       .word   _C_LABEL(sa11x0_idle_mem)
-
-/*
- * Idle loop, exercised while waiting for a process to wake up.
- */
-
-idle:
-       /* Disable interrupts */
-       IRQdisable
-
-       /* XXX - r1 needs to be preserved for cpu_switch */
-       mov     r7, r1
-       ldr     r3, Lcpufuncs
-       ldr     r1, Lsa11x0_idle_mem
-       ldr     r1, [r1]
-
-       /* enter idle mode. the following code must be 32-byte aligned */
-       mcr     p15, 0, r0, c15, c2, 2
-       ldr     r0, [r1]
-       mcr     p15, 0, r0, c15, c8, 2
-
-Lidle_slept:
-       /* enable clock switching again */
-       mcr     p15, 0, r0, c15, c1, 2
-
-       /* run irq_entry after enabling clock switching */
-       IRQenable
-       mov     r1, r7
-
-       /* Disable interrupts while we check for an active queue */
-       IRQdisable
-       ldr     r7, Lwhichqs
-       ldr     r3, [r7]
-       teq     r3, #0x00000000
-       bne     sw1
-
-       /* All processes are still asleep so idle a while longer */
-       b       idle
-
-
-/*
- * Find a new process to run, save the current context and
- * load the new context
- */
-



Home | Main Index | Thread Index | Old Index