Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

Cleanup preprocessor around corelock usage and move its definition outside #ifdef ASSEMBLER_THREADS

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29330 a1c6a512-1295-4272-9138-f99709370657

+25 -22
+20 -19
firmware/export/thread.h
··· 125 125 uint32_t start; /* 40 - Thread start address, or NULL when started */ 126 126 }; 127 127 128 - #ifdef CPU_PP 129 - #ifdef HAVE_CORELOCK_OBJECT 130 - /* No reliable atomic instruction available - use Peterson's algorithm */ 131 - struct corelock 132 - { 133 - volatile unsigned char myl[NUM_CORES]; 134 - volatile unsigned char turn; 135 - } __attribute__((packed)); 136 - 137 - /* Too big to inline everywhere */ 138 - void corelock_init(struct corelock *cl); 139 - void corelock_lock(struct corelock *cl); 140 - int corelock_try_lock(struct corelock *cl); 141 - void corelock_unlock(struct corelock *cl); 142 - #endif /* HAVE_CORELOCK_OBJECT */ 143 - #endif /* CPU_PP */ 144 128 #elif defined(CPU_MIPS) 145 129 struct regs 146 130 { ··· 171 155 #endif 172 156 #endif /* PLATFORM_NATIVE */ 173 157 158 + #ifdef CPU_PP 159 + #ifdef HAVE_CORELOCK_OBJECT 160 + /* No reliable atomic instruction available - use Peterson's algorithm */ 161 + struct corelock 162 + { 163 + volatile unsigned char myl[NUM_CORES]; 164 + volatile unsigned char turn; 165 + } __attribute__((packed)); 166 + 167 + /* Too big to inline everywhere */ 168 + void corelock_init(struct corelock *cl); 169 + void corelock_lock(struct corelock *cl); 170 + int corelock_try_lock(struct corelock *cl); 171 + void corelock_unlock(struct corelock *cl); 172 + #endif /* HAVE_CORELOCK_OBJECT */ 173 + #endif /* CPU_PP */ 174 + 174 175 /* NOTE: The use of the word "queue" may also refer to a linked list of 175 176 threads being maintained that are normally dealt with in FIFO order 176 177 and not necessarily kernel event_queue */ ··· 266 267 object where thread is blocked - used 267 268 for implicit unblock and explicit wake 268 269 states: STATE_BLOCKED/STATE_BLOCKED_W_TMO */ 269 - #if NUM_CORES > 1 270 + #ifdef HAVE_CORELOCK_OBJECT 270 271 struct corelock *obj_cl; /* Object corelock where thead is blocked - 271 272 states: STATE_BLOCKED/STATE_BLOCKED_W_TMO */ 272 273 struct corelock waiter_cl; /* Corelock for thread_wait */ ··· 323 324 /* Specify current thread in a function taking an ID. */ 324 325 #define THREAD_ID_CURRENT ((unsigned int)-1) 325 326 326 - #if NUM_CORES > 1 327 + #ifdef HAVE_CORELOCK_OBJECT 327 328 /* Operations to be performed just before stopping a thread and starting 328 329 a new one if specified before calling switch_thread */ 329 330 enum ··· 356 357 threads */ 357 358 #endif 358 359 long next_tmo_check; /* soonest time to check tmo threads */ 359 - #if NUM_CORES > 1 360 + #ifdef HAVE_CORELOCK_OBJECT 360 361 struct thread_blk_ops blk_ops; /* operations to perform when 361 362 blocking a thread */ 362 363 struct corelock rtr_cl; /* Lock for rtr list */
+3 -1
firmware/kernel.c
··· 68 68 static struct 69 69 { 70 70 struct event_queue *queues[MAX_NUM_QUEUES+1]; 71 - IF_COP( struct corelock cl; ) 71 + #ifdef HAVE_CORELOCK_OBJECT 72 + struct corelock cl; 73 + #endif 72 74 } all_queues SHAREDBSS_ATTR; 73 75 74 76 /****************************************************************************
+2 -2
firmware/thread.c
··· 967 967 * life again. */ 968 968 if (state == STATE_BLOCKED_W_TMO) 969 969 { 970 - #if NUM_CORES > 1 970 + #ifdef HAVE_CORELOCK_OBJECT 971 971 /* Lock the waiting thread's kernel object */ 972 972 struct corelock *ocl = curr->obj_cl; 973 973 ··· 1782 1782 */ 1783 1783 void remove_thread(unsigned int thread_id) 1784 1784 { 1785 - #if NUM_CORES > 1 1785 + #ifdef HAVE_CORELOCK_OBJECT 1786 1786 /* core is not constant here because of core switching */ 1787 1787 unsigned int core = CURRENT_CORE; 1788 1788 unsigned int old_core = NUM_CORES;