diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2014-12-02 18:13:11 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2014-12-02 18:13:11 +0000 |
commit | c3e37ac3749d7898c3631b92739eec375ff62794 (patch) | |
tree | 46e97382daab8b9aee216326c59fb73a040e9190 /sys/arch/amd64 | |
parent | 0224e60cd07513ae58583f5a62064c8f112866b6 (diff) |
delete all the simplelocks. ok deraadt
Diffstat (limited to 'sys/arch/amd64')
-rw-r--r-- | sys/arch/amd64/amd64/cpu.c | 4 | ||||
-rw-r--r-- | sys/arch/amd64/amd64/intr.c | 22 | ||||
-rw-r--r-- | sys/arch/amd64/amd64/machdep.c | 8 | ||||
-rw-r--r-- | sys/arch/amd64/include/cpu.h | 3 | ||||
-rw-r--r-- | sys/arch/amd64/include/pmap.h | 4 |
5 files changed, 6 insertions, 35 deletions
diff --git a/sys/arch/amd64/amd64/cpu.c b/sys/arch/amd64/amd64/cpu.c index e27de4ba448..2d7619fc2e3 100644 --- a/sys/arch/amd64/amd64/cpu.c +++ b/sys/arch/amd64/amd64/cpu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.c,v 1.70 2014/11/23 00:25:05 guenther Exp $ */ +/* $OpenBSD: cpu.c,v 1.71 2014/12/02 18:13:10 tedu Exp $ */ /* $NetBSD: cpu.c,v 1.1 2003/04/26 18:39:26 fvdl Exp $ */ /*- @@ -444,8 +444,6 @@ cpu_attach(struct device *parent, struct device *self, void *aux) #endif ci->ci_func = caa->cpu_func; - simple_lock_init(&ci->ci_slock); - #if defined(MULTIPROCESSOR) /* * Allocate UPAGES contiguous pages for the idle PCB and stack. diff --git a/sys/arch/amd64/amd64/intr.c b/sys/arch/amd64/amd64/intr.c index 10ee22b1ee0..8f4d4dddcdf 100644 --- a/sys/arch/amd64/amd64/intr.c +++ b/sys/arch/amd64/amd64/intr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: intr.c,v 1.38 2014/09/14 14:17:23 jsg Exp $ */ +/* $OpenBSD: intr.c,v 1.39 2014/12/02 18:13:10 tedu Exp $ */ /* $NetBSD: intr.c,v 1.3 2003/03/03 22:16:20 fvdl Exp $ */ /* @@ -180,7 +180,6 @@ intr_allocate_slot_cpu(struct cpu_info *ci, struct pic *pic, int pin, start = CPU_IS_PRIMARY(ci) ? NUM_LEGACY_IRQS : 0; slot = -1; - simple_lock(&ci->ci_slock); for (i = 0; i < start; i++) { isp = ci->ci_isources[i]; if (isp != NULL && isp->is_pic == pic && isp->is_pin == pin) { @@ -201,7 +200,6 @@ intr_allocate_slot_cpu(struct cpu_info *ci, struct pic *pic, int pin, } } if (slot == -1) { - simple_unlock(&ci->ci_slock); return EBUSY; } @@ -210,14 +208,12 @@ intr_allocate_slot_cpu(struct cpu_info *ci, struct pic *pic, int pin, isp = malloc(sizeof (struct intrsource), M_DEVBUF, M_NOWAIT|M_ZERO); if (isp == NULL) { - simple_unlock(&ci->ci_slock); return ENOMEM; } snprintf(isp->is_evname, sizeof (isp->is_evname), "pin %d", pin); ci->ci_isources[slot] = isp; } - simple_unlock(&ci->ci_slock); *index = slot; return 0; @@ -263,9 +259,7 @@ intr_allocate_slot(struct pic *pic, int legacy_irq, int pin, int level, snprintf(isp->is_evname, sizeof (isp->is_evname), "pin %d", pin); - simple_lock(&ci->ci_slock); ci->ci_isources[slot] = isp; - simple_unlock(&ci->ci_slock); } else { if (isp->is_pic != pic || isp->is_pin != pin) { if (pic == &i8259_pic) @@ -314,10 +308,8 @@ other: found: idtvec = idt_vec_alloc(APIC_LEVEL(level), IDT_INTR_HIGH); if (idtvec == 0) { - simple_lock(&ci->ci_slock); free(ci->ci_isources[slot], M_DEVBUF, 0); ci->ci_isources[slot] = NULL; - simple_unlock(&ci->ci_slock); return EBUSY; } } @@ -383,8 +375,6 @@ intr_establish(int legacy_irq, struct pic *pic, int pin, int type, int level, return NULL; } - simple_lock(&ci->ci_slock); - source->is_pin = pin; source->is_pic = pic; @@ -400,7 +390,6 @@ intr_establish(int legacy_irq, struct pic *pic, int pin, int type, int level, break; case IST_PULSE: if (type != IST_NONE) { - simple_unlock(&ci->ci_slock); printf("intr_establish: pic %s pin %d: can't share " "type %d with %d\n", pic->pic_name, pin, source->is_type, type); @@ -409,7 +398,6 @@ intr_establish(int legacy_irq, struct pic *pic, int pin, int type, int level, } break; default: - simple_unlock(&ci->ci_slock); panic("intr_establish: bad intr type %d for pic %s pin %d", source->is_type, pic->pic_dev.dv_xname, pin); } @@ -441,8 +429,6 @@ intr_establish(int legacy_irq, struct pic *pic, int pin, int type, int level, intr_calculatemasks(ci); - simple_unlock(&ci->ci_slock); - if (ci->ci_isources[slot]->is_resume == NULL || source->is_idtvec != idt_vec) { if (source->is_idtvec != 0 && source->is_idtvec != idt_vec) @@ -487,7 +473,6 @@ intr_disestablish(struct intrhand *ih) source = ci->ci_isources[ih->ih_slot]; idtvec = source->is_idtvec; - simple_lock(&ci->ci_slock); pic->pic_hwmask(pic, ih->ih_pin); x86_atomic_clearbits_u64(&ci->ci_ipending, (1UL << ih->ih_slot)); @@ -498,7 +483,6 @@ intr_disestablish(struct intrhand *ih) p = &q->ih_next) ; if (q == NULL) { - simple_unlock(&ci->ci_slock); panic("intr_disestablish: handler not registered"); } @@ -525,8 +509,6 @@ intr_disestablish(struct intrhand *ih) evcount_detach(&ih->ih_count); free(ih, M_DEVBUF, 0); - - simple_unlock(&ci->ci_slock); } int @@ -664,7 +646,6 @@ intr_printconfig(void) for (i = 0; i < NIPL; i++) printf("IPL %d mask %lx unmask %lx\n", i, (u_long)ci->ci_imask[i], (u_long)ci->ci_iunmask[i]); - simple_lock(&ci->ci_slock); for (i = 0; i < MAX_INTR_SOURCES; i++) { isp = ci->ci_isources[i]; if (isp == NULL) @@ -678,7 +659,6 @@ intr_printconfig(void) ih->ih_fun, ih->ih_level); } - simple_unlock(&ci->ci_slock); } #endif } diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c index f50d2e92ab8..3853c0f554d 100644 --- a/sys/arch/amd64/amd64/machdep.c +++ b/sys/arch/amd64/amd64/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.198 2014/11/22 18:55:20 deraadt Exp $ */ +/* $OpenBSD: machdep.c,v 1.199 2014/12/02 18:13:10 tedu Exp $ */ /* $NetBSD: machdep.c,v 1.3 2003/05/07 22:58:18 fvdl Exp $ */ /*- @@ -1067,7 +1067,6 @@ setregs(struct proc *p, struct exec_package *pack, u_long stack, struct gate_descriptor *idt; char idt_allocmap[NIDT]; -struct simplelock idt_lock; char *gdtstore; extern struct user *proc0paddr; @@ -1720,15 +1719,12 @@ idt_vec_alloc(int low, int high) { int vec; - simple_lock(&idt_lock); for (vec = low; vec <= high; vec++) { if (idt_allocmap[vec] == 0) { idt_allocmap[vec] = 1; - simple_unlock(&idt_lock); return vec; } } - simple_unlock(&idt_lock); return 0; } @@ -1746,10 +1742,8 @@ idt_vec_set(int vec, void (*function)(void)) void idt_vec_free(int vec) { - simple_lock(&idt_lock); unsetgate(&idt[vec]); idt_allocmap[vec] = 0; - simple_unlock(&idt_lock); } #ifdef DIAGNOSTIC diff --git a/sys/arch/amd64/include/cpu.h b/sys/arch/amd64/include/cpu.h index 06983dcbc75..bd654f17dce 100644 --- a/sys/arch/amd64/include/cpu.h +++ b/sys/arch/amd64/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.86 2014/09/12 09:52:45 kettenis Exp $ */ +/* $OpenBSD: cpu.h,v 1.87 2014/12/02 18:13:10 tedu Exp $ */ /* $NetBSD: cpu.h,v 1.1 2003/04/26 18:39:39 fvdl Exp $ */ /*- @@ -69,7 +69,6 @@ struct cpu_info { struct cpu_info *ci_next; struct proc *ci_curproc; - struct simplelock ci_slock; u_int ci_cpuid; u_int ci_apicid; u_int32_t ci_randseed; diff --git a/sys/arch/amd64/include/pmap.h b/sys/arch/amd64/include/pmap.h index 5c3a22b832a..ef9ccceb1ce 100644 --- a/sys/arch/amd64/include/pmap.h +++ b/sys/arch/amd64/include/pmap.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.h,v 1.48 2014/11/16 12:30:56 deraadt Exp $ */ +/* $OpenBSD: pmap.h,v 1.49 2014/12/02 18:13:10 tedu Exp $ */ /* $NetBSD: pmap.h,v 1.1 2003/04/26 18:39:46 fvdl Exp $ */ /* @@ -282,7 +282,7 @@ LIST_HEAD(pmap_head, pmap); /* struct pmap_head: head of a pmap list */ /* * the pmap structure * - * note that the pm_obj contains the simple_lock, the reference count, + * note that the pm_obj contains the reference count, * page list, and number of PTPs within the pmap. * * pm_lock is the same as the spinlock for vm object 0. Changes to |