summaryrefslogtreecommitdiff
path: root/firmware/target/sh/system-target.h
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/sh/system-target.h')
-rw-r--r--firmware/target/sh/system-target.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/firmware/target/sh/system-target.h b/firmware/target/sh/system-target.h
index 5db9cc071f..a62a024823 100644
--- a/firmware/target/sh/system-target.h
+++ b/firmware/target/sh/system-target.h
@@ -137,4 +137,18 @@ static inline void commit_dcache(void) {}
137static inline void commit_discard_dcache(void) {} 137static inline void commit_discard_dcache(void) {}
138static inline void commit_discard_idcache(void) {} 138static inline void commit_discard_idcache(void) {}
139 139
140/*---------------------------------------------------------------------------
141 * Put core in a power-saving state.
142 *---------------------------------------------------------------------------
143 */
144static inline void core_sleep(void)
145{
146 asm volatile (
147 "and.b #0x7f, @(r0, gbr) \n" /* Clear SBY (bit 7) in SBYCR */
148 "mov #0, r1 \n" /* Enable interrupts */
149 "ldc r1, sr \n" /* Following instruction cannot be interrupted */
150 "sleep \n" /* Execute standby */
151 : : "z"(&SBYCR-GBR) : "r1");
152}
153
140#endif /* SYSTEM_TARGET_H */ 154#endif /* SYSTEM_TARGET_H */