From owner-p4-projects@FreeBSD.ORG Sat Apr 26 18:06:20 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D049637B404; Sat, 26 Apr 2003 18:06:19 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6E5FF37B401 for ; Sat, 26 Apr 2003 18:06:19 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 137AE43FBF for ; Sat, 26 Apr 2003 18:06:19 -0700 (PDT) (envelope-from jmallett@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3R16I0U085655 for ; Sat, 26 Apr 2003 18:06:18 -0700 (PDT) (envelope-from jmallett@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3R16IJh085647 for perforce@freebsd.org; Sat, 26 Apr 2003 18:06:18 -0700 (PDT) Date: Sat, 26 Apr 2003 18:06:18 -0700 (PDT) Message-Id: <200304270106.h3R16IJh085647@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jmallett@freebsd.org using -f From: Juli Mallett To: Perforce Change Reviews Subject: PERFORCE change 29843 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Apr 2003 01:06:20 -0000 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(); }