diff options
author | notaz | 2011-08-01 23:22:04 +0300 |
---|---|---|
committer | notaz | 2011-08-01 23:32:21 +0300 |
commit | 19e57cbf170d1ce49f00097f3cc3a4ed96d77374 (patch) | |
tree | fcb7ab0c55a9c1d70e77ad42c495cc71c09ad6ee /frontend/pcnt.h | |
parent | f968d35dc0302f3fb7fba5a1bafb5feed1f758f6 (diff) | |
download | pcsx_rearmed-19e57cbf170d1ce49f00097f3cc3a4ed96d77374.tar.gz pcsx_rearmed-19e57cbf170d1ce49f00097f3cc3a4ed96d77374.tar.bz2 pcsx_rearmed-19e57cbf170d1ce49f00097f3cc3a4ed96d77374.zip |
frontnd: pcnt: enable counters to avoid using ext tools
Diffstat (limited to 'frontend/pcnt.h')
-rw-r--r-- | frontend/pcnt.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/frontend/pcnt.h b/frontend/pcnt.h index 232ae07..3969aa4 100644 --- a/frontend/pcnt.h +++ b/frontend/pcnt.h @@ -83,6 +83,19 @@ static inline unsigned int pcnt_get(void) return val; } +static inline void pcnt_init(void) +{ +#ifdef __ARM_ARCH_7A__ + int v; + asm volatile("mrc p15, 0, %0, c9, c12, 0" : "=r"(v)); + v |= 5; // master enable, ccnt reset + v &= ~8; // ccnt divider 0 + asm volatile("mcr p15, 0, %0, c9, c12, 0" :: "r"(v)); + // enable cycle counter + asm volatile("mcr p15, 0, %0, c9, c12, 1" :: "r"(1<<31)); +#endif +} + #else #define pcnt_start(id) |