summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAchin Gupta <achin.gupta@arm.com>2012-04-19 15:24:46 +0100
committerDietmar Eggemann <dietmar.eggemann@arm.com>2012-05-23 12:44:35 +0100
commitfb00a4a56fdefd7056e19f9fd80c762c17ee102c (patch)
treeedaecda88aad3d9868dca05f2482bd5060e057ec
parentfc98b489ecdfc4f0d8d92fd99d4f2b9238d736da (diff)
downloadswitcher-fb00a4a56fdefd7056e19f9fd80c762c17ee102c.tar.gz
Debug S&R cp14: Added helper functions and their prototypes
Seperated the cp14 helper functions used for Debug S&R from the generic cp15 ones. Needed primarily for 16 sets for registers for breakpoints & watchpoints.
-rw-r--r--acsr/debug_helpers.h211
-rw-r--r--acsr/debug_helpers.s1103
2 files changed, 1314 insertions, 0 deletions
diff --git a/acsr/debug_helpers.h b/acsr/debug_helpers.h
new file mode 100644
index 0000000..b796ccb
--- /dev/null
+++ b/acsr/debug_helpers.h
@@ -0,0 +1,211 @@
+/*
+ * Copyright (c) 2012, ARM Limited. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with
+ * or without modification, are permitted provided that the
+ * following conditions are met:
+ *
+ * Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the
+ * following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the
+ * above copyright notice, this list of conditions and
+ * the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * Neither the name of ARM nor the names of its
+ * contributors may be used to endorse or promote products
+ * derived from this software without specific prior written
+ * permission.
+ */
+
+/*
+ * Functions used for v7.1 Debug context S&R
+ */
+extern unsigned read_dbg_drar(void);
+extern unsigned read_dbg_dsar(void);
+extern unsigned read_dbg_devid(void);
+extern unsigned read_dbg_didr(void);
+extern unsigned read_dbg_dtrrxext(void);
+extern unsigned read_dbg_dtrtxext(void);
+extern unsigned read_dbg_dscrext(void);
+extern unsigned read_dbg_wfar(void);
+extern unsigned read_dbg_vcr(void);
+extern unsigned read_dbg_claimclr(void);
+extern unsigned read_dbg_bvr0(void);
+extern unsigned read_dbg_bvr1(void);
+extern unsigned read_dbg_bvr2(void);
+extern unsigned read_dbg_bvr3(void);
+extern unsigned read_dbg_bvr4(void);
+extern unsigned read_dbg_bvr5(void);
+extern unsigned read_dbg_bvr6(void);
+extern unsigned read_dbg_bvr7(void);
+extern unsigned read_dbg_bvr8(void);
+extern unsigned read_dbg_bvr9(void);
+extern unsigned read_dbg_bvr10(void);
+extern unsigned read_dbg_bvr11(void);
+extern unsigned read_dbg_bvr12(void);
+extern unsigned read_dbg_bvr13(void);
+extern unsigned read_dbg_bvr14(void);
+extern unsigned read_dbg_bvr15(void);
+extern unsigned read_dbg_bcr0(void);
+extern unsigned read_dbg_bcr1(void);
+extern unsigned read_dbg_bcr2(void);
+extern unsigned read_dbg_bcr3(void);
+extern unsigned read_dbg_bcr4(void);
+extern unsigned read_dbg_bcr5(void);
+extern unsigned read_dbg_bcr6(void);
+extern unsigned read_dbg_bcr7(void);
+extern unsigned read_dbg_bcr8(void);
+extern unsigned read_dbg_bcr9(void);
+extern unsigned read_dbg_bcr10(void);
+extern unsigned read_dbg_bcr11(void);
+extern unsigned read_dbg_bcr12(void);
+extern unsigned read_dbg_bcr13(void);
+extern unsigned read_dbg_bcr14(void);
+extern unsigned read_dbg_bcr15(void);
+extern unsigned read_dbg_wvr0(void);
+extern unsigned read_dbg_wvr1(void);
+extern unsigned read_dbg_wvr2(void);
+extern unsigned read_dbg_wvr3(void);
+extern unsigned read_dbg_wvr4(void);
+extern unsigned read_dbg_wvr5(void);
+extern unsigned read_dbg_wvr6(void);
+extern unsigned read_dbg_wvr7(void);
+extern unsigned read_dbg_wvr8(void);
+extern unsigned read_dbg_wvr9(void);
+extern unsigned read_dbg_wvr10(void);
+extern unsigned read_dbg_wvr11(void);
+extern unsigned read_dbg_wvr12(void);
+extern unsigned read_dbg_wvr13(void);
+extern unsigned read_dbg_wvr14(void);
+extern unsigned read_dbg_wvr15(void);
+extern unsigned read_dbg_wcr0(void);
+extern unsigned read_dbg_wcr1(void);
+extern unsigned read_dbg_wcr2(void);
+extern unsigned read_dbg_wcr3(void);
+extern unsigned read_dbg_wcr4(void);
+extern unsigned read_dbg_wcr5(void);
+extern unsigned read_dbg_wcr6(void);
+extern unsigned read_dbg_wcr7(void);
+extern unsigned read_dbg_wcr8(void);
+extern unsigned read_dbg_wcr9(void);
+extern unsigned read_dbg_wcr10(void);
+extern unsigned read_dbg_wcr11(void);
+extern unsigned read_dbg_wcr12(void);
+extern unsigned read_dbg_wcr13(void);
+extern unsigned read_dbg_wcr14(void);
+extern unsigned read_dbg_wcr15(void);
+extern unsigned read_dbg_bxvr0(void);
+extern unsigned read_dbg_bxvr1(void);
+extern unsigned read_dbg_bxvr2(void);
+extern unsigned read_dbg_bxvr3(void);
+extern unsigned read_dbg_bxvr4(void);
+extern unsigned read_dbg_bxvr5(void);
+extern unsigned read_dbg_bxvr6(void);
+extern unsigned read_dbg_bxvr7(void);
+extern unsigned read_dbg_bxvr8(void);
+extern unsigned read_dbg_bxvr9(void);
+extern unsigned read_dbg_bxvr10(void);
+extern unsigned read_dbg_bxvr11(void);
+extern unsigned read_dbg_bxvr12(void);
+extern unsigned read_dbg_bxvr13(void);
+extern unsigned read_dbg_bxvr14(void);
+extern unsigned read_dbg_bxvr15(void);
+
+extern void write_dbg_osdlr(unsigned);
+extern void write_dbg_oslar(unsigned);
+extern void write_dbg_dtrrxext(unsigned);
+extern void write_dbg_dtrtxext(unsigned);
+extern void write_dbg_dscrext(unsigned);
+extern void write_dbg_wfar(unsigned);
+extern void write_dbg_vcr(unsigned);
+extern void write_dbg_claimset(unsigned);
+extern void write_dbg_bvr0(unsigned);
+extern void write_dbg_bvr1(unsigned);
+extern void write_dbg_bvr2(unsigned);
+extern void write_dbg_bvr3(unsigned);
+extern void write_dbg_bvr4(unsigned);
+extern void write_dbg_bvr5(unsigned);
+extern void write_dbg_bvr6(unsigned);
+extern void write_dbg_bvr7(unsigned);
+extern void write_dbg_bvr8(unsigned);
+extern void write_dbg_bvr9(unsigned);
+extern void write_dbg_bvr10(unsigned);
+extern void write_dbg_bvr11(unsigned);
+extern void write_dbg_bvr12(unsigned);
+extern void write_dbg_bvr13(unsigned);
+extern void write_dbg_bvr14(unsigned);
+extern void write_dbg_bvr15(unsigned);
+extern void write_dbg_bcr0(unsigned);
+extern void write_dbg_bcr1(unsigned);
+extern void write_dbg_bcr2(unsigned);
+extern void write_dbg_bcr3(unsigned);
+extern void write_dbg_bcr4(unsigned);
+extern void write_dbg_bcr5(unsigned);
+extern void write_dbg_bcr6(unsigned);
+extern void write_dbg_bcr7(unsigned);
+extern void write_dbg_bcr8(unsigned);
+extern void write_dbg_bcr9(unsigned);
+extern void write_dbg_bcr10(unsigned);
+extern void write_dbg_bcr11(unsigned);
+extern void write_dbg_bcr12(unsigned);
+extern void write_dbg_bcr13(unsigned);
+extern void write_dbg_bcr14(unsigned);
+extern void write_dbg_bcr15(unsigned);
+extern void write_dbg_wvr0(unsigned);
+extern void write_dbg_wvr1(unsigned);
+extern void write_dbg_wvr2(unsigned);
+extern void write_dbg_wvr3(unsigned);
+extern void write_dbg_wvr4(unsigned);
+extern void write_dbg_wvr5(unsigned);
+extern void write_dbg_wvr6(unsigned);
+extern void write_dbg_wvr7(unsigned);
+extern void write_dbg_wvr8(unsigned);
+extern void write_dbg_wvr9(unsigned);
+extern void write_dbg_wvr10(unsigned);
+extern void write_dbg_wvr11(unsigned);
+extern void write_dbg_wvr12(unsigned);
+extern void write_dbg_wvr13(unsigned);
+extern void write_dbg_wvr14(unsigned);
+extern void write_dbg_wvr15(unsigned);
+extern void write_dbg_wcr0(unsigned);
+extern void write_dbg_wcr1(unsigned);
+extern void write_dbg_wcr2(unsigned);
+extern void write_dbg_wcr3(unsigned);
+extern void write_dbg_wcr4(unsigned);
+extern void write_dbg_wcr5(unsigned);
+extern void write_dbg_wcr6(unsigned);
+extern void write_dbg_wcr7(unsigned);
+extern void write_dbg_wcr8(unsigned);
+extern void write_dbg_wcr9(unsigned);
+extern void write_dbg_wcr10(unsigned);
+extern void write_dbg_wcr11(unsigned);
+extern void write_dbg_wcr12(unsigned);
+extern void write_dbg_wcr13(unsigned);
+extern void write_dbg_wcr14(unsigned);
+extern void write_dbg_wcr15(unsigned);
+extern void write_dbg_bxvr0(unsigned);
+extern void write_dbg_bxvr1(unsigned);
+extern void write_dbg_bxvr2(unsigned);
+extern void write_dbg_bxvr3(unsigned);
+extern void write_dbg_bxvr4(unsigned);
+extern void write_dbg_bxvr5(unsigned);
+extern void write_dbg_bxvr6(unsigned);
+extern void write_dbg_bxvr7(unsigned);
+extern void write_dbg_bxvr8(unsigned);
+extern void write_dbg_bxvr9(unsigned);
+extern void write_dbg_bxvr10(unsigned);
+extern void write_dbg_bxvr11(unsigned);
+extern void write_dbg_bxvr12(unsigned);
+extern void write_dbg_bxvr13(unsigned);
+extern void write_dbg_bxvr14(unsigned);
+extern void write_dbg_bxvr15(unsigned);
+
+/*
+ * GCC Compatibility
+ */
+#ifndef __ARMCC_VERSION
+#define __nop() __asm__ __volatile__( "nop\n" )
+#endif
diff --git a/acsr/debug_helpers.s b/acsr/debug_helpers.s
new file mode 100644
index 0000000..f2700ab
--- /dev/null
+++ b/acsr/debug_helpers.s
@@ -0,0 +1,1103 @@
+ ;
+ ; Copyright (c) 2012, ARM Limited. All rights reserved.
+ ;
+ ; Redistribution and use in source and binary forms, with
+ ; or without modification, are permitted provided that the
+ ; following conditions are met:
+ ;
+ ; Redistributions of source code must retain the above
+ ; copyright notice, this list of conditions and the
+ ; following disclaimer.
+ ;
+ ; Redistributions in binary form must reproduce the
+ ; above copyright notice, this list of conditions and
+ ; the following disclaimer in the documentation
+ ; and/or other materials provided with the distribution.
+ ;
+ ; Neither the name of ARM nor the names of its
+ ; contributors may be used to endorse or promote products
+ ; derived from this software without specific prior written
+ ; permission.
+ ;
+
+ EXPORT read_dbg_drar
+ EXPORT read_dbg_dsar
+ EXPORT read_dbg_devid
+ EXPORT read_dbg_didr
+ EXPORT read_dbg_dtrrxext
+ EXPORT read_dbg_dtrtxext
+ EXPORT read_dbg_dscrext
+ EXPORT read_dbg_wfar
+ EXPORT read_dbg_vcr
+ EXPORT read_dbg_claimclr
+ EXPORT read_dbg_bvr0
+ EXPORT read_dbg_bvr1
+ EXPORT read_dbg_bvr2
+ EXPORT read_dbg_bvr3
+ EXPORT read_dbg_bvr4
+ EXPORT read_dbg_bvr5
+ EXPORT read_dbg_bvr6
+ EXPORT read_dbg_bvr7
+ EXPORT read_dbg_bvr8
+ EXPORT read_dbg_bvr9
+ EXPORT read_dbg_bvr10
+ EXPORT read_dbg_bvr11
+ EXPORT read_dbg_bvr12
+ EXPORT read_dbg_bvr13
+ EXPORT read_dbg_bvr14
+ EXPORT read_dbg_bvr15
+ EXPORT read_dbg_bcr0
+ EXPORT read_dbg_bcr1
+ EXPORT read_dbg_bcr2
+ EXPORT read_dbg_bcr3
+ EXPORT read_dbg_bcr4
+ EXPORT read_dbg_bcr5
+ EXPORT read_dbg_bcr6
+ EXPORT read_dbg_bcr7
+ EXPORT read_dbg_bcr8
+ EXPORT read_dbg_bcr9
+ EXPORT read_dbg_bcr10
+ EXPORT read_dbg_bcr11
+ EXPORT read_dbg_bcr12
+ EXPORT read_dbg_bcr13
+ EXPORT read_dbg_bcr14
+ EXPORT read_dbg_bcr15
+ EXPORT read_dbg_wvr0
+ EXPORT read_dbg_wvr1
+ EXPORT read_dbg_wvr2
+ EXPORT read_dbg_wvr3
+ EXPORT read_dbg_wvr4
+ EXPORT read_dbg_wvr5
+ EXPORT read_dbg_wvr6
+ EXPORT read_dbg_wvr7
+ EXPORT read_dbg_wvr8
+ EXPORT read_dbg_wvr9
+ EXPORT read_dbg_wvr10
+ EXPORT read_dbg_wvr11
+ EXPORT read_dbg_wvr12
+ EXPORT read_dbg_wvr13
+ EXPORT read_dbg_wvr14
+ EXPORT read_dbg_wvr15
+ EXPORT read_dbg_wcr0
+ EXPORT read_dbg_wcr1
+ EXPORT read_dbg_wcr2
+ EXPORT read_dbg_wcr3
+ EXPORT read_dbg_wcr4
+ EXPORT read_dbg_wcr5
+ EXPORT read_dbg_wcr6
+ EXPORT read_dbg_wcr7
+ EXPORT read_dbg_wcr8
+ EXPORT read_dbg_wcr9
+ EXPORT read_dbg_wcr10
+ EXPORT read_dbg_wcr11
+ EXPORT read_dbg_wcr12
+ EXPORT read_dbg_wcr13
+ EXPORT read_dbg_wcr14
+ EXPORT read_dbg_wcr15
+ EXPORT read_dbg_bxvr0
+ EXPORT read_dbg_bxvr1
+ EXPORT read_dbg_bxvr2
+ EXPORT read_dbg_bxvr3
+ EXPORT read_dbg_bxvr4
+ EXPORT read_dbg_bxvr5
+ EXPORT read_dbg_bxvr6
+ EXPORT read_dbg_bxvr7
+ EXPORT read_dbg_bxvr8
+ EXPORT read_dbg_bxvr9
+ EXPORT read_dbg_bxvr10
+ EXPORT read_dbg_bxvr11
+ EXPORT read_dbg_bxvr12
+ EXPORT read_dbg_bxvr13
+ EXPORT read_dbg_bxvr14
+ EXPORT read_dbg_bxvr15
+
+ EXPORT write_dbg_osdlr
+ EXPORT write_dbg_oslar
+ EXPORT write_dbg_dtrrxext
+ EXPORT write_dbg_dtrtxext
+ EXPORT write_dbg_dscrext
+ EXPORT write_dbg_wfar
+ EXPORT write_dbg_vcr
+ EXPORT write_dbg_claimset
+ EXPORT write_dbg_bvr0
+ EXPORT write_dbg_bvr1
+ EXPORT write_dbg_bvr2
+ EXPORT write_dbg_bvr3
+ EXPORT write_dbg_bvr4
+ EXPORT write_dbg_bvr5
+ EXPORT write_dbg_bvr6
+ EXPORT write_dbg_bvr7
+ EXPORT write_dbg_bvr8
+ EXPORT write_dbg_bvr9
+ EXPORT write_dbg_bvr10
+ EXPORT write_dbg_bvr11
+ EXPORT write_dbg_bvr12
+ EXPORT write_dbg_bvr13
+ EXPORT write_dbg_bvr14
+ EXPORT write_dbg_bvr15
+ EXPORT write_dbg_bcr0
+ EXPORT write_dbg_bcr1
+ EXPORT write_dbg_bcr2
+ EXPORT write_dbg_bcr3
+ EXPORT write_dbg_bcr4
+ EXPORT write_dbg_bcr5
+ EXPORT write_dbg_bcr6
+ EXPORT write_dbg_bcr7
+ EXPORT write_dbg_bcr8
+ EXPORT write_dbg_bcr9
+ EXPORT write_dbg_bcr10
+ EXPORT write_dbg_bcr11
+ EXPORT write_dbg_bcr12
+ EXPORT write_dbg_bcr13
+ EXPORT write_dbg_bcr14
+ EXPORT write_dbg_bcr15
+ EXPORT write_dbg_wvr0
+ EXPORT write_dbg_wvr1
+ EXPORT write_dbg_wvr2
+ EXPORT write_dbg_wvr3
+ EXPORT write_dbg_wvr4
+ EXPORT write_dbg_wvr5
+ EXPORT write_dbg_wvr6
+ EXPORT write_dbg_wvr7
+ EXPORT write_dbg_wvr8
+ EXPORT write_dbg_wvr9
+ EXPORT write_dbg_wvr10
+ EXPORT write_dbg_wvr11
+ EXPORT write_dbg_wvr12
+ EXPORT write_dbg_wvr13
+ EXPORT write_dbg_wvr14
+ EXPORT write_dbg_wvr15
+ EXPORT write_dbg_wcr0
+ EXPORT write_dbg_wcr1
+ EXPORT write_dbg_wcr2
+ EXPORT write_dbg_wcr3
+ EXPORT write_dbg_wcr4
+ EXPORT write_dbg_wcr5
+ EXPORT write_dbg_wcr6
+ EXPORT write_dbg_wcr7
+ EXPORT write_dbg_wcr8
+ EXPORT write_dbg_wcr9
+ EXPORT write_dbg_wcr10
+ EXPORT write_dbg_wcr11
+ EXPORT write_dbg_wcr12
+ EXPORT write_dbg_wcr13
+ EXPORT write_dbg_wcr14
+ EXPORT write_dbg_wcr15
+ EXPORT write_dbg_bxvr0
+ EXPORT write_dbg_bxvr1
+ EXPORT write_dbg_bxvr2
+ EXPORT write_dbg_bxvr3
+ EXPORT write_dbg_bxvr4
+ EXPORT write_dbg_bxvr5
+ EXPORT write_dbg_bxvr6
+ EXPORT write_dbg_bxvr7
+ EXPORT write_dbg_bxvr8
+ EXPORT write_dbg_bxvr9
+ EXPORT write_dbg_bxvr10
+ EXPORT write_dbg_bxvr11
+ EXPORT write_dbg_bxvr12
+ EXPORT write_dbg_bxvr13
+ EXPORT write_dbg_bxvr14
+ EXPORT write_dbg_bxvr15
+
+ AREA ACSR, CODE, ALIGN=5
+;----------
+; Read ops
+;----------
+
+read_dbg_devid FUNCTION
+ mrc p14, 0, r0, c7, c2, 7
+ bx lr
+ ENDFUNC
+
+read_dbg_didr FUNCTION
+ mrc p14, 0, r0, c0, c0, 0
+ bx lr
+ ENDFUNC
+
+read_dbg_drar FUNCTION
+ mrc p14, 0, r0, c1, c0, 0 ; Read Debug ROM Address Register
+ bx lr
+ ENDFUNC
+
+read_dbg_dsar FUNCTION
+ mrc p14, 0, r0, c2, c0, 0 ; Read Debug Self Address Offset Register
+ bx lr
+ ENDFUNC
+
+read_dbg_dtrrxext FUNCTION
+ mrc p14, 0, r0, c0, c0, 2
+ bx lr
+ ENDFUNC
+
+read_dbg_dtrtxext FUNCTION
+ mrc p14, 0, r0, c0, c3, 2
+ bx lr
+ ENDFUNC
+
+read_dbg_dscrext FUNCTION
+ mrc p14, 0, r0, c0, c2, 2
+ bx lr
+ ENDFUNC
+
+read_dbg_wfar FUNCTION
+ mrc p14, 0, r0, c0, c6, 0
+ bx lr
+ ENDFUNC
+
+read_dbg_vcr FUNCTION
+ mrc p14, 0, r0, c0, c7, 0
+ bx lr
+ ENDFUNC
+
+read_dbg_claimclr FUNCTION
+ mrc p14, 0, r0, c7, c9, 6
+ bx lr
+ ENDFUNC
+
+read_dbg_bvr0 FUNCTION
+ mrc p14, 0, r0, c0, c0, 4
+ bx lr
+ ENDFUNC
+
+read_dbg_bvr1 FUNCTION
+ mrc p14, 0, r0, c0, c1, 4
+ bx lr
+ ENDFUNC
+
+read_dbg_bvr2 FUNCTION
+ mrc p14, 0, r0, c0, c2, 4
+ bx lr
+ ENDFUNC
+
+read_dbg_bvr3 FUNCTION
+ mrc p14, 0, r0, c0, c3, 4
+ bx lr
+ ENDFUNC
+
+read_dbg_bvr4 FUNCTION
+ mrc p14, 0, r0, c0, c4, 4
+ bx lr
+ ENDFUNC
+
+read_dbg_bvr5 FUNCTION
+ mrc p14, 0, r0, c0, c5, 4
+ bx lr
+ ENDFUNC
+
+read_dbg_bvr6 FUNCTION
+ mrc p14, 0, r0, c0, c6, 4
+ bx lr
+ ENDFUNC
+
+read_dbg_bvr7 FUNCTION
+ mrc p14, 0, r0, c0, c7, 4
+ bx lr
+ ENDFUNC
+
+read_dbg_bvr8 FUNCTION
+ mrc p14, 0, r0, c0, c8, 4
+ bx lr
+ ENDFUNC
+
+read_dbg_bvr9 FUNCTION
+ mrc p14, 0, r0, c0, c9, 4
+ bx lr
+ ENDFUNC
+
+read_dbg_bvr10 FUNCTION
+ mrc p14, 0, r0, c0, c10, 4
+ bx lr
+ ENDFUNC
+
+read_dbg_bvr11 FUNCTION
+ mrc p14, 0, r0, c0, c11, 4
+ bx lr
+ ENDFUNC
+
+read_dbg_bvr12 FUNCTION
+ mrc p14, 0, r0, c0, c12, 4
+ bx lr
+ ENDFUNC
+
+read_dbg_bvr13 FUNCTION
+ mrc p14, 0, r0, c0, c13, 4
+ bx lr
+ ENDFUNC
+
+read_dbg_bvr14 FUNCTION
+ mrc p14, 0, r0, c0, c14, 4
+ bx lr
+ ENDFUNC
+
+read_dbg_bvr15 FUNCTION
+ mrc p14, 0, r0, c0, c15, 4
+ bx lr
+ ENDFUNC
+
+read_dbg_bcr0 FUNCTION
+ mrc p14, 0, r0, c0, c0, 5
+ bx lr
+ ENDFUNC
+
+read_dbg_bcr1 FUNCTION
+ mrc p14, 0, r0, c0, c1, 5
+ bx lr
+ ENDFUNC
+
+read_dbg_bcr2 FUNCTION
+ mrc p14, 0, r0, c0, c2, 5
+ bx lr
+ ENDFUNC
+
+read_dbg_bcr3 FUNCTION
+ mrc p14, 0, r0, c0, c3, 5
+ bx lr
+ ENDFUNC
+
+read_dbg_bcr4 FUNCTION
+ mrc p14, 0, r0, c0, c4, 5
+ bx lr
+ ENDFUNC
+
+read_dbg_bcr5 FUNCTION
+ mrc p14, 0, r0, c0, c5, 5
+ bx lr
+ ENDFUNC
+
+read_dbg_bcr6 FUNCTION
+ mrc p14, 0, r0, c0, c6, 5
+ bx lr
+ ENDFUNC
+
+read_dbg_bcr7 FUNCTION
+ mrc p14, 0, r0, c0, c7, 5
+ bx lr
+ ENDFUNC
+
+read_dbg_bcr8 FUNCTION
+ mrc p14, 0, r0, c0, c8, 5
+ bx lr
+ ENDFUNC
+
+read_dbg_bcr9 FUNCTION
+ mrc p14, 0, r0, c0, c9, 5
+ bx lr
+ ENDFUNC
+
+read_dbg_bcr10 FUNCTION
+ mrc p14, 0, r0, c0, c10, 5
+ bx lr
+ ENDFUNC
+
+read_dbg_bcr11 FUNCTION
+ mrc p14, 0, r0, c0, c11, 5
+ bx lr
+ ENDFUNC
+
+read_dbg_bcr12 FUNCTION
+ mrc p14, 0, r0, c0, c12, 5
+ bx lr
+ ENDFUNC
+
+read_dbg_bcr13 FUNCTION
+ mrc p14, 0, r0, c0, c13, 5
+ bx lr
+ ENDFUNC
+
+read_dbg_bcr14 FUNCTION
+ mrc p14, 0, r0, c0, c14, 5
+ bx lr
+ ENDFUNC
+
+read_dbg_bcr15 FUNCTION
+ mrc p14, 0, r0, c0, c15, 5
+ bx lr
+ ENDFUNC
+
+read_dbg_wvr0 FUNCTION
+ mrc p14, 0, r0, c0, c0, 6
+ bx lr
+ ENDFUNC
+
+read_dbg_wvr1 FUNCTION
+ mrc p14, 0, r0, c0, c1, 6
+ bx lr
+ ENDFUNC
+
+read_dbg_wvr2 FUNCTION
+ mrc p14, 0, r0, c0, c2, 6
+ bx lr
+ ENDFUNC
+
+read_dbg_wvr3 FUNCTION
+ mrc p14, 0, r0, c0, c3, 6
+ bx lr
+ ENDFUNC
+
+read_dbg_wvr4 FUNCTION
+ mrc p14, 0, r0, c0, c4, 6
+ bx lr
+ ENDFUNC
+
+read_dbg_wvr5 FUNCTION
+ mrc p14, 0, r0, c0, c5, 6
+ bx lr
+ ENDFUNC
+
+read_dbg_wvr6 FUNCTION
+ mrc p14, 0, r0, c0, c6, 6
+ bx lr
+ ENDFUNC
+
+read_dbg_wvr7 FUNCTION
+ mrc p14, 0, r0, c0, c7, 6
+ bx lr
+ ENDFUNC
+
+read_dbg_wvr8 FUNCTION
+ mrc p14, 0, r0, c0, c8, 6
+ bx lr
+ ENDFUNC
+
+read_dbg_wvr9 FUNCTION
+ mrc p14, 0, r0, c0, c9, 6
+ bx lr
+ ENDFUNC
+
+read_dbg_wvr10 FUNCTION
+ mrc p14, 0, r0, c0, c10, 6
+ bx lr
+ ENDFUNC
+
+read_dbg_wvr11 FUNCTION
+ mrc p14, 0, r0, c0, c11, 6
+ bx lr
+ ENDFUNC
+
+read_dbg_wvr12 FUNCTION
+ mrc p14, 0, r0, c0, c12, 6
+ bx lr
+ ENDFUNC
+
+read_dbg_wvr13 FUNCTION
+ mrc p14, 0, r0, c0, c13, 6
+ bx lr
+ ENDFUNC
+
+read_dbg_wvr14 FUNCTION
+ mrc p14, 0, r0, c0, c14, 6
+ bx lr
+ ENDFUNC
+
+read_dbg_wvr15 FUNCTION
+ mrc p14, 0, r0, c0, c15, 6
+ bx lr
+ ENDFUNC
+
+read_dbg_wcr0 FUNCTION
+ mrc p14, 0, r0, c0, c0, 7
+ bx lr
+ ENDFUNC
+
+read_dbg_wcr1 FUNCTION
+ mrc p14, 0, r0, c0, c1, 7
+ bx lr
+ ENDFUNC
+
+read_dbg_wcr2 FUNCTION
+ mrc p14, 0, r0, c0, c2, 7
+ bx lr
+ ENDFUNC
+
+read_dbg_wcr3 FUNCTION
+ mrc p14, 0, r0, c0, c3, 7
+ bx lr
+ ENDFUNC
+
+read_dbg_wcr4 FUNCTION
+ mrc p14, 0, r0, c0, c4, 7
+ bx lr
+ ENDFUNC
+
+read_dbg_wcr5 FUNCTION
+ mrc p14, 0, r0, c0, c5, 7
+ bx lr
+ ENDFUNC
+
+read_dbg_wcr6 FUNCTION
+ mrc p14, 0, r0, c0, c6, 7
+ bx lr
+ ENDFUNC
+
+read_dbg_wcr7 FUNCTION
+ mrc p14, 0, r0, c0, c7, 7
+ bx lr
+ ENDFUNC
+
+read_dbg_wcr8 FUNCTION
+ mrc p14, 0, r0, c0, c8, 7
+ bx lr
+ ENDFUNC
+
+read_dbg_wcr9 FUNCTION
+ mrc p14, 0, r0, c0, c9, 7
+ bx lr
+ ENDFUNC
+
+read_dbg_wcr10 FUNCTION
+ mrc p14, 0, r0, c0, c10, 7
+ bx lr
+ ENDFUNC
+
+read_dbg_wcr11 FUNCTION
+ mrc p14, 0, r0, c0, c11, 7
+ bx lr
+ ENDFUNC
+
+read_dbg_wcr12 FUNCTION
+ mrc p14, 0, r0, c0, c12, 7
+ bx lr
+ ENDFUNC
+
+read_dbg_wcr13 FUNCTION
+ mrc p14, 0, r0, c0, c13, 7
+ bx lr
+ ENDFUNC
+
+read_dbg_wcr14 FUNCTION
+ mrc p14, 0, r0, c0, c14, 7
+ bx lr
+ ENDFUNC
+
+read_dbg_wcr15 FUNCTION
+ mrc p14, 0, r0, c0, c15, 7
+ bx lr
+ ENDFUNC
+
+read_dbg_bxvr0 FUNCTION
+ mrc p14, 0, r0, c1, c0, 1
+ bx lr
+ ENDFUNC
+
+read_dbg_bxvr1 FUNCTION
+ mrc p14, 0, r0, c1, c1, 1
+ bx lr
+ ENDFUNC
+
+read_dbg_bxvr2 FUNCTION
+ mrc p14, 0, r0, c1, c2, 1
+ bx lr
+ ENDFUNC
+
+read_dbg_bxvr3 FUNCTION
+ mrc p14, 0, r0, c1, c3, 1
+ bx lr
+ ENDFUNC
+
+read_dbg_bxvr4 FUNCTION
+ mrc p14, 0, r0, c1, c4, 1
+ bx lr
+ ENDFUNC
+
+read_dbg_bxvr5 FUNCTION
+ mrc p14, 0, r0, c1, c5, 1
+ bx lr
+ ENDFUNC
+
+read_dbg_bxvr6 FUNCTION
+ mrc p14, 0, r0, c1, c6, 1
+ bx lr
+ ENDFUNC
+
+read_dbg_bxvr7 FUNCTION
+ mrc p14, 0, r0, c1, c7, 1
+ bx lr
+ ENDFUNC
+
+read_dbg_bxvr8 FUNCTION
+ mrc p14, 0, r0, c1, c8, 1
+ bx lr
+ ENDFUNC
+
+read_dbg_bxvr9 FUNCTION
+ mrc p14, 0, r0, c1, c9, 1
+ bx lr
+ ENDFUNC
+
+read_dbg_bxvr10 FUNCTION
+ mrc p14, 0, r0, c1, c10, 1
+ bx lr
+ ENDFUNC
+
+read_dbg_bxvr11 FUNCTION
+ mrc p14, 0, r0, c1, c11, 1
+ bx lr
+ ENDFUNC
+
+read_dbg_bxvr12 FUNCTION
+ mrc p14, 0, r0, c1, c12, 1
+ bx lr
+ ENDFUNC
+
+read_dbg_bxvr13 FUNCTION
+ mrc p14, 0, r0, c1, c13, 1
+ bx lr
+ ENDFUNC
+
+read_dbg_bxvr14 FUNCTION
+ mrc p14, 0, r0, c1, c14, 1
+ bx lr
+ ENDFUNC
+
+read_dbg_bxvr15 FUNCTION
+ mrc p14, 0, r0, c1, c15, 1
+ bx lr
+ ENDFUNC
+
+;-----------
+; Write ops
+;-----------
+write_dbg_osdlr FUNCTION
+ mcr p14, 0, r0, c1, c3, 4 ; Write OS Double Lock Register
+ isb
+ bx lr
+ ENDFUNC
+
+write_dbg_oslar FUNCTION
+ mcr p14, 0, r0, c1, c0, 4 ; Write OS Lock address register
+ isb
+ bx lr
+ ENDFUNC
+
+write_dbg_dtrrxext FUNCTION
+ mcr p14, 0, r0, c0, c0, 2
+ bx lr
+ ENDFUNC
+
+write_dbg_dtrtxext FUNCTION
+ mcr p14, 0, r0, c0, c3, 2
+ bx lr
+ ENDFUNC
+
+write_dbg_dscrext FUNCTION
+ mcr p14, 0, r0, c0, c2, 2
+ bx lr
+ ENDFUNC
+
+write_dbg_wfar FUNCTION
+ mcr p14, 0, r0, c0, c6, 0
+ bx lr
+ ENDFUNC
+
+write_dbg_vcr FUNCTION
+ mcr p14, 0, r0, c0, c7, 0
+ bx lr
+ ENDFUNC
+
+write_dbg_claimset FUNCTION
+ mcr p14, 0, r0, c7, c8, 6
+ bx lr
+ ENDFUNC
+
+write_dbg_bvr0 FUNCTION
+ mcr p14, 0, r0, c0, c0, 4
+ bx lr
+ ENDFUNC
+
+write_dbg_bvr1 FUNCTION
+ mcr p14, 0, r0, c0, c1, 4
+ bx lr
+ ENDFUNC
+
+write_dbg_bvr2 FUNCTION
+ mcr p14, 0, r0, c0, c2, 4
+ bx lr
+ ENDFUNC
+
+write_dbg_bvr3 FUNCTION
+ mcr p14, 0, r0, c0, c3, 4
+ bx lr
+ ENDFUNC
+
+write_dbg_bvr4 FUNCTION
+ mcr p14, 0, r0, c0, c4, 4
+ bx lr
+ ENDFUNC
+
+write_dbg_bvr5 FUNCTION
+ mcr p14, 0, r0, c0, c5, 4
+ bx lr
+ ENDFUNC
+
+write_dbg_bvr6 FUNCTION
+ mcr p14, 0, r0, c0, c6, 4
+ bx lr
+ ENDFUNC
+
+write_dbg_bvr7 FUNCTION
+ mcr p14, 0, r0, c0, c7, 4
+ bx lr
+ ENDFUNC
+
+write_dbg_bvr8 FUNCTION
+ mcr p14, 0, r0, c0, c8, 4
+ bx lr
+ ENDFUNC
+
+write_dbg_bvr9 FUNCTION
+ mcr p14, 0, r0, c0, c9, 4
+ bx lr
+ ENDFUNC
+
+write_dbg_bvr10 FUNCTION
+ mcr p14, 0, r0, c0, c10, 4
+ bx lr
+ ENDFUNC
+
+write_dbg_bvr11 FUNCTION
+ mcr p14, 0, r0, c0, c11, 4
+ bx lr
+ ENDFUNC
+
+write_dbg_bvr12 FUNCTION
+ mcr p14, 0, r0, c0, c12, 4
+ bx lr
+ ENDFUNC
+
+write_dbg_bvr13 FUNCTION
+ mcr p14, 0, r0, c0, c13, 4
+ bx lr
+ ENDFUNC
+
+write_dbg_bvr14 FUNCTION
+ mcr p14, 0, r0, c0, c14, 4
+ bx lr
+ ENDFUNC
+
+write_dbg_bvr15 FUNCTION
+ mcr p14, 0, r0, c0, c15, 4
+ bx lr
+ ENDFUNC
+
+write_dbg_bcr0 FUNCTION
+ mcr p14, 0, r0, c0, c0, 5
+ bx lr
+ ENDFUNC
+
+write_dbg_bcr1 FUNCTION
+ mcr p14, 0, r0, c0, c1, 5
+ bx lr
+ ENDFUNC
+
+write_dbg_bcr2 FUNCTION
+ mcr p14, 0, r0, c0, c2, 5
+ bx lr
+ ENDFUNC
+
+write_dbg_bcr3 FUNCTION
+ mcr p14, 0, r0, c0, c3, 5
+ bx lr
+ ENDFUNC
+
+write_dbg_bcr4 FUNCTION
+ mcr p14, 0, r0, c0, c4, 5
+ bx lr
+ ENDFUNC
+
+write_dbg_bcr5 FUNCTION
+ mcr p14, 0, r0, c0, c5, 5
+ bx lr
+ ENDFUNC
+
+write_dbg_bcr6 FUNCTION
+ mcr p14, 0, r0, c0, c6, 5
+ bx lr
+ ENDFUNC
+
+write_dbg_bcr7 FUNCTION
+ mcr p14, 0, r0, c0, c7, 5
+ bx lr
+ ENDFUNC
+
+write_dbg_bcr8 FUNCTION
+ mcr p14, 0, r0, c0, c8, 5
+ bx lr
+ ENDFUNC
+
+write_dbg_bcr9 FUNCTION
+ mcr p14, 0, r0, c0, c9, 5
+ bx lr
+ ENDFUNC
+
+write_dbg_bcr10 FUNCTION
+ mcr p14, 0, r0, c0, c10, 5
+ bx lr
+ ENDFUNC
+
+write_dbg_bcr11 FUNCTION
+ mcr p14, 0, r0, c0, c11, 5
+ bx lr
+ ENDFUNC
+
+write_dbg_bcr12 FUNCTION
+ mcr p14, 0, r0, c0, c12, 5
+ bx lr
+ ENDFUNC
+
+write_dbg_bcr13 FUNCTION
+ mcr p14, 0, r0, c0, c13, 5
+ bx lr
+ ENDFUNC
+
+write_dbg_bcr14 FUNCTION
+ mcr p14, 0, r0, c0, c14, 5
+ bx lr
+ ENDFUNC
+
+write_dbg_bcr15 FUNCTION
+ mcr p14, 0, r0, c0, c15, 5
+ bx lr
+ ENDFUNC
+
+write_dbg_wvr0 FUNCTION
+ mcr p14, 0, r0, c0, c0, 6
+ bx lr
+ ENDFUNC
+
+write_dbg_wvr1 FUNCTION
+ mcr p14, 0, r0, c0, c1, 6
+ bx lr
+ ENDFUNC
+
+write_dbg_wvr2 FUNCTION
+ mcr p14, 0, r0, c0, c2, 6
+ bx lr
+ ENDFUNC
+
+write_dbg_wvr3 FUNCTION
+ mcr p14, 0, r0, c0, c3, 6
+ bx lr
+ ENDFUNC
+
+write_dbg_wvr4 FUNCTION
+ mcr p14, 0, r0, c0, c4, 6
+ bx lr
+ ENDFUNC
+
+write_dbg_wvr5 FUNCTION
+ mcr p14, 0, r0, c0, c5, 6
+ bx lr
+ ENDFUNC
+
+write_dbg_wvr6 FUNCTION
+ mcr p14, 0, r0, c0, c6, 6
+ bx lr
+ ENDFUNC
+
+write_dbg_wvr7 FUNCTION
+ mcr p14, 0, r0, c0, c7, 6
+ bx lr
+ ENDFUNC
+
+write_dbg_wvr8 FUNCTION
+ mcr p14, 0, r0, c0, c8, 6
+ bx lr
+ ENDFUNC
+
+write_dbg_wvr9 FUNCTION
+ mcr p14, 0, r0, c0, c9, 6
+ bx lr
+ ENDFUNC
+
+write_dbg_wvr10 FUNCTION
+ mcr p14, 0, r0, c0, c10, 6
+ bx lr
+ ENDFUNC
+
+write_dbg_wvr11 FUNCTION
+ mcr p14, 0, r0, c0, c11, 6
+ bx lr
+ ENDFUNC
+
+write_dbg_wvr12 FUNCTION
+ mcr p14, 0, r0, c0, c12, 6
+ bx lr
+ ENDFUNC
+
+write_dbg_wvr13 FUNCTION
+ mcr p14, 0, r0, c0, c13, 6
+ bx lr
+ ENDFUNC
+
+write_dbg_wvr14 FUNCTION
+ mcr p14, 0, r0, c0, c14, 6
+ bx lr
+ ENDFUNC
+
+write_dbg_wvr15 FUNCTION
+ mcr p14, 0, r0, c0, c15, 6
+ bx lr
+ ENDFUNC
+
+write_dbg_wcr0 FUNCTION
+ mcr p14, 0, r0, c0, c0, 7
+ bx lr
+ ENDFUNC
+
+write_dbg_wcr1 FUNCTION
+ mcr p14, 0, r0, c0, c1, 7
+ bx lr
+ ENDFUNC
+
+write_dbg_wcr2 FUNCTION
+ mcr p14, 0, r0, c0, c2, 7
+ bx lr
+ ENDFUNC
+
+write_dbg_wcr3 FUNCTION
+ mcr p14, 0, r0, c0, c3, 7
+ bx lr
+ ENDFUNC
+
+write_dbg_wcr4 FUNCTION
+ mcr p14, 0, r0, c0, c4, 7
+ bx lr
+ ENDFUNC
+
+write_dbg_wcr5 FUNCTION
+ mcr p14, 0, r0, c0, c5, 7
+ bx lr
+ ENDFUNC
+
+write_dbg_wcr6 FUNCTION
+ mcr p14, 0, r0, c0, c6, 7
+ bx lr
+ ENDFUNC
+
+write_dbg_wcr7 FUNCTION
+ mcr p14, 0, r0, c0, c7, 7
+ bx lr
+ ENDFUNC
+
+write_dbg_wcr8 FUNCTION
+ mcr p14, 0, r0, c0, c8, 7
+ bx lr
+ ENDFUNC
+
+write_dbg_wcr9 FUNCTION
+ mcr p14, 0, r0, c0, c9, 7
+ bx lr
+ ENDFUNC
+
+write_dbg_wcr10 FUNCTION
+ mcr p14, 0, r0, c0, c10, 7
+ bx lr
+ ENDFUNC
+
+write_dbg_wcr11 FUNCTION
+ mcr p14, 0, r0, c0, c11, 7
+ bx lr
+ ENDFUNC
+
+write_dbg_wcr12 FUNCTION
+ mcr p14, 0, r0, c0, c12, 7
+ bx lr
+ ENDFUNC
+
+write_dbg_wcr13 FUNCTION
+ mcr p14, 0, r0, c0, c13, 7
+ bx lr
+ ENDFUNC
+
+write_dbg_wcr14 FUNCTION
+ mcr p14, 0, r0, c0, c14, 7
+ bx lr
+ ENDFUNC
+
+write_dbg_wcr15 FUNCTION
+ mcr p14, 0, r0, c0, c15, 7
+ bx lr
+ ENDFUNC
+
+write_dbg_bxvr0 FUNCTION
+ mcr p14, 0, r0, c1, c0, 1
+ bx lr
+ ENDFUNC
+
+write_dbg_bxvr1 FUNCTION
+ mcr p14, 0, r0, c1, c1, 1
+ bx lr
+ ENDFUNC
+
+write_dbg_bxvr2 FUNCTION
+ mcr p14, 0, r0, c1, c2, 1
+ bx lr
+ ENDFUNC
+
+write_dbg_bxvr3 FUNCTION
+ mcr p14, 0, r0, c1, c3, 1
+ bx lr
+ ENDFUNC
+
+write_dbg_bxvr4 FUNCTION
+ mcr p14, 0, r0, c1, c4, 1
+ bx lr
+ ENDFUNC
+
+write_dbg_bxvr5 FUNCTION
+ mcr p14, 0, r0, c1, c5, 1
+ bx lr
+ ENDFUNC
+
+write_dbg_bxvr6 FUNCTION
+ mcr p14, 0, r0, c1, c6, 1
+ bx lr
+ ENDFUNC
+
+write_dbg_bxvr7 FUNCTION
+ mcr p14, 0, r0, c1, c7, 1
+ bx lr
+ ENDFUNC
+
+write_dbg_bxvr8 FUNCTION
+ mcr p14, 0, r0, c1, c8, 1
+ bx lr
+ ENDFUNC
+
+write_dbg_bxvr9 FUNCTION
+ mcr p14, 0, r0, c1, c9, 1
+ bx lr
+ ENDFUNC
+
+write_dbg_bxvr10 FUNCTION
+ mcr p14, 0, r0, c1, c10, 1
+ bx lr
+ ENDFUNC
+
+write_dbg_bxvr11 FUNCTION
+ mcr p14, 0, r0, c1, c11, 1
+ bx lr
+ ENDFUNC
+
+write_dbg_bxvr12 FUNCTION
+ mcr p14, 0, r0, c1, c12, 1
+ bx lr
+ ENDFUNC
+
+write_dbg_bxvr13 FUNCTION
+ mcr p14, 0, r0, c1, c13, 1
+ bx lr
+ ENDFUNC
+
+write_dbg_bxvr14 FUNCTION
+ mcr p14, 0, r0, c1, c14, 1
+ bx lr
+ ENDFUNC
+
+write_dbg_bxvr15 FUNCTION
+ mcr p14, 0, r0, c1, c15, 1
+ bx lr
+ ENDFUNC
+
+ END