Date: Fri, 17 Jul 2015 13:01:50 +0000 From: "wma_semihalf.com (Wojciech Macek)" <phabric-noreply@FreeBSD.org> To: freebsd-arm@freebsd.org Subject: [Differential] [Request, 100 lines] D3118: Add support for external function for PCI devid acquisition Message-ID: <differential-rev-PHID-DREV-olj5aqn6fnfrdtjspc5q-req@FreeBSD.org>
next in thread | raw e-mail | index | archive | help
--b1_b034f9194cbd6069833991284d615f15 Content-Type: text/plain; charset = "utf-8" Content-Transfer-Encoding: 8bit wma_semihalf.com created this revision. wma_semihalf.com added reviewers: zbb, emaste, andrew. wma_semihalf.com added a subscriber: freebsd-arm-list. wma_semihalf.com set the repository for this revision to rS FreeBSD src repository. Herald added subscribers: emaste, andrew, imp. REVISION SUMMARY It is possible that some HW will use different PCI devids, hence allow to replace the default domain:bus:slot:func schema by implementing and registering custom function. REPOSITORY rS FreeBSD src repository REVISION DETAIL https://reviews.freebsd.org/D3118 AFFECTED FILES sys/arm64/arm64/gic_v3_its.c sys/arm64/arm64/gic_v3_var.h EMAIL PREFERENCES https://reviews.freebsd.org/settings/panel/emailpreferences/ To: wma_semihalf.com, zbb, emaste, andrew Cc: imp, andrew, freebsd-arm-list, emaste --b1_b034f9194cbd6069833991284d615f15 Content-Type: text/x-patch; charset=utf-8; name="D3118.7045.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="D3118.7045.patch" ZGlmZiAtLWdpdCBhL3N5cy9hcm02NC9hcm02NC9naWNfdjNfdmFyLmggYi9zeXMvYXJtNjQvYXJt NjQvZ2ljX3YzX3Zhci5oCi0tLSBhL3N5cy9hcm02NC9hcm02NC9naWNfdjNfdmFyLmgKKysrIGIv c3lzL2FybTY0L2FybTY0L2dpY192M192YXIuaApAQCAtMjc3LDEzICsyNzcsMTQgQEAKIAkgICAg cmVnLCB2YWwpOwkJCQlcCiB9KQogCi0jZGVmaW5lCVBDSV9ERVZJRChwY2lfZGV2KQkJCQlcCisj ZGVmaW5lCVBDSV9SSURfRE9NQUlOX1NISUZ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MT0NfREVGSU5FKE1fR0lDX1Yz X0lUUywgIkdJQ3YzIElUUyIsIEdJQ19WM19JVFNfREVWU1RSKTsKIAordHlwZWRlZiB1aW50MzJf dCAoKml0c19kZXZpZF9mdW5jX3QpKGRldmljZV90KTsKKwogc3RhdGljIGludCBpdHNfYWxsb2Nf dGFibGVzKHN0cnVjdCBnaWNfdjNfaXRzX3NvZnRjICopOwogc3RhdGljIHZvaWQgaXRzX2ZyZWVf dGFibGVzKHN0cnVjdCBnaWNfdjNfaXRzX3NvZnRjICopOwogc3RhdGljIHZvaWQgaXRzX2luaXRf Y29tbWFuZHEoc3RydWN0IGdpY192M19pdHNfc29mdGMgKik7CkBAIC05OCwxMiArMTAxLDE5IEBA CiBzdGF0aWMgdm9pZCBpdHNfY21kX21hcGkoc3RydWN0IGdpY192M19pdHNfc29mdGMgKiwgc3Ry dWN0IGl0c19kZXYgKiwgdWludDMyX3QpOwogc3RhdGljIHZvaWQgaXRzX2NtZF9pbnYoc3RydWN0 IGdpY192M19pdHNfc29mdGMgKiwgc3RydWN0IGl0c19kZXYgKiwgdWludDMyX3QpOwogc3RhdGlj IHZvaWQgaXRzX2NtZF9pbnZhbGwoc3RydWN0IGdpY192M19pdHNfc29mdGMgKiwgc3RydWN0IGl0 c19jb2wgKik7CitzdGF0aWMgdWludDMyX3QgaXRzX3F1aXJrX2RldmlkX3RodW5kZXIoZGV2aWNl X3QpOwogCiBzdGF0aWMgdm9pZCBscGlfaW5pdF9jb25mdGFibGUoc3RydWN0IGdpY192M19pdHNf c29mdGMgKik7CiBzdGF0aWMgdm9pZCBscGlfYml0bWFwX2luaXQoc3RydWN0IGdpY192M19pdHNf c29mdGMgKik7CiBzdGF0aWMgdm9pZCBscGlfaW5pdF9jcHUoc3RydWN0IGdpY192M19pdHNfc29m dGMgKik7CiBzdGF0aWMgaW50IGxwaV9jb25maWdfY3B1KHN0cnVjdCBnaWNfdjNfaXRzX3NvZnRj ICopOwogCitzdHJ1Y3QgaXRzX3F1a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2VfdCBwY2lfZGV2KQorewor CWludCBic2Y7CisJdWludDMyX3QgYnVzOworCisJYnVzID0gcGNpX2dldF9idXMocGNpX2Rldik7 CisKKwlic2YgPSBQQ0lfUklEKHBjaV9nZXRfYnVzKHBjaV9kZXYpLCBwY2lfZ2V0X3Nsb3QocGNp X2RldiksCisJICAgIHBjaV9nZXRfZnVuY3Rpb24ocGNpX2RldikpOworCisJLyogRUNBTSBpcyBv biBidXM9MCAqLworCWlmIChidXMgPT0gMCkgeworCQlyZXR1cm4gKChwY2lfZ2V0X2RvbWFpbihw Y2lfZGV2KSA8PCBQQ0lfUklEX0RPTUFJTl9TSElGVCkgfAorCQkgICAgYnNmKTsKKwkvKiBQRU0g b3RoZXJ3aXNlICovCisJfSBlbHNlIHsKKwkJaW50IHBlbTsKKworCQkvKiBQRU0gbnVtYmVyIGlz IGVxdWFsIHRvIGRvbWFpbiAqLworCQlwZW0gPSBwY2lfZ2V0X2RvbWFpbihwY2lfZGV2KTsKKwor CQkvKiBIYXJkY29kZSBhcHByb3ByaWF0ZSBQRU0gbnVtYmVycyAqLworCQlpZiAocGVtIDwgMyAp CisJCQlyZXR1cm4gKCgweDEgPDwgUENJX1JJRF9ET01BSU5fU0hJRlQpIHwgYnNmKTsKKworCQlp ZiAocGVtIDwgNiApCisJCQlyZXR1cm4gKCgweDMgPDwgUENJX1JJRF9ET01BSU5fU0hJRlQpIHwg YnNmKTsKKworCQlpZiAocGVtIDwgOSApCisJCQlyZXR1cm4gKCgweDkgPDwgUENJX1JJRF9ET01B SU5fU0hJRlQpIHwgYnNmKTsKKworCQlpZiAocGVtIDwgMTIgKQorCQkJcmV0dXJuICgoMHhCIDw8 IFBDSV9SSURfRE9NQUlOX1NISUZUKSB8IGJzZik7CisJfQorCisJcmV0dXJuICgwKTsKK30KKwor c3RhdGljIF9faW5saW5lIHVpbnQzMl90CitpdHNfZ2V0X2RldmlkX2RlZmF1bHQoZGV2aWNlX3Qg cGNpX2RldikKK3sKKworCXJldHVybiAoUENJX0RFVklEX0dFTkVSSUMocGNpX2RldikpOworfQor CitzdGF0aWMgdWludDMyX3QKK2l0c19nZXRfZGV2aWQoZGV2aWNlX3QgcGNpX2RldikKK3sKKwlz dHJ1Y3QgaXRzX3F1aXJrcyAqcXVpcmsgPSAmaXRzX3F1aXJrc1swXTsKKworCXdoaWxlIChxdWly ay0+Y3B1aWQgIT0gMCkgeworCQlpZiAoQ1BVX01BVENIX1JBVyhxdWlyay0+Y3B1aWRfbWFzaywg cXVpcmstPmNwdWlkKSkgeworCQkJaWYgKHF1aXJrLT5kZXZpZF9mdW5jICE9IE5VTEwpCisJCQkJ cmV0dXJuICgoKnF1aXJrLT5kZXZpZF9mdW5jKShwY2lfZGV2KSk7CisJCX0KKwkJcXVpcmsrKzsK Kwl9CisKKwlyZXR1cm4gKGl0c19nZXRfZGV2aWRfZGVmYXVsdChwY2lfZGV2KSk7Cit9CisKIHN0 YXRpYyBpbnQKIGdpY192M19pdHNfYXR0YWNoKGRldmljZV90IGRldikKIHsKQEAgLTEzMDAsNyAr MTM4NSw3IEBACiAJaWYgKG5ld2RldiAhPSBOVUxMKQogCQlyZXR1cm4gKG5ld2Rldik7CiAKLQlk ZXZpZCA9IFBDSV9ERVZJRChwY2lfZGV2KTsKKwlkZXZpZCA9IGl0c19nZXRfZGV2aWQocGNpX2Rl dik7CiAKIAkvKiBUaGVyZSB3YXMgbm8gcHJldmlvdXNseSBjcmVhdGVkIGRldmljZS4gQ3JlYXRl IG9uZSBub3cgKi8KIAluZXdkZXYgPSBtYWxsb2Moc2l6ZW9mKCpuZXdkZXYpLCBNX0dJQ19WM19J VFMsIChNX1dBSVRPSyB8IE1fWkVSTykpOwoK --b1_b034f9194cbd6069833991284d615f15--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?differential-rev-PHID-DREV-olj5aqn6fnfrdtjspc5q-req>