* new-exceptions/bspsupport/ppc_exc_alignment.c: New file.
	* Makefile.am: Reflect change above.
	* new-exceptions/bspsupport/vectors.h: Declare
	ppc_exc_alignment_handler().
This commit is contained in:
Sebastian Huber
2011-06-07 13:58:23 +00:00
parent b125b461d5
commit 88dcb841e7
4 changed files with 61 additions and 0 deletions

View File

@@ -1,3 +1,10 @@
2011-06-07 Sebastian Huber <sebastian.huber@embedded-brains.de>
* new-exceptions/bspsupport/ppc_exc_alignment.c: New file.
* Makefile.am: Reflect change above.
* new-exceptions/bspsupport/vectors.h: Declare
ppc_exc_alignment_handler().
2011-06-07 Sebastian Huber <sebastian.huber@embedded-brains.de> 2011-06-07 Sebastian Huber <sebastian.huber@embedded-brains.de>
* new-exceptions/cpu_asm.S: Use BSP_DATA_CACHE_ENABLED instead of * new-exceptions/cpu_asm.S: Use BSP_DATA_CACHE_ENABLED instead of

View File

@@ -41,6 +41,7 @@ new_exceptions_exc_bspsupport_rel_SOURCES = \
new-exceptions/bspsupport/ppc_exc_global_handler.c \ new-exceptions/bspsupport/ppc_exc_global_handler.c \
new-exceptions/bspsupport/ppc_exc_categories.c \ new-exceptions/bspsupport/ppc_exc_categories.c \
new-exceptions/bspsupport/ppc_exc_address.c \ new-exceptions/bspsupport/ppc_exc_address.c \
new-exceptions/bspsupport/ppc_exc_alignment.c \
new-exceptions/bspsupport/ppc_exc_prologue.c new-exceptions/bspsupport/ppc_exc_prologue.c
new_exceptions_exc_bspsupport_rel_CPPFLAGS = $(AM_CPPFLAGS) new_exceptions_exc_bspsupport_rel_CPPFLAGS = $(AM_CPPFLAGS)

View File

@@ -0,0 +1,45 @@
/*
* Copyright (c) 2011 embedded brains GmbH. All rights reserved.
*
* embedded brains GmbH
* Obere Lagerstr. 30
* 82178 Puchheim
* Germany
* <rtems@embedded-brains.de>
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rtems.com/license/LICENSE.
*
* $Id$
*/
#include <rtems.h>
#include <bsp/vectors.h>
int ppc_exc_alignment_handler(BSP_Exception_frame *frame, unsigned excNum)
{
unsigned opcode = *(unsigned *) frame->EXC_SRR0;
/* Do we have a dcbz instruction? */
if ((opcode & 0xffe007ff) == 0x7c0007ec) {
unsigned clsz = (unsigned) rtems_cache_get_data_line_size();
unsigned a = (opcode >> 16) & 0x1f;
unsigned b = (opcode >> 11) & 0x1f;
unsigned *regs = &frame->GPR0;
unsigned *current = (unsigned *)
(((a == 0 ? 0 : regs [a]) + regs [b]) & (clsz - 1));
unsigned *end = current + clsz / 4;
while (current != end) {
*current = 0;
++current;
}
frame->EXC_SRR0 += 4;
return 0;
} else {
return -1;
}
}

View File

@@ -509,6 +509,14 @@ extern uint32_t (*ppc_exc_get_DAR)(void);
void void
ppc_exc_wrapup(BSP_Exception_frame *f); ppc_exc_wrapup(BSP_Exception_frame *f);
/**
* @brief Standard aligment handler.
*
* @retval 0 Performed a dcbz instruction.
* @retval -1 Otherwise.
*/
int ppc_exc_alignment_handler(BSP_Exception_frame *frame, unsigned excNum);
/** @} */ /** @} */
/* /*