Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp995885imu; Fri, 11 Jan 2019 12:57:53 -0800 (PST) X-Google-Smtp-Source: ALg8bN6gr+RbGC6FQwDzXDGnsQTNp6jfPsrhBUt2k6239MZJuUH1C6zbcd+/mCgGRI19uFgkXxGS X-Received: by 2002:a17:902:b406:: with SMTP id x6mr15441048plr.329.1547240273513; Fri, 11 Jan 2019 12:57:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547240273; cv=none; d=google.com; s=arc-20160816; b=nc+oM1RPEjx2Fy8B+VtTD74nLWHl+3HbXEfHlrw3WdMnMg110EVYgZpwz7cJOrwVa6 hCF3i+I7fHYThatQ+JJjUKj0R+ZNO15Ixj5Gn0QD+vrZgvA9d+HGD6eYlBjBxxfZNHuw VN9ixaEgQhITavRA0V4zg20ikisABm7Oqkv5PM3vpZUwixt33FZb4/aSau7IxkLRDos9 NdivJRUvwHwCyPAuywAYT9tc0n33i4SabiMrAFwemNn59LHzZPg7CVNPwkxb0Z9ijAdC 7k8/AlIXiGr2ivUgWk490FxOX6N/h17jaEMNqLzOdlOLWPPkxFA8vEOyordTFtnvUATO y3TA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=kedV1S7Qo3zNTOmFpiB+JK+j8l2W1E6CQQL/KEBLSY8=; b=oN6MPVcd7JUsXdTA/9/KDIm0RFb4ti/W0H2HG1wA+b+ol4JOu8tjx23okE+mllNSEv u5pCaymp/c27n/yqmcbmENa7X3iC6D5oF0wLveBaHsvCodBwKS0hhYPwrbyP5qnUAC8X 0zTlx29nFIYY4VY4vGJPAbOu6x1gOsyrDa0ypUHWI/SexWH9d1yIr3p5EeMy+nGrXM4r nGm/HOZVbu2pVj4xBoZlWEuqwU/aGykr0JjJ/J1QNnYgymA/4kZEsDv+yTXJHFtmblmV o6Bj46OUQ5dbhIvMwYSeaHzWrwyigPzeimCiuP4+J7brbwuIOWcbdIjIsMD6EDMhYCAv jnLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="Mi/LtUF6"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v34si74593236plg.205.2019.01.11.12.57.38; Fri, 11 Jan 2019 12:57:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="Mi/LtUF6"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389664AbfAKSFt (ORCPT + 99 others); Fri, 11 Jan 2019 13:05:49 -0500 Received: from fllv0015.ext.ti.com ([198.47.19.141]:44224 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389626AbfAKSFp (ORCPT ); Fri, 11 Jan 2019 13:05:45 -0500 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id x0BI5ZUF067776; Fri, 11 Jan 2019 12:05:35 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1547229935; bh=kedV1S7Qo3zNTOmFpiB+JK+j8l2W1E6CQQL/KEBLSY8=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=Mi/LtUF67VzpSkWPJpfaq7LtUD5aNeUO4AnbtN46qgH7kSuRJMqNl6PnRYm+mRgAL XnvAo+CowVhDC7Xr7DRZwN7oB6uNEsUNjC1cu1dfJhvSo/SAT0wPDMVrGN/EKTNAX4 9hautAfo/W2XK7jGKV+fxgzxi537aFlWS6W4oS5k= Received: from DFLE115.ent.ti.com (dfle115.ent.ti.com [10.64.6.36]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x0BI5Zgi059332 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 11 Jan 2019 12:05:35 -0600 Received: from DFLE107.ent.ti.com (10.64.6.28) by DFLE115.ent.ti.com (10.64.6.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Fri, 11 Jan 2019 12:05:34 -0600 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE107.ent.ti.com (10.64.6.28) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1591.10 via Frontend Transport; Fri, 11 Jan 2019 12:05:35 -0600 Received: from legion.dal.desgin.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id x0BI5ZRL017209; Fri, 11 Jan 2019 12:05:35 -0600 Received: from localhost (uda0226330.dhcp.ti.com [172.22.109.196]) by legion.dal.desgin.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id x0BI5YU07760; Fri, 11 Jan 2019 12:05:34 -0600 (CST) From: "Andrew F. Davis" To: Laura Abbott , Sumit Semwal , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= CC: , , , "Andrew F . Davis" Subject: [PATCH 12/14] staging: android: ion: Declare helpers for carveout and chunk heaps Date: Fri, 11 Jan 2019 12:05:21 -0600 Message-ID: <20190111180523.27862-13-afd@ti.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190111180523.27862-1-afd@ti.com> References: <20190111180523.27862-1-afd@ti.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When enabled the helpers functions for creating carveout and chunk heaps should have declarations in the ION header. Signed-off-by: Andrew F. Davis --- drivers/staging/android/ion/ion.h | 33 +++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/drivers/staging/android/ion/ion.h b/drivers/staging/android/ion/ion.h index e291299fd35f..97b2876b165a 100644 --- a/drivers/staging/android/ion/ion.h +++ b/drivers/staging/android/ion/ion.h @@ -308,4 +308,37 @@ void ion_page_pool_free(struct ion_page_pool *pool, struct page *page); int ion_page_pool_shrink(struct ion_page_pool *pool, gfp_t gfp_mask, int nr_to_scan); +#ifdef CONFIG_ION_CARVEOUT_HEAP +/** + * ion_carveout_heap_create + * @base: base address of carveout memory + * @size: size of carveout memory region + * + * Creates a carveout ion_heap using the passed in data + */ +struct ion_heap *ion_carveout_heap_create(phys_addr_t base, size_t size); +#else +static inline struct ion_heap *ion_carveout_heap_create(phys_addr_t base, size_t size) +{ + return ERR_PTR(-ENODEV); +} +#endif + +#ifdef CONFIG_ION_CHUNK_HEAP +/** + * ion_chunk_heap_create + * @base: base address of carveout memory + * @size: size of carveout memory region + * @chunk_size: minimum allocation granularity + * + * Creates a chunk ion_heap using the passed in data + */ +struct ion_heap *ion_chunk_heap_create(phys_addr_t base, size_t size, size_t chunk_size); +#else +static inline struct ion_heap *ion_chunk_heap_create(phys_addr_t base, size_t size, size_t chunk_size) +{ + return ERR_PTR(-ENODEV); +} +#endif + #endif /* _ION_H */ -- 2.19.1