Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/sommerfeld_i386mp_1]: src/sys/arch/i386 Correct merge botches.
details: https://anonhg.NetBSD.org/src/rev/600869641dbe
branches: sommerfeld_i386mp_1
changeset: 482355:600869641dbe
user: sommerfeld <sommerfeld%NetBSD.org@localhost>
date: Sun Jan 07 22:59:23 2001 +0000
description:
Correct merge botches.
Post-merge kernel now boots multiuser.
diffstat:
sys/arch/i386/i386/autoconf.c | 9 ++++++---
sys/arch/i386/i386/cpu.c | 4 ++--
sys/arch/i386/i386/db_memrw.c | 6 +++---
sys/arch/i386/i386/gdt.c | 4 ++--
sys/arch/i386/i386/locore.s | 5 ++---
sys/arch/i386/i386/machdep.c | 24 +++++++++++++++---------
sys/arch/i386/i386/pmap.c | 39 ++-------------------------------------
sys/arch/i386/i386/svr4_sigcode.s | 24 +++++++++++++++++++++++-
sys/arch/i386/i386/trap.c | 4 ++--
sys/arch/i386/i386/vm_machdep.c | 4 ++--
sys/arch/i386/include/cpu.h | 4 ++--
sys/arch/i386/include/gdt.h | 6 +++---
12 files changed, 64 insertions(+), 69 deletions(-)
diffs (truncated from 382 to 300 lines):
diff -r 5efbc8736d5d -r 600869641dbe sys/arch/i386/i386/autoconf.c
--- a/sys/arch/i386/i386/autoconf.c Sun Jan 07 22:12:38 2001 +0000
+++ b/sys/arch/i386/i386/autoconf.c Sun Jan 07 22:59:23 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: autoconf.c,v 1.45.2.6 2001/01/07 22:12:40 sommerfeld Exp $ */
+/* $NetBSD: autoconf.c,v 1.45.2.7 2001/01/07 22:59:23 sommerfeld Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -66,6 +66,7 @@
#include <machine/pte.h>
#include <machine/cpu.h>
+#include <machine/gdt.h>
#include <machine/bootinfo.h>
#include "ioapic.h"
@@ -125,13 +126,15 @@
spl0();
- /* Set up proc0's TSS and LDT (after the FPU is configured). */
- i386_proc0_tss_ldt_init();
+ gdt_init();
#ifdef MULTIPROCESSOR
cpu_init_idle_pcbs();
#endif
+ /* Set up proc0's TSS and LDT (after the FPU is configured). */
+ i386_proc0_tss_ldt_init();
+
/* XXX Finish deferred buffer cache allocation. */
i386_bufinit();
}
diff -r 5efbc8736d5d -r 600869641dbe sys/arch/i386/i386/cpu.c
--- a/sys/arch/i386/i386/cpu.c Sun Jan 07 22:12:38 2001 +0000
+++ b/sys/arch/i386/i386/cpu.c Sun Jan 07 22:59:23 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.c,v 1.1.2.17 2001/01/04 04:44:32 thorpej Exp $ */
+/* $NetBSD: cpu.c,v 1.1.2.18 2001/01/07 22:59:23 sommerfeld Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -379,7 +379,7 @@
continue;
if ((ci->ci_flags & CPUF_PRESENT) == 0)
continue;
- i386_init_pcb_tss_ldt(ci->ci_idle_pcb);
+ i386_init_pcb_tss_ldt(ci);
}
}
diff -r 5efbc8736d5d -r 600869641dbe sys/arch/i386/i386/db_memrw.c
--- a/sys/arch/i386/i386/db_memrw.c Sun Jan 07 22:12:38 2001 +0000
+++ b/sys/arch/i386/i386/db_memrw.c Sun Jan 07 22:59:23 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: db_memrw.c,v 1.8.2.3 2001/01/07 22:12:40 sommerfeld Exp $ */
+/* $NetBSD: db_memrw.c,v 1.8.2.4 2001/01/07 22:59:23 sommerfeld Exp $ */
/*-
* Copyright (c) 1996, 2000 The NetBSD Foundation, Inc.
@@ -174,11 +174,11 @@
/*
* shoot down in case other cpu mistakenly caches page.
*/
- pmap_tlb_shootdown(pmap_kernel(), va, oldpte, &cpumask);
+ pmap_tlb_shootdown(pmap_kernel(), pgva, oldpte, &cpumask);
pmap_tlb_shootnow(cpumask);
}
#else
- pmap_update_pg(va);
+ pmap_update_pg(pgva);
#endif
} while (size != 0);
diff -r 5efbc8736d5d -r 600869641dbe sys/arch/i386/i386/gdt.c
--- a/sys/arch/i386/i386/gdt.c Sun Jan 07 22:12:38 2001 +0000
+++ b/sys/arch/i386/i386/gdt.c Sun Jan 07 22:59:23 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: gdt.c,v 1.22.2.3 2001/01/07 22:12:41 sommerfeld Exp $ */
+/* $NetBSD: gdt.c,v 1.22.2.4 2001/01/07 22:59:23 sommerfeld Exp $ */
/*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -300,7 +300,7 @@
int sel;
{
- gdt_put_slot(IDXSEL(tss));
+ gdt_put_slot(IDXSEL(sel));
}
void
diff -r 5efbc8736d5d -r 600869641dbe sys/arch/i386/i386/locore.s
--- a/sys/arch/i386/i386/locore.s Sun Jan 07 22:12:38 2001 +0000
+++ b/sys/arch/i386/i386/locore.s Sun Jan 07 22:59:23 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.s,v 1.215.2.18 2001/01/07 22:12:41 sommerfeld Exp $ */
+/* $NetBSD: locore.s,v 1.215.2.19 2001/01/07 22:59:23 sommerfeld Exp $ */
/*-
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -295,7 +295,7 @@
#else
.align 12
#endif
- .globl _C_LABEL(local_apic)
+ .globl _C_LABEL(local_apic), _C_LABEL(lapic_id)
_C_LABEL(local_apic):
.space LAPIC_ID
_C_LABEL(lapic_id):
@@ -2825,7 +2825,6 @@
int $3
#endif
1:
-#endif
#endif /* DIAGNOSTIC */
GET_CURPROC(%edx, %eax)
movl %esp,P_MD_REGS(%edx) # save pointer to frame
diff -r 5efbc8736d5d -r 600869641dbe sys/arch/i386/i386/machdep.c
--- a/sys/arch/i386/i386/machdep.c Sun Jan 07 22:12:38 2001 +0000
+++ b/sys/arch/i386/i386/machdep.c Sun Jan 07 22:59:23 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.376.2.13 2001/01/07 22:12:42 sommerfeld Exp $ */
+/* $NetBSD: machdep.c,v 1.376.2.14 2001/01/07 22:59:24 sommerfeld Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 2000 The NetBSD Foundation, Inc.
@@ -324,7 +324,9 @@
int sz, x;
vaddr_t minaddr, maxaddr;
vsize_t size;
+#if 0
char buf[160]; /* about 2 line */
+#endif
char pbuf[9];
#if NBIOSCALL > 0
extern int biostramp_image_size;
@@ -450,17 +452,25 @@
i386_proc0_tss_ldt_init()
{
struct pcb *pcb;
+ int x;
- gdt_init();
curpcb = pcb = &proc0.p_addr->u_pcb;
pcb->pcb_tss.tss_ss0 = GSEL(GDATA_SEL, SEL_KPL);
pcb->pcb_tss.tss_esp0 = (int)proc0.p_addr + USPACE - 16;
- i386_init_pcb_tss_ldt(pcb);
-
+ pcb->pcb_flags = 0;
+ pcb->pcb_tss.tss_ioopt =
+ ((caddr_t)pcb->pcb_iomap - (caddr_t)&pcb->pcb_tss) << 16;
+
+ for (x = 0; x < sizeof(pcb->pcb_iomap) / 4; x++)
+ pcb->pcb_iomap[x] = 0xffffffff;
+
+ pcb->pcb_ldt_sel = pmap_kernel()->pm_ldt_sel = GSEL(GLDT_SEL, SEL_KPL);
+ pcb->pcb_cr0 = rcr0();
+
proc0.p_md.md_regs = (struct trapframe *)pcb->pcb_tss.tss_esp0 - 1;
- proc0.p_md.md_tss_sel = mumble.ci_idle_tss_sel;
+ proc0.p_md.md_tss_sel = tss_alloc(pcb);
ltr(proc0.p_md.md_tss_sel);
lldt(pcb->pcb_ldt_sel);
@@ -872,13 +882,11 @@
: "eax", "ebx", "ecx", "edx");
}
->>>>>>> 1.426
void
identifycpu(ci)
struct cpu_info *ci;
{
extern char cpu_vendor[];
- extern int cpu_id;
extern int cpu_brand_id;
const char *name, *modifier, *vendorname, *brand = "";
int class = CPUCLASS_386, vendor, i, max;
@@ -2352,8 +2360,6 @@
ptoa(physmem), 2*1024*1024UL);
cngetc();
}
-
- identifycpu();
}
struct queue {
diff -r 5efbc8736d5d -r 600869641dbe sys/arch/i386/i386/pmap.c
--- a/sys/arch/i386/i386/pmap.c Sun Jan 07 22:12:38 2001 +0000
+++ b/sys/arch/i386/i386/pmap.c Sun Jan 07 22:59:23 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.83.2.25 2001/01/07 22:12:43 sommerfeld Exp $ */
+/* $NetBSD: pmap.c,v 1.83.2.26 2001/01/07 22:59:24 sommerfeld Exp $ */
/*
*
@@ -837,7 +837,6 @@
struct pmap *kpm;
vaddr_t kva;
pt_entry_t *pte;
- int first16q;
int i;
/*
@@ -1055,40 +1054,6 @@
0, pool_page_alloc_nointr, pool_page_free_nointr, M_VMPMAP);
/*
- * we must call uvm_page_physload() after we are done playing with
- * virtual_avail but before we call pmap_steal_memory. [i.e. here]
- * this call tells the VM system how much physical memory it
- * controls. If we have 16M of RAM or less, just put it all on
- * the default free list. Otherwise, put the first 16M of RAM
- * on a lower priority free list (so that all of the ISA DMA'able
- * memory won't be eaten up first-off).
- */
-
- if (avail_end <= (16 * 1024 * 1024))
- first16q = VM_FREELIST_DEFAULT;
- else
- first16q = VM_FREELIST_FIRST16;
-
- if (avail_start < hole_start) /* any free memory before the hole? */
- uvm_page_physload(atop(avail_start), atop(hole_start),
- atop(avail_start), atop(hole_start),
- first16q);
-
- if (first16q != VM_FREELIST_DEFAULT &&
- hole_end < 16 * 1024 * 1024) {
- uvm_page_physload(atop(hole_end), atop(16 * 1024 * 1024),
- atop(hole_end), atop(16 * 1024 * 1024),
- first16q);
- uvm_page_physload(atop(16 * 1024 * 1024), atop(avail_end),
- atop(16 * 1024 * 1024), atop(avail_end),
- VM_FREELIST_DEFAULT);
- } else {
- uvm_page_physload(atop(hole_end), atop(avail_end),
- atop(hole_end), atop(avail_end),
- VM_FREELIST_DEFAULT);
- }
-
- /*
* Initialize the TLB shootdown queues.
*/
@@ -2149,12 +2114,12 @@
pt_entry_t *zpte = PTESLEW(zero_pte, id);
caddr_t zerova = VASLEW(zerop, id);
boolean_t rv = TRUE;
+ int i, *ptr;
#ifdef DIAGNOSTIC
if (*zpte)
panic("pmap_zero_page_uncached: lock botch");
#endif
- int i, *ptr;
*zpte = (pa & PG_FRAME) | PG_V | PG_RW | /* map in */
((cpu_class != CPUCLASS_386) ? PG_N : 0);
diff -r 5efbc8736d5d -r 600869641dbe sys/arch/i386/i386/svr4_sigcode.s
--- a/sys/arch/i386/i386/svr4_sigcode.s Sun Jan 07 22:12:38 2001 +0000
+++ b/sys/arch/i386/i386/svr4_sigcode.s Sun Jan 07 22:59:23 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: svr4_sigcode.s,v 1.1.4.2 2001/01/07 22:12:44 sommerfeld Exp $ */
+/* $NetBSD: svr4_sigcode.s,v 1.1.4.3 2001/01/07 22:59:25 sommerfeld Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -76,6 +76,7 @@
#if defined(_KERNEL) && !defined(_LKM)
#include "opt_vm86.h"
+#include "opt_multiprocessor.h"
#endif
#include "assym.h"
@@ -140,6 +141,27 @@
addl $8,%esp ; \
iret
+#ifdef MULTIPROCESSOR
+#define GET_CPUINFO(reg) \
+ movzbl _C_LABEL(lapic_id)+3,reg ; \
+ movl _C_LABEL(cpu_info)(,reg,4),reg
+
+#define CHECK_ASTPENDING(treg) \
+ GET_CPUINFO(treg) ;\
+ cmpl $0,CPU_INFO_ASTPENDING(treg)
+
+#define CLEAR_ASTPENDING(cireg) \
+ movl $0,CPU_INFO_ASTPENDING(cireg)
+
+#else
+
+#define CHECK_ASTPENDING(treg) cmpb $0,_C_LABEL(astpending)
Home |
Main Index |
Thread Index |
Old Index