diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2011-03-02 08:49:38 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2011-03-02 08:49:38 +0000 |
commit | 12375d1d3aa41f7d277a9af584c7b810b636ec95 (patch) | |
tree | fc9ce8029a6910a8dac71b3bf60c71155a01eea4 /firmware/target/mips/ingenic_jz47xx/ata-sd-jz4740.c | |
parent | 05e180a1308a095d51d51d0e047fcd44425ea88f (diff) | |
download | rockbox-12375d1d3aa41f7d277a9af584c7b810b636ec95.tar.gz rockbox-12375d1d3aa41f7d277a9af584c7b810b636ec95.zip |
Merge functionality of wakeups and semaphores-- fewer APIs and object types. semaphore_wait takes a timeout now so codecs and plugins have to be made incompatible. Don't make semaphores for targets not using them.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29492 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/mips/ingenic_jz47xx/ata-sd-jz4740.c')
-rw-r--r-- | firmware/target/mips/ingenic_jz47xx/ata-sd-jz4740.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/firmware/target/mips/ingenic_jz47xx/ata-sd-jz4740.c b/firmware/target/mips/ingenic_jz47xx/ata-sd-jz4740.c index efca66445a..846b9095f1 100644 --- a/firmware/target/mips/ingenic_jz47xx/ata-sd-jz4740.c +++ b/firmware/target/mips/ingenic_jz47xx/ata-sd-jz4740.c | |||
@@ -47,7 +47,7 @@ static long sd_stack[(DEFAULT_STACK_SIZE*2 + 0x1c0)/sizeof(long)]; | |||
47 | static const char sd_thread_name[] = "ata/sd"; | 47 | static const char sd_thread_name[] = "ata/sd"; |
48 | static struct event_queue sd_queue; | 48 | static struct event_queue sd_queue; |
49 | static struct mutex sd_mtx; | 49 | static struct mutex sd_mtx; |
50 | static struct wakeup sd_wakeup; | 50 | static struct semaphore sd_wakeup; |
51 | static void sd_thread(void) NORETURN_ATTR; | 51 | static void sd_thread(void) NORETURN_ATTR; |
52 | 52 | ||
53 | static int use_4bit; | 53 | static int use_4bit; |
@@ -831,7 +831,7 @@ static int jz_sd_exec_cmd(struct sd_request *request) | |||
831 | 831 | ||
832 | /* Wait for command completion */ | 832 | /* Wait for command completion */ |
833 | //__intc_unmask_irq(IRQ_MSC); | 833 | //__intc_unmask_irq(IRQ_MSC); |
834 | //wakeup_wait(&sd_wakeup, 100); | 834 | //semaphore_wait(&sd_wakeup, 100); |
835 | while (timeout-- && !(REG_MSC_STAT & MSC_STAT_END_CMD_RES)); | 835 | while (timeout-- && !(REG_MSC_STAT & MSC_STAT_END_CMD_RES)); |
836 | 836 | ||
837 | 837 | ||
@@ -881,7 +881,7 @@ static int jz_sd_exec_cmd(struct sd_request *request) | |||
881 | #endif | 881 | #endif |
882 | } | 882 | } |
883 | //__intc_unmask_irq(IRQ_MSC); | 883 | //__intc_unmask_irq(IRQ_MSC); |
884 | //wakeup_wait(&sd_wakeup, 100); | 884 | //semaphore_wait(&sd_wakeup, 100); |
885 | /* Wait for Data Done */ | 885 | /* Wait for Data Done */ |
886 | while (!(REG_MSC_IREG & MSC_IREG_DATA_TRAN_DONE)); | 886 | while (!(REG_MSC_IREG & MSC_IREG_DATA_TRAN_DONE)); |
887 | REG_MSC_IREG = MSC_IREG_DATA_TRAN_DONE; /* clear status */ | 887 | REG_MSC_IREG = MSC_IREG_DATA_TRAN_DONE; /* clear status */ |
@@ -891,7 +891,7 @@ static int jz_sd_exec_cmd(struct sd_request *request) | |||
891 | if (events & SD_EVENT_PROG_DONE) | 891 | if (events & SD_EVENT_PROG_DONE) |
892 | { | 892 | { |
893 | //__intc_unmask_irq(IRQ_MSC); | 893 | //__intc_unmask_irq(IRQ_MSC); |
894 | //wakeup_wait(&sd_wakeup, 100); | 894 | //semaphore_wait(&sd_wakeup, 100); |
895 | while (!(REG_MSC_IREG & MSC_IREG_PRG_DONE)); | 895 | while (!(REG_MSC_IREG & MSC_IREG_PRG_DONE)); |
896 | REG_MSC_IREG = MSC_IREG_PRG_DONE; /* clear status */ | 896 | REG_MSC_IREG = MSC_IREG_PRG_DONE; /* clear status */ |
897 | } | 897 | } |
@@ -945,7 +945,7 @@ static void jz_sd_rx_handler(unsigned int arg) | |||
945 | /* MSC interrupt handler */ | 945 | /* MSC interrupt handler */ |
946 | void MSC(void) | 946 | void MSC(void) |
947 | { | 947 | { |
948 | //wakeup_signal(&sd_wakeup); | 948 | //semaphore_release(&sd_wakeup); |
949 | logf("MSC interrupt"); | 949 | logf("MSC interrupt"); |
950 | } | 950 | } |
951 | 951 | ||
@@ -1228,7 +1228,7 @@ int sd_init(void) | |||
1228 | static bool inited = false; | 1228 | static bool inited = false; |
1229 | if(!inited) | 1229 | if(!inited) |
1230 | { | 1230 | { |
1231 | wakeup_init(&sd_wakeup); | 1231 | semaphore_init(&sd_wakeup, 1, 0); |
1232 | mutex_init(&sd_mtx); | 1232 | mutex_init(&sd_mtx); |
1233 | queue_init(&sd_queue, true); | 1233 | queue_init(&sd_queue, true); |
1234 | create_thread(sd_thread, sd_stack, sizeof(sd_stack), 0, | 1234 | create_thread(sd_thread, sd_stack, sizeof(sd_stack), 0, |