mcr/mrc interface work. Implemented for arm926ejs and arm720t. mcr/mrc commands added.
[fw/openocd] / src / target / armv4_5.h
index 7ea3826ab092a347b64ef10aa03edf9f36e37709..80f28db395263193fe96c70bad6dad76de8d4ea8 100644 (file)
@@ -5,6 +5,9 @@
  *   Copyright (C) 2008 by Spencer Oliver                                  *
  *   spen@spen-soft.co.uk                                                  *
  *                                                                         *
+ *   Copyright (C) 2009 by Ã˜yvind Harboe                                   *
+ *   oyvind.harboe@zylin.com                                               *
+ *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
  *   it under the terms of the GNU General Public License as published by  *
  *   the Free Software Foundation; either version 2 of the License, or     *
@@ -315,4 +318,19 @@ extern int armv4_5_invalidate_core_regs(target_t *target);
  */
 #define ARMV5_T_BKPT(Im) ((0xbe00 | Im) | ((0xbe00 | Im) << 16))
 
+/* build basic mrc/mcr opcode */
+
+static inline uint32_t mrc_opcode(int cpnum, uint32_t op1, uint32_t op2, uint32_t CRn, uint32_t CRm)
+{
+       uint32_t t = 0;
+       t|=op1<<21;
+       t|=op2<<5;
+       t|=CRn<<16;
+       t|=CRm<<0;
+       return t;
+}
+
+
+
+
 #endif /* ARMV4_5_H */