{"action":"created","comment":{"url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/pulls/comments/79145752","id":79145752,"diff_hunk":"@@ -0,0 +1,89 @@\n+/*\n+ * Copyright (c) 2016, ARM Limited and Contributors. All rights reserved.\n+ *\n+ * Redistribution and use in source and binary forms, with or without\n+ * modification, are permitted provided that the following conditions are met:\n+ *\n+ * Redistributions of source code must retain the above copyright notice, this\n+ * list of conditions and the following disclaimer.\n+ *\n+ * Redistributions in binary form must reproduce the above copyright notice,\n+ * this list of conditions and the following disclaimer in the documentation\n+ * and/or other materials provided with the distribution.\n+ *\n+ * Neither the name of ARM nor the names of its contributors may be used\n+ * to endorse or promote products derived from this software without specific\n+ * prior written permission.\n+ *\n+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\n+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n+ * POSSIBILITY OF SUCH DAMAGE.\n+ */\n+#include <arch.h>\n+#include <arch_helpers.h>\n+#include <assert.h>\n+#include <console.h>\n+#include <debug.h>\n+#include <mmio.h>\n+#include <mt_cpuxgpt.h>\n+#include <mtk_sip_svc.h>\n+#include <plat_private.h>\n+#include <platform.h>\n+#include <platform_def.h>\n+#include <mtk_plat_common.h>\n+#include <runtime_svc.h>\n+#include <xlat_tables.h>\n+\n+/*******************************************************************************\n+ * SIP top level handler for servicing SMCs.\n+ ******************************************************************************/\n+uint64_t mediatek_plat_sip_handler(uint32_t smc_fid,\n+\t\t\t\tuint64_t x1,\n+\t\t\t\tuint64_t x2,\n+\t\t\t\tuint64_t x3,\n+\t\t\t\tuint64_t x4,\n+\t\t\t\tvoid *cookie,\n+\t\t\t\tvoid *handle,\n+\t\t\t\tuint64_t flags)\n+{\n+\tuint64_t rc = 0;\n+\tuint32_t ns;\n+\n+\t/* Determine which security state this SMC originated from */\n+\tns = is_caller_non_secure(flags);\n+\n+\tVERBOSE(\"sip_smc_handler\\n\");\n+\tVERBOSE(\"id=0x%x\\n\", smc_fid);\n+\tVERBOSE(\"x1=0x%lx, x2=0x%lx, x3=0x%lx, x4=0x%lx\\n\", x1, x2, x3, x4);\n+\n+\tif (!ns) {\n+\t\t/* SiP SMC service secure world's call */\n+\t\tswitch (smc_fid) {\n+\t\tdefault:\n+\t\t\trc = SMC_UNK;\n+\t\t}\n+\t} else {\n+\t\t/* SiP SMC service normal world's call */\n+\t\tswitch (smc_fid) {\n+\t\tdefault:\n+\t\t\trc = SMC_UNK;\n+\t\t}\n+\t}\n+\n+\tif (rc == SMC_UNK) {","path":"plat/mediatek/mt6795/plat_sip_svc.c","position":81,"original_position":81,"commit_id":"c1ff80b1289df2c6d950413eab37cdd999b462a6","original_commit_id":"c1ff80b1289df2c6d950413eab37cdd999b462a6","user":{"login":"davidcunado-arm","id":19822500,"avatar_url":"https://avatars.githubusercontent.com/u/19822500?v=3","gravatar_id":"","url":"https://api.github.com/users/davidcunado-arm","html_url":"https://github.com/davidcunado-arm","followers_url":"https://api.github.com/users/davidcunado-arm/followers","following_url":"https://api.github.com/users/davidcunado-arm/following{/other_user}","gists_url":"https://api.github.com/users/davidcunado-arm/gists{/gist_id}","starred_url":"https://api.github.com/users/davidcunado-arm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidcunado-arm/subscriptions","organizations_url":"https://api.github.com/users/davidcunado-arm/orgs","repos_url":"https://api.github.com/users/davidcunado-arm/repos","events_url":"https://api.github.com/users/davidcunado-arm/events{/privacy}","received_events_url":"https://api.github.com/users/davidcunado-arm/received_events","type":"User","site_admin":false},"body":"This code has raised an error in our static analysis - identical code in the if and else branches. \r\nCan you provide an update to resolve? \r\nI suspect this code is for some future support, but until then it would be beneficial to change this code so that it does not fail the static analysis - I believe that simply removing the if-else statements then rationalising the remaining code in the function could be one approach.","created_at":"2016-09-16T10:45:17Z","updated_at":"2016-09-16T10:45:18Z","html_url":"https://github.com/ARM-software/arm-trusted-firmware/pull/663#discussion_r79145752","pull_request_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/pulls/663","_links":{"self":{"href":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/pulls/comments/79145752"},"html":{"href":"https://github.com/ARM-software/arm-trusted-firmware/pull/663#discussion_r79145752"},"pull_request":{"href":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/pulls/663"}}},"pull_request":{"url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/pulls/663","id":76916085,"html_url":"https://github.com/ARM-software/arm-trusted-firmware/pull/663","diff_url":"https://github.com/ARM-software/arm-trusted-firmware/pull/663.diff","patch_url":"https://github.com/ARM-software/arm-trusted-firmware/pull/663.patch","issue_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/issues/663","number":663,"state":"closed","locked":false,"title":"mediatek: Support for Mediatek MT6795 SoC","user":{"login":"leon-chen-mtk","id":17244512,"avatar_url":"https://avatars.githubusercontent.com/u/17244512?v=3","gravatar_id":"","url":"https://api.github.com/users/leon-chen-mtk","html_url":"https://github.com/leon-chen-mtk","followers_url":"https://api.github.com/users/leon-chen-mtk/followers","following_url":"https://api.github.com/users/leon-chen-mtk/following{/other_user}","gists_url":"https://api.github.com/users/leon-chen-mtk/gists{/gist_id}","starred_url":"https://api.github.com/users/leon-chen-mtk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leon-chen-mtk/subscriptions","organizations_url":"https://api.github.com/users/leon-chen-mtk/orgs","repos_url":"https://api.github.com/users/leon-chen-mtk/repos","events_url":"https://api.github.com/users/leon-chen-mtk/events{/privacy}","received_events_url":"https://api.github.com/users/leon-chen-mtk/received_events","type":"User","site_admin":false},"body":"This patch support single core to boot to Linux kernel\r\nthrough Trusted Firmware.\r\nIt also support 32 bit kernel and 64 bit kernel booting.","created_at":"2016-07-11T08:29:05Z","updated_at":"2016-09-16T10:45:18Z","closed_at":"2016-09-14T17:09:38Z","merged_at":"2016-09-14T17:09:38Z","merge_commit_sha":"a760613fc081523bd38a3c093a2c95d2c3b03916","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/pulls/663/commits","review_comments_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/pulls/663/comments","review_comment_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/issues/663/comments","statuses_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/statuses/c1ff80b1289df2c6d950413eab37cdd999b462a6","head":{"label":"leon-chen-mtk:mt6795_2","ref":"mt6795_2","sha":"c1ff80b1289df2c6d950413eab37cdd999b462a6","user":{"login":"leon-chen-mtk","id":17244512,"avatar_url":"https://avatars.githubusercontent.com/u/17244512?v=3","gravatar_id":"","url":"https://api.github.com/users/leon-chen-mtk","html_url":"https://github.com/leon-chen-mtk","followers_url":"https://api.github.com/users/leon-chen-mtk/followers","following_url":"https://api.github.com/users/leon-chen-mtk/following{/other_user}","gists_url":"https://api.github.com/users/leon-chen-mtk/gists{/gist_id}","starred_url":"https://api.github.com/users/leon-chen-mtk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leon-chen-mtk/subscriptions","organizations_url":"https://api.github.com/users/leon-chen-mtk/orgs","repos_url":"https://api.github.com/users/leon-chen-mtk/repos","events_url":"https://api.github.com/users/leon-chen-mtk/events{/privacy}","received_events_url":"https://api.github.com/users/leon-chen-mtk/received_events","type":"User","site_admin":false},"repo":{"id":59575706,"name":"arm-trusted-firmware","full_name":"leon-chen-mtk/arm-trusted-firmware","owner":{"login":"leon-chen-mtk","id":17244512,"avatar_url":"https://avatars.githubusercontent.com/u/17244512?v=3","gravatar_id":"","url":"https://api.github.com/users/leon-chen-mtk","html_url":"https://github.com/leon-chen-mtk","followers_url":"https://api.github.com/users/leon-chen-mtk/followers","following_url":"https://api.github.com/users/leon-chen-mtk/following{/other_user}","gists_url":"https://api.github.com/users/leon-chen-mtk/gists{/gist_id}","starred_url":"https://api.github.com/users/leon-chen-mtk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leon-chen-mtk/subscriptions","organizations_url":"https://api.github.com/users/leon-chen-mtk/orgs","repos_url":"https://api.github.com/users/leon-chen-mtk/repos","events_url":"https://api.github.com/users/leon-chen-mtk/events{/privacy}","received_events_url":"https://api.github.com/users/leon-chen-mtk/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/leon-chen-mtk/arm-trusted-firmware","description":"ARM Trusted Firmware","fork":true,"url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware","forks_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/forks","keys_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/keys{/key_id}","collaborators_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/teams","hooks_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/hooks","issue_events_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/issues/events{/number}","events_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/events","assignees_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/assignees{/user}","branches_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/branches{/branch}","tags_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/tags","blobs_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/git/refs{/sha}","trees_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/git/trees{/sha}","statuses_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/statuses/{sha}","languages_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/languages","stargazers_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/stargazers","contributors_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/contributors","subscribers_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/subscribers","subscription_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/subscription","commits_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/commits{/sha}","git_commits_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/git/commits{/sha}","comments_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/comments{/number}","issue_comment_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/issues/comments{/number}","contents_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/contents/{+path}","compare_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/compare/{base}...{head}","merges_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/merges","archive_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/downloads","issues_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/issues{/number}","pulls_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/pulls{/number}","milestones_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/milestones{/number}","notifications_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/labels{/name}","releases_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/releases{/id}","deployments_url":"https://api.github.com/repos/leon-chen-mtk/arm-trusted-firmware/deployments","created_at":"2016-05-24T13:30:58Z","updated_at":"2016-05-24T13:31:01Z","pushed_at":"2016-09-12T09:28:24Z","git_url":"git://github.com/leon-chen-mtk/arm-trusted-firmware.git","ssh_url":"git@github.com:leon-chen-mtk/arm-trusted-firmware.git","clone_url":"https://github.com/leon-chen-mtk/arm-trusted-firmware.git","svn_url":"https://github.com/leon-chen-mtk/arm-trusted-firmware","homepage":null,"size":7395,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ARM-software:integration","ref":"integration","sha":"048d802a087b2c52bd5e817cb8e0bc52ea6260ad","user":{"login":"ARM-software","id":5690313,"avatar_url":"https://avatars.githubusercontent.com/u/5690313?v=3","gravatar_id":"","url":"https://api.github.com/users/ARM-software","html_url":"https://github.com/ARM-software","followers_url":"https://api.github.com/users/ARM-software/followers","following_url":"https://api.github.com/users/ARM-software/following{/other_user}","gists_url":"https://api.github.com/users/ARM-software/gists{/gist_id}","starred_url":"https://api.github.com/users/ARM-software/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ARM-software/subscriptions","organizations_url":"https://api.github.com/users/ARM-software/orgs","repos_url":"https://api.github.com/users/ARM-software/repos","events_url":"https://api.github.com/users/ARM-software/events{/privacy}","received_events_url":"https://api.github.com/users/ARM-software/received_events","type":"Organization","site_admin":false},"repo":{"id":13740589,"name":"arm-trusted-firmware","full_name":"ARM-software/arm-trusted-firmware","owner":{"login":"ARM-software","id":5690313,"avatar_url":"https://avatars.githubusercontent.com/u/5690313?v=3","gravatar_id":"","url":"https://api.github.com/users/ARM-software","html_url":"https://github.com/ARM-software","followers_url":"https://api.github.com/users/ARM-software/followers","following_url":"https://api.github.com/users/ARM-software/following{/other_user}","gists_url":"https://api.github.com/users/ARM-software/gists{/gist_id}","starred_url":"https://api.github.com/users/ARM-software/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ARM-software/subscriptions","organizations_url":"https://api.github.com/users/ARM-software/orgs","repos_url":"https://api.github.com/users/ARM-software/repos","events_url":"https://api.github.com/users/ARM-software/events{/privacy}","received_events_url":"https://api.github.com/users/ARM-software/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ARM-software/arm-trusted-firmware","description":"ARM Trusted Firmware","fork":false,"url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware","forks_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/forks","keys_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/teams","hooks_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/hooks","issue_events_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/issues/events{/number}","events_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/events","assignees_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/assignees{/user}","branches_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/branches{/branch}","tags_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/tags","blobs_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/git/refs{/sha}","trees_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/statuses/{sha}","languages_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/languages","stargazers_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/stargazers","contributors_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/contributors","subscribers_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/subscribers","subscription_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/subscription","commits_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/commits{/sha}","git_commits_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/git/commits{/sha}","comments_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/comments{/number}","issue_comment_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/issues/comments{/number}","contents_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/contents/{+path}","compare_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/merges","archive_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/downloads","issues_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/issues{/number}","pulls_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/pulls{/number}","milestones_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/milestones{/number}","notifications_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/labels{/name}","releases_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/releases{/id}","deployments_url":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/deployments","created_at":"2013-10-21T11:39:00Z","updated_at":"2016-09-10T09:23:15Z","pushed_at":"2016-09-15T15:47:47Z","git_url":"git://github.com/ARM-software/arm-trusted-firmware.git","ssh_url":"git@github.com:ARM-software/arm-trusted-firmware.git","clone_url":"https://github.com/ARM-software/arm-trusted-firmware.git","svn_url":"https://github.com/ARM-software/arm-trusted-firmware","homepage":null,"size":10082,"stargazers_count":197,"watchers_count":197,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":205,"mirror_url":null,"open_issues_count":14,"forks":205,"open_issues":14,"watchers":197,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/pulls/663"},"html":{"href":"https://github.com/ARM-software/arm-trusted-firmware/pull/663"},"issue":{"href":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/issues/663"},"comments":{"href":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/issues/663/comments"},"review_comments":{"href":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/pulls/663/comments"},"review_comment":{"href":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/pulls/663/commits"},"statuses":{"href":"https://api.github.com/repos/ARM-software/arm-trusted-firmware/statuses/c1ff80b1289df2c6d950413eab37cdd999b462a6"}}}}
{"actor":{"display_login":"davidcunado-arm"}}