summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2014-07-04 09:48:39 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2014-07-04 09:48:39 +0000
commitba689310060ce0abe3599f5307ea3e19c4fd1919 (patch)
treeebe829e3dafb43cf2b723d1fbc114b82c5b68af7 /sys
parentc80b00e08f564ce1a71a29e37053b5094237b0de (diff)
Create the ioport_ex and iomem_ex extents after we've set up the gdt gates
such that curcpu() works. The extent code creates pools, and if we want to add any sort of locking to the pool code we need that working. Found out the hard way by guenther@. ok dlg@, guenther@
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/i386/i386/machdep.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/sys/arch/i386/i386/machdep.c b/sys/arch/i386/i386/machdep.c
index eb5308023a7..59f08fa2f7b 100644
--- a/sys/arch/i386/i386/machdep.c
+++ b/sys/arch/i386/i386/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.540 2014/07/03 21:15:28 matthew Exp $ */
+/* $OpenBSD: machdep.c,v 1.541 2014/07/04 09:48:38 kettenis Exp $ */
/* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */
/*-
@@ -3061,24 +3061,6 @@ init386(paddr_t first_avail)
cpu_info_primary.ci_self = &cpu_info_primary;
cpu_info_primary.ci_curpcb = &proc0.p_addr->u_pcb;
- /*
- * Initialize the I/O port and I/O mem extent maps.
- * Note: we don't have to check the return value since
- * creation of a fixed extent map will never fail (since
- * descriptor storage has already been allocated).
- *
- * N.B. The iomem extent manages _all_ physical addresses
- * on the machine. When the amount of RAM is found, the two
- * extents of RAM are allocated from the map (0 -> ISA hole
- * and end of ISA hole -> end of RAM).
- */
- ioport_ex = extent_create("ioport", 0x0, 0xffff, M_DEVBUF,
- (caddr_t)ioport_ex_storage, sizeof(ioport_ex_storage),
- EX_NOCOALESCE|EX_NOWAIT);
- iomem_ex = extent_create("iomem", 0x0, 0xffffffff, M_DEVBUF,
- (caddr_t)iomem_ex_storage, sizeof(iomem_ex_storage),
- EX_NOCOALESCE|EX_NOWAIT);
-
/* make bootstrap gdt gates and memory segments */
setsegment(&gdt[GCODE_SEL].sd, 0, 0xfffff, SDT_MEMERA, SEL_KPL, 1, 1);
setsegment(&gdt[GICODE_SEL].sd, 0, 0xfffff, SDT_MEMERA, SEL_KPL, 1, 1);
@@ -3128,6 +3110,24 @@ init386(paddr_t first_avail)
setregion(&region, idt, sizeof(idt_region) - 1);
lidt(&region);
+ /*
+ * Initialize the I/O port and I/O mem extent maps.
+ * Note: we don't have to check the return value since
+ * creation of a fixed extent map will never fail (since
+ * descriptor storage has already been allocated).
+ *
+ * N.B. The iomem extent manages _all_ physical addresses
+ * on the machine. When the amount of RAM is found, the two
+ * extents of RAM are allocated from the map (0 -> ISA hole
+ * and end of ISA hole -> end of RAM).
+ */
+ ioport_ex = extent_create("ioport", 0x0, 0xffff, M_DEVBUF,
+ (caddr_t)ioport_ex_storage, sizeof(ioport_ex_storage),
+ EX_NOCOALESCE|EX_NOWAIT);
+ iomem_ex = extent_create("iomem", 0x0, 0xffffffff, M_DEVBUF,
+ (caddr_t)iomem_ex_storage, sizeof(iomem_ex_storage),
+ EX_NOCOALESCE|EX_NOWAIT);
+
#if NISA > 0
isa_defaultirq();
#endif