]> git.sur5r.net Git - openocd/commitdiff
target: check args to mrc/mcr.
authorØyvind Harboe <oyvind.harboe@zylin.com>
Mon, 26 Oct 2009 17:53:19 +0000 (18:53 +0100)
committerØyvind Harboe <oyvind.harboe@zylin.com>
Thu, 5 Nov 2009 22:57:49 +0000 (23:57 +0100)
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
src/target/target.c

index d4662f71176b09b8368a23b970a48ff8496a40f8..9b07df18bde6da8ed400e6650e6d9164f3bb8760 100644 (file)
@@ -722,6 +722,30 @@ static int arm_cp_check(struct target_s *target, int cpnum, uint32_t op1, uint32
                return ERROR_FAIL;
        }
 
+       if (op1>7)
+       {
+               LOG_ERROR("Illegal op1");
+               return ERROR_FAIL;
+       }
+
+       if (op2>7)
+       {
+               LOG_ERROR("Illegal op2");
+               return ERROR_FAIL;
+       }
+
+       if (CRn>15)
+       {
+               LOG_ERROR("Illegal CRn");
+               return ERROR_FAIL;
+       }
+
+       if (CRm>7)
+       {
+               LOG_ERROR("Illegal CRm");
+               return ERROR_FAIL;
+       }
+
        return ERROR_OK;
 }