diff options
| author | John Baldwin <jhb@FreeBSD.org> | 2021-12-28 21:51:25 +0000 |
|---|---|---|
| committer | John Baldwin <jhb@FreeBSD.org> | 2022-04-29 21:27:47 +0000 |
| commit | 5159d50a1e0690d2bf46c49f83112a756bd6fb47 (patch) | |
| tree | 647e865acd1c7dbad7f4ee8d8c2af1a33799bb5a /sys/mips | |
| parent | 745c280c89eba41dee25a6cdd4ef4258de87dc65 (diff) | |
Diffstat (limited to 'sys/mips')
| -rw-r--r-- | sys/mips/include/cpu.h | 1 | ||||
| -rw-r--r-- | sys/mips/include/md_var.h | 3 | ||||
| -rw-r--r-- | sys/mips/mips/busdma_machdep.c | 24 | ||||
| -rw-r--r-- | sys/mips/mips/vm_machdep.c | 11 |
4 files changed, 18 insertions, 21 deletions
diff --git a/sys/mips/include/cpu.h b/sys/mips/include/cpu.h index b4f5c59f72f5..aaec97aa25f1 100644 --- a/sys/mips/include/cpu.h +++ b/sys/mips/include/cpu.h @@ -84,7 +84,6 @@ extern char btext[]; extern char etext[]; -void swi_vm(void *); void cpu_halt(void); void cpu_reset(void); diff --git a/sys/mips/include/md_var.h b/sys/mips/include/md_var.h index 3d8981456654..64cc2058f71b 100644 --- a/sys/mips/include/md_var.h +++ b/sys/mips/include/md_var.h @@ -78,9 +78,6 @@ void mips_postboot_fixup(void); void cpu_identify(void); void cpu_switch_set_userlocal(void) __asm(__STRING(cpu_switch_set_userlocal)); -extern int busdma_swi_pending; -void busdma_swi(void); - struct dumperinfo; struct minidumpstate; int cpu_minidumpsys(struct dumperinfo *, const struct minidumpstate *); diff --git a/sys/mips/mips/busdma_machdep.c b/sys/mips/mips/busdma_machdep.c index 80e57cd0414f..f408ca8f4260 100644 --- a/sys/mips/mips/busdma_machdep.c +++ b/sys/mips/mips/busdma_machdep.c @@ -117,8 +117,6 @@ struct sync_list { bus_size_t datacount; /* client data count */ }; -int busdma_swi_pending; - struct bounce_zone { STAILQ_ENTRY(bounce_zone) links; STAILQ_HEAD(bp_list, bounce_page) bounce_page_list; @@ -141,6 +139,7 @@ static struct mtx bounce_lock; static int total_bpages; static int busdma_zonecount; static STAILQ_HEAD(, bounce_zone) bounce_zone_list; +static void *busdma_ih; static SYSCTL_NODE(_hw, OID_AUTO, busdma, CTLFLAG_RD, 0, "Busdma parameters"); @@ -1485,6 +1484,7 @@ free_bounce_page(bus_dma_tag_t dmat, struct bounce_page *bpage) { struct bus_dmamap *map; struct bounce_zone *bz; + bool schedule_swi; bz = dmat->bounce_zone; bpage->datavaddr = 0; @@ -1499,6 +1499,7 @@ free_bounce_page(bus_dma_tag_t dmat, struct bounce_page *bpage) bpage->busaddr &= ~PAGE_MASK; } + schedule_swi = false; mtx_lock(&bounce_lock); STAILQ_INSERT_HEAD(&bz->bounce_page_list, bpage, links); bz->free_bpages++; @@ -1508,16 +1509,17 @@ free_bounce_page(bus_dma_tag_t dmat, struct bounce_page *bpage) STAILQ_REMOVE_HEAD(&bounce_map_waitinglist, links); STAILQ_INSERT_TAIL(&bounce_map_callbacklist, map, links); - busdma_swi_pending = 1; bz->total_deferred++; - swi_sched(vm_ih, 0); + schedule_swi = true; } } mtx_unlock(&bounce_lock); + if (schedule_swi) + swi_sched(busdma_ih, 0); } -void -busdma_swi(void) +static void +busdma_swi(void *dummy __unused) { bus_dma_tag_t dmat; struct bus_dmamap *map; @@ -1535,3 +1537,13 @@ busdma_swi(void) } mtx_unlock(&bounce_lock); } + +static void +start_busdma_swi(void *dummy __unused) +{ + if (swi_add(NULL, "busdma", busdma_swi, NULL, SWI_BUSDMA, INTR_MPSAFE, + &busdma_ih)) + panic("died while creating busdma swi ithread"); +} +SYSINIT(start_busdma_swi, SI_SUB_SOFTINTR, SI_ORDER_ANY, start_busdma_swi, + NULL); diff --git a/sys/mips/mips/vm_machdep.c b/sys/mips/mips/vm_machdep.c index a635bace4a09..eb313e2da8de 100644 --- a/sys/mips/mips/vm_machdep.c +++ b/sys/mips/mips/vm_machdep.c @@ -459,17 +459,6 @@ cpu_procctl(struct thread *td __unused, int idtype __unused, id_t id __unused, return (EINVAL); } -/* - * Software interrupt handler for queued VM system processing. - */ -void -swi_vm(void *dummy) -{ - - if (busdma_swi_pending) - busdma_swi(); -} - int cpu_set_user_tls(struct thread *td, void *tls_base) { |
