machdep.c (45270) | machdep.c (45783) |
---|---|
1/*- 2 * Copyright (c) 1992 Terrence R. Lambert. 3 * Copyright (c) 1982, 1987, 1990 The Regents of the University of California. 4 * All rights reserved. 5 * 6 * This code is derived from software contributed to Berkeley by 7 * William Jolitz. 8 * --- 21 unchanged lines hidden (view full) --- 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 35 * SUCH DAMAGE. 36 * 37 * from: @(#)machdep.c 7.4 (Berkeley) 6/3/91 | 1/*- 2 * Copyright (c) 1992 Terrence R. Lambert. 3 * Copyright (c) 1982, 1987, 1990 The Regents of the University of California. 4 * All rights reserved. 5 * 6 * This code is derived from software contributed to Berkeley by 7 * William Jolitz. 8 * --- 21 unchanged lines hidden (view full) --- 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 35 * SUCH DAMAGE. 36 * 37 * from: @(#)machdep.c 7.4 (Berkeley) 6/3/91 |
38 * $Id: machdep.c,v 1.110 1999/03/06 09:43:01 kato Exp $ | 38 * $Id: machdep.c,v 1.111 1999/04/03 22:20:02 jdp Exp $ |
39 */ 40 41#include "apm.h" 42#include "ether.h" 43#include "npx.h" 44#include "opt_atalk.h" 45#include "opt_cpu.h" 46#include "opt_ddb.h" --- 19 unchanged lines hidden (view full) --- 66#include <sys/reboot.h> 67#include <sys/callout.h> 68#include <sys/malloc.h> 69#include <sys/mbuf.h> 70#include <sys/msgbuf.h> 71#include <sys/sysent.h> 72#include <sys/sysctl.h> 73#include <sys/vmmeter.h> | 39 */ 40 41#include "apm.h" 42#include "ether.h" 43#include "npx.h" 44#include "opt_atalk.h" 45#include "opt_cpu.h" 46#include "opt_ddb.h" --- 19 unchanged lines hidden (view full) --- 66#include <sys/reboot.h> 67#include <sys/callout.h> 68#include <sys/malloc.h> 69#include <sys/mbuf.h> 70#include <sys/msgbuf.h> 71#include <sys/sysent.h> 72#include <sys/sysctl.h> 73#include <sys/vmmeter.h> |
74#include <sys/bus.h> |
|
74 75#ifdef SYSVSHM 76#include <sys/shm.h> 77#endif 78 79#ifdef SYSVMSG 80#include <sys/msg.h> 81#endif --- 38 unchanged lines hidden (view full) --- 120#include <machine/pcb_ext.h> /* pcb.h included via sys/user.h */ 121#ifdef SMP 122#include <machine/smp.h> 123#endif 124#ifdef PERFMON 125#include <machine/perfmon.h> 126#endif 127 | 75 76#ifdef SYSVSHM 77#include <sys/shm.h> 78#endif 79 80#ifdef SYSVMSG 81#include <sys/msg.h> 82#endif --- 38 unchanged lines hidden (view full) --- 121#include <machine/pcb_ext.h> /* pcb.h included via sys/user.h */ 122#ifdef SMP 123#include <machine/smp.h> 124#endif 125#ifdef PERFMON 126#include <machine/perfmon.h> 127#endif 128 |
129#ifdef OLD_BUS_ARCH |
|
128#include <i386/isa/isa_device.h> | 130#include <i386/isa/isa_device.h> |
131#endif |
|
129#include <i386/isa/intr_machdep.h> 130#ifdef PC98 131#include <pc98/pc98/pc98_machdep.h> 132#include <pc98/pc98/pc98.h> 133#else 134#ifndef VM86 135#include <i386/isa/rtc.h> 136#endif --- 11 unchanged lines hidden (view full) --- 148extern void initializecpu(void); 149 150static void cpu_startup __P((void *)); 151SYSINIT(cpu, SI_SUB_CPU, SI_ORDER_FIRST, cpu_startup, NULL) 152 153static MALLOC_DEFINE(M_MBUF, "mbuf", "mbuf"); 154 155#ifdef PC98 | 132#include <i386/isa/intr_machdep.h> 133#ifdef PC98 134#include <pc98/pc98/pc98_machdep.h> 135#include <pc98/pc98/pc98.h> 136#else 137#ifndef VM86 138#include <i386/isa/rtc.h> 139#endif --- 11 unchanged lines hidden (view full) --- 151extern void initializecpu(void); 152 153static void cpu_startup __P((void *)); 154SYSINIT(cpu, SI_SUB_CPU, SI_ORDER_FIRST, cpu_startup, NULL) 155 156static MALLOC_DEFINE(M_MBUF, "mbuf", "mbuf"); 157 158#ifdef PC98 |
156int need_pre_dma_flush; /* If 1, use wbinvd befor DMA transfer. */ | 159int need_pre_dma_flush; /* If 1, use wbinvd befor DMA transfer. */ |
157int need_post_dma_flush; /* If 1, use invd after DMA transfer. */ 158#endif 159 160int _udatasel, _ucodesel; 161u_int atdevbase; 162 163#if defined(SWTCH_OPTIM_STATS) 164extern int swtch_optim_stats; 165SYSCTL_INT(_debug, OID_AUTO, swtch_optim_stats, 166 CTLFLAG_RD, &swtch_optim_stats, 0, ""); 167SYSCTL_INT(_debug, OID_AUTO, tlb_flush_count, 168 CTLFLAG_RD, &tlb_flush_count, 0, ""); 169#endif 170 171#ifdef PC98 | 160int need_post_dma_flush; /* If 1, use invd after DMA transfer. */ 161#endif 162 163int _udatasel, _ucodesel; 164u_int atdevbase; 165 166#if defined(SWTCH_OPTIM_STATS) 167extern int swtch_optim_stats; 168SYSCTL_INT(_debug, OID_AUTO, swtch_optim_stats, 169 CTLFLAG_RD, &swtch_optim_stats, 0, ""); 170SYSCTL_INT(_debug, OID_AUTO, tlb_flush_count, 171 CTLFLAG_RD, &tlb_flush_count, 0, ""); 172#endif 173 174#ifdef PC98 |
172int ispc98 = 1; | 175static int ispc98 = 1; |
173#else | 176#else |
174int ispc98 = 0; | 177static int ispc98 = 0; |
175#endif 176SYSCTL_INT(_machdep, OID_AUTO, ispc98, CTLFLAG_RD, &ispc98, 0, ""); 177 178int physmem = 0; 179int cold = 1; 180 181static int 182sysctl_hw_physmem SYSCTL_HANDLER_ARGS --- 662 unchanged lines hidden (view full) --- 845 regs->tf_eip = entry; 846 regs->tf_esp = stack; 847 regs->tf_eflags = PSL_USER | (regs->tf_eflags & PSL_T); 848 regs->tf_ss = _udatasel; 849 regs->tf_ds = _udatasel; 850 regs->tf_es = _udatasel; 851 regs->tf_cs = _ucodesel; 852 | 178#endif 179SYSCTL_INT(_machdep, OID_AUTO, ispc98, CTLFLAG_RD, &ispc98, 0, ""); 180 181int physmem = 0; 182int cold = 1; 183 184static int 185sysctl_hw_physmem SYSCTL_HANDLER_ARGS --- 662 unchanged lines hidden (view full) --- 848 regs->tf_eip = entry; 849 regs->tf_esp = stack; 850 regs->tf_eflags = PSL_USER | (regs->tf_eflags & PSL_T); 851 regs->tf_ss = _udatasel; 852 regs->tf_ds = _udatasel; 853 regs->tf_es = _udatasel; 854 regs->tf_cs = _ucodesel; 855 |
856 /* PS_STRINGS value for BSD/OS binaries. It is 0 for non-BSD/OS. */ 857 regs->tf_ebx = ps_strings; 858 |
|
853 /* reset %fs and %gs as well */ 854 pcb->pcb_fs = _udatasel; 855 pcb->pcb_gs = _udatasel; 856 if (pcb == curpcb) { 857 __asm("movw %w0,%%fs" : : "r" (_udatasel)); 858 __asm("movw %w0,%%gs" : : "r" (_udatasel)); 859 } 860 --- 308 unchanged lines hidden (view full) --- 1169void 1170init386(first) 1171 int first; 1172{ 1173 int x; 1174 unsigned biosbasemem, biosextmem; 1175 struct gate_descriptor *gdp; 1176 int gsel_tss; | 859 /* reset %fs and %gs as well */ 860 pcb->pcb_fs = _udatasel; 861 pcb->pcb_gs = _udatasel; 862 if (pcb == curpcb) { 863 __asm("movw %w0,%%fs" : : "r" (_udatasel)); 864 __asm("movw %w0,%%gs" : : "r" (_udatasel)); 865 } 866 --- 308 unchanged lines hidden (view full) --- 1175void 1176init386(first) 1177 int first; 1178{ 1179 int x; 1180 unsigned biosbasemem, biosextmem; 1181 struct gate_descriptor *gdp; 1182 int gsel_tss; |
1183#if NNPX > 0 1184 int msize; 1185#endif |
|
1177 | 1186 |
1178 struct isa_device *idp; | |
1179#ifndef SMP 1180 /* table descriptors - used to load tables by microp */ 1181 struct region_descriptor r_gdt, r_idt; 1182#endif 1183 int pagesinbase, pagesinext; 1184 vm_offset_t target_page; 1185 int pa_indx, off; 1186 int speculative_mprobe; --- 286 unchanged lines hidden (view full) --- 1473 speculative_mprobe = FALSE; 1474 1475#ifdef MAXMEM 1476 Maxmem = MAXMEM/4; 1477 speculative_mprobe = FALSE; 1478#endif 1479 1480#if NNPX > 0 | 1187#ifndef SMP 1188 /* table descriptors - used to load tables by microp */ 1189 struct region_descriptor r_gdt, r_idt; 1190#endif 1191 int pagesinbase, pagesinext; 1192 vm_offset_t target_page; 1193 int pa_indx, off; 1194 int speculative_mprobe; --- 286 unchanged lines hidden (view full) --- 1481 speculative_mprobe = FALSE; 1482 1483#ifdef MAXMEM 1484 Maxmem = MAXMEM/4; 1485 speculative_mprobe = FALSE; 1486#endif 1487 1488#if NNPX > 0 |
1481 idp = find_isadev(isa_devtab_null, &npxdriver, 0); 1482 if (idp != NULL && idp->id_msize != 0) { 1483 Maxmem = idp->id_msize / 4; 1484 speculative_mprobe = FALSE; | 1489 if (resource_int_value("npx", 0, "msize", &msize) == 0) { 1490 if (msize != 0) { 1491 Maxmem = msize / 4; 1492 speculative_mprobe = FALSE; 1493 } |
1485 } 1486#endif 1487 1488#ifdef SMP 1489 /* look for the MP hardware - needed for apic addresses */ 1490 mp_probe(); 1491#endif 1492 --- 499 unchanged lines hidden --- | 1494 } 1495#endif 1496 1497#ifdef SMP 1498 /* look for the MP hardware - needed for apic addresses */ 1499 mp_probe(); 1500#endif 1501 --- 499 unchanged lines hidden --- |