From patchwork Tue May 19 09:05:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Kerr X-Patchwork-Id: 473791 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 10353140D4D for ; Tue, 19 May 2015 19:06:14 +1000 (AEST) Received: from ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id E92E51A06CB for ; Tue, 19 May 2015 19:06:13 +1000 (AEST) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from ozlabs.org (ozlabs.org [IPv6:2401:3900:2:1::2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 1BED21A0017 for ; Tue, 19 May 2015 19:05:44 +1000 (AEST) Received: by ozlabs.org (Postfix, from userid 1023) id 027C2140D58; Tue, 19 May 2015 19:05:43 +1000 (AEST) MIME-Version: 1.0 Message-Id: <1432026338.125580.428502178166.2.gpush@pablo> In-Reply-To: <1432026338.124852.77854388738.0.gpush@pablo> To: skiboot@lists.ozlabs.org From: Jeremy Kerr Date: Tue, 19 May 2015 17:05:38 +0800 Subject: [Skiboot] [PATCH 2/7 v3] core: Introduce REGION_HW_RESERVED X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" This change allows the mem_region code to distinguish reserved memory that was allocated before skiboot init, by introducing a new mem_region_type member. When we extract reserved ranges from the device tree, we mark them with this new type. Signed-off-by: Jeremy Kerr --- core/mem_region.c | 2 +- include/mem_region.h | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/core/mem_region.c b/core/mem_region.c index 4f73776..b3f7dc4 100644 --- a/core/mem_region.c +++ b/core/mem_region.c @@ -878,7 +878,7 @@ void mem_region_init(void) region = new_region(name, dt_get_number(range, 2), dt_get_number(range + 1, 2), - NULL, REGION_RESERVED); + NULL, REGION_HW_RESERVED); list_add(®ions, ®ion->list); } } else if (names || ranges) { diff --git a/include/mem_region.h b/include/mem_region.h index fefd6ba..1f25c9c 100644 --- a/include/mem_region.h +++ b/include/mem_region.h @@ -28,7 +28,10 @@ enum mem_region_type { /* ranges used explicitly for skiboot, but not allocatable. eg .text */ REGION_SKIBOOT_FIRMWARE, - /* ranges reserved, possibly before skiboot init, eg HW framebuffer */ + /* ranges reserved before skiboot init, eg HBRT memory */ + REGION_HW_RESERVED, + + /* ranges reserved, eg HW framebuffer */ REGION_RESERVED, /* ranges available for the OS, created by mem_region_release_unused */