This is an automated email from Gerrit.

Tarek BOCHKATI ([email protected]) just uploaded a new patch set to 
Gerrit, which you can find at http://openocd.zylin.com/4839

-- gerrit

commit dc3dbe1e99d7981f7135218d1da1915fbeab44bb
Author: Tarek BOCHKATI <[email protected]>
Date:   Tue Jan 8 11:06:14 2019 +0100

    cortex_a_poll(): call resumed callback if the target is resumed externally
    
    In Cortex-A poll() function, we detect if the target get resumed even
    externally, since we test on the DSCR_CORE_HALTED bit,
    and the target->state is set to TARGET_RUNNING.
    
    But we never trigger that the target has been resumed (if the old state was 
halted).
    
    So in this patch we simply test if the target->state is HALTED while
    the target is really RUNNING, then we trigger the resumed event callback
    with a warning message (external resume detected) and of course we
    invalidate the register cache.
    
    Change-Id: I6df0dd5b93bf08642d08ac5fb22829fded1b7c4d
    Signed-off-by: Tarek BOCHKATI <[email protected]>

diff --git a/src/target/cortex_a.c b/src/target/cortex_a.c
index 0a55a20..2d8c690 100644
--- a/src/target/cortex_a.c
+++ b/src/target/cortex_a.c
@@ -759,9 +759,18 @@ static int cortex_a_poll(struct target *target)
                                        TARGET_EVENT_DEBUG_HALTED);
                        }
                }
-       } else
+       } else {
                target->state = TARGET_RUNNING;
 
+               if (prev_target_state == TARGET_HALTED) {
+                       /* registers are now invalid */
+                       register_cache_invalidate(armv7a->arm.core_cache);
+
+                       LOG_WARNING("target external resume detected");
+                       target_call_event_callbacks(target, 
TARGET_EVENT_RESUMED);
+               }
+       }
+
        return retval;
 }
 

-- 


_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to