mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-10-17 06:50:37 +08:00
Update to FreeBSD stable/12 2019-06-26
Git mirror commit aa83598855d14cdbf7aef6b05d0617e90f87ca2f.
This commit is contained in:
@@ -69,6 +69,8 @@ struct gtaskqueue_busy {
|
||||
|
||||
static struct gtask * const TB_DRAIN_WAITER = (struct gtask *)0x1;
|
||||
|
||||
typedef void (*gtaskqueue_enqueue_fn)(void *context);
|
||||
|
||||
struct gtaskqueue {
|
||||
STAILQ_HEAD(, gtask) tq_queue;
|
||||
gtaskqueue_enqueue_fn tq_enqueue;
|
||||
@@ -697,7 +699,7 @@ taskqgroup_find(struct taskqgroup *qgroup, void *uniq)
|
||||
}
|
||||
}
|
||||
if (idx == -1)
|
||||
panic("taskqgroup_find: Failed to pick a qid.");
|
||||
panic("%s: failed to pick a qid.", __func__);
|
||||
|
||||
return (idx);
|
||||
}
|
||||
@@ -759,7 +761,8 @@ taskqgroup_attach(struct taskqgroup *qgroup, struct grouptask *gtask,
|
||||
mtx_unlock(&qgroup->tqg_lock);
|
||||
error = intr_setaffinity(irq, CPU_WHICH_IRQ, &mask);
|
||||
if (error)
|
||||
printf("%s: setaffinity failed for %s: %d\n", __func__, gtask->gt_name, error);
|
||||
printf("%s: binding interrupt failed for %s: %d\n",
|
||||
__func__, gtask->gt_name, error);
|
||||
} else
|
||||
#else /* __rtems__ */
|
||||
BSD_ASSERT(irq == -1);
|
||||
@@ -789,16 +792,15 @@ taskqgroup_attach_deferred(struct taskqgroup *qgroup, struct grouptask *gtask)
|
||||
error = intr_setaffinity(gtask->gt_irq, CPU_WHICH_IRQ, &mask);
|
||||
mtx_lock(&qgroup->tqg_lock);
|
||||
if (error)
|
||||
printf("%s: %s setaffinity failed: %d\n", __func__, gtask->gt_name, error);
|
||||
printf("%s: binding interrupt failed for %s: %d\n",
|
||||
__func__, gtask->gt_name, error);
|
||||
|
||||
}
|
||||
#else /* __rtems__ */
|
||||
BSD_ASSERT(gtask->gt_irq == -1);
|
||||
#endif /* __rtems__ */
|
||||
qgroup->tqg_queue[qid].tgc_cnt++;
|
||||
|
||||
LIST_INSERT_HEAD(&qgroup->tqg_queue[qid].tgc_tasks, gtask,
|
||||
gt_list);
|
||||
LIST_INSERT_HEAD(&qgroup->tqg_queue[qid].tgc_tasks, gtask, gt_list);
|
||||
MPASS(qgroup->tqg_queue[qid].tgc_taskq != NULL);
|
||||
gtask->gt_taskqueue = qgroup->tqg_queue[qid].tgc_taskq;
|
||||
mtx_unlock(&qgroup->tqg_lock);
|
||||
@@ -806,7 +808,7 @@ taskqgroup_attach_deferred(struct taskqgroup *qgroup, struct grouptask *gtask)
|
||||
|
||||
int
|
||||
taskqgroup_attach_cpu(struct taskqgroup *qgroup, struct grouptask *gtask,
|
||||
void *uniq, int cpu, int irq, const char *name)
|
||||
void *uniq, int cpu, int irq, const char *name)
|
||||
{
|
||||
#ifndef __rtems__
|
||||
cpuset_t mask;
|
||||
@@ -848,7 +850,8 @@ taskqgroup_attach_cpu(struct taskqgroup *qgroup, struct grouptask *gtask,
|
||||
if (irq != -1 && tqg_smp_started) {
|
||||
error = intr_setaffinity(irq, CPU_WHICH_IRQ, &mask);
|
||||
if (error)
|
||||
printf("%s: setaffinity failed: %d\n", __func__, error);
|
||||
printf("%s: binding interrupt failed for %s: %d\n",
|
||||
__func__, gtask->gt_name, error);
|
||||
}
|
||||
#else /* __rtems__ */
|
||||
BSD_ASSERT(irq == -1);
|
||||
@@ -894,7 +897,8 @@ taskqgroup_attach_cpu_deferred(struct taskqgroup *qgroup, struct grouptask *gtas
|
||||
if (irq != -1) {
|
||||
error = intr_setaffinity(irq, CPU_WHICH_IRQ, &mask);
|
||||
if (error)
|
||||
printf("%s: setaffinity failed: %d\n", __func__, error);
|
||||
printf("%s: binding interrupt failed for %s: %d\n",
|
||||
__func__, gtask->gt_name, error);
|
||||
}
|
||||
#else /* __rtems__ */
|
||||
BSD_ASSERT(irq == -1);
|
||||
@@ -913,7 +917,7 @@ taskqgroup_detach(struct taskqgroup *qgroup, struct grouptask *gtask)
|
||||
if (qgroup->tqg_queue[i].tgc_taskq == gtask->gt_taskqueue)
|
||||
break;
|
||||
if (i == qgroup->tqg_cnt)
|
||||
panic("taskqgroup_detach: task %s not in group\n", gtask->gt_name);
|
||||
panic("%s: task %s not in group", __func__, gtask->gt_name);
|
||||
qgroup->tqg_queue[i].tgc_cnt--;
|
||||
LIST_REMOVE(gtask, gt_list);
|
||||
mtx_unlock(&qgroup->tqg_lock);
|
||||
@@ -941,8 +945,7 @@ taskqgroup_binder(void *ctx)
|
||||
thread_unlock(curthread);
|
||||
|
||||
if (error)
|
||||
printf("%s: setaffinity failed: %d\n", __func__,
|
||||
error);
|
||||
printf("%s: binding curthread failed: %d\n", __func__, error);
|
||||
#else /* __rtems__ */
|
||||
sc = rtems_task_set_affinity(RTEMS_SELF, sizeof(mask), &mask);
|
||||
if (sc != RTEMS_SUCCESSFUL)
|
||||
@@ -1115,7 +1118,7 @@ taskqgroup_destroy(struct taskqgroup *qgroup)
|
||||
|
||||
void
|
||||
taskqgroup_config_gtask_init(void *ctx, struct grouptask *gtask, gtask_fn_t *fn,
|
||||
const char *name)
|
||||
const char *name)
|
||||
{
|
||||
|
||||
GROUPTASK_INIT(gtask, 0, fn, ctx);
|
||||
@@ -1125,5 +1128,6 @@ taskqgroup_config_gtask_init(void *ctx, struct grouptask *gtask, gtask_fn_t *fn,
|
||||
void
|
||||
taskqgroup_config_gtask_deinit(struct grouptask *gtask)
|
||||
{
|
||||
|
||||
taskqgroup_detach(qgroup_config, gtask);
|
||||
}
|
||||
|
Reference in New Issue
Block a user