summaryrefslogtreecommitdiff
path: root/apps/debug_menu.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/debug_menu.c')
-rw-r--r--apps/debug_menu.c77
1 files changed, 29 insertions, 48 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c
index 6caae2d7e0..7d1e1c18cf 100644
--- a/apps/debug_menu.c
+++ b/apps/debug_menu.c
@@ -90,7 +90,9 @@ extern int ata_device;
90extern int ata_io_address; 90extern int ata_io_address;
91extern struct core_entry cores[NUM_CORES]; 91extern struct core_entry cores[NUM_CORES];
92 92
93char thread_status_char(int status) 93#ifndef SIMULATOR
94#ifdef HAVE_LCD_BITMAP
95static char thread_status_char(int status)
94{ 96{
95 switch (status) 97 switch (status)
96 { 98 {
@@ -102,10 +104,9 @@ char thread_status_char(int status)
102 104
103 return '?'; 105 return '?';
104} 106}
105#ifndef SIMULATOR 107
106#ifdef HAVE_LCD_BITMAP
107/* Test code!!! */ 108/* Test code!!! */
108bool dbg_os(void) 109static bool dbg_os(void)
109{ 110{
110 struct thread_entry *thread; 111 struct thread_entry *thread;
111 char buf[32]; 112 char buf[32];
@@ -168,7 +169,7 @@ bool dbg_os(void)
168# else 169# else
169 snprintf(buf, 32, "%c%c %s: %d%%", 170 snprintf(buf, 32, "%c%c %s: %d%%",
170 (status == STATE_RUNNING) ? '*' : ' ', 171 (status == STATE_RUNNING) ? '*' : ' ',
171 (status == STATE_BLOCKED) ? 'B' : ' ', 172 thread_status_char(status),
172 cores[CURRENT_CORE].threads[i].name, usage); 173 cores[CURRENT_CORE].threads[i].name, usage);
173# endif 174# endif
174 lcd_puts(0, 1+i, buf); 175 lcd_puts(0, 1+i, buf);
@@ -183,7 +184,7 @@ bool dbg_os(void)
183 return false; 184 return false;
184} 185}
185#else /* !HAVE_LCD_BITMAP */ 186#else /* !HAVE_LCD_BITMAP */
186bool dbg_os(void) 187static bool dbg_os(void)
187{ 188{
188 char buf[32]; 189 char buf[32];
189 int button; 190 int button;
@@ -229,7 +230,7 @@ bool dbg_os(void)
229#ifdef HAVE_LCD_BITMAP 230#ifdef HAVE_LCD_BITMAP
230#if CONFIG_CODEC != SWCODEC 231#if CONFIG_CODEC != SWCODEC
231#ifndef SIMULATOR 232#ifndef SIMULATOR
232bool dbg_audio_thread(void) 233static bool dbg_audio_thread(void)
233{ 234{
234 char buf[32]; 235 char buf[32];
235 struct audio_debug d; 236 struct audio_debug d;
@@ -282,7 +283,7 @@ extern size_t filebuflen;
282 283
283static unsigned int ticks, boost_ticks; 284static unsigned int ticks, boost_ticks;
284 285
285void dbg_audio_task(void) 286static void dbg_audio_task(void)
286{ 287{
287#ifndef SIMULATOR 288#ifndef SIMULATOR
288 if(FREQ > CPUFREQ_NORMAL) 289 if(FREQ > CPUFREQ_NORMAL)
@@ -292,7 +293,7 @@ void dbg_audio_task(void)
292 ticks++; 293 ticks++;
293} 294}
294 295
295bool dbg_audio_thread(void) 296static bool dbg_audio_thread(void)
296{ 297{
297 char buf[32]; 298 char buf[32];
298 int button; 299 int button;
@@ -373,37 +374,18 @@ bool dbg_audio_thread(void)
373#endif /* HAVE_LCD_BITMAP */ 374#endif /* HAVE_LCD_BITMAP */
374 375
375 376
376#ifndef SIMULATOR 377#if (CONFIG_CPU == SH7034 || defined(CPU_COLDFIRE)) && !defined(SIMULATOR)
377/* Tool function to read the flash manufacturer and type, if available. 378/* Tool function to read the flash manufacturer and type, if available.
378 Only chips which could be reprogrammed in system will return values. 379 Only chips which could be reprogrammed in system will return values.
379 (The mode switch addresses vary between flash manufacturers, hence addr1/2) */ 380 (The mode switch addresses vary between flash manufacturers, hence addr1/2) */
380 /* In IRAM to avoid problems when running directly from Flash */ 381 /* In IRAM to avoid problems when running directly from Flash */
381bool dbg_flash_id(unsigned* p_manufacturer, unsigned* p_device, 382static bool dbg_flash_id(unsigned* p_manufacturer, unsigned* p_device,
382 unsigned addr1, unsigned addr2) 383 unsigned addr1, unsigned addr2)
383 ICODE_ATTR; 384 ICODE_ATTR __attribute__((noinline));
384bool dbg_flash_id(unsigned* p_manufacturer, unsigned* p_device, 385static bool dbg_flash_id(unsigned* p_manufacturer, unsigned* p_device,
385 unsigned addr1, unsigned addr2) 386 unsigned addr1, unsigned addr2)
386 387
387{ 388{
388#ifdef CPU_PP
389 /* TODO: Implement for PortalPlayer */
390 (void)p_manufacturer;
391 (void)p_device;
392 (void)addr1;
393 (void)addr2;
394#elif CONFIG_CPU == PNX0101
395 /* TODO: Implement for iFP7xx */
396 (void)p_manufacturer;
397 (void)p_device;
398 (void)addr1;
399 (void)addr2;
400#elif CONFIG_CPU == S3C2440
401 /* TODO: Implement for Gigabeat */
402 (void)p_manufacturer;
403 (void)p_device;
404 (void)addr1;
405 (void)addr2;
406#else
407 unsigned not_manu, not_id; /* read values before switching to ID mode */ 389 unsigned not_manu, not_id; /* read values before switching to ID mode */
408 unsigned manu, id; /* read values when in ID mode */ 390 unsigned manu, id; /* read values when in ID mode */
409 391
@@ -444,14 +426,13 @@ bool dbg_flash_id(unsigned* p_manufacturer, unsigned* p_device,
444 *p_device = id; 426 *p_device = id;
445 return true; /* success */ 427 return true; /* success */
446 } 428 }
447#endif
448 return false; /* fail */ 429 return false; /* fail */
449} 430}
450#endif /* !SIMULATOR */ 431#endif /* (CONFIG_CPU == SH7034 || CPU_COLDFIRE) && !SIMULATOR */
451 432
452#ifndef SIMULATOR 433#ifndef SIMULATOR
453#ifdef HAVE_LCD_BITMAP 434#ifdef HAVE_LCD_BITMAP
454bool dbg_hw_info(void) 435static bool dbg_hw_info(void)
455{ 436{
456#if CONFIG_CPU == SH7034 437#if CONFIG_CPU == SH7034
457 char buf[32]; 438 char buf[32];
@@ -602,7 +583,7 @@ bool dbg_hw_info(void)
602 return false; 583 return false;
603} 584}
604#else /* !HAVE_LCD_BITMAP */ 585#else /* !HAVE_LCD_BITMAP */
605bool dbg_hw_info(void) 586static bool dbg_hw_info(void)
606{ 587{
607 char buf[32]; 588 char buf[32];
608 int button; 589 int button;
@@ -765,7 +746,7 @@ bool dbg_partitions(void)
765#endif 746#endif
766 747
767#if defined(CPU_COLDFIRE) && defined(HAVE_SPDIF_OUT) 748#if defined(CPU_COLDFIRE) && defined(HAVE_SPDIF_OUT)
768bool dbg_spdif(void) 749static bool dbg_spdif(void)
769{ 750{
770 char buf[128]; 751 char buf[128];
771 int line; 752 int line;
@@ -1261,7 +1242,7 @@ bool dbg_ports(void)
1261#endif /* !SIMULATOR */ 1242#endif /* !SIMULATOR */
1262 1243
1263#ifdef HAVE_ADJUSTABLE_CPU_FREQ 1244#ifdef HAVE_ADJUSTABLE_CPU_FREQ
1264bool dbg_cpufreq(void) 1245static bool dbg_cpufreq(void)
1265{ 1246{
1266 char buf[128]; 1247 char buf[128];
1267 int line; 1248 int line;
@@ -1323,7 +1304,7 @@ bool dbg_cpufreq(void)
1323#define BAT_LAST_VAL MIN(LCD_WIDTH, POWER_HISTORY_LEN) 1304#define BAT_LAST_VAL MIN(LCD_WIDTH, POWER_HISTORY_LEN)
1324#define BAT_YSPACE (LCD_HEIGHT - 20) 1305#define BAT_YSPACE (LCD_HEIGHT - 20)
1325 1306
1326bool view_battery(void) 1307static bool view_battery(void)
1327{ 1308{
1328 int view = 0; 1309 int view = 0;
1329 int i, x, y; 1310 int i, x, y;
@@ -1590,7 +1571,7 @@ static bool view_runtime(void)
1590 1571
1591#ifndef SIMULATOR 1572#ifndef SIMULATOR
1592#ifdef HAVE_MMC 1573#ifdef HAVE_MMC
1593bool dbg_mmc_info(void) 1574static bool dbg_mmc_info(void)
1594{ 1575{
1595 bool done = false; 1576 bool done = false;
1596 int currval = 0; 1577 int currval = 0;
@@ -1970,7 +1951,7 @@ static bool dbg_tagcache_info(void)
1970#endif 1951#endif
1971 1952
1972#if CONFIG_CPU == SH7034 1953#if CONFIG_CPU == SH7034
1973bool dbg_save_roms(void) 1954static bool dbg_save_roms(void)
1974{ 1955{
1975 int fd; 1956 int fd;
1976 int oldmode = system_memory_guard(MEMGUARD_NONE); 1957 int oldmode = system_memory_guard(MEMGUARD_NONE);
@@ -1993,7 +1974,7 @@ bool dbg_save_roms(void)
1993 return false; 1974 return false;
1994} 1975}
1995#elif defined CPU_COLDFIRE 1976#elif defined CPU_COLDFIRE
1996bool dbg_save_roms(void) 1977static bool dbg_save_roms(void)
1997{ 1978{
1998 int fd; 1979 int fd;
1999 int oldmode = system_memory_guard(MEMGUARD_NONE); 1980 int oldmode = system_memory_guard(MEMGUARD_NONE);
@@ -2042,7 +2023,7 @@ bool dbg_save_roms(void)
2042 2023
2043#ifndef SIMULATOR 2024#ifndef SIMULATOR
2044#ifdef CONFIG_TUNER 2025#ifdef CONFIG_TUNER
2045bool dbg_fm_radio(void) 2026static bool dbg_fm_radio(void)
2046{ 2027{
2047 char buf[32]; 2028 char buf[32];
2048 bool fm_detected; 2029 bool fm_detected;
@@ -2086,7 +2067,7 @@ bool dbg_fm_radio(void)
2086#ifdef HAVE_LCD_BITMAP 2067#ifdef HAVE_LCD_BITMAP
2087extern bool do_screendump_instead_of_usb; 2068extern bool do_screendump_instead_of_usb;
2088 2069
2089bool dbg_screendump(void) 2070static bool dbg_screendump(void)
2090{ 2071{
2091 do_screendump_instead_of_usb = !do_screendump_instead_of_usb; 2072 do_screendump_instead_of_usb = !do_screendump_instead_of_usb;
2092 gui_syncsplash(HZ, true, "Screendump %s", 2073 gui_syncsplash(HZ, true, "Screendump %s",
@@ -2096,7 +2077,7 @@ bool dbg_screendump(void)
2096#endif /* HAVE_LCD_BITMAP */ 2077#endif /* HAVE_LCD_BITMAP */
2097 2078
2098#if CONFIG_CPU == SH7034 || defined(CPU_COLDFIRE) 2079#if CONFIG_CPU == SH7034 || defined(CPU_COLDFIRE)
2099bool dbg_set_memory_guard(void) 2080static bool dbg_set_memory_guard(void)
2100{ 2081{
2101 static const struct opt_items names[MAXMEMGUARD] = { 2082 static const struct opt_items names[MAXMEMGUARD] = {
2102 { "None", -1 }, 2083 { "None", -1 },
@@ -2113,7 +2094,7 @@ bool dbg_set_memory_guard(void)
2113#endif /* CONFIG_CPU == SH7034 || defined(CPU_COLDFIRE) */ 2094#endif /* CONFIG_CPU == SH7034 || defined(CPU_COLDFIRE) */
2114 2095
2115#if defined(HAVE_EEPROM) && !defined(HAVE_EEPROM_SETTINGS) 2096#if defined(HAVE_EEPROM) && !defined(HAVE_EEPROM_SETTINGS)
2116bool dbg_write_eeprom(void) 2097static bool dbg_write_eeprom(void)
2117{ 2098{
2118 int fd; 2099 int fd;
2119 int rc; 2100 int rc;