- Timestamp:
- 2018-04-15T09:35:04Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c1f44ca
- Parents:
- 8ebe212
- Location:
- kernel
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/abs32le/include/arch/mm/page.h
r8ebe212 r18b6a88 152 152 pte_t *p = &pt[i]; 153 153 154 return ( 155 ((unsigned int) (!p->page_cache_disable) << PAGE_CACHEABLE_SHIFT) | 154 return (((unsigned int) (!p->page_cache_disable) << PAGE_CACHEABLE_SHIFT) | 156 155 ((unsigned int) (!p->present) << PAGE_PRESENT_SHIFT) | 157 156 ((unsigned int) p->uaccessible << PAGE_USER_SHIFT) | … … 159 158 ((unsigned int) p->writeable << PAGE_WRITE_SHIFT) | 160 159 (1 << PAGE_EXEC_SHIFT) | 161 ((unsigned int) p->global << PAGE_GLOBAL_SHIFT) 162 ); 160 ((unsigned int) p->global << PAGE_GLOBAL_SHIFT)); 163 161 } 164 162 -
kernel/arch/arm32/include/arch/cycle.h
r8ebe212 r18b6a88 52 52 if ((ID_PFR1_read() & ID_PFR1_GEN_TIMER_EXT_MASK) == 53 53 ID_PFR1_GEN_TIMER_EXT) { 54 uint32_t low = 0, high = 0; 55 asm volatile( "MRRC p15, 0, %[low], %[high], c14": [low]"=r"(low), [high]"=r"(high)); 56 return ((uint64_t)high << 32) | low; 54 uint32_t low = 0, high = 0; 55 asm volatile ( 56 "MRRC p15, 0, %[low], %[high], c14" 57 : [low] "=r" (low), [high] "=r" (high) 58 ); 59 return ((uint64_t)high << 32) | low; 57 60 } else { 58 61 return (uint64_t)PMCCNTR_read() * 64; -
kernel/arch/arm32/src/mach/integratorcp/integratorcp.c
r8ebe212 r18b6a88 245 245 void icp_cpu_halt(void) 246 246 { 247 while (true); 247 while (true) 248 ; 248 249 } 249 250 … … 345 346 346 347 #ifdef CONFIG_PL011_UART 347 348 349 350 351 352 353 348 srln_instance_t *srln_instance = srln_init(); 349 if (srln_instance) { 350 indev_t *sink = stdin_wire(); 351 indev_t *srln = srln_wire(srln_instance, sink); 352 pl011_uart_input_wire(&icp.uart, srln); 353 icp_irqc_unmask(ICP_UART0_IRQ); 354 } 354 355 #endif 355 356 } -
kernel/arch/ia64/src/mm/page.c
r8ebe212 r18b6a88 75 75 * For paranoia reasons, we set it again. 76 76 */ 77 for (i = 0; i < REGION_REGISTERS; i++) {77 for (i = 0; i < REGION_REGISTERS; i++) { 78 78 rr.word = rr_read(i); 79 79 rr.map.ve = 0; /* disable VHPT walker */ -
kernel/arch/sparc64/include/arch/sun4v/hypercall.h
r8ebe212 r18b6a88 152 152 */ 153 153 static inline uint64_t 154 154 __hypercall_fast(const uint64_t p1, const uint64_t p2, const uint64_t p3, 155 155 const uint64_t p4, const uint64_t p5, const uint64_t function_number) 156 156 { … … 187 187 */ 188 188 static inline uint64_t 189 189 __hypercall_fast_ret1(const uint64_t p1, const uint64_t p2, const uint64_t p3, 190 190 const uint64_t p4, const uint64_t p5, const uint64_t function_number, 191 191 uint64_t *ret1) … … 223 223 */ 224 224 static inline uint64_t 225 225 __hypercall_hyperfast(const uint64_t p1, const uint64_t p2, const uint64_t p3, 226 226 const uint64_t p4, const uint64_t p5, const uint64_t sw_trap_number) 227 227 { -
kernel/genarch/src/drivers/am335x/timer.c
r8ebe212 r18b6a88 47 47 48 48 typedef struct timer_regs_mmap { 49 50 49 uintptr_t base; 50 size_t size; 51 51 } timer_regs_mmap_t; 52 52 53 53 static const timer_regs_mmap_t regs_map[TIMERS_MAX] = { 54 54 { .base = AM335x_DMTIMER0_BASE_ADDRESS, .size = AM335x_DMTIMER0_SIZE }, 55 { 0, 0}, /* DMTIMER1 is not supported by this driver */55 { 0, 0 }, /* DMTIMER1 is not supported by this driver */ 56 56 { .base = AM335x_DMTIMER2_BASE_ADDRESS, .size = AM335x_DMTIMER2_SIZE }, 57 57 { .base = AM335x_DMTIMER3_BASE_ADDRESS, .size = AM335x_DMTIMER3_SIZE }, … … 67 67 am335x_timer_regs_t *regs = timer->regs; 68 68 69 while (regs->twps & reg); 69 while (regs->twps & reg) 70 ; 70 71 71 72 switch (reg) { … … 149 150 timer->regs->tiocp_cfg |= AM335x_TIMER_TIOCPCFG_SOFTRESET_FLAG; 150 151 /* Wait until the reset is done */ 151 while (timer->regs->tiocp_cfg & AM335x_TIMER_TIOCPCFG_SOFTRESET_FLAG); 152 while (timer->regs->tiocp_cfg & AM335x_TIMER_TIOCPCFG_SOFTRESET_FLAG) 153 ; 152 154 } 153 155 -
kernel/generic/src/adt/avl.c
r8ebe212 r18b6a88 308 308 */ 309 309 static int 310 310 repair(avltree_t *t, avltree_node_t *u, avltree_node_t *v, avltree_node_t *w, 311 311 int *dir, int ro) 312 312 { -
kernel/generic/src/interrupt/interrupt.c
r8ebe212 r18b6a88 165 165 } 166 166 167 static NO_TRACE 168 voidfault_from_uspace_core(istate_t *istate, const char *fmt, va_list args)167 static NO_TRACE void 168 fault_from_uspace_core(istate_t *istate, const char *fmt, va_list args) 169 169 { 170 170 printf("Task %s (%" PRIu64 ") killed due to an exception at " -
kernel/generic/src/ipc/sysipc.c
r8ebe212 r18b6a88 765 765 766 766 if (!call) { 767 ipc_data_t data = { };767 ipc_data_t data = { }; 768 768 data.cap_handle = CAP_NIL; 769 769 STRUCT_TO_USPACE(calldata, &data); -
kernel/generic/src/mm/km.c
r8ebe212 r18b6a88 263 263 } 264 264 } else { 265 lowmem:265 lowmem: 266 266 frame = frame_alloc(1, FRAME_LOWMEM | flags, 0); 267 267 if (!frame) -
kernel/generic/src/proc/scheduler.c
r8ebe212 r18b6a88 430 430 case Exiting: 431 431 rcu_thread_exiting(); 432 repeat:432 repeat: 433 433 if (THREAD->detached) { 434 434 thread_destroy(THREAD, false); -
kernel/generic/src/synch/rcu.c
r8ebe212 r18b6a88 253 253 static void synch_complete(rcu_item_t *rcu_item); 254 254 static inline void rcu_call_impl(bool expedite, rcu_item_t *rcu_item, 255 255 rcu_func_t func); 256 256 static void add_barrier_cb(void *arg); 257 257 static void barrier_complete(rcu_item_t *barrier_item); … … 440 440 { 441 441 for (unsigned int cpu_id = 0; cpu_id < config.cpu_count; ++cpu_id) { 442 char name[THREAD_NAME_BUFLEN] = { 0};442 char name[THREAD_NAME_BUFLEN] = { 0 }; 443 443 444 444 snprintf(name, THREAD_NAME_BUFLEN - 1, "rcu-rec/%u", cpu_id); 445 445 446 446 cpus[cpu_id].rcu.reclaimer_thr = 447 447 thread_create(reclaimer, NULL, TASK, THREAD_FLAG_NONE, name); 448 448 449 449 if (!cpus[cpu_id].rcu.reclaimer_thr) … … 461 461 { 462 462 rcu.detector_thr = 463 463 thread_create(detector, NULL, TASK, THREAD_FLAG_NONE, "rcu-det"); 464 464 465 465 if (!rcu.detector_thr) … … 656 656 /** rcu_call() inline-able implementation. See rcu_call() for comments. */ 657 657 static inline void rcu_call_impl(bool expedite, rcu_item_t *rcu_item, 658 658 rcu_func_t func) 659 659 { 660 660 assert(rcu_item); … … 667 667 rcu_cpu_data_t *r = &CPU->rcu; 668 668 669 rcu_item_t **prev_tail 670 =local_atomic_exchange(&r->parriving_cbs_tail, &rcu_item->next);669 rcu_item_t **prev_tail = 670 local_atomic_exchange(&r->parriving_cbs_tail, &rcu_item->next); 671 671 *prev_tail = rcu_item; 672 672 … … 829 829 if (0 < arriving_cnt) { 830 830 CPU->rcu.stat_avg_cbs = 831 831 (99 * CPU->rcu.stat_avg_cbs + 1 * arriving_cnt) / 100; 832 832 } 833 833 } … … 853 853 * or risk exhausting all system memory. 854 854 */ 855 bool expedite = (EXPEDITE_THRESHOLD < CPU->rcu.next_cbs_cnt) 856 ||CPU->rcu.expedite_arriving;855 bool expedite = (EXPEDITE_THRESHOLD < CPU->rcu.next_cbs_cnt) || 856 CPU->rcu.expedite_arriving; 857 857 CPU->rcu.expedite_arriving = false; 858 858 … … 958 958 /* Wait for the GP to complete. */ 959 959 errno_t ret = _condvar_wait_timeout_spinlock(&rcu.gp_ended, &rcu.gp_lock, 960 960 SYNCH_NO_TIMEOUT, SYNCH_FLAGS_INTERRUPTIBLE); 961 961 962 962 if (ret == EINTR) { … … 984 984 while (!cpu_mask_is_none(reader_cpus)) { 985 985 /* Give cpus a chance to context switch (a QS) and batch callbacks. */ 986 if (!gp_sleep(&expedite))986 if (!gp_sleep(&expedite)) 987 987 return false; 988 988 … … 1015 1015 errno_t ret = 0; 1016 1016 ret = _condvar_wait_timeout_spinlock(&rcu.expedite_now, &rcu.gp_lock, 1017 1017 DETECT_SLEEP_MS * 1000, SYNCH_FLAGS_INTERRUPTIBLE); 1018 1018 1019 1019 /* rcu.expedite_now was signaled. */ … … 1145 1145 1146 1146 printf("Bug: thread (id %" PRIu64 " \"%s\") exited while in RCU read" 1147 1147 " section.\n", THREAD->tid, THREAD->name); 1148 1148 } 1149 1149 } … … 1207 1207 */ 1208 1208 rcu_gp_t compl_gp = ACCESS_ONCE(rcu.completed_gp); 1209 if (CPU->rcu.cur_cbs_gp <= compl_gp 1210 &&compl_gp <= CPU->rcu.cur_cbs_gp + UINT32_MAX_HALF) {1209 if (CPU->rcu.cur_cbs_gp <= compl_gp && 1210 compl_gp <= CPU->rcu.cur_cbs_gp + UINT32_MAX_HALF) { 1211 1211 *completed_gp = compl_gp; 1212 1212 return true; … … 1237 1237 */ 1238 1238 if (expedite) { 1239 if (0 == rcu.req_expedited_cnt)1239 if (0 == rcu.req_expedited_cnt) 1240 1240 condvar_signal(&rcu.expedite_now); 1241 1241 … … 1270 1270 while (rcu.completed_gp < wait_on_gp && !interrupted) { 1271 1271 int ret = _condvar_wait_timeout_spinlock(&rcu.gp_ended, &rcu.gp_lock, 1272 1272 SYNCH_NO_TIMEOUT, SYNCH_FLAGS_INTERRUPTIBLE); 1273 1273 interrupted = (ret == EINTR); 1274 1274 } … … 1330 1330 while (0 == rcu.req_gp_end_cnt && !interrupted) { 1331 1331 int ret = _condvar_wait_timeout_spinlock(&rcu.req_gp_changed, 1332 1332 &rcu.gp_lock, SYNCH_NO_TIMEOUT, SYNCH_FLAGS_INTERRUPTIBLE); 1333 1333 1334 1334 interrupted = (ret == EINTR); … … 1395 1395 /* minor bug: sleeps for the same duration if woken up spuriously. */ 1396 1396 ret = _condvar_wait_timeout_spinlock(&rcu.expedite_now, &rcu.gp_lock, 1397 1397 DETECT_SLEEP_MS * 1000, SYNCH_FLAGS_INTERRUPTIBLE); 1398 1398 } 1399 1399 … … 1479 1479 int delaying_cpu_cnt = atomic_get(&rcu.delaying_cpu_cnt); 1480 1480 1481 for (int i = 0; i < delaying_cpu_cnt; ++i) {1481 for (int i = 0; i < delaying_cpu_cnt; ++i) { 1482 1482 if (!semaphore_down_interruptable(&rcu.remaining_readers)) 1483 1483 return false; … … 1549 1549 if (THREAD == rcu.detector_thr) { 1550 1550 THREAD->priority = -1; 1551 } 1552 else if (THREAD == CPU->rcu.reclaimer_thr) { 1551 } else if (THREAD == CPU->rcu.reclaimer_thr) { 1553 1552 THREAD->priority = -1; 1554 1553 } … … 1606 1605 1607 1606 printf("Bug: thread (id %" PRIu64 " \"%s\") exited while in RCU read" 1608 1607 " section.\n", THREAD->tid, THREAD->name); 1609 1608 } 1610 1609 } … … 1834 1833 1835 1834 printf("Config: expedite_threshold=%d, critical_threshold=%d," 1836 1837 1835 " detect_sleep=%dms, %s\n", 1836 EXPEDITE_THRESHOLD, CRITICAL_THRESHOLD, DETECT_SLEEP_MS, algo); 1838 1837 printf("Completed GPs: %" PRIu64 "\n", rcu.completed_gp); 1839 1838 printf("Expedited GPs: %zu\n", rcu.stat_expedited_cnt); 1840 1839 printf("Delayed GPs: %zu (cpus w/ still running readers after gp sleep)\n", 1841 1840 rcu.stat_delayed_cnt); 1842 1841 printf("Preempt blocked GPs: %zu (waited for preempted readers; " 1843 1842 "running or not)\n", rcu.stat_preempt_blocking_cnt); 1844 1843 printf("Smp calls: %zu\n", rcu.stat_smp_call_cnt); 1845 1844
Note:
See TracChangeset
for help on using the changeset viewer.