diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2014-08-08 03:23:29 -0400 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2014-08-08 03:23:29 -0400 |
commit | 9a3400a4a667e32d1dd0b50364b083787ff63320 (patch) | |
tree | 5676a100428362373b96249d2891c131f9fcf44b | |
parent | 4ea4cdfc11a87927d696d4966c6c433bd5e6bf90 (diff) | |
download | rockbox-9a3400a4a667e32d1dd0b50364b083787ff63320.tar.gz rockbox-9a3400a4a667e32d1dd0b50364b083787ff63320.zip |
Fix some more straggling stuff
* HWCODEC bootloaders
* Remove references to thread structures outside the kernel. They are
private and should not be used elsewhere. The mrobe-100 is an offender
that gets squashed.
* The ata.c hack stuff for large sector disks on iPod Video gets squashed
for the same reason. I will no longer maintain it, period; please find
the real reason for its difficulties.
Change-Id: Iae1a675beac887754eb3cc59b560c941077523f5
-rw-r--r-- | firmware/drivers/ata.c | 68 | ||||
-rw-r--r-- | firmware/kernel/thread.c | 11 | ||||
-rw-r--r-- | firmware/target/arm/olympus/mrobe-100/lcd-remote-mr100.c | 8 | ||||
-rw-r--r-- | firmware/target/arm/pp/thread-pp.c | 5 | ||||
-rw-r--r-- | flash/bootbox/main.c | 3 |
5 files changed, 7 insertions, 88 deletions
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c index 4b365a50ab..355ff37900 100644 --- a/firmware/drivers/ata.c +++ b/firmware/drivers/ata.c | |||
@@ -79,74 +79,6 @@ | |||
79 | static unsigned int ata_thread_id = 0; | 79 | static unsigned int ata_thread_id = 0; |
80 | #endif | 80 | #endif |
81 | 81 | ||
82 | #if defined(MAX_PHYS_SECTOR_SIZE) && MEMORYSIZE == 64 | ||
83 | /* Hack - what's the deal with 5g? */ | ||
84 | struct ata_lock | ||
85 | { | ||
86 | struct thread_entry *thread; | ||
87 | int count; | ||
88 | volatile unsigned char locked; | ||
89 | IF_COP( struct corelock cl; ) | ||
90 | }; | ||
91 | |||
92 | static void ata_lock_init(struct ata_lock *l) | ||
93 | { | ||
94 | corelock_init(&l->cl); | ||
95 | l->locked = 0; | ||
96 | l->count = 0; | ||
97 | l->thread = NULL; | ||
98 | } | ||
99 | |||
100 | static void ata_lock_lock(struct ata_lock *l) | ||
101 | { | ||
102 | struct thread_entry * const current = thread_self_entry(); | ||
103 | |||
104 | if (current == l->thread) | ||
105 | { | ||
106 | l->count++; | ||
107 | return; | ||
108 | } | ||
109 | |||
110 | corelock_lock(&l->cl); | ||
111 | |||
112 | IF_PRIO( current->skip_count = -1; ) | ||
113 | |||
114 | while (l->locked != 0) | ||
115 | { | ||
116 | corelock_unlock(&l->cl); | ||
117 | switch_thread(); | ||
118 | corelock_lock(&l->cl); | ||
119 | } | ||
120 | |||
121 | l->locked = 1; | ||
122 | l->thread = current; | ||
123 | corelock_unlock(&l->cl); | ||
124 | } | ||
125 | |||
126 | static void ata_lock_unlock(struct ata_lock *l) | ||
127 | { | ||
128 | if (l->count > 0) | ||
129 | { | ||
130 | l->count--; | ||
131 | return; | ||
132 | } | ||
133 | |||
134 | corelock_lock(&l->cl); | ||
135 | |||
136 | IF_PRIO( l->thread->skip_count = 0; ) | ||
137 | |||
138 | l->thread = NULL; | ||
139 | l->locked = 0; | ||
140 | |||
141 | corelock_unlock(&l->cl); | ||
142 | } | ||
143 | |||
144 | #define mutex ata_lock | ||
145 | #define mutex_init ata_lock_init | ||
146 | #define mutex_lock ata_lock_lock | ||
147 | #define mutex_unlock ata_lock_unlock | ||
148 | #endif /* MAX_PHYS_SECTOR_SIZE */ | ||
149 | |||
150 | #if defined(HAVE_USBSTACK) && defined(USE_ROCKBOX_USB) | 82 | #if defined(HAVE_USBSTACK) && defined(USE_ROCKBOX_USB) |
151 | #define ALLOW_USB_SPINDOWN | 83 | #define ALLOW_USB_SPINDOWN |
152 | #endif | 84 | #endif |
diff --git a/firmware/kernel/thread.c b/firmware/kernel/thread.c index 5bb6eb5522..c148f6b76e 100644 --- a/firmware/kernel/thread.c +++ b/firmware/kernel/thread.c | |||
@@ -189,10 +189,6 @@ void switch_thread(void) | |||
189 | #include "thread-pp.c" | 189 | #include "thread-pp.c" |
190 | #endif /* CPU_PP */ | 190 | #endif /* CPU_PP */ |
191 | 191 | ||
192 | #ifndef IF_NO_SKIP_YIELD | ||
193 | #define IF_NO_SKIP_YIELD(...) | ||
194 | #endif | ||
195 | |||
196 | /* | 192 | /* |
197 | * End Processor-specific section | 193 | * End Processor-specific section |
198 | ***************************************************************************/ | 194 | ***************************************************************************/ |
@@ -1014,8 +1010,7 @@ unsigned int wakeup_thread_(struct thread_entry **list | |||
1014 | { | 1010 | { |
1015 | /* No PIP - just boost the thread by aging */ | 1011 | /* No PIP - just boost the thread by aging */ |
1016 | #ifdef HAVE_PRIORITY_SCHEDULING | 1012 | #ifdef HAVE_PRIORITY_SCHEDULING |
1017 | IF_NO_SKIP_YIELD( if (thread->skip_count != -1) ) | 1013 | thread->skip_count = thread->priority; |
1018 | thread->skip_count = thread->priority; | ||
1019 | #endif /* HAVE_PRIORITY_SCHEDULING */ | 1014 | #endif /* HAVE_PRIORITY_SCHEDULING */ |
1020 | remove_from_list_l(list, thread); | 1015 | remove_from_list_l(list, thread); |
1021 | core_schedule_wakeup(thread); | 1016 | core_schedule_wakeup(thread); |
@@ -1303,9 +1298,8 @@ void switch_thread(void) | |||
1303 | #endif | 1298 | #endif |
1304 | 1299 | ||
1305 | #ifdef HAVE_PRIORITY_SCHEDULING | 1300 | #ifdef HAVE_PRIORITY_SCHEDULING |
1306 | IF_NO_SKIP_YIELD( if (thread->skip_count != -1) ) | ||
1307 | /* Reset the value of thread's skip count */ | 1301 | /* Reset the value of thread's skip count */ |
1308 | thread->skip_count = 0; | 1302 | thread->skip_count = 0; |
1309 | #endif | 1303 | #endif |
1310 | 1304 | ||
1311 | for (;;) | 1305 | for (;;) |
@@ -1365,7 +1359,6 @@ void switch_thread(void) | |||
1365 | * processes aging; they must give up the processor by going | 1359 | * processes aging; they must give up the processor by going |
1366 | * off the run list. */ | 1360 | * off the run list. */ |
1367 | if (LIKELY(priority <= max) || | 1361 | if (LIKELY(priority <= max) || |
1368 | IF_NO_SKIP_YIELD( thread->skip_count == -1 || ) | ||
1369 | (priority > PRIORITY_REALTIME && | 1362 | (priority > PRIORITY_REALTIME && |
1370 | (diff = priority - max, | 1363 | (diff = priority - max, |
1371 | ++thread->skip_count > diff*diff))) | 1364 | ++thread->skip_count > diff*diff))) |
diff --git a/firmware/target/arm/olympus/mrobe-100/lcd-remote-mr100.c b/firmware/target/arm/olympus/mrobe-100/lcd-remote-mr100.c index 511a5518ff..34b114910a 100644 --- a/firmware/target/arm/olympus/mrobe-100/lcd-remote-mr100.c +++ b/firmware/target/arm/olympus/mrobe-100/lcd-remote-mr100.c | |||
@@ -500,14 +500,14 @@ void lcd_remote_off(void) | |||
500 | 500 | ||
501 | void lcd_remote_on(void) | 501 | void lcd_remote_on(void) |
502 | { | 502 | { |
503 | /* Only wake the remote thread if it's in the blocked state. */ | 503 | if (semaphore_wait(&rc_thread_wakeup, 0) == OBJ_WAIT_TIMEDOUT || |
504 | struct thread_entry *rc_thread = thread_id_entry(remote_thread_id); | 504 | (rc_status & RC_FORCE_DETECT)) |
505 | if (rc_thread->state == STATE_BLOCKED || (rc_status & RC_FORCE_DETECT)) | ||
506 | { | 505 | { |
507 | rc_status &= ~RC_FORCE_DETECT; | 506 | rc_status &= ~RC_FORCE_DETECT; |
508 | rc_status &= ~RC_POWER_OFF; | 507 | rc_status &= ~RC_POWER_OFF; |
509 | semaphore_release(&rc_thread_wakeup); | ||
510 | } | 508 | } |
509 | |||
510 | semaphore_release(&rc_thread_wakeup); | ||
511 | } | 511 | } |
512 | 512 | ||
513 | bool remote_detect(void) | 513 | bool remote_detect(void) |
diff --git a/firmware/target/arm/pp/thread-pp.c b/firmware/target/arm/pp/thread-pp.c index b2e7fb018d..184d243e8d 100644 --- a/firmware/target/arm/pp/thread-pp.c +++ b/firmware/target/arm/pp/thread-pp.c | |||
@@ -21,11 +21,6 @@ | |||
21 | * | 21 | * |
22 | ****************************************************************************/ | 22 | ****************************************************************************/ |
23 | 23 | ||
24 | #if defined(MAX_PHYS_SECTOR_SIZE) && MEMORYSIZE == 64 | ||
25 | /* Support a special workaround object for large-sector disks */ | ||
26 | #define IF_NO_SKIP_YIELD(...) __VA_ARGS__ | ||
27 | #endif | ||
28 | |||
29 | #if NUM_CORES == 1 | 24 | #if NUM_CORES == 1 |
30 | /* Single-core variants for FORCE_SINGLE_CORE */ | 25 | /* Single-core variants for FORCE_SINGLE_CORE */ |
31 | static inline void core_sleep(void) | 26 | static inline void core_sleep(void) |
diff --git a/flash/bootbox/main.c b/flash/bootbox/main.c index ff6b8374e9..ac90d60336 100644 --- a/flash/bootbox/main.c +++ b/flash/bootbox/main.c | |||
@@ -29,8 +29,7 @@ | |||
29 | #include "cpu.h" | 29 | #include "cpu.h" |
30 | #include "system.h" | 30 | #include "system.h" |
31 | #include "lcd.h" | 31 | #include "lcd.h" |
32 | #include "kernel.h" | 32 | #include "../kernel-internal.h" |
33 | #include "thread.h" | ||
34 | #include "storage.h" | 33 | #include "storage.h" |
35 | #include "disk.h" | 34 | #include "disk.h" |
36 | #include "font.h" | 35 | #include "font.h" |