From patchwork Tue Jan 2 09:28:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manish Jaggi X-Patchwork-Id: 123098 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp8755000qgn; Tue, 2 Jan 2018 01:31:04 -0800 (PST) X-Google-Smtp-Source: ACJfBoufXk4+EHdE4aoETzjei4FF2MG2+BgcLvh7j2vB4/nkMJHghpN/1/ZHpHKaBwaihI88Wq4M X-Received: by 10.107.41.79 with SMTP id p76mr13813471iop.105.1514885464509; Tue, 02 Jan 2018 01:31:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514885464; cv=none; d=google.com; s=arc-20160816; b=0DUD2BFmJLficHrFIFL4pnjtTrJ0NnIr2N+Zcl+1222gOcrid0yD7N32LLNVuxsdkg cTl6EALC+zvbvWA7fBhoov8J98vwCEeY/3hWnKd8y/Ya3Bvh6LLJ3i03Aj0fiv+gN3u2 qkyTmVFFDlncS+uo2vFtOMrB9DyBD+MXegWgvW7+P/V/+UpUJA2C9hhHL5aAdthZ6Ay2 vvFkJnQY3au7pfzZCE/eGJaPyFgmx340ZE+ZbkmTopD8D3zDUvT4aZdX5p8jdEF0DreR XK6IJOeBvLN5n90bqCLL+8v4tYlolz2cMIZvMd67nmH6+vW1qFfi9ckz2TTF38+cPKHy M/kA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:cc:references:in-reply-to:message-id:date:to :from:dkim-signature:arc-authentication-results; bh=UyIXnEnpXw8MaY3SmN97MKXDzm3hdUHgj7/kme/V70g=; b=sHWkyGJlVK/MabrX9/EyVou/oCPNHJf3kDOLCkdyR7WquTQ2FvSV+UvTwOB5VGAzOl ISC17fK52vX0xRWVJNNeTbxRJ7UiduZ6+aG0mNUG/TEmY2r4w1KxlVNCHhB0JxIJ1Jzd /rBp28UQtk8aQaDOb+a7lF7t/A5d4pcs8oFPUlHP7vAb0LF7TdX+5ks4RrAy5pDXawNJ rdh9LJ1Lsok5AYmqwwNvWvb3fDx5/Ppj7sxSYi46m5wo5g1NfXhd2McrFGOqNGRgeU9E 1Rcj6HvD+srKsyXhOqh8H6NZrKF0GMeHyt25RJLO5t5a86n++LT7GuUMbKLjig9YDAxl 1f9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=eB+34UR/; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id e71si24257742itd.171.2018.01.02.01.31.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Jan 2018 01:31:04 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=eB+34UR/; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eWIsT-0002b9-Ow; Tue, 02 Jan 2018 09:28:57 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eWIsT-0002ac-8z for xen-devel@lists.xenproject.org; Tue, 02 Jan 2018 09:28:57 +0000 X-Inumbo-ID: 338dfef4-ef9f-11e7-b4a6-bc764e045a96 Received: from mail-pl0-x244.google.com (unknown [2607:f8b0:400e:c01::244]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 338dfef4-ef9f-11e7-b4a6-bc764e045a96; Tue, 02 Jan 2018 10:27:50 +0100 (CET) Received: by mail-pl0-x244.google.com with SMTP id i6so28325668plt.13 for ; Tue, 02 Jan 2018 01:28:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Q3HQQpfZ3loVAOuusmrggKv5ilXvgOHkTSK8yB5usZo=; b=eB+34UR/V6lVHd4fibE07btcbT7YDDBaWzV143ASAgW0ha6lhWIfIIkguqhTWxeffl uruqhWT2EBLeevtVW3KnYFsKOri5TAxzXatr9UPlbnXaK4DN2F7orzXvUlTCRXBr4erL alSAKscli/1jz0VLPAXyR6u3l7v8WJILUS/xs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Q3HQQpfZ3loVAOuusmrggKv5ilXvgOHkTSK8yB5usZo=; b=hfYIn6Pk3LEWkwA5iJ9J0Q9HnL0wje9M3KHTIWBDVU5I2O210F52QdsT21wvlg3/nJ f1jgocPVcg89e1/KaBF8wa2NpoqHW3GNQWkXuIfqh7H7PQYQuaEna3FG7nCmfAuc2IHu WUMqsi+6gA96g0a5ptW8iqt+9I50cAt4tcc4NhcVqPT0smMhIqXLFns+uSK7Qf1BlfZp L8Ktp1mKuZVbWdp3qHcyO8UQ8I4Z4lUffawnZ4nFLx6lapcCeavbwBJeUaV9ErKaWn4/ Wcv3BdjkospDyz/vsh27DS569kaqKR7uFm5DMazCajQmLqMgQUPL4LxlpiKMKbMjGlIi Ymyg== X-Gm-Message-State: AKGB3mLGzDTHjMyfh185Fg8qz/2hVIuX8cL7gerO6nACrwj8Xd64ci5Y fd5lLgJ99umAFftbWktTR5tewFw0HiI= X-Received: by 10.84.218.8 with SMTP id q8mr43770031pli.117.1514885335816; Tue, 02 Jan 2018 01:28:55 -0800 (PST) Received: from thunder-dev-box.domain.name ([111.93.218.67]) by smtp.gmail.com with ESMTPSA id e8sm22065207pgs.44.2018.01.02.01.28.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Jan 2018 01:28:55 -0800 (PST) From: manish.jaggi@linaro.org To: xen-devel@lists.xenproject.org, julien.grall@linaro.org, sameer.goel@linaro.org, andre.przywara@linaro.org Date: Tue, 2 Jan 2018 14:58:05 +0530 Message-Id: <20180102092809.1841-8-manish.jaggi@linaro.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180102092809.1841-1-manish.jaggi@linaro.org> References: <20180102092809.1841-1-manish.jaggi@linaro.org> Cc: Manish Jaggi , manish.jaggi@cavium.com Subject: [Xen-devel] [RFC 07/11] Add kernel helper functions X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" From: Manish Jaggi Add kalloc kfree functions from linux kernel. Signed-off-by: Manish Jaggi --- xen/include/xen/kernel.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/xen/include/xen/kernel.h b/xen/include/xen/kernel.h index 548b64da9f..78517f6caa 100644 --- a/xen/include/xen/kernel.h +++ b/xen/include/xen/kernel.h @@ -7,6 +7,16 @@ #include +/* Xen: Define compatibility functions */ +#define FW_BUG "[Firmware Bug]: " +#define pr_err(fmt, ...) printk(XENLOG_ERR fmt, ## __VA_ARGS__) +#define pr_warn(fmt, ...) printk(XENLOG_WARNING fmt, ## __VA_ARGS__) + +/* Alias to Xen allocation helpers */ +#define kfree xfree +#define kmalloc(size, flags) _xmalloc(size, sizeof(void *)) +#define kzalloc(size, flags) _xzalloc(size, sizeof(void *)) + /* * min()/max() macros that also do * strict type-checking.. See the