diff options
Diffstat (limited to 'firmware/thread.c')
-rw-r--r-- | firmware/thread.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/firmware/thread.c b/firmware/thread.c index 71656e1711..0f4273107f 100644 --- a/firmware/thread.c +++ b/firmware/thread.c | |||
@@ -161,6 +161,13 @@ void switch_thread(void) | |||
161 | * Processor-specific section | 161 | * Processor-specific section |
162 | */ | 162 | */ |
163 | 163 | ||
164 | #if defined(MAX_PHYS_SECTOR_SIZE) && MEM == 64 | ||
165 | /* Support a special workaround object for large-sector disks */ | ||
166 | #define IF_NO_SKIP_YIELD(...) __VA_ARGS__ | ||
167 | #else | ||
168 | #define IF_NO_SKIP_YIELD(...) | ||
169 | #endif | ||
170 | |||
164 | #if defined(CPU_ARM) | 171 | #if defined(CPU_ARM) |
165 | /*--------------------------------------------------------------------------- | 172 | /*--------------------------------------------------------------------------- |
166 | * Start the thread running and terminate it if it returns | 173 | * Start the thread running and terminate it if it returns |
@@ -1945,8 +1952,9 @@ void switch_thread(void) | |||
1945 | #endif | 1952 | #endif |
1946 | 1953 | ||
1947 | #ifdef HAVE_PRIORITY_SCHEDULING | 1954 | #ifdef HAVE_PRIORITY_SCHEDULING |
1955 | IF_NO_SKIP_YIELD( if (thread->skip_count != -1) ) | ||
1948 | /* Reset the value of thread's skip count */ | 1956 | /* Reset the value of thread's skip count */ |
1949 | thread->skip_count = 0; | 1957 | thread->skip_count = 0; |
1950 | #endif | 1958 | #endif |
1951 | 1959 | ||
1952 | for (;;) | 1960 | for (;;) |
@@ -2002,6 +2010,7 @@ void switch_thread(void) | |||
2002 | * priority threads are runnable. The highest priority runnable | 2010 | * priority threads are runnable. The highest priority runnable |
2003 | * thread(s) are never skipped. */ | 2011 | * thread(s) are never skipped. */ |
2004 | if (priority <= max || | 2012 | if (priority <= max || |
2013 | IF_NO_SKIP_YIELD( thread->skip_count == -1 || ) | ||
2005 | (diff = priority - max, ++thread->skip_count > diff*diff)) | 2014 | (diff = priority - max, ++thread->skip_count > diff*diff)) |
2006 | { | 2015 | { |
2007 | cores[core].running = thread; | 2016 | cores[core].running = thread; |
@@ -2146,7 +2155,8 @@ unsigned int wakeup_thread(struct thread_entry **list) | |||
2146 | if (bl == NULL) | 2155 | if (bl == NULL) |
2147 | { | 2156 | { |
2148 | /* No inheritance - just boost the thread by aging */ | 2157 | /* No inheritance - just boost the thread by aging */ |
2149 | thread->skip_count = thread->priority; | 2158 | IF_NO_SKIP_YIELD( if (thread->skip_count != -1) ) |
2159 | thread->skip_count = thread->priority; | ||
2150 | current = cores[CURRENT_CORE].running; | 2160 | current = cores[CURRENT_CORE].running; |
2151 | } | 2161 | } |
2152 | else | 2162 | else |