Changeset 624 for trunk/kernel/libk/busylock.c
- Timestamp:
- Mar 12, 2019, 1:37:38 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/libk/busylock.c
r600 r624 2 2 * busylock.c - local kernel-busy waiting lock implementation. 3 3 * 4 * Authors Alain Greiner (2016,2017,2018 )4 * Authors Alain Greiner (2016,2017,2018,2019) 5 5 * 6 6 * Copyright (c) UPMC Sorbonne Universites … … 76 76 77 77 #if DEBUG_BUSYLOCK 78 if( (lock->type != LOCK_CHDEV_TXT0) && 79 ((uint32_t)hal_get_cycles() > DEBUG_BUSYLOCK) ) 78 if( lock->type != LOCK_CHDEV_TXT0 ) 80 79 { 80 // update thread list of busylocks 81 81 xptr_t root_xp = XPTR( local_cxy , &this->busylocks_root ); 82 83 // update thread list of busylocks84 82 xlist_add_last( root_xp , XPTR( local_cxy , &lock->xlist ) ); 85 83 } 86 84 #endif 87 85 88 #if( DEBUG_BUSYLOCK & & DEBUG_BUSYLOCK_THREAD_XP)86 #if( DEBUG_BUSYLOCK & 1 ) 89 87 if( (lock->type != LOCK_CHDEV_TXT0) && 90 (XPTR( local_cxy , this ) == DEBUG_BUSYLOCK_THREAD_XP) ) 88 (this->process->pid == DEBUG_BUSYLOCK_PID) && 89 (this->trdid == DEBUG_BUSYLOCK_TRDID) ) 91 90 { 92 // get cluster and local pointer of target thread93 cxy_t thread_cxy = GET_CXY( DEBUG_BUSYLOCK_THREAD_XP );94 thread_t * thread_ptr = GET_PTR( DEBUG_BUSYLOCK_THREAD_XP );95 96 // display message on kernel TXT097 91 printk("\n[%s] thread[%x,%x] ACQUIRE lock %s\n", 98 92 __FUNCTION__, this->process->pid, this->trdid, lock_type_str[lock->type] ); … … 120 114 121 115 #if DEBUG_BUSYLOCK 122 if( (lock->type != LOCK_CHDEV_TXT0) && 123 ((uint32_t)hal_get_cycles() > DEBUG_BUSYLOCK) ) 116 if( lock->type != LOCK_CHDEV_TXT0 ) 124 117 { 125 118 // remove lock from thread list of busylocks … … 128 121 #endif 129 122 130 #if( DEBUG_BUSYLOCK & & DEBUG_BUSYLOCK_THREAD_XP)123 #if( DEBUG_BUSYLOCK & 1 ) 131 124 if( (lock->type != LOCK_CHDEV_TXT0) && 132 (XPTR( local_cxy , this ) == DEBUG_BUSYLOCK_THREAD_XP) ) 125 (this->process->pid == DEBUG_BUSYLOCK_PID) && 126 (this->trdid == DEBUG_BUSYLOCK_TRDID) ) 133 127 { 134 // get cluster and local pointer of target thread135 cxy_t thread_cxy = GET_CXY( DEBUG_BUSYLOCK_THREAD_XP );136 thread_t * thread_ptr = GET_PTR( DEBUG_BUSYLOCK_THREAD_XP );137 138 // display message on kernel TXT0139 128 printk("\n[%s] thread[%x,%x] RELEASE lock %s\n", 140 129 __FUNCTION__, this->process->pid, this->trdid, lock_type_str[lock->type] );
Note: See TracChangeset
for help on using the changeset viewer.