{"action":"created","comment":{"url":"https://api.github.com/repos/openucx/ucx/pulls/comments/48696240","id":48696240,"diff_hunk":"@@ -0,0 +1,641 @@\n+/**\n+ * Copyright (C) Mellanox Technologies Ltd. 2001-2015.  ALL RIGHTS RESERVED.\n+ *\n+ * See file LICENSE for terms.\n+ */\n+\n+#include \"pgtable.h\"\n+\n+#include <ucs/arch/bitops.h>\n+#include <ucs/debug/log.h>\n+#include <ucs/debug/memtrack.h>\n+#include <ucs/sys/math.h>\n+#include <string.h>\n+\n+\n+#define UCS_PGT_REGION_FMT            \"%p [0x%lx..0x%lx]\"\n+#define UCS_PGT_REGION_ARG(_region)   (_region), (_region)->start, (_region)->end\n+\n+#define ucs_pgt_entry_clear(_pte) \\\n+    { (_pte)->value = 0; }\n+\n+#define ucs_pgt_entry_value(_pte) \\\n+    ((void*)((_pte)->value & UCS_PGT_ENTRY_PTR_MASK))\n+\n+#define ucs_pgt_entry_test(_pte, _flag) \\\n+    ((_pte)->value & (_flag))\n+\n+#define ucs_pgt_entry_present(_pte) \\\n+    ucs_pgt_entry_test(_pte, UCS_PGT_ENTRY_FLAG_REGION | UCS_PGT_ENTRY_FLAG_DIR)\n+\n+#define ucs_pgt_is_addr_aligned(_addr) \\\n+    (!((_addr) & (UCS_PGT_ADDR_ALIGN - 1)))\n+\n+#define ucs_pgt_check_ptr(_ptr) \\\n+    do { \\\n+        ucs_assertv(!((uintptr_t)(_ptr) & (UCS_PGT_ENTRY_MIN_ALIGN - 1)), \\\n+                    \"ptr=%p\", (_ptr)); \\\n+    } while (0)\n+\n+#define ucs_pgt_entry_set_region(_pte, _region) \\\n+    do { \\\n+        ucs_pgt_region_t *tmp = (_region); \\\n+        ucs_pgt_check_ptr(tmp); \\\n+        (_pte)->value = ((uintptr_t)tmp) | UCS_PGT_ENTRY_FLAG_REGION; \\\n+    } while (0)\n+\n+#define ucs_pgt_entry_set_dir(_pte, _dir) \\\n+    do { \\\n+        ucs_pgt_dir_t *tmp = (_dir); \\\n+        ucs_pgt_check_ptr(tmp); \\\n+        (_pte)->value = ((uintptr_t)tmp) | UCS_PGT_ENTRY_FLAG_DIR; \\\n+    } while (0)\n+\n+#define ucs_pgt_entry_get_region(_pte) \\\n+    ({ \\\n+        ucs_assert(ucs_pgt_entry_test(_pte, UCS_PGT_ENTRY_FLAG_REGION)); \\\n+        (ucs_pgt_region_t*)ucs_pgt_entry_value(_pte); \\\n+    })\n+\n+#define ucs_pgt_entry_get_dir(_pte) \\\n+    ({ \\\n+        ucs_assert(ucs_pgt_entry_test(_pte, UCS_PGT_ENTRY_FLAG_DIR)); \\\n+        (ucs_pgt_dir_t*)ucs_pgt_entry_value(_pte); \\","path":"src/ucs/datastruct/pgtable.c","position":63,"original_position":63,"commit_id":"9dbd386eb3f08bb0512eb39bb52450bfcf75f0fa","original_commit_id":"9dbd386eb3f08bb0512eb39bb52450bfcf75f0fa","user":{"login":"miked-mellanox","id":2255576,"avatar_url":"https://avatars.githubusercontent.com/u/2255576?v=3","gravatar_id":"","url":"https://api.github.com/users/miked-mellanox","html_url":"https://github.com/miked-mellanox","followers_url":"https://api.github.com/users/miked-mellanox/followers","following_url":"https://api.github.com/users/miked-mellanox/following{/other_user}","gists_url":"https://api.github.com/users/miked-mellanox/gists{/gist_id}","starred_url":"https://api.github.com/users/miked-mellanox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miked-mellanox/subscriptions","organizations_url":"https://api.github.com/users/miked-mellanox/orgs","repos_url":"https://api.github.com/users/miked-mellanox/repos","events_url":"https://api.github.com/users/miked-mellanox/events{/privacy}","received_events_url":"https://api.github.com/users/miked-mellanox/received_events","type":"User","site_admin":false},"body":"ohh. right, thx","created_at":"2016-01-03T19:45:02Z","updated_at":"2016-01-03T19:45:02Z","html_url":"https://github.com/openucx/ucx/pull/534#discussion_r48696240","pull_request_url":"https://api.github.com/repos/openucx/ucx/pulls/534","_links":{"self":{"href":"https://api.github.com/repos/openucx/ucx/pulls/comments/48696240"},"html":{"href":"https://github.com/openucx/ucx/pull/534#discussion_r48696240"},"pull_request":{"href":"https://api.github.com/repos/openucx/ucx/pulls/534"}}},"pull_request":{"url":"https://api.github.com/repos/openucx/ucx/pulls/534","id":54922102,"html_url":"https://github.com/openucx/ucx/pull/534","diff_url":"https://github.com/openucx/ucx/pull/534.diff","patch_url":"https://github.com/openucx/ucx/pull/534.patch","issue_url":"https://api.github.com/repos/openucx/ucx/issues/534","number":534,"state":"open","locked":false,"title":"UCS/TEST: Implement a page table data structure for address intervals.","user":{"login":"yosefe","id":2255631,"avatar_url":"https://avatars.githubusercontent.com/u/2255631?v=3","gravatar_id":"","url":"https://api.github.com/users/yosefe","html_url":"https://github.com/yosefe","followers_url":"https://api.github.com/users/yosefe/followers","following_url":"https://api.github.com/users/yosefe/following{/other_user}","gists_url":"https://api.github.com/users/yosefe/gists{/gist_id}","starred_url":"https://api.github.com/users/yosefe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yosefe/subscriptions","organizations_url":"https://api.github.com/users/yosefe/orgs","repos_url":"https://api.github.com/users/yosefe/repos","events_url":"https://api.github.com/users/yosefe/events{/privacy}","received_events_url":"https://api.github.com/users/yosefe/received_events","type":"User","site_admin":false},"body":null,"created_at":"2016-01-03T10:04:54Z","updated_at":"2016-01-03T19:45:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e4c08a0410bd5f70871b37de45f88b08a3b2a217","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/openucx/ucx/pulls/534/commits","review_comments_url":"https://api.github.com/repos/openucx/ucx/pulls/534/comments","review_comment_url":"https://api.github.com/repos/openucx/ucx/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openucx/ucx/issues/534/comments","statuses_url":"https://api.github.com/repos/openucx/ucx/statuses/9dbd386eb3f08bb0512eb39bb52450bfcf75f0fa","head":{"label":"yosefe:topic/ucs-pgtable","ref":"topic/ucs-pgtable","sha":"9dbd386eb3f08bb0512eb39bb52450bfcf75f0fa","user":{"login":"yosefe","id":2255631,"avatar_url":"https://avatars.githubusercontent.com/u/2255631?v=3","gravatar_id":"","url":"https://api.github.com/users/yosefe","html_url":"https://github.com/yosefe","followers_url":"https://api.github.com/users/yosefe/followers","following_url":"https://api.github.com/users/yosefe/following{/other_user}","gists_url":"https://api.github.com/users/yosefe/gists{/gist_id}","starred_url":"https://api.github.com/users/yosefe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yosefe/subscriptions","organizations_url":"https://api.github.com/users/yosefe/orgs","repos_url":"https://api.github.com/users/yosefe/repos","events_url":"https://api.github.com/users/yosefe/events{/privacy}","received_events_url":"https://api.github.com/users/yosefe/received_events","type":"User","site_admin":false},"repo":{"id":25532870,"name":"ucx","full_name":"yosefe/ucx","owner":{"login":"yosefe","id":2255631,"avatar_url":"https://avatars.githubusercontent.com/u/2255631?v=3","gravatar_id":"","url":"https://api.github.com/users/yosefe","html_url":"https://github.com/yosefe","followers_url":"https://api.github.com/users/yosefe/followers","following_url":"https://api.github.com/users/yosefe/following{/other_user}","gists_url":"https://api.github.com/users/yosefe/gists{/gist_id}","starred_url":"https://api.github.com/users/yosefe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yosefe/subscriptions","organizations_url":"https://api.github.com/users/yosefe/orgs","repos_url":"https://api.github.com/users/yosefe/repos","events_url":"https://api.github.com/users/yosefe/events{/privacy}","received_events_url":"https://api.github.com/users/yosefe/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/yosefe/ucx","description":"The UCX","fork":true,"url":"https://api.github.com/repos/yosefe/ucx","forks_url":"https://api.github.com/repos/yosefe/ucx/forks","keys_url":"https://api.github.com/repos/yosefe/ucx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yosefe/ucx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yosefe/ucx/teams","hooks_url":"https://api.github.com/repos/yosefe/ucx/hooks","issue_events_url":"https://api.github.com/repos/yosefe/ucx/issues/events{/number}","events_url":"https://api.github.com/repos/yosefe/ucx/events","assignees_url":"https://api.github.com/repos/yosefe/ucx/assignees{/user}","branches_url":"https://api.github.com/repos/yosefe/ucx/branches{/branch}","tags_url":"https://api.github.com/repos/yosefe/ucx/tags","blobs_url":"https://api.github.com/repos/yosefe/ucx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yosefe/ucx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yosefe/ucx/git/refs{/sha}","trees_url":"https://api.github.com/repos/yosefe/ucx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yosefe/ucx/statuses/{sha}","languages_url":"https://api.github.com/repos/yosefe/ucx/languages","stargazers_url":"https://api.github.com/repos/yosefe/ucx/stargazers","contributors_url":"https://api.github.com/repos/yosefe/ucx/contributors","subscribers_url":"https://api.github.com/repos/yosefe/ucx/subscribers","subscription_url":"https://api.github.com/repos/yosefe/ucx/subscription","commits_url":"https://api.github.com/repos/yosefe/ucx/commits{/sha}","git_commits_url":"https://api.github.com/repos/yosefe/ucx/git/commits{/sha}","comments_url":"https://api.github.com/repos/yosefe/ucx/comments{/number}","issue_comment_url":"https://api.github.com/repos/yosefe/ucx/issues/comments{/number}","contents_url":"https://api.github.com/repos/yosefe/ucx/contents/{+path}","compare_url":"https://api.github.com/repos/yosefe/ucx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yosefe/ucx/merges","archive_url":"https://api.github.com/repos/yosefe/ucx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yosefe/ucx/downloads","issues_url":"https://api.github.com/repos/yosefe/ucx/issues{/number}","pulls_url":"https://api.github.com/repos/yosefe/ucx/pulls{/number}","milestones_url":"https://api.github.com/repos/yosefe/ucx/milestones{/number}","notifications_url":"https://api.github.com/repos/yosefe/ucx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yosefe/ucx/labels{/name}","releases_url":"https://api.github.com/repos/yosefe/ucx/releases{/id}","created_at":"2014-10-21T16:22:47Z","updated_at":"2015-07-13T17:18:28Z","pushed_at":"2016-01-03T19:35:03Z","git_url":"git://github.com/yosefe/ucx.git","ssh_url":"git@github.com:yosefe/ucx.git","clone_url":"https://github.com/yosefe/ucx.git","svn_url":"https://github.com/yosefe/ucx","homepage":"","size":3340,"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":"openucx:master","ref":"master","sha":"9971f3baa16c22e6549965d749d1d696401a8bce","user":{"login":"openucx","id":13118737,"avatar_url":"https://avatars.githubusercontent.com/u/13118737?v=3","gravatar_id":"","url":"https://api.github.com/users/openucx","html_url":"https://github.com/openucx","followers_url":"https://api.github.com/users/openucx/followers","following_url":"https://api.github.com/users/openucx/following{/other_user}","gists_url":"https://api.github.com/users/openucx/gists{/gist_id}","starred_url":"https://api.github.com/users/openucx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openucx/subscriptions","organizations_url":"https://api.github.com/users/openucx/orgs","repos_url":"https://api.github.com/users/openucx/repos","events_url":"https://api.github.com/users/openucx/events{/privacy}","received_events_url":"https://api.github.com/users/openucx/received_events","type":"Organization","site_admin":false},"repo":{"id":25379390,"name":"ucx","full_name":"openucx/ucx","owner":{"login":"openucx","id":13118737,"avatar_url":"https://avatars.githubusercontent.com/u/13118737?v=3","gravatar_id":"","url":"https://api.github.com/users/openucx","html_url":"https://github.com/openucx","followers_url":"https://api.github.com/users/openucx/followers","following_url":"https://api.github.com/users/openucx/following{/other_user}","gists_url":"https://api.github.com/users/openucx/gists{/gist_id}","starred_url":"https://api.github.com/users/openucx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openucx/subscriptions","organizations_url":"https://api.github.com/users/openucx/orgs","repos_url":"https://api.github.com/users/openucx/repos","events_url":"https://api.github.com/users/openucx/events{/privacy}","received_events_url":"https://api.github.com/users/openucx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openucx/ucx","description":"Unified Communication X  (mailing list - https://elist.ornl.gov/mailman/listinfo/ucx-group): ","fork":false,"url":"https://api.github.com/repos/openucx/ucx","forks_url":"https://api.github.com/repos/openucx/ucx/forks","keys_url":"https://api.github.com/repos/openucx/ucx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openucx/ucx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openucx/ucx/teams","hooks_url":"https://api.github.com/repos/openucx/ucx/hooks","issue_events_url":"https://api.github.com/repos/openucx/ucx/issues/events{/number}","events_url":"https://api.github.com/repos/openucx/ucx/events","assignees_url":"https://api.github.com/repos/openucx/ucx/assignees{/user}","branches_url":"https://api.github.com/repos/openucx/ucx/branches{/branch}","tags_url":"https://api.github.com/repos/openucx/ucx/tags","blobs_url":"https://api.github.com/repos/openucx/ucx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openucx/ucx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openucx/ucx/git/refs{/sha}","trees_url":"https://api.github.com/repos/openucx/ucx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openucx/ucx/statuses/{sha}","languages_url":"https://api.github.com/repos/openucx/ucx/languages","stargazers_url":"https://api.github.com/repos/openucx/ucx/stargazers","contributors_url":"https://api.github.com/repos/openucx/ucx/contributors","subscribers_url":"https://api.github.com/repos/openucx/ucx/subscribers","subscription_url":"https://api.github.com/repos/openucx/ucx/subscription","commits_url":"https://api.github.com/repos/openucx/ucx/commits{/sha}","git_commits_url":"https://api.github.com/repos/openucx/ucx/git/commits{/sha}","comments_url":"https://api.github.com/repos/openucx/ucx/comments{/number}","issue_comment_url":"https://api.github.com/repos/openucx/ucx/issues/comments{/number}","contents_url":"https://api.github.com/repos/openucx/ucx/contents/{+path}","compare_url":"https://api.github.com/repos/openucx/ucx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openucx/ucx/merges","archive_url":"https://api.github.com/repos/openucx/ucx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openucx/ucx/downloads","issues_url":"https://api.github.com/repos/openucx/ucx/issues{/number}","pulls_url":"https://api.github.com/repos/openucx/ucx/pulls{/number}","milestones_url":"https://api.github.com/repos/openucx/ucx/milestones{/number}","notifications_url":"https://api.github.com/repos/openucx/ucx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openucx/ucx/labels{/name}","releases_url":"https://api.github.com/repos/openucx/ucx/releases{/id}","created_at":"2014-10-17T22:17:24Z","updated_at":"2015-12-31T04:48:42Z","pushed_at":"2016-01-03T19:35:04Z","git_url":"git://github.com/openucx/ucx.git","ssh_url":"git@github.com:openucx/ucx.git","clone_url":"https://github.com/openucx/ucx.git","svn_url":"https://github.com/openucx/ucx","homepage":" http://www.openucx.org","size":4972,"stargazers_count":26,"watchers_count":26,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":19,"mirror_url":null,"open_issues_count":60,"forks":19,"open_issues":60,"watchers":26,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openucx/ucx/pulls/534"},"html":{"href":"https://github.com/openucx/ucx/pull/534"},"issue":{"href":"https://api.github.com/repos/openucx/ucx/issues/534"},"comments":{"href":"https://api.github.com/repos/openucx/ucx/issues/534/comments"},"review_comments":{"href":"https://api.github.com/repos/openucx/ucx/pulls/534/comments"},"review_comment":{"href":"https://api.github.com/repos/openucx/ucx/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openucx/ucx/pulls/534/commits"},"statuses":{"href":"https://api.github.com/repos/openucx/ucx/statuses/9dbd386eb3f08bb0512eb39bb52450bfcf75f0fa"}}}}