From owner-freebsd-ppc@FreeBSD.ORG Mon Jan 16 22:50:07 2012 Return-Path: Delivered-To: freebsd-ppc@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 288621065675 for ; Mon, 16 Jan 2012 22:50:07 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 0097E8FC17 for ; Mon, 16 Jan 2012 22:50:07 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q0GMo6E3005566 for ; Mon, 16 Jan 2012 22:50:06 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q0GMo6Yo005565; Mon, 16 Jan 2012 22:50:06 GMT (envelope-from gnats) Resent-Date: Mon, 16 Jan 2012 22:50:06 GMT Resent-Message-Id: <201201162250.q0GMo6Yo005565@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ppc@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Lyubomir Grigorov Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C559106564A for ; Mon, 16 Jan 2012 22:46:18 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 6C1338FC0A for ; Mon, 16 Jan 2012 22:46:18 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q0GMkIrh083749 for ; Mon, 16 Jan 2012 22:46:18 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id q0GMkIns083748; Mon, 16 Jan 2012 22:46:18 GMT (envelope-from nobody) Message-Id: <201201162246.q0GMkIns083748@red.freebsd.org> Date: Mon, 16 Jan 2012 22:46:18 GMT From: Lyubomir Grigorov To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: powerpc/164225: Boot fails on IBM 7028-6E1 (heap memory claim failed) X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 22:50:07 -0000 >Number: 164225 >Category: powerpc >Synopsis: Boot fails on IBM 7028-6E1 (heap memory claim failed) >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ppc >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Jan 16 22:50:06 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Lyubomir Grigorov >Release: 9.0-RELEASE >Organization: >Environment: n/a >Description: When booting 9.0-RELEASE (32bit ppc) on IBM pSeries 610 (7028-6E1), going to SMS, choosing install device CD-ROM, choosing FreeBSD 9.0, it fails with: Heap memory claim failed! I traced the source to the following 3 files: sys/boot/ofw/common/main.c .. .. 48 #define HEAP_SIZE 0x80000 .. 52 void 53 init_heap(void) 54 { 55 void *base; 56 ihandle_t stdout; 57 58 if ((base = ofw_alloc_heap(HEAP_SIZE)) == (void *)0xffffffff) { 59 OF_getprop(chosen, "stdout", &stdout, sizeof(stdout)); 60 OF_puts(stdout, "Heap memory claim failed!\n"); 61 OF_enter(); 62 } 63 64 setheap(base, (void *)((int)base + HEAP_SIZE)); 65 } .. .. sys/boot/ofw/libofw/ofw_memory.c .. .. 119 ofw_alloc_heap(unsigned int size) 120 { 121 phandle_t memoryp, root; 122 cell_t available[4]; 123 cell_t acells; 124 125 root = OF_finddevice("/"); 126 acells = 1; 127 OF_getprop(root, "#address-cells", &acells, sizeof(acells)); 128 129 memoryp = OF_instance_to_package(memory); 130 OF_getprop(memoryp, "available", available, sizeof(available)); 131 132 heap_base = OF_claim((void *)available[acells-1], size, 133 sizeof(register_t)); 134 135 if (heap_base != (void *)-1) { 136 heap_size = size; 137 } 138 139 return (heap_base); 140 } .. .. sys/boot/ofw/libofw/openfirm.c .. .. 617 /* Claim an area of memory. */ 618 void * 619 OF_claim(void *virt, u_int size, u_int align) 620 { 621 static struct { 622 cell_t name; 623 cell_t nargs; 624 cell_t nreturns; 625 cell_t virt; 626 cell_t size; 627 cell_t align; 628 cell_t baseaddr; 629 } args = { 630 (cell_t)"claim", 631 3, 632 1, 633 }; 634 635 args.virt = (cell_t)virt; 636 args.size = size; 637 args.align = align; 638 if (openfirmware(&args) == -1) 639 return ((void *)-1); 640 return ((void *)args.baseaddr); 641 } .. .. I noticed that the NetBSD version only does: sys/arch/macppc/stand/ofwboot/Locore.c .. 442 return args.baseaddr; .. >How-To-Repeat: Boot from FreeBSD 9.0 CD on an IBM 7028-6E1 or 7028-6C1. >Fix: >Release-Note: >Audit-Trail: >Unformatted: