Changeset c263c77 in mainline
- Timestamp:
- 2011-05-20T23:12:26Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0c33b1d5
- Parents:
- b6f3e7e
- Location:
- kernel
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/genarch/src/drivers/ega/ega.c
rb6f3e7e rc263c77 40 40 #include <mm/as.h> 41 41 #include <mm/slab.h> 42 #include <synch/mutex.h>43 42 #include <arch/mm/page.h> 44 43 #include <typedefs.h> … … 63 62 64 63 typedef struct { 65 mutex_t mtx;64 IRQ_SPINLOCK_DECLARE(lock); 66 65 67 66 uint32_t cursor; … … 540 539 ega_instance_t *instance = (ega_instance_t *) dev->data; 541 540 542 mutex_lock(&instance->mtx);541 irq_spinlock_lock(&instance->lock, true); 543 542 544 543 switch (ch) { … … 563 562 ega_move_cursor(instance, silent); 564 563 565 mutex_unlock(&instance->mtx);564 irq_spinlock_unlock(&instance->lock, true); 566 565 } 567 566 … … 570 569 ega_instance_t *instance = (ega_instance_t *) dev->data; 571 570 572 mutex_lock(&instance->mtx);571 irq_spinlock_lock(&instance->lock, true); 573 572 574 573 memcpy(instance->addr, instance->backbuf, EGA_VRAM_SIZE); … … 576 575 ega_show_cursor(instance, silent); 577 576 578 mutex_unlock(&instance->mtx);577 irq_spinlock_unlock(&instance->lock, true); 579 578 } 580 579 … … 594 593 egadev->data = instance; 595 594 596 mutex_initialize(&instance->mtx, MUTEX_PASSIVE);595 irq_spinlock_initialize(&instance->lock, "*ega.instance.lock"); 597 596 598 597 instance->base = base; -
kernel/genarch/src/fb/fb.c
rb6f3e7e rc263c77 80 80 81 81 typedef struct { 82 mutex_t mtx;82 SPINLOCK_DECLARE(lock); 83 83 84 84 uint8_t *addr; … … 365 365 { 366 366 fb_instance_t *instance = (fb_instance_t *) dev->data; 367 mutex_lock(&instance->mtx);367 spinlock_lock(&instance->lock); 368 368 369 369 switch (ch) { … … 406 406 cursor_put(instance, silent); 407 407 408 mutex_unlock(&instance->mtx);408 spinlock_unlock(&instance->lock); 409 409 } 410 410 … … 473 473 fb_instance_t *instance = (fb_instance_t *) dev->data; 474 474 475 mutex_lock(&instance->mtx);475 spinlock_lock(&instance->lock); 476 476 fb_redraw_internal(instance); 477 mutex_unlock(&instance->mtx);477 spinlock_unlock(&instance->lock); 478 478 } 479 479 … … 554 554 fbdev->data = instance; 555 555 556 mutex_initialize(&instance->mtx, MUTEX_PASSIVE);556 spinlock_initialize(&instance->lock, "*fb.instance.lock"); 557 557 instance->rgb_conv = rgb_conv; 558 558 instance->pixelbytes = pixelbytes; -
kernel/generic/src/synch/spinlock.c
rb6f3e7e rc263c77 84 84 * This conserns especially printf_lock and the 85 85 * framebuffer lock. 86 * 87 * Any lock whose name is prefixed by "*" will be 88 * ignored by this deadlock detection routine 89 * as this might cause an infinite recursion. 90 * We trust our code that there is no possible deadlock 91 * caused by these locks (except when an exception 92 * is triggered for instance by printf()). 93 * 94 * We encountered false positives caused by very 95 * slow framebuffer interaction (especially when 96 * run in a simulator) that caused problems with both 97 * printf_lock and the framebuffer lock. 86 98 */ 99 if (lock->name[0] == '*') 100 continue; 101 87 102 if (i++ > DEADLOCK_THRESHOLD) { 88 103 printf("cpu%u: looping on spinlock %p:%s, "
Note:
See TracChangeset
for help on using the changeset viewer.