From owner-svn-src-all@FreeBSD.ORG Sat Dec 19 04:33:10 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ACC81106566B; Sat, 19 Dec 2009 04:33:10 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 812B08FC14; Sat, 19 Dec 2009 04:33:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBJ4XAej019673; Sat, 19 Dec 2009 04:33:10 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBJ4XA8Q019670; Sat, 19 Dec 2009 04:33:10 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <200912190433.nBJ4XA8Q019670@svn.freebsd.org> From: Takahashi Yoshihiro Date: Sat, 19 Dec 2009 04:33:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200703 - in stable/7/sys/boot/pc98: libpc98 loader X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 04:33:10 -0000 Author: nyan Date: Sat Dec 19 04:33:10 2009 New Revision: 200703 URL: http://svn.freebsd.org/changeset/base/200703 Log: MFC: r200253 and r200255 Reduce diffs against i386. Modified: stable/7/sys/boot/pc98/libpc98/biosmem.c stable/7/sys/boot/pc98/loader/main.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/pc98/libpc98/biosmem.c ============================================================================== --- stable/7/sys/boot/pc98/libpc98/biosmem.c Sat Dec 19 04:25:19 2009 (r200702) +++ stable/7/sys/boot/pc98/libpc98/biosmem.c Sat Dec 19 04:33:10 2009 (r200703) @@ -34,8 +34,13 @@ __FBSDID("$FreeBSD$"); #include "libi386.h" #include "btxv86.h" -vm_offset_t memtop, memtop_copyin; -u_int32_t bios_basemem, bios_extmem; +vm_offset_t memtop, memtop_copyin, high_heap_base; +uint32_t bios_basemem, bios_extmem, high_heap_size; + +/* + * The minimum amount of memory to reserve in bios_extmem for the heap. + */ +#define HEAP_MIN (3 * 1024 * 1024) void bios_getmem(void) @@ -48,5 +53,12 @@ bios_getmem(void) /* Set memtop to actual top of memory */ memtop = memtop_copyin = 0x100000 + bios_extmem; + /* + * If we have extended memory, use the last 3MB of 'extended' memory + * as a high heap candidate. + */ + if (bios_extmem >= HEAP_MIN) { + high_heap_size = HEAP_MIN; + high_heap_base = memtop - HEAP_MIN; + } } - Modified: stable/7/sys/boot/pc98/loader/main.c ============================================================================== --- stable/7/sys/boot/pc98/loader/main.c Sat Dec 19 04:25:19 2009 (r200702) +++ stable/7/sys/boot/pc98/loader/main.c Sat Dec 19 04:33:10 2009 (r200703) @@ -96,14 +96,18 @@ main(void) */ bios_getmem(); -#ifdef LOADER_BZIP2_SUPPORT - heap_top = PTOV(memtop_copyin); - memtop_copyin -= 0x300000; - heap_bottom = PTOV(memtop_copyin); -#else - heap_top = (void *)bios_basemem; - heap_bottom = (void *)end; +#if defined(LOADER_BZIP2_SUPPORT) + if (high_heap_size > 0) { + heap_top = PTOV(high_heap_base + high_heap_size); + heap_bottom = PTOV(high_heap_base); + if (high_heap_base < memtop_copyin) + memtop_copyin = high_heap_base; + } else #endif + { + heap_top = (void *)PTOV(bios_basemem); + heap_bottom = (void *)end; + } setheap(heap_bottom, heap_top); /*