Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 4 May 2015 16:45:14 +0000
From:      "zbb (Zbigniew Bodek)" <phabric-noreply@FreeBSD.org>
To:        freebsd-arm@freebsd.org
Subject:   [Differential] [Updated, 1, 019 lines] D2377: Introduce ARM GICv3 support
Message-ID:  <77e3339787d220e369108658a7915513@localhost.localdomain>
In-Reply-To: <differential-rev-PHID-DREV-piql4a7htwxjub743777-req@FreeBSD.org>
References:  <differential-rev-PHID-DREV-piql4a7htwxjub743777-req@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--b1_77e3339787d220e369108658a7915513
Content-Type: text/plain; charset = "utf-8"
Content-Transfer-Encoding: 8bit

zbb removed rS FreeBSD src repository as the repository for this revision.
zbb updated this revision to Diff 5180.

CHANGES SINCE LAST UPDATE
  https://reviews.freebsd.org/D2377?vs=5024&id=5180

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/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_77e3339787d220e369108658a7915513
Content-Type: text/x-patch; charset=utf-8; name="D2377.5180.patch"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="D2377.5180.patch"

ZGlmZiAtLWdpdCBhL3N5cy9jb25mL2ZpbGVzLmFybTY0IGIvc3lzL2NvbmYvZmlsZXMuYXJtNjQK
LS0tIGEvc3lzL2NvbmYvZmlsZXMuYXJtNjQKKysrIGIvc3lzL2NvbmYvZmlsZXMuYXJtNjQKQEAg
LTE4LDYgKzE4LDcgQEAKIGFybTY0L2FybTY0L2VsZl9tYWNoZGVwLmMJc3RhbmRhcmQKIGFybT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9TR0lfQkFTRV9TSVpFICsgR0lDRF9JUFJJT1JJVFlSKGkpLAorCQkgICAgR0lDX1BS
SU9SSVRZX01BWCk7CisJfQorCisJZ2ljX3YzX3dhaXRfZm9yX3J3cChzYywgUkVESVNUKTsKKwor
ZXJyb3I6CisJcmV0dXJuIChlcnIpOworfQoK


--b1_77e3339787d220e369108658a7915513--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?77e3339787d220e369108658a7915513>