diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-05-17 17:18:19 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-05-17 17:18:19 +0000 |
commit | 0fa834d4332608374852575437d2714f820868c4 (patch) | |
tree | 4e57188abe5ff32b2639ca69314fec94378bed8d /nuttx/arch/arm/src/common/up_copystate.c | |
parent | 0368c4fac2539f3a8812f9471e9be74fb7aeb303 (diff) | |
download | px4-nuttx-0fa834d4332608374852575437d2714f820868c4.tar.gz px4-nuttx-0fa834d4332608374852575437d2714f820868c4.tar.bz2 px4-nuttx-0fa834d4332608374852575437d2714f820868c4.zip |
Debug Cortex-M3 interrupts
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1787 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/arm/src/common/up_copystate.c')
-rw-r--r-- | nuttx/arch/arm/src/common/up_copystate.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/nuttx/arch/arm/src/common/up_copystate.c b/nuttx/arch/arm/src/common/up_copystate.c index 1c4cb42ec..b73c6c95c 100644 --- a/nuttx/arch/arm/src/common/up_copystate.c +++ b/nuttx/arch/arm/src/common/up_copystate.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/common/up_copystate.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -69,9 +69,22 @@ void up_copystate(uint32 *dest, uint32 *src) { int i; - for (i = 0; i < XCPTCONTEXT_REGS; i++) + + /* In the current ARM model, the state is always copied to and from the + * stack and TCB. In the Cortex-M3 model, the state is copied from the + * stack to the TCB, but only a referenced is passed to get the the state + * from the TCB. So the following check makes sense only for the Cortex-M3 + * model: + */ + +#ifdef __thumb2__ + if (src != dest) +#endif { - *dest++ = *src++; + for (i = 0; i < XCPTCONTEXT_REGS; i++) + { + *dest++ = *src++; + } } } |