Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Apr 2015 13:52:25 +0000
From:      "zbb (Zbigniew Bodek)" <phabric-noreply@FreeBSD.org>
To:        freebsd-arm@freebsd.org
Subject:   [Differential] [Request, 2, 082 lines] D2378: Introduce ITS support for ARM64
Message-ID:  <differential-rev-PHID-DREV-xmqmcfafyun443233vly-req@FreeBSD.org>

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

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

zbb created this revision.
zbb added reviewers: emaste, imp, ian, andrew.
zbb added a subscriber: freebsd-arm.
zbb set the repository for this revision to rS FreeBSD src repository.
Herald added subscribers: imp, andrew, emaste.
Herald added a reviewer: manpages.

REVISION SUMMARY
  Add ARM ITS (Interrupt Translation Services) support required to bring-up
  message signaled interrupts on some ARM64 platforms.
  
  Obtained from: Semihalf
  Sponsored by:  The FreeBSD Foundation

REPOSITORY
  rS FreeBSD src repository

REVISION DETAIL
  https://reviews.freebsd.org/D2378

AFFECTED FILES
  sys/arm64/arm64/gic_v3.c
  sys/arm64/arm64/gic_v3_fdt.c
  sys/arm64/arm64/gic_v3_its.c
  sys/arm64/arm64/gic_v3_reg.h
  sys/arm64/arm64/gic_v3_var.h

EMAIL PREFERENCES
  https://reviews.freebsd.org/settings/panel/emailpreferences/

To: zbb, emaste, imp, ian, andrew, brueffer, joel, wblock
Cc: emaste, andrew, imp, freebsd-arm

--b1_3d0dd6449082dcf13167e54f7d0d6994
Content-Type: text/x-patch; charset=utf-8; name="D2378.5025.patch"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="D2378.5025.patch"

ZGlmZiAtLWdpdCBhL3N5cy9hcm02NC9hcm02NC9naWNfdjNfdmFyLmggYi9zeXMvYXJtNjQvYXJt
NjQvZ2ljX3YzX3Zhci5oCi0tLSBhL3N5cy9hcm02NC9hcm02NC9naWNfdjNfdmFyLmgKKysrIGIv
c3lzL2FybTY0L2FybTY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xzZSB7CiAJCUtBU1NFUlQoMCwgKCIlczogVW5zdXBwb3J0ZWQgSVJRIG51
bWJlciAldSIsIF9fZnVuY19fLCBpcnEpKTsKIAl9CkBAIC0yODQsNiArMjg1LDggQEAKIAl9IGVs
c2UgaWYgKGlycSA+PSBHSUNfRklSU1RfU1BJICYmIGlycSA8PSBHSUNfTEFTVF9TUEkpIHsgLyog
U1BJcyBpbiBkaXN0cmlidXRvciAqLwogCQlnaWNfZF93cml0ZShzYywgNCwgR0lDRF9JU0VOQUJM
RVIoaXJxID4+IDUpLCBtYXNrKTsKIAkJZ2ljX3YzX3dhaXRfZm9yX3J3cChzYywgRElTVCk7CisJ
fSBlbHNlIGlmIChpcnEgPj0gR0lDX0ZJUlNUX0xQSSkgeyAvKiBMUElzICovCisJCWxwaV91bm1h
c2tfaXJxKGRldiwgaXJxKTsKIAl9IGVsc2UgewogCQlLQVNTRVJUKDAsICgiJXM6IFVuc3VwcG9y
dGVkIElSUSBudW1iZXIgJXUiLCBfX2Z1bmNfXywgaXJxKSk7CiAJfQoK


--b1_3d0dd6449082dcf13167e54f7d0d6994--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?differential-rev-PHID-DREV-xmqmcfafyun443233vly-req>