Changeset e037cf37 in mainline
- Timestamp:
- 2020-12-29T22:17:21Z (4 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 11e394f, d70dc1c4
- Parents:
- 1483981
- Location:
- kernel
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/genarch/src/drivers/ega/ega.c
r1483981 re037cf37 568 568 } 569 569 570 static void ega_redraw(outdev_t *dev) 571 { 572 ega_instance_t *instance = (ega_instance_t *) dev->data; 573 574 irq_spinlock_lock(&instance->lock, true); 575 570 static void ega_redraw_internal(ega_instance_t *instance) 571 { 576 572 memcpy(instance->addr, instance->backbuf, EGA_VRAM_SIZE); 577 573 ega_move_cursor(instance); 578 574 ega_show_cursor(instance); 579 575 } 576 577 static void ega_redraw(outdev_t *dev) 578 { 579 ega_instance_t *instance = (ega_instance_t *) dev->data; 580 581 irq_spinlock_lock(&instance->lock, true); 582 ega_redraw_internal(instance); 580 583 irq_spinlock_unlock(&instance->lock, true); 584 } 585 586 /** EGA was mapped or unmapped. 587 * 588 * @param arg EGA instance 589 */ 590 static void ega_mapped_changed(void *arg) 591 { 592 ega_instance_t *instance = (ega_instance_t *) arg; 593 594 if (!instance->parea.mapped) { 595 irq_spinlock_lock(&instance->lock, true); 596 ega_redraw_internal(instance); 597 irq_spinlock_unlock(&instance->lock, true); 598 } 581 599 } 582 600 … … 621 639 instance->parea.unpriv = false; 622 640 instance->parea.mapped = false; 641 instance->parea.mapped_changed = ega_mapped_changed; 642 instance->parea.arg = (void *) instance; 623 643 ddi_parea_register(&instance->parea); 624 644 -
kernel/genarch/src/fb/fb.c
r1483981 re037cf37 516 516 } 517 517 518 /** Framebuffer was mapped or unmapped. 519 * 520 * @param arg Framebuffer instance 521 */ 522 static void fb_mapped_changed(void *arg) 523 { 524 fb_instance_t *instance = (fb_instance_t *) arg; 525 526 if (!instance->parea.mapped) { 527 spinlock_lock(&instance->lock); 528 fb_redraw_internal(instance); 529 spinlock_unlock(&instance->lock); 530 } 531 } 532 518 533 /** Initialize framebuffer as a output character device 519 534 * … … 661 676 instance->parea.unpriv = false; 662 677 instance->parea.mapped = false; 678 instance->parea.mapped_changed = fb_mapped_changed; 679 instance->parea.arg = (void *) instance; 663 680 ddi_parea_register(&instance->parea); 664 681 -
kernel/generic/include/ddi/ddi.h
r1483981 re037cf37 42 42 43 43 /** Structure representing contiguous physical memory area. */ 44 typedef struct {44 typedef struct parea { 45 45 /** Link to @c pareas ordered dictionary */ 46 46 odlink_t lpareas; … … 54 54 /** Indicate whether the area is actually mapped. */ 55 55 bool mapped; 56 /** Called when @c mapped field has changed */ 57 void (*mapped_changed)(void *); 58 /** Callback argument */ 59 void *arg; 56 60 } parea_t; 57 61 … … 59 63 extern void ddi_parea_init(parea_t *); 60 64 extern void ddi_parea_register(parea_t *); 65 extern void ddi_parea_unmap_notify(parea_t *); 61 66 62 67 extern void *pio_map(void *, size_t); -
kernel/generic/include/mm/as.h
r1483981 re037cf37 236 236 size_t frames; 237 237 bool anonymous; 238 struct parea *parea; 238 239 }; 239 240 -
kernel/generic/src/ddi/ddi.c
r1483981 re037cf37 107 107 } 108 108 109 /** Norify physical area has been unmapped. 110 * 111 * @param parea Physical area 112 */ 113 void ddi_parea_unmap_notify(parea_t *parea) 114 { 115 parea->mapped = false; 116 if (parea->mapped_changed != NULL) 117 parea->mapped_changed(parea->arg); 118 } 119 109 120 /** Map piece of physical memory into virtual address space of current task. 110 121 * … … 204 215 205 216 map: 217 backend_data.parea = parea; 218 206 219 if (!as_area_create(TASK->as, flags, FRAMES2SIZE(pages), 207 220 AS_AREA_ATTR_NONE, &phys_backend, &backend_data, virt, bound)) { -
kernel/generic/src/mm/backend_phys.c
r1483981 re037cf37 38 38 39 39 #include <assert.h> 40 #include <ddi/ddi.h> 40 41 #include <typedefs.h> 41 42 #include <mm/as.h> … … 101 102 { 102 103 /* 103 * Nothing to do.104 104 * The anonymous frames, if any, are released in 105 105 * phys_destroy_shared_data(). 106 106 */ 107 108 /* Notify parea has been unmapped */ 109 if (area->backend_data.parea != NULL) 110 ddi_parea_unmap_notify(area->backend_data.parea); 107 111 } 108 112
Note:
See TracChangeset
for help on using the changeset viewer.