summaryrefslogtreecommitdiff
path: root/firmware/common
diff options
context:
space:
mode:
authorMiika Pekkarinen <miipekk@ihme.org>2006-08-02 17:39:34 +0000
committerMiika Pekkarinen <miipekk@ihme.org>2006-08-02 17:39:34 +0000
commitd8ac6074184ffc21c4da8c594df72ee42aa23df2 (patch)
treec42203d8bf2c7e85a9886616f0268250dbe5e9d6 /firmware/common
parentd68ae6a7a62e0a32cfc84200092985910c0fd099 (diff)
downloadrockbox-d8ac6074184ffc21c4da8c594df72ee42aa23df2.tar.gz
rockbox-d8ac6074184ffc21c4da8c594df72ee42aa23df2.zip
Tagcache: Fixed runtime stats not being gathered when tagcache is kept
on disk. Initial attempt to make tagcache thread safe. Replaced a few direct buffer allocations with buffer_alloc from tagcache and dircache where possible. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10415 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/common')
-rw-r--r--firmware/common/dircache.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/firmware/common/dircache.c b/firmware/common/dircache.c
index 7599c1b6c5..6167aa3933 100644
--- a/firmware/common/dircache.c
+++ b/firmware/common/dircache.c
@@ -623,14 +623,10 @@ int dircache_build(int last_size)
623 return 2; 623 return 2;
624 } 624 }
625 625
626 dircache_root = (struct dircache_entry *)(((long)audiobuf & ~0x03) + 0x04);
627
628 if (last_size > DIRCACHE_RESERVE && last_size < DIRCACHE_LIMIT ) 626 if (last_size > DIRCACHE_RESERVE && last_size < DIRCACHE_LIMIT )
629 { 627 {
630 allocated_size = last_size + DIRCACHE_RESERVE; 628 allocated_size = last_size + DIRCACHE_RESERVE;
631 629 dircache_root = (struct dircache_entry *)buffer_alloc(allocated_size);
632 /* We have to long align the audiobuf to keep the buffer access fast. */
633 audiobuf += (long)((allocated_size & ~0x03) + 0x04);
634 thread_enabled = true; 630 thread_enabled = true;
635 631
636 /* Start a transparent rebuild. */ 632 /* Start a transparent rebuild. */
@@ -638,6 +634,8 @@ int dircache_build(int last_size)
638 return 3; 634 return 3;
639 } 635 }
640 636
637 dircache_root = (struct dircache_entry *)(((long)audiobuf & ~0x03) + 0x04);
638
641 /* Start a non-transparent rebuild. */ 639 /* Start a non-transparent rebuild. */
642 return dircache_do_rebuild(); 640 return dircache_do_rebuild();
643} 641}
@@ -672,8 +670,7 @@ void dircache_init(void)
672 memset(opendirs, 0, sizeof(opendirs)); 670 memset(opendirs, 0, sizeof(opendirs));
673 for (i = 0; i < MAX_OPEN_DIRS; i++) 671 for (i = 0; i < MAX_OPEN_DIRS; i++)
674 { 672 {
675 opendirs[i].secondary_entry.d_name = audiobuf; 673 opendirs[i].secondary_entry.d_name = buffer_alloc(MAX_PATH);
676 audiobuf += MAX_PATH;
677 } 674 }
678 675
679 queue_init(&dircache_queue); 676 queue_init(&dircache_queue);