Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/kern_intr.c
Show First 20 Lines • Show All 433 Lines • ▼ Show 20 Lines | |||||
int | int | ||||
intr_getaffinity(int irq, int mode, void *m) | intr_getaffinity(int irq, int mode, void *m) | ||||
{ | { | ||||
struct intr_event *ie; | struct intr_event *ie; | ||||
struct thread *td; | struct thread *td; | ||||
struct proc *p; | struct proc *p; | ||||
cpuset_t *mask; | cpuset_t *mask; | ||||
struct cpuset *set; | |||||
lwpid_t id; | lwpid_t id; | ||||
int error; | int error; | ||||
mask = m; | mask = m; | ||||
ie = intr_lookup(irq); | ie = intr_lookup(irq); | ||||
if (ie == NULL) | if (ie == NULL) | ||||
return (ESRCH); | return (ESRCH); | ||||
Show All 12 Lines | intr_getaffinity(int irq, int mode, void *m) | ||||
case CPU_WHICH_ITHREAD: | case CPU_WHICH_ITHREAD: | ||||
mtx_lock(&ie->ie_lock); | mtx_lock(&ie->ie_lock); | ||||
if (ie->ie_thread == NULL) { | if (ie->ie_thread == NULL) { | ||||
mtx_unlock(&ie->ie_lock); | mtx_unlock(&ie->ie_lock); | ||||
CPU_COPY(cpuset_root, mask); | CPU_COPY(cpuset_root, mask); | ||||
} else { | } else { | ||||
id = ie->ie_thread->it_thread->td_tid; | id = ie->ie_thread->it_thread->td_tid; | ||||
mtx_unlock(&ie->ie_lock); | mtx_unlock(&ie->ie_lock); | ||||
error = cpuset_which(CPU_WHICH_TID, id, &p, &td, NULL); | error = cpuset_which(CPU_WHICH_TID, id, &p, &td, &set); | ||||
if (error != 0) | if (error != 0) | ||||
return (error); | return (error); | ||||
CPU_COPY(&td->td_cpuset->cs_mask, mask); | CPU_COPY(&td->td_cpuset->cs_mask, mask); | ||||
PROC_UNLOCK(p); | PROC_UNLOCK(p); | ||||
} | } | ||||
break; | |||||
jhb: Oof at both of these bugs. | |||||
Not Done Inline ActionsMeh.. it is code that was never run. We all have bugs. gallatin: Meh.. it is code that was never run. We all have bugs. | |||||
default: | default: | ||||
return (EINVAL); | return (EINVAL); | ||||
} | } | ||||
return (0); | return (0); | ||||
} | } | ||||
int | int | ||||
intr_event_destroy(struct intr_event *ie) | intr_event_destroy(struct intr_event *ie) | ||||
▲ Show 20 Lines • Show All 1,525 Lines • Show Last 20 Lines |
Oof at both of these bugs.