freemyipod r557 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r556‎ | r557 | r558 >
Date:14:20, 7 February 2011
Author:theseven
Status:new
Tags:
Comment:
emCORE: Allow clock gate state to be read out
Modified paths:
  • /emcore/trunk/clockgates.h (modified) (history)
  • /emcore/trunk/export/syscallapi.h (modified) (history)
  • /emcore/trunk/export/syscallwrappers.h (modified) (history)
  • /emcore/trunk/syscallapi.c (modified) (history)
  • /emcore/trunk/target/ipodnano2g/clockgates.c (modified) (history)
  • /emcore/trunk/target/ipodnano3g/clockgates.c (modified) (history)
  • /emcore/trunk/target/ipodnano4g/clockgates.c (modified) (history)

Diff [purge]

Index: emcore/trunk/clockgates.h
@@ -28,6 +28,7 @@
2929 #include "global.h"
3030
3131
 32+bool clockgate_get_state(int gate);
3233 void clockgate_enable(int gate, bool enable);
3334
3435
Index: emcore/trunk/target/ipodnano2g/clockgates.c
@@ -25,6 +25,11 @@
2626 #include "s5l8701.h"
2727
2828
 29+bool clockgate_get_state(int gate)
 30+{
 31+ return !(PWRCON(gate >> 5) & (1 << (gate & 0x1f)));
 32+}
 33+
2934 void clockgate_enable(int gate, bool enable)
3035 {
3136 uint32_t mode = enter_critical_section();
Index: emcore/trunk/target/ipodnano3g/clockgates.c
@@ -25,6 +25,11 @@
2626 #include "s5l8702.h"
2727
2828
 29+bool clockgate_get_state(int gate)
 30+{
 31+ return !(PWRCON(gate >> 5) & (1 << (gate & 0x1f)));
 32+}
 33+
2934 void clockgate_enable(int gate, bool enable)
3035 {
3136 uint32_t mode = enter_critical_section();
Index: emcore/trunk/target/ipodnano4g/clockgates.c
@@ -25,8 +25,15 @@
2626 #include "s5l8720.h"
2727
2828
 29+bool clockgate_get_state(int gate)
 30+{
 31+ return !(PWRCON(gate >> 5) & (1 << (gate & 0x1f)));
 32+}
 33+
2934 void clockgate_enable(int gate, bool enable)
3035 {
 36+ uint32_t mode = enter_critical_section();
3137 if (enable) PWRCON(gate >> 5) &= ~(1 << (gate & 0x1f));
3238 else PWRCON(gate >> 5) |= 1 << (gate & 0x1f);
 39+ leave_critical_section(mode);
3340 }
Index: emcore/trunk/export/syscallwrappers.h
@@ -202,6 +202,7 @@
203203 #define fat_enable_flushing __emcore_syscall->fat_enable_flushing
204204 #define lcd_get_format __emcore_syscall->lcd_get_format
205205 #define crc32 __emcore_syscall->crc32
 206+#define clockgate_get_state __emcore_syscall->clockgate_get_state
206207
207208
208209 #endif
Index: emcore/trunk/export/syscallapi.h
@@ -259,6 +259,7 @@
260260 typeof(fat_enable_flushing) *fat_enable_flushing;
261261 typeof(lcd_get_format) *lcd_get_format;
262262 typeof(crc32) *crc32;
 263+ typeof(clockgate_get_state) *clockgate_get_state;
263264 };
264265
265266
Index: emcore/trunk/syscallapi.c
@@ -220,5 +220,6 @@
221221 .fat_enable_flushing = fat_enable_flushing,
222222 #endif
223223 .lcd_get_format = lcd_get_format,
224 - .crc32 = crc32
 224+ .crc32 = crc32,
 225+ .clockgate_get_state = clockgate_get_state
225226 };