{"action":"created","comment":{"url":"https://api.github.com/repos/ARMmbed/uvisor/pulls/comments/65689566","id":65689566,"diff_hunk":"@@ -296,3 +295,36 @@ void vmpu_arch_init(void)\n     /* init memory protection */\n     vmpu_mem_init();\n }\n+\n+int vmpu_is_region_size_valid(uint32_t size)\n+{\n+    /* Align size to 32B */\n+    const uint32_t masked_size = size & ~31;\n+    if (masked_size < 32 || (1 << 29) < masked_size) {\n+        /* 2^5 == 32, which is the minimum region size */\n+        /* 2^29 == 512M, which is the maximum region size */\n+        return 0;\n+    }\n+    /* There is no rounding, we only care about an exact match! */\n+    return (masked_size == size);\n+}\n+\n+uint32_t vmpu_round_up_region(uint32_t addr, uint32_t size)\n+{\n+    if (!vmpu_is_region_size_valid(size)) {\n+        /* Region size must be valid! */\n+        return 0;\n+    }\n+    /* Alignment is always 32B */\n+    const uint32_t mask = 31;\n+\n+    /* Adding the mask can overflow */","path":"core/system/src/mpu/vmpu_freescale_k64.c","position":35,"original_position":35,"commit_id":"32fd72503183edfdb7269b5e7c00985aec89260a","original_commit_id":"8a43252164d683b7c5569400afab535ede965aee","user":{"login":"Patater","id":410816,"avatar_url":"https://avatars.githubusercontent.com/u/410816?v=3","gravatar_id":"","url":"https://api.github.com/users/Patater","html_url":"https://github.com/Patater","followers_url":"https://api.github.com/users/Patater/followers","following_url":"https://api.github.com/users/Patater/following{/other_user}","gists_url":"https://api.github.com/users/Patater/gists{/gist_id}","starred_url":"https://api.github.com/users/Patater/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Patater/subscriptions","organizations_url":"https://api.github.com/users/Patater/orgs","repos_url":"https://api.github.com/users/Patater/repos","events_url":"https://api.github.com/users/Patater/events{/privacy}","received_events_url":"https://api.github.com/users/Patater/received_events","type":"User","site_admin":false},"body":"Add period","created_at":"2016-06-03T10:48:35Z","updated_at":"2016-06-03T10:48:35Z","html_url":"https://github.com/ARMmbed/uvisor/pull/227#discussion_r65689566","pull_request_url":"https://api.github.com/repos/ARMmbed/uvisor/pulls/227","_links":{"self":{"href":"https://api.github.com/repos/ARMmbed/uvisor/pulls/comments/65689566"},"html":{"href":"https://github.com/ARMmbed/uvisor/pull/227#discussion_r65689566"},"pull_request":{"href":"https://api.github.com/repos/ARMmbed/uvisor/pulls/227"}}},"pull_request":{"url":"https://api.github.com/repos/ARMmbed/uvisor/pulls/227","id":71713218,"html_url":"https://github.com/ARMmbed/uvisor/pull/227","diff_url":"https://github.com/ARMmbed/uvisor/pull/227.diff","patch_url":"https://github.com/ARMmbed/uvisor/pull/227.patch","issue_url":"https://api.github.com/repos/ARMmbed/uvisor/issues/227","number":227,"state":"open","locked":false,"title":"1. Add tier-1 page allocator","user":{"login":"niklas-arm","id":15176141,"avatar_url":"https://avatars.githubusercontent.com/u/15176141?v=3","gravatar_id":"","url":"https://api.github.com/users/niklas-arm","html_url":"https://github.com/niklas-arm","followers_url":"https://api.github.com/users/niklas-arm/followers","following_url":"https://api.github.com/users/niklas-arm/following{/other_user}","gists_url":"https://api.github.com/users/niklas-arm/gists{/gist_id}","starred_url":"https://api.github.com/users/niklas-arm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/niklas-arm/subscriptions","organizations_url":"https://api.github.com/users/niklas-arm/orgs","repos_url":"https://api.github.com/users/niklas-arm/repos","events_url":"https://api.github.com/users/niklas-arm/events{/privacy}","received_events_url":"https://api.github.com/users/niklas-arm/received_events","type":"User","site_admin":false},"body":"This adds the page allocator algorithm, initialization code and SVC calls.\r\n\r\nThis is part of larger changes, but I'd prefer to review these parts separately when possible.\r\n\r\n@Patater @AlessandroA @meriac ","created_at":"2016-05-27T13:31:18Z","updated_at":"2016-06-03T10:48:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f74631a58a6e9dbac16c3be3b79873dd2186e77f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ARMmbed/uvisor/pulls/227/commits","review_comments_url":"https://api.github.com/repos/ARMmbed/uvisor/pulls/227/comments","review_comment_url":"https://api.github.com/repos/ARMmbed/uvisor/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ARMmbed/uvisor/issues/227/comments","statuses_url":"https://api.github.com/repos/ARMmbed/uvisor/statuses/32fd72503183edfdb7269b5e7c00985aec89260a","head":{"label":"niklas-arm:feature/page_heap_allocator","ref":"feature/page_heap_allocator","sha":"32fd72503183edfdb7269b5e7c00985aec89260a","user":{"login":"niklas-arm","id":15176141,"avatar_url":"https://avatars.githubusercontent.com/u/15176141?v=3","gravatar_id":"","url":"https://api.github.com/users/niklas-arm","html_url":"https://github.com/niklas-arm","followers_url":"https://api.github.com/users/niklas-arm/followers","following_url":"https://api.github.com/users/niklas-arm/following{/other_user}","gists_url":"https://api.github.com/users/niklas-arm/gists{/gist_id}","starred_url":"https://api.github.com/users/niklas-arm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/niklas-arm/subscriptions","organizations_url":"https://api.github.com/users/niklas-arm/orgs","repos_url":"https://api.github.com/users/niklas-arm/repos","events_url":"https://api.github.com/users/niklas-arm/events{/privacy}","received_events_url":"https://api.github.com/users/niklas-arm/received_events","type":"User","site_admin":false},"repo":{"id":56140266,"name":"uvisor","full_name":"niklas-arm/uvisor","owner":{"login":"niklas-arm","id":15176141,"avatar_url":"https://avatars.githubusercontent.com/u/15176141?v=3","gravatar_id":"","url":"https://api.github.com/users/niklas-arm","html_url":"https://github.com/niklas-arm","followers_url":"https://api.github.com/users/niklas-arm/followers","following_url":"https://api.github.com/users/niklas-arm/following{/other_user}","gists_url":"https://api.github.com/users/niklas-arm/gists{/gist_id}","starred_url":"https://api.github.com/users/niklas-arm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/niklas-arm/subscriptions","organizations_url":"https://api.github.com/users/niklas-arm/orgs","repos_url":"https://api.github.com/users/niklas-arm/repos","events_url":"https://api.github.com/users/niklas-arm/events{/privacy}","received_events_url":"https://api.github.com/users/niklas-arm/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/niklas-arm/uvisor","description":"mbed OS uVisor -- device security layer for ARMv7M microcontrollers","fork":true,"url":"https://api.github.com/repos/niklas-arm/uvisor","forks_url":"https://api.github.com/repos/niklas-arm/uvisor/forks","keys_url":"https://api.github.com/repos/niklas-arm/uvisor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/niklas-arm/uvisor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/niklas-arm/uvisor/teams","hooks_url":"https://api.github.com/repos/niklas-arm/uvisor/hooks","issue_events_url":"https://api.github.com/repos/niklas-arm/uvisor/issues/events{/number}","events_url":"https://api.github.com/repos/niklas-arm/uvisor/events","assignees_url":"https://api.github.com/repos/niklas-arm/uvisor/assignees{/user}","branches_url":"https://api.github.com/repos/niklas-arm/uvisor/branches{/branch}","tags_url":"https://api.github.com/repos/niklas-arm/uvisor/tags","blobs_url":"https://api.github.com/repos/niklas-arm/uvisor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/niklas-arm/uvisor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/niklas-arm/uvisor/git/refs{/sha}","trees_url":"https://api.github.com/repos/niklas-arm/uvisor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/niklas-arm/uvisor/statuses/{sha}","languages_url":"https://api.github.com/repos/niklas-arm/uvisor/languages","stargazers_url":"https://api.github.com/repos/niklas-arm/uvisor/stargazers","contributors_url":"https://api.github.com/repos/niklas-arm/uvisor/contributors","subscribers_url":"https://api.github.com/repos/niklas-arm/uvisor/subscribers","subscription_url":"https://api.github.com/repos/niklas-arm/uvisor/subscription","commits_url":"https://api.github.com/repos/niklas-arm/uvisor/commits{/sha}","git_commits_url":"https://api.github.com/repos/niklas-arm/uvisor/git/commits{/sha}","comments_url":"https://api.github.com/repos/niklas-arm/uvisor/comments{/number}","issue_comment_url":"https://api.github.com/repos/niklas-arm/uvisor/issues/comments{/number}","contents_url":"https://api.github.com/repos/niklas-arm/uvisor/contents/{+path}","compare_url":"https://api.github.com/repos/niklas-arm/uvisor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/niklas-arm/uvisor/merges","archive_url":"https://api.github.com/repos/niklas-arm/uvisor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/niklas-arm/uvisor/downloads","issues_url":"https://api.github.com/repos/niklas-arm/uvisor/issues{/number}","pulls_url":"https://api.github.com/repos/niklas-arm/uvisor/pulls{/number}","milestones_url":"https://api.github.com/repos/niklas-arm/uvisor/milestones{/number}","notifications_url":"https://api.github.com/repos/niklas-arm/uvisor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/niklas-arm/uvisor/labels{/name}","releases_url":"https://api.github.com/repos/niklas-arm/uvisor/releases{/id}","deployments_url":"https://api.github.com/repos/niklas-arm/uvisor/deployments","created_at":"2016-04-13T09:50:01Z","updated_at":"2016-04-13T09:50:02Z","pushed_at":"2016-06-02T14:39:43Z","git_url":"git://github.com/niklas-arm/uvisor.git","ssh_url":"git@github.com:niklas-arm/uvisor.git","clone_url":"https://github.com/niklas-arm/uvisor.git","svn_url":"https://github.com/niklas-arm/uvisor","homepage":"","size":5195,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"ARMmbed:dev","ref":"dev","sha":"8357f564ee83d00fe33de6c311b310f1309bbfb8","user":{"login":"ARMmbed","id":8916057,"avatar_url":"https://avatars.githubusercontent.com/u/8916057?v=3","gravatar_id":"","url":"https://api.github.com/users/ARMmbed","html_url":"https://github.com/ARMmbed","followers_url":"https://api.github.com/users/ARMmbed/followers","following_url":"https://api.github.com/users/ARMmbed/following{/other_user}","gists_url":"https://api.github.com/users/ARMmbed/gists{/gist_id}","starred_url":"https://api.github.com/users/ARMmbed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ARMmbed/subscriptions","organizations_url":"https://api.github.com/users/ARMmbed/orgs","repos_url":"https://api.github.com/users/ARMmbed/repos","events_url":"https://api.github.com/users/ARMmbed/events{/privacy}","received_events_url":"https://api.github.com/users/ARMmbed/received_events","type":"Organization","site_admin":false},"repo":{"id":27869517,"name":"uvisor","full_name":"ARMmbed/uvisor","owner":{"login":"ARMmbed","id":8916057,"avatar_url":"https://avatars.githubusercontent.com/u/8916057?v=3","gravatar_id":"","url":"https://api.github.com/users/ARMmbed","html_url":"https://github.com/ARMmbed","followers_url":"https://api.github.com/users/ARMmbed/followers","following_url":"https://api.github.com/users/ARMmbed/following{/other_user}","gists_url":"https://api.github.com/users/ARMmbed/gists{/gist_id}","starred_url":"https://api.github.com/users/ARMmbed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ARMmbed/subscriptions","organizations_url":"https://api.github.com/users/ARMmbed/orgs","repos_url":"https://api.github.com/users/ARMmbed/repos","events_url":"https://api.github.com/users/ARMmbed/events{/privacy}","received_events_url":"https://api.github.com/users/ARMmbed/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ARMmbed/uvisor","description":"mbed OS uVisor -- device security layer for ARMv7M microcontrollers","fork":false,"url":"https://api.github.com/repos/ARMmbed/uvisor","forks_url":"https://api.github.com/repos/ARMmbed/uvisor/forks","keys_url":"https://api.github.com/repos/ARMmbed/uvisor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ARMmbed/uvisor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ARMmbed/uvisor/teams","hooks_url":"https://api.github.com/repos/ARMmbed/uvisor/hooks","issue_events_url":"https://api.github.com/repos/ARMmbed/uvisor/issues/events{/number}","events_url":"https://api.github.com/repos/ARMmbed/uvisor/events","assignees_url":"https://api.github.com/repos/ARMmbed/uvisor/assignees{/user}","branches_url":"https://api.github.com/repos/ARMmbed/uvisor/branches{/branch}","tags_url":"https://api.github.com/repos/ARMmbed/uvisor/tags","blobs_url":"https://api.github.com/repos/ARMmbed/uvisor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ARMmbed/uvisor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ARMmbed/uvisor/git/refs{/sha}","trees_url":"https://api.github.com/repos/ARMmbed/uvisor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ARMmbed/uvisor/statuses/{sha}","languages_url":"https://api.github.com/repos/ARMmbed/uvisor/languages","stargazers_url":"https://api.github.com/repos/ARMmbed/uvisor/stargazers","contributors_url":"https://api.github.com/repos/ARMmbed/uvisor/contributors","subscribers_url":"https://api.github.com/repos/ARMmbed/uvisor/subscribers","subscription_url":"https://api.github.com/repos/ARMmbed/uvisor/subscription","commits_url":"https://api.github.com/repos/ARMmbed/uvisor/commits{/sha}","git_commits_url":"https://api.github.com/repos/ARMmbed/uvisor/git/commits{/sha}","comments_url":"https://api.github.com/repos/ARMmbed/uvisor/comments{/number}","issue_comment_url":"https://api.github.com/repos/ARMmbed/uvisor/issues/comments{/number}","contents_url":"https://api.github.com/repos/ARMmbed/uvisor/contents/{+path}","compare_url":"https://api.github.com/repos/ARMmbed/uvisor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ARMmbed/uvisor/merges","archive_url":"https://api.github.com/repos/ARMmbed/uvisor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ARMmbed/uvisor/downloads","issues_url":"https://api.github.com/repos/ARMmbed/uvisor/issues{/number}","pulls_url":"https://api.github.com/repos/ARMmbed/uvisor/pulls{/number}","milestones_url":"https://api.github.com/repos/ARMmbed/uvisor/milestones{/number}","notifications_url":"https://api.github.com/repos/ARMmbed/uvisor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ARMmbed/uvisor/labels{/name}","releases_url":"https://api.github.com/repos/ARMmbed/uvisor/releases{/id}","deployments_url":"https://api.github.com/repos/ARMmbed/uvisor/deployments","created_at":"2014-12-11T11:59:50Z","updated_at":"2016-05-30T04:35:22Z","pushed_at":"2016-06-03T10:46:32Z","git_url":"git://github.com/ARMmbed/uvisor.git","ssh_url":"git@github.com:ARMmbed/uvisor.git","clone_url":"https://github.com/ARMmbed/uvisor.git","svn_url":"https://github.com/ARMmbed/uvisor","homepage":"","size":6418,"stargazers_count":57,"watchers_count":57,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":33,"mirror_url":null,"open_issues_count":29,"forks":33,"open_issues":29,"watchers":57,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ARMmbed/uvisor/pulls/227"},"html":{"href":"https://github.com/ARMmbed/uvisor/pull/227"},"issue":{"href":"https://api.github.com/repos/ARMmbed/uvisor/issues/227"},"comments":{"href":"https://api.github.com/repos/ARMmbed/uvisor/issues/227/comments"},"review_comments":{"href":"https://api.github.com/repos/ARMmbed/uvisor/pulls/227/comments"},"review_comment":{"href":"https://api.github.com/repos/ARMmbed/uvisor/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ARMmbed/uvisor/pulls/227/commits"},"statuses":{"href":"https://api.github.com/repos/ARMmbed/uvisor/statuses/32fd72503183edfdb7269b5e7c00985aec89260a"}}}}
{"actor":{"display_login":"Patater"}}