This is an automated email from Gerrit.

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

-- gerrit

commit a0ca448bf6443de95e549310c3dd24950a5203ac
Author: Brandon Warhurst <[email protected]>
Date:   Thu Apr 18 14:29:23 2013 -0400

    Added functionality to the SYS_SYSTEM semihosting call.
    
    There seems to be a few missing semihosting calls.  I
    am not sure why this one is actually missing, since it
    seems simple enough to implement.  It was tested using
    an HTC HD7 connected to openocd through a "home brew"
    ftdi 4232H board.
    
    Change-Id: I0d0979b1da588fbe9dd7fffea570c83f7d6aa85e
    Signed-off-by: Brandon Warhurst <[email protected]>

diff --git a/src/target/arm_semihosting.c b/src/target/arm_semihosting.c
index 238a199..65fd188 100644
--- a/src/target/arm_semihosting.c
+++ b/src/target/arm_semihosting.c
@@ -375,7 +375,7 @@ static int do_semihosting(struct target *target)
                return target_call_event_callbacks(target, TARGET_EVENT_HALTED);
 
        case 0x12:      /* SYS_SYSTEM */
-               /* Provide SYS_SYSTEM functionality.  Uses the 
+               /* Provide SYS_SYSTEM functionality.  Uses the
                 * libc system command, there may be a reason *NOT*
                 * to use this, but as I can't think of one, I
                 * implemented it this way.
@@ -384,17 +384,14 @@ static int do_semihosting(struct target *target)
                if (retval != ERROR_OK)
                        return retval;
                else {
-                       //printf ("Reading from address 0x%08x\n",r1);
-                       //printf ("Got a system 
command[0x%08x,0x%08x]\n",*(unsigned int *)params,*(unsigned int *)(params+4));
                        uint32_t len = target_buffer_get_u32(target, params+4);
                        uint32_t c_ptr = target_buffer_get_u32(target, params);
                        uint8_t cmd[256];
-                       //printf ("Got a system 
command[0x%08x,0x%08x]\n",c_ptr,len);
-                       if(len > 255) {
+                       if (len > 255) {
                                result = -1;
                                arm->semihosting_errno = EINVAL;
                        } else {
-                               memset(cmd,0x0,256);
+                               memset(cmd, 0x0, 256);
                                retval = target_read_memory(target, c_ptr, 1, 
len, cmd);
                                if (retval != ERROR_OK)
                                        return retval;

-- 

------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to