Changeset dc747e3 in mainline
- Timestamp:
- 2005-12-15T10:27:59Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7dd2561
- Parents:
- 3fc03fd
- Files:
-
- 31 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/ia32/src/drivers/ega.c
r3fc03fd rdc747e3 43 43 */ 44 44 45 static spinlock_t egalock;45 SPINLOCK_INITIALIZE(egalock); 46 46 static __u32 ega_cursor; 47 47 -
arch/ia32/src/drivers/i8042.c
r3fc03fd rdc747e3 64 64 #define LOCKED_CAPSLOCK (1<<0) 65 65 66 static spinlock_t keylock; /**< keylock protects keyflags and lockflags. */66 SPINLOCK_INITIALIZE(keylock); /**< keylock protects keyflags and lockflags. */ 67 67 static volatile int keyflags; /**< Tracking of multiple keypresses. */ 68 68 static volatile int lockflags; /**< Tracking of multiple keys lockings. */ … … 244 244 exc_register(VECTOR_KBD, "i8042_interrupt", i8042_interrupt); 245 245 trap_virtual_enable_irqs(1<<IRQ_KBD); 246 spinlock_initialize(&keylock, "i8042_lock");247 246 chardev_initialize("i8042_kbd", &kbrd, &ops); 248 247 stdin = &kbrd; -
arch/ia32/src/mm/page.c
r3fc03fd rdc747e3 36 36 #include <arch/interrupt.h> 37 37 #include <arch/asm.h> 38 #include <synch/spinlock.h>39 38 #include <debug.h> 40 39 #include <memstr.h> -
arch/mips32/src/debugger.c
r3fc03fd rdc747e3 39 39 40 40 bpinfo_t breakpoints[BKPOINTS_MAX]; 41 spinlock_t bkpoint_lock;41 SPINLOCK_INITIALIZE(bkpoint_lock); 42 42 43 43 static int cmd_print_breakpoints(cmd_arg_t *argv); … … 182 182 for (i=0; i<BKPOINTS_MAX; i++) 183 183 breakpoints[i].address = NULL; 184 spinlock_initialize(&bkpoint_lock, "breakpoint_lock");185 184 186 185 cmd_initialize(&pbkpt_info); -
arch/mips32/src/mm/asid.c
r3fc03fd rdc747e3 34 34 #include <typedefs.h> 35 35 36 static spinlock_t asid_usage_lock;36 SPINLOCK_INITIALIZE(asid_usage_lock); 37 37 static count_t asid_usage[ASIDS]; /**< Usage tracking array for ASIDs */ 38 38 -
generic/include/console/chardev.h
r3fc03fd rdc747e3 53 53 54 54 waitq_t wq; 55 spinlock_t lock; /**< Protects everything below. */55 SPINLOCK_DECLARE(lock); /**< Protects everything below. */ 56 56 __u8 buffer[CHARDEV_BUFLEN]; 57 57 count_t counter; -
generic/include/console/kconsole.h
r3fc03fd rdc747e3 56 56 struct cmd_info { 57 57 link_t link; /**< Command list link. */ 58 spinlock_t lock; /**< This lock protects everything below. */58 SPINLOCK_DECLARE(lock); /**< This lock protects everything below. */ 59 59 const char *name; /**< Command name. */ 60 60 const char *description; /**< Textual description. */ -
generic/include/cpu.h
r3fc03fd rdc747e3 43 43 44 44 struct cpu { 45 spinlock_t lock;45 SPINLOCK_DECLARE(lock); 46 46 context_t saved_context; 47 47 … … 50 50 volatile count_t needs_relink; 51 51 52 spinlock_t timeoutlock;52 SPINLOCK_DECLARE(timeoutlock); 53 53 link_t timeout_active_head; 54 54 -
generic/include/mm/frame.h
r3fc03fd rdc747e3 55 55 link_t link; /**< link to previous and next zone */ 56 56 57 spinlock_t lock; /**< this lock protects everything below */57 SPINLOCK_DECLARE(lock); /**< this lock protects everything below */ 58 58 __address base; /**< physical address of the first frame in the frames array */ 59 59 frame_t *frames; /**< array of frame_t structures in this zone */ -
generic/include/mm/vm.h
r3fc03fd rdc747e3 58 58 */ 59 59 struct vm_area { 60 spinlock_t lock;60 SPINLOCK_DECLARE(lock); 61 61 link_t link; 62 62 vm_type_t type; … … 73 73 */ 74 74 struct vm { 75 spinlock_t lock;75 SPINLOCK_DECLARE(lock); 76 76 link_t vm_area_head; 77 77 pte_t *ptl0; -
generic/include/proc/scheduler.h
r3fc03fd rdc747e3 41 41 /** Scheduler run queue structure. */ 42 42 struct runq { 43 spinlock_t lock;43 SPINLOCK_DECLARE(lock); 44 44 link_t rq_head; /**< List of ready threads. */ 45 45 count_t n; /**< Number of threads in rq_ready. */ -
generic/include/proc/task.h
r3fc03fd rdc747e3 35 35 36 36 struct task { 37 spinlock_t lock;37 SPINLOCK_DECLARE(lock); 38 38 link_t th_head; /**< List of threads contained in this task. */ 39 39 link_t tasks_link; /**< Link to other tasks within the system. */ -
generic/include/proc/thread.h
r3fc03fd rdc747e3 71 71 * 72 72 */ 73 spinlock_t lock;73 SPINLOCK_DECLARE(lock); 74 74 75 75 void (* thread_code)(void *); /**< Function implementing the thread. */ -
generic/include/synch/rwlock.h
r3fc03fd rdc747e3 34 34 #include <synch/mutex.h> 35 35 #include <synch/synch.h> 36 #include <synch/spinlock.h> 36 37 37 38 enum rwlock_type { … … 42 43 43 44 struct rwlock { 44 spinlock_t lock;45 SPINLOCK_DECLARE(lock); 45 46 mutex_t exclusive; /**< Mutex for writers, readers can bypass it if readers_in is positive. */ 46 47 count_t readers_in; /**< Number of readers in critical section. */ -
generic/include/synch/spinlock.h
r3fc03fd rdc747e3 42 42 }; 43 43 44 /* 45 * SPINLOCK_DECLARE is to be used for dynamically allocated spinlocks, 46 * where the lock gets initialized in run time. 47 */ 48 #define SPINLOCK_DECLARE(slname) spinlock_t slname 49 50 /* 51 * SPINLOCK_INITIALIZE is to be used for statically allocated spinlocks. 52 * It declares and initializes the lock. 53 */ 54 #ifdef CONFIG_DEBUG_SPINLOCK 55 #define SPINLOCK_INITIALIZE(slname) \ 56 spinlock_t slname = { \ 57 .name = #slname, \ 58 .val = 0 \ 59 } 60 #else 61 #define SPINLOCK_INITIALIZE(slname) \ 62 spinlock_t slname = { \ 63 .val = 0 \ 64 } 65 #endif 66 44 67 extern void spinlock_initialize(spinlock_t *sl, char *name); 45 68 extern void spinlock_lock(spinlock_t *sl); … … 49 72 #else 50 73 51 struct spinlock { 52 }; 74 /* On UP systems, spinlocks are effectively left out. */ 75 #define SPINLOCK_DECLARE(name) 76 #define SPINLOCK_INITIALIZE(name) 53 77 54 78 #define spinlock_initialize(x,name) -
generic/include/synch/waitq.h
r3fc03fd rdc747e3 46 46 * Must be acquired before T.lock for each T of type thread_t. 47 47 */ 48 spinlock_t lock;48 SPINLOCK_DECLARE(lock); 49 49 50 50 int missed_wakeups; /**< Number of waitq_wakeup() calls that didn't find a thread to wake up. */ -
generic/include/time/timeout.h
r3fc03fd rdc747e3 40 40 41 41 struct timeout { 42 spinlock_t lock;42 SPINLOCK_DECLARE(lock); 43 43 44 44 link_t link; /**< Link to the list of active timeouts on THE->cpu */ -
generic/src/console/kconsole.c
r3fc03fd rdc747e3 66 66 */ 67 67 68 spinlock_t cmd_lock; /**< Lock protecting command list. */69 link_t cmd_head; /**< Command list. */68 SPINLOCK_INITIALIZE(cmd_lock); /**< Lock protecting command list. */ 69 link_t cmd_head; /**< Command list. */ 70 70 71 71 static cmd_info_t *parse_cmdline(char *cmdline, size_t len); … … 78 78 int i; 79 79 80 spinlock_initialize(&cmd_lock, "kconsole_cmd");81 80 list_initialize(&cmd_head); 82 81 -
generic/src/cpu/cpu.c
r3fc03fd rdc747e3 67 67 cpus[i].id = i; 68 68 69 spinlock_initialize(&cpus[i].lock, "cpu_t.lock"); 70 69 71 #ifdef CONFIG_SMP 70 72 waitq_initialize(&cpus[i].kcpulb_wq); … … 72 74 73 75 for (j = 0; j < RQ_COUNT; j++) { 76 spinlock_initialize(&cpus[i].rq[j].lock, "rq_t.lock"); 74 77 list_initialize(&cpus[i].rq[j].rq_head); 75 78 } -
generic/src/debug/print.c
r3fc03fd rdc747e3 36 36 #include <arch.h> 37 37 38 static char digits[] = "0123456789abcdef"; /**< Hexadecimal characters */39 static spinlock_t printflock;/**< printf spinlock */38 static char digits[] = "0123456789abcdef"; /**< Hexadecimal characters */ 39 SPINLOCK_INITIALIZE(printflock); /**< printf spinlock */ 40 40 41 41 #define DEFAULT_DOUBLE_PRECISION 16 -
generic/src/interrupt/interrupt.c
r3fc03fd rdc747e3 41 41 } exc_table[IVT_ITEMS]; 42 42 43 static spinlock_t exctbl_lock;43 SPINLOCK_INITIALIZE(exctbl_lock); 44 44 45 45 /** Register exception handler … … 125 125 int i; 126 126 127 spinlock_initialize(&exctbl_lock, "exctbl_lock");128 129 127 for (i=0;i < IVT_ITEMS; i++) 130 128 exc_register(i, "undef", exc_undef); -
generic/src/main/main.c
r3fc03fd rdc747e3 175 175 */ 176 176 kconsole_init(); 177 177 178 /* Exception handler initialization, before architecture 178 179 * starts adding it's own handlers -
generic/src/mm/frame.c
r3fc03fd rdc747e3 42 42 #include <align.h> 43 43 44 spinlock_t zone_head_lock;/**< this lock protects zone_head list */45 link_t zone_head; /**< list of all zones in the system */44 SPINLOCK_INITIALIZE(zone_head_lock); /**< this lock protects zone_head list */ 45 link_t zone_head; /**< list of all zones in the system */ 46 46 47 47 /** Blacklist containing non-available areas of memory. … … 243 243 void zone_init(void) 244 244 { 245 spinlock_initialize(&zone_head_lock, "zone_head_lock");246 245 list_initialize(&zone_head); 247 246 } -
generic/src/mm/heap.c
r3fc03fd rdc747e3 44 44 45 45 static chunk_t *chunk0; 46 static spinlock_t heaplock;46 SPINLOCK_INITIALIZE(heaplock); 47 47 48 48 void early_heap_init(__address heap, size_t size) 49 49 { 50 spinlock_initialize(&heaplock, "heap_lock");51 50 memsetb(heap, size, 0); 52 51 chunk0 = (chunk_t *) heap; -
generic/src/mm/tlb.c
r3fc03fd rdc747e3 38 38 #include <panic.h> 39 39 40 #ifdef CONFIG_SMP 41 static spinlock_t tlblock; 42 #endif 40 SPINLOCK_INITIALIZE(tlblock); 43 41 44 42 void tlb_init(void) 45 43 { 46 if (config.cpu_active == 1)47 spinlock_initialize(&tlblock, "tlb_lock");48 49 44 tlb_arch_init(); 50 45 } -
generic/src/proc/task.c
r3fc03fd rdc747e3 37 37 #include <list.h> 38 38 39 spinlock_t tasks_lock;39 SPINLOCK_INITIALIZE(tasks_lock); 40 40 link_t tasks_head; 41 41 … … 49 49 { 50 50 TASK = NULL; 51 spinlock_initialize(&tasks_lock, "tasks_lock");52 51 list_initialize(&tasks_head); 53 52 } -
generic/src/proc/thread.c
r3fc03fd rdc747e3 55 55 char *thread_states[] = {"Invalid", "Running", "Sleeping", "Ready", "Entering", "Exiting"}; /**< Thread states */ 56 56 57 spinlock_t threads_lock; /**< Lock protecting threads_head list. For locking rules, see declaration thereof. */58 link_t threads_head; /**< List of all threads. */59 60 static spinlock_t tidlock;57 SPINLOCK_INITIALIZE(threads_lock); /**< Lock protecting threads_head list. For locking rules, see declaration thereof. */ 58 link_t threads_head; /**< List of all threads. */ 59 60 SPINLOCK_INITIALIZE(tidlock); 61 61 __u32 last_tid = 0; 62 62 … … 97 97 THREAD = NULL; 98 98 nrdy = 0; 99 spinlock_initialize(&threads_lock, "threads_lock");100 99 list_initialize(&threads_head); 101 100 } -
generic/src/synch/rwlock.c
r3fc03fd rdc747e3 193 193 * after this thread is put asleep. 194 194 */ 195 #ifdef CONFIG_SMP 195 196 thread_register_call_me(release_spinlock, &rwl->lock); 197 #else 198 thread_register_call_me(release_spinlock, NULL); 199 #endif 196 200 197 201 rc = _mutex_lock_timeout(&rwl->exclusive, usec, trylock); … … 201 205 * release_spinlock() wasn't called 202 206 */ 203 thread_register_call_me(NULL, NULL); 207 thread_register_call_me(NULL, NULL); 204 208 spinlock_unlock(&rwl->lock); 205 209 case ESYNCH_TIMEOUT: -
test/synch/rwlock4/test.c
r3fc03fd rdc747e3 40 40 #include <synch/rwlock.h> 41 41 #include <synch/synch.h> 42 #include <synch/spinlock.h> 42 43 43 44 #define READERS 50 … … 46 47 static rwlock_t rwlock; 47 48 48 static spinlock_t lock;49 SPINLOCK_INITIALIZE(lock); 49 50 50 51 static waitq_t can_start; -
test/synch/semaphore2/test.c
r3fc03fd rdc747e3 38 38 #include <synch/semaphore.h> 39 39 #include <synch/synch.h> 40 #include <synch/spinlock.h> 40 41 41 42 static semaphore_t sem; 42 43 43 static spinlock_t lock;44 SPINLOCK_INITIALIZE(lock); 44 45 45 46 static waitq_t can_start; -
test/thread/thread1/test.c
r3fc03fd rdc747e3 38 38 #include <arch.h> 39 39 40 41 42 40 #define THREADS 5 43 44 41 45 42 static void thread(void *data) … … 52 49 } 53 50 54 55 56 51 void test(void) 57 52 { … … 59 54 int i; 60 55 61 62 63 for (i=0; i<THREADS; i++) 64 { 56 for (i=0; i<THREADS; i++) { 65 57 if (!(t = thread_create(thread, NULL, TASK, 0))) 66 58 panic("could not create thread\n"); … … 68 60 } 69 61 printf("ok\n"); 70 71 62 }
Note:
See TracChangeset
for help on using the changeset viewer.