Changeset View
Changeset View
Standalone View
Standalone View
sys/compat/linuxkpi/common/src/linux_compat.c
Show First 20 Lines • Show All 2,458 Lines • ▼ Show 20 Lines | list_sort(void *priv, struct list_head *head, int (*cmp)(void *priv, | ||||
thunk.priv = priv; | thunk.priv = priv; | ||||
qsort_r(ar, count, sizeof(struct list_head *), &thunk, linux_le_cmp); | qsort_r(ar, count, sizeof(struct list_head *), &thunk, linux_le_cmp); | ||||
INIT_LIST_HEAD(head); | INIT_LIST_HEAD(head); | ||||
for (i = 0; i < count; i++) | for (i = 0; i < count; i++) | ||||
list_add_tail(ar[i], head); | list_add_tail(ar[i], head); | ||||
free(ar, M_KMALLOC); | free(ar, M_KMALLOC); | ||||
} | } | ||||
void | |||||
lkpi_irq_release(struct device *dev, struct irq_ent *irqe) | |||||
{ | |||||
if (irqe->tag != NULL) | |||||
bus_teardown_intr(dev->bsddev, irqe->res, irqe->tag); | |||||
if (irqe->res != NULL) | |||||
bus_release_resource(dev->bsddev, SYS_RES_IRQ, | |||||
rman_get_rid(irqe->res), irqe->res); | |||||
list_del(&irqe->links); | |||||
} | |||||
void | |||||
lkpi_devm_irq_release(struct device *dev, void *p) | |||||
{ | |||||
struct irq_ent *irqe; | |||||
if (dev == NULL || p == NULL) | |||||
return; | |||||
irqe = p; | |||||
lkpi_irq_release(dev, irqe); | |||||
} | |||||
void | |||||
linux_irq_handler(void *ent) | |||||
{ | |||||
struct irq_ent *irqe; | |||||
if (linux_set_current_flags(curthread, M_NOWAIT)) | |||||
return; | |||||
irqe = ent; | |||||
if (irqe->handler(irqe->irq, irqe->arg) == IRQ_WAKE_THREAD && | |||||
irqe->thread_handler != NULL) { | |||||
THREAD_SLEEPING_OK(); | |||||
irqe->thread_handler(irqe->irq, irqe->arg); | |||||
THREAD_NO_SLEEPING(); | |||||
} | |||||
} | |||||
#if defined(__i386__) || defined(__amd64__) | #if defined(__i386__) || defined(__amd64__) | ||||
int | int | ||||
linux_wbinvd_on_all_cpus(void) | linux_wbinvd_on_all_cpus(void) | ||||
{ | { | ||||
pmap_invalidate_cache(); | pmap_invalidate_cache(); | ||||
return (0); | return (0); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 176 Lines • Show Last 20 Lines |