From owner-freebsd-arm@FreeBSD.ORG Mon May 11 18:53:25 2015 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D612D4AF for ; Mon, 11 May 2015 18:53:25 +0000 (UTC) Received: from phabric-backend.isc.freebsd.org (phabric-backend.isc.freebsd.org [IPv6:2001:4f8:3:ffe0:406a:0:50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A5A661B12 for ; Mon, 11 May 2015 18:53:25 +0000 (UTC) Received: from phabric-backend.isc.freebsd.org (phabric-backend.isc.freebsd.org [127.0.1.5]) by phabric-backend.isc.freebsd.org (8.14.9/8.14.9) with ESMTP id t4BIrPDk007227 for ; Mon, 11 May 2015 18:53:25 GMT (envelope-from daemon-user@phabric-backend.isc.freebsd.org) Received: (from daemon-user@localhost) by phabric-backend.isc.freebsd.org (8.14.9/8.14.9/Submit) id t4BIrPDP007226; Mon, 11 May 2015 18:53:25 GMT (envelope-from daemon-user) Date: Mon, 11 May 2015 18:53:25 +0000 To: freebsd-arm@freebsd.org From: "zbb (Zbigniew Bodek)" Subject: [Differential] [Updated, 1, 026 lines] D2377: Introduce ARM GICv3 support Message-ID: <4fd2e56b800518810b82d7f619324eee@localhost.localdomain> X-Priority: 3 Thread-Topic: D2377: Introduce ARM GICv3 support X-Herald-Rules: <28>, <31>, <32>, <34>, <8> X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-Cc: X-Phabricator-Cc: X-Phabricator-Cc: X-Phabricator-Cc: X-Phabricator-Cc: In-Reply-To: References: Thread-Index: MjA1ZGZkZWI5MTE4ZDk2Nzk0YzAyZGRiMWRiIFVQ+qU= Precedence: bulk X-Phabricator-Sent-This-Message: Yes X-Mail-Transport-Agent: MetaMTA X-Auto-Response-Suppress: All X-Phabricator-Mail-Tags: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="b1_4fd2e56b800518810b82d7f619324eee" X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.20 List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2015 18:53:26 -0000 --b1_4fd2e56b800518810b82d7f619324eee Content-Type: text/plain; charset = "utf-8" Content-Transfer-Encoding: 8bit zbb updated this revision to Diff 5327. CHANGES SINCE LAST UPDATE https://reviews.freebsd.org/D2377?vs=5256&id=5327 REVISION DETAIL https://reviews.freebsd.org/D2377 AFFECTED FILES sys/arm64/arm64/gic_v3.c sys/arm64/arm64/gic_v3_fdt.c sys/arm64/arm64/gic_v3_reg.h sys/arm64/arm64/gic_v3_var.h sys/arm64/arm64/locore.S sys/arm64/include/armreg.h sys/conf/files.arm64 EMAIL PREFERENCES https://reviews.freebsd.org/settings/panel/emailpreferences/ To: zbb, emaste, ian, imp, andrew, brueffer, joel, wblock Cc: kostikbel, emaste, andrew, imp, freebsd-arm --b1_4fd2e56b800518810b82d7f619324eee Content-Type: text/x-patch; charset=utf-8; name="D2377.5327.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="D2377.5327.patch" ZGlmZiAtLWdpdCBhL3N5cy9jb25mL2ZpbGVzLmFybTY0IGIvc3lzL2NvbmYvZmlsZXMuYXJtNjQK LS0tIGEvc3lzL2NvbmYvZmlsZXMuYXJtNjQKKysrIGIvc3lzL2NvbmYvZmlsZXMuYXJtNjQKQEAg LTE5LDYgKzE5LDggQEAKIGFybTY0L2FybTY0L2VsZl9tYWNoZGVwLmMJc3RhbmRhcmQKIGFybTY0 L2FybTY0L2V4Y2VwdGlvbi5TCQlzdGFuZGFyZAogYXJtNjQvYXJtNjQ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REVWTUVUSE9EKGRldmljZV9hdHRhY2gsCWdpY192M19mZHRfYXR0YWNoKSwKKworCS8qIEVuZCAq LworCURFVk1FVEhPRF9FTkQKK307CisKK0RFRklORV9DTEFTU18xKGdpY192MywgZ2ljX3YzX2Zk dF9kcml2ZXIsIGdpY192M19mZHRfbWV0aG9kcywKKyAgICBzaXplb2Yoc3RydWN0IGdpY192M19z b2Z0YyksIGdpY192M19kcml2ZXIpOworCitzdGF0aWMgZGV2Y2xhc3NfdCBnaWNfdjNfZmR0X2Rl dmNsYXNzOworCitFQVJMWV9EUklWRVJfTU9EVUxFKGdpY192Mywgc2ltcGxlYnVzLCBnaWNfdjNf ZHJpdmVyLCBnaWNfdjNfZmR0X2RldmNsYXNzLAorICAgIDAsIDAsIEJVU19QQVNTX0lOVEVSUlVQ VCArIEJVU19QQVNTX09SREVSX01JRERMRSk7CitFQVJMWV9EUklWRVJfTU9EVUxFKGdpY192Mywg b2Z3YnVzLCBnaWNfdjNfZHJpdmVyLCBnaWNfdjNfZmR0X2RldmNsYXNzLAorICAgIDAsIDAsIEJV U19QQVNTX0lOVEVSUlVQVCArIEJVU19QQVNTX09SREVSX01JRERMRSk7CisKKy8qCisgKiBEZXZp Y2UgaW50ZXJmYWNlLgorICovCitzdGF0aWMgaW50CitnaWNfdjNfZmR0X3Byb2JlKGRldmljZV90 IGRldikKK3sKKworCWlmICghb2Z3X2J1c19zdGF0dXNfb2theShkZXYpKQorCQlyZXR1cm4gKEVO WElPKTsKKworCWlmICghb2Z3X2J1c19pc19jb21wYXRpYmxlKGRldiwgImFybSxnaWMtdjMiKSkK KwkJcmV0dXJuIChFTlhJTyk7CisKKwlkZXZpY2Vfc2V0X2Rlc2MoZGV2LCBHSUNfVjNfREVWU1RS KTsKKwlyZXR1cm4gKEJVU19QUk9CRV9ERUZBVUxUKTsKK30KKworc3RhdGljIGludAorZ2ljX3Yz X2ZkdF9hdHRhY2goZGV2aWNlX3QgZGV2KQoreworCXN0cnVjdCBnaWNfd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