Add paging debug instrumentation

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2899 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo 2010-08-31 02:21:12 +00:00
parent dbbc4214ae
commit e6c5fbef2e
3 changed files with 10 additions and 6 deletions

View File

@ -123,6 +123,7 @@ void up_dataabort(uint32_t *regs, uint32_t far, uint32_t fsr)
* fatal error. * fatal error.
*/ */
pglldbg("FSR: %08x FAR: %08x\n", fsr, far);
if ((fsr & FSR_MASK) != FSR_PAGE) if ((fsr & FSR_MASK) != FSR_PAGE)
{ {
goto segfault; goto segfault;
@ -133,6 +134,7 @@ void up_dataabort(uint32_t *regs, uint32_t far, uint32_t fsr)
* (It has not yet been saved in the register context save area). * (It has not yet been saved in the register context save area).
*/ */
pgllvdbg("VBASE: %08x VEND: %08x\n", PG_PAGED_VBASE, PG_PAGED_VEND);
if (far < PG_PAGED_VBASE || far >= PG_PAGED_VEND) if (far < PG_PAGED_VBASE || far >= PG_PAGED_VEND)
{ {
goto segfault; goto segfault;
@ -162,7 +164,7 @@ void up_dataabort(uint32_t *regs, uint32_t far, uint32_t fsr)
return; return;
segfault: segfault:
lldbg("Data abort at PC: %x FAR: %08x FSR: %08x\n", regs[REG_PC], far, fsr); lldbg("Data abort. PC: %08x FAR: %08x FSR: %08x\n", regs[REG_PC], far, fsr);
PANIC(OSERR_ERREXCEPTION); PANIC(OSERR_ERREXCEPTION);
} }
@ -178,7 +180,7 @@ void up_dataabort(uint32_t *regs)
/* Crash -- possibly showing diagnost debug information. */ /* Crash -- possibly showing diagnost debug information. */
lldbg("Data abort at %08x\n", regs[REG_PC]); lldbg("Data abort. PC: %08x\n", regs[REG_PC]);
PANIC(OSERR_ERREXCEPTION); PANIC(OSERR_ERREXCEPTION);
} }

View File

@ -105,6 +105,9 @@ void up_prefetchabort(uint32_t *regs)
* virtual addresses. * virtual addresses.
*/ */
pglldbg("VADDR: %08x VBASE: %08x VEND: %08x\n",
regs[REG_PC], PG_PAGED_VBASE, PG_PAGED_VEND);
if (regs[REG_R15] >= PG_PAGED_VBASE && regs[REG_R15] < PG_PAGED_VEND) if (regs[REG_R15] >= PG_PAGED_VBASE && regs[REG_R15] < PG_PAGED_VEND)
{ {
/* Save the offending PC as the fault address in the TCB of the currently /* Save the offending PC as the fault address in the TCB of the currently
@ -133,7 +136,7 @@ void up_prefetchabort(uint32_t *regs)
else else
#endif #endif
{ {
lldbg("Prefetch abort at %08x\n", regs[REG_PC]); lldbg("Prefetch abort. PC: %08x\n", regs[REG_PC]);
PANIC(OSERR_ERREXCEPTION); PANIC(OSERR_ERREXCEPTION);
} }
} }

View File

@ -1,7 +1,7 @@
/************************************************************************************ /************************************************************************************
* arm/arm/src/lpc313x/lpc313x_spi.c * arm/arm/src/lpc313x/lpc313x_spi.c
* *
* Copyright (C) 2009 Gregory Nutt. All rights reserved. * Copyright (C) 2009-2010 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr> * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -568,8 +568,7 @@ static uint8_t spi_status(FAR struct spi_dev_s *dev, enum spi_dev_e devid)
static uint16_t spi_send(FAR struct spi_dev_s *dev, uint16_t wd) static uint16_t spi_send(FAR struct spi_dev_s *dev, uint16_t wd)
{ {
FAR struct lpc313x_spidev_s *priv = (FAR struct lpc313x_spidev_s *)dev; FAR struct lpc313x_spidev_s *priv = (FAR struct lpc313x_spidev_s *)dev;
DEBUGASSERT(priv);
DEBUGASSERT(priv && priv->spibase);
spi_writeword(priv, wd); spi_writeword(priv, wd);
return spi_readword(priv); return spi_readword(priv);