This is an automated email from Gerrit.

Matthias Welwarsky (matth...@welwarsky.de) just uploaded a new patch set to 
Gerrit, which you can find at http://openocd.zylin.com/3758

-- gerrit

commit 2a7d0b54f154bcfcbe8c26237472a42725bb90ec
Author: Matthias Welwarsky <matthias.welwar...@sysgo.com>
Date:   Fri Sep 16 15:23:27 2016 +0200

    aarch64: correct display for aarch64 state
    
    Aarch64 state has different PSTATE and exception level model.
    Correct the printout e.g. in poll command.
    
    Change-Id: I1820fd1836c7076ae0aa405fa335fd1a14a2e5b3
    Signed-off-by: Matthias Welwarsky <matthias.welwar...@sysgo.com>

diff --git a/src/target/armv8.c b/src/target/armv8.c
index 0c72fe9..fdebf5b 100644
--- a/src/target/armv8.c
+++ b/src/target/armv8.c
@@ -730,6 +730,27 @@ int armv8_init_arch_info(struct target *target, struct 
armv8_common *armv8)
        return ERROR_OK;
 }
 
+int armv8_aarch64_state(struct target *target)
+{
+       struct arm *arm = target_to_arm(target);
+
+       if (arm->common_magic != ARM_COMMON_MAGIC) {
+               LOG_ERROR("BUG: called for a non-ARM target");
+               return ERROR_FAIL;
+       }
+
+       LOG_USER("target halted in %s state due to %s, current mode: %s\n"
+               "cpsr: 0x%8.8" PRIx32 " pc: 0x%" PRIx64 "%s",
+               armv8_state_strings[arm->core_state],
+               debug_reason_name(target),
+               armv8_mode_name(arm->core_mode),
+               buf_get_u32(arm->cpsr->value, 0, 32),
+               buf_get_u64(arm->pc->value, 0, 64),
+               arm->is_semihosting ? ", semihosting" : "");
+
+       return ERROR_OK;
+}
+
 int armv8_arch_state(struct target *target)
 {
        static const char * const state[] = {
@@ -744,18 +765,15 @@ int armv8_arch_state(struct target *target)
                return ERROR_COMMAND_SYNTAX_ERROR;
        }
 
-       arm_arch_state(target);
+       if (arm->core_state == ARM_STATE_AARCH64)
+               armv8_aarch64_state(target);
+       else
+               arm_arch_state(target);
 
-       if (armv8->is_armv7r) {
-               LOG_USER("D-Cache: %s, I-Cache: %s",
-                       state[armv8->armv8_mmu.armv8_cache.d_u_cache_enabled],
-                       state[armv8->armv8_mmu.armv8_cache.i_cache_enabled]);
-       } else {
-               LOG_USER("MMU: %s, D-Cache: %s, I-Cache: %s",
-                       state[armv8->armv8_mmu.mmu_enabled],
-                       state[armv8->armv8_mmu.armv8_cache.d_u_cache_enabled],
-                       state[armv8->armv8_mmu.armv8_cache.i_cache_enabled]);
-       }
+       LOG_USER("MMU: %s, D-Cache: %s, I-Cache: %s",
+               state[armv8->armv8_mmu.mmu_enabled],
+               state[armv8->armv8_mmu.armv8_cache.d_u_cache_enabled],
+               state[armv8->armv8_mmu.armv8_cache.i_cache_enabled]);
 
        if (arm->core_mode == ARM_MODE_ABT)
                armv8_show_fault_registers(target);

-- 

------------------------------------------------------------------------------
_______________________________________________
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to