Date: Sat, 26 Apr 2003 18:06:18 -0700 (PDT) From: Juli Mallett <jmallett@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 29843 for review Message-ID: <200304270106.h3R16IJh085647@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=29843 Change 29843 by jmallett@jmallett_dalek on 2003/04/26 18:05:48 Count and display available memory, call back into machine sources, mips_init, from platform sources, to set up thread0 and so on. Now we blow up much later on, somewhere in mtx code, yuck. Affected files ... .. //depot/projects/mips/sys/mips/include/md_var.h#4 edit .. //depot/projects/mips/sys/mips/mips/machdep.c#10 edit .. //depot/projects/mips/sys/mips/sgimips/machdep_sgimips.c#10 edit Differences ... ==== //depot/projects/mips/sys/mips/include/md_var.h#4 (text+ko) ==== @@ -30,6 +30,7 @@ void cpu_halt(void); void cpu_reset(void); +void mips_init(void); void swi_vm(void *); #endif /* !_MACHINE_MD_VAR_H_ */ ==== //depot/projects/mips/sys/mips/mips/machdep.c#10 (text+ko) ==== @@ -45,6 +45,16 @@ struct pcpu pcpu0; void +mips_init(void) +{ + struct pcpu *pc; + + proc_linkup(&proc0, &ksegrp0, &kse0, &thread0); + pc = &pcpu0; + pc->pc_curthread = &thread0; +} + +void cpu_halt(void) { platform_halt(); ==== //depot/projects/mips/sys/mips/sgimips/machdep_sgimips.c#10 (text+ko) ==== @@ -53,7 +53,7 @@ { NULL, NULL, 0 } }; -int arcsmem; +int arcsmem, availmem; int mach_type, mach_subtype, mach_boardrev; void @@ -119,6 +119,7 @@ break; case ARCBIOS_MEM_FreeContiguous: case ARCBIOS_MEM_FreeMemory: + availmem += btoc(size); printf("Physical available block %d:\n", j); printf("Available memory range %0x-%0x\n", first, last); @@ -135,6 +136,10 @@ } printf("total memory = %ld (%ld MB)\n", ctob(physmem), ctob(physmem) / (1024 * 1024)); - printf("ARCS memory = %d (%d MB)\n", ctob(arcsmem), - ctob(arcsmem) / (1024 * 1024)); + printf("ARCS memory = %d (%d KB)\n", ctob(arcsmem), + ctob(arcsmem) / 1024); + printf("avail memory = %d (%d MB)\n", ctob(availmem), + ctob(availmem) / (1024 * 1024)); + + mips_init(); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200304270106.h3R16IJh085647>