URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [lib/] [libcpu/] [powerpc/] [mpc6xx/] [exceptions/] [asm_utils.S] - Rev 173
Compare with Previous | Blame | View Log
/** asm_utils.s** $Id: asm_utils.S,v 1.2 2001-09-27 12:01:25 chris Exp $** Copyright (C) 1999 Eric Valette (valette@crf.canon.fr)** This file contains the low-level support for moving exception* exception code to appropriate location.**/#include <libcpu/cpu.h>#include <libcpu/io.h>#include <rtems/score/targopts.h>#include "asm.h".globl codemovecodemove:.type codemove,@function/* r3 dest, r4 src, r5 length in bytes, r6 cachelinesize */cmplw cr1,r3,r4addi r0,r5,3srwi. r0,r0,2beq cr1,4f /* In place copy is not necessary */beq 7f /* Protect against 0 count */mtctr r0bge cr1,2fla r8,-4(r4)la r7,-4(r3)1: lwzu r0,4(r8)stwu r0,4(r7)bdnz 1bb 4f2: slwi r0,r0,2add r8,r4,r0add r7,r3,r03: lwzu r0,-4(r8)stwu r0,-4(r7)bdnz 3b/* Now flush the cache: note that we must start from a cache aligned* address. Otherwise we might miss one cache line.*/4: cmpwi r6,0add r5,r3,r5beq 7f /* Always flush prefetch queue in any case */subi r0,r6,1andc r3,r3,r0mr r4,r35: cmplw r4,r5dcbst 0,r4add r4,r4,r6blt 5bsync /* Wait for all dcbst to complete on bus */mr r4,r36: cmplw r4,r5icbi 0,r4add r4,r4,r6blt 6b7: sync /* Wait for all icbi to complete on bus */isyncblr
