{"action":"created","comment":{"url":"https://api.github.com/repos/cahirwpz/mimiker/pulls/comments/90395602","pull_request_review_id":10913319,"id":90395602,"diff_hunk":"@@ -0,0 +1,71 @@\n+#include <uio.h>\n+#include <systm.h>\n+#include <stdc.h>\n+#include <vm_map.h>\n+\n+static int copyin_vmspace(vm_map_t *vm, const void *restrict udaddr,\n+                          void *restrict kaddr, size_t len) {\n+  if (vm == get_kernel_vm_map()) {\n+    memcpy(kaddr, udaddr, len);\n+    return 0;\n+  } else if (vm == get_user_vm_map()) {\n+    return copyin(udaddr, kaddr, len);\n+  } else {\n+    /* copyin on non-active vm maps is not supported */\n+    assert(false);\n+    __builtin_unreachable();\n+  }\n+}\n+static int copyout_vmspace(vm_map_t *vm, const void *restrict kaddr,\n+                           void *restrict udaddr, size_t len) {\n+  if (vm == get_kernel_vm_map()) {\n+    memcpy(udaddr, kaddr, len);\n+    return 0;\n+  } else if (vm == get_user_vm_map()) {\n+    return copyout(kaddr, udaddr, len);\n+  } else {\n+    /* copyout on non-active vm maps is not supported */\n+    assert(false);\n+    __builtin_unreachable();\n+  }\n+}\n+\n+/* Heavily inspired by NetBSD's uiomove */\n+/* This function modifies uio to reflect on the progress. */\n+int uiomove(void *buf, size_t n, uio_t *uio) {\n+  char *cbuf = buf + uio->uio_offset;\n+  assert(uio->uio_op == UIO_READ || uio->uio_op == UIO_WRITE);\n+  int error = 0;\n+  while (n > 0 && uio->uio_resid > 0) {\n+    /* Take the first io vector */\n+    iovec_t *iov = uio->uio_iov;\n+    size_t cnt = iov->iov_len;\n+    if (cnt == 0) {\n+      /* If no data left to move in this vector, proceed to the next io vector,","path":"sys/subr_copy.c","position":44,"original_position":44,"commit_id":"e69c4d1f42195c869314aaf7c053dc4d2f7336d0","original_commit_id":"e69c4d1f42195c869314aaf7c053dc4d2f7336d0","user":{"login":"cahirwpz","id":265236,"avatar_url":"https://avatars.githubusercontent.com/u/265236?v=3","gravatar_id":"","url":"https://api.github.com/users/cahirwpz","html_url":"https://github.com/cahirwpz","followers_url":"https://api.github.com/users/cahirwpz/followers","following_url":"https://api.github.com/users/cahirwpz/following{/other_user}","gists_url":"https://api.github.com/users/cahirwpz/gists{/gist_id}","starred_url":"https://api.github.com/users/cahirwpz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cahirwpz/subscriptions","organizations_url":"https://api.github.com/users/cahirwpz/orgs","repos_url":"https://api.github.com/users/cahirwpz/repos","events_url":"https://api.github.com/users/cahirwpz/events{/privacy}","received_events_url":"https://api.github.com/users/cahirwpz/received_events","type":"User","site_admin":false},"body":"`s/vector/block/` ?","created_at":"2016-12-01T07:35:40Z","updated_at":"2016-12-01T07:35:41Z","html_url":"https://github.com/cahirwpz/mimiker/pull/154#discussion_r90395602","pull_request_url":"https://api.github.com/repos/cahirwpz/mimiker/pulls/154","_links":{"self":{"href":"https://api.github.com/repos/cahirwpz/mimiker/pulls/comments/90395602"},"html":{"href":"https://github.com/cahirwpz/mimiker/pull/154#discussion_r90395602"},"pull_request":{"href":"https://api.github.com/repos/cahirwpz/mimiker/pulls/154"}}},"pull_request":{"url":"https://api.github.com/repos/cahirwpz/mimiker/pulls/154","id":95595619,"html_url":"https://github.com/cahirwpz/mimiker/pull/154","diff_url":"https://github.com/cahirwpz/mimiker/pull/154.diff","patch_url":"https://github.com/cahirwpz/mimiker/pull/154.patch","issue_url":"https://api.github.com/repos/cahirwpz/mimiker/issues/154","number":154,"state":"open","locked":false,"title":"Implemented uiomove (and imported device interface)","user":{"login":"rafalcieslak","id":6637987,"avatar_url":"https://avatars.githubusercontent.com/u/6637987?v=3","gravatar_id":"","url":"https://api.github.com/users/rafalcieslak","html_url":"https://github.com/rafalcieslak","followers_url":"https://api.github.com/users/rafalcieslak/followers","following_url":"https://api.github.com/users/rafalcieslak/following{/other_user}","gists_url":"https://api.github.com/users/rafalcieslak/gists{/gist_id}","starred_url":"https://api.github.com/users/rafalcieslak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rafalcieslak/subscriptions","organizations_url":"https://api.github.com/users/rafalcieslak/orgs","repos_url":"https://api.github.com/users/rafalcieslak/repos","events_url":"https://api.github.com/users/rafalcieslak/events{/privacy}","received_events_url":"https://api.github.com/users/rafalcieslak/received_events","type":"User","site_admin":false},"body":"This was indeed straight-forward. I hope this is what you meant!\r\n\r\nI imported 8d87530 with very minor changes.\r\n\r\nThe provided test case verifies that both move directions work, multiple io vectors are supported, as well as offsets.","created_at":"2016-11-28T23:13:59Z","updated_at":"2016-12-01T07:35:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1ad6f533e9d4d6fbfcb96cd7999e4429ee528066","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/cahirwpz/mimiker/pulls/154/commits","review_comments_url":"https://api.github.com/repos/cahirwpz/mimiker/pulls/154/comments","review_comment_url":"https://api.github.com/repos/cahirwpz/mimiker/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cahirwpz/mimiker/issues/154/comments","statuses_url":"https://api.github.com/repos/cahirwpz/mimiker/statuses/e69c4d1f42195c869314aaf7c053dc4d2f7336d0","head":{"label":"rafalcieslak:uiomove","ref":"uiomove","sha":"e69c4d1f42195c869314aaf7c053dc4d2f7336d0","user":{"login":"rafalcieslak","id":6637987,"avatar_url":"https://avatars.githubusercontent.com/u/6637987?v=3","gravatar_id":"","url":"https://api.github.com/users/rafalcieslak","html_url":"https://github.com/rafalcieslak","followers_url":"https://api.github.com/users/rafalcieslak/followers","following_url":"https://api.github.com/users/rafalcieslak/following{/other_user}","gists_url":"https://api.github.com/users/rafalcieslak/gists{/gist_id}","starred_url":"https://api.github.com/users/rafalcieslak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rafalcieslak/subscriptions","organizations_url":"https://api.github.com/users/rafalcieslak/orgs","repos_url":"https://api.github.com/users/rafalcieslak/repos","events_url":"https://api.github.com/users/rafalcieslak/events{/privacy}","received_events_url":"https://api.github.com/users/rafalcieslak/received_events","type":"User","site_admin":false},"repo":{"id":47133877,"name":"mimiker","full_name":"rafalcieslak/mimiker","owner":{"login":"rafalcieslak","id":6637987,"avatar_url":"https://avatars.githubusercontent.com/u/6637987?v=3","gravatar_id":"","url":"https://api.github.com/users/rafalcieslak","html_url":"https://github.com/rafalcieslak","followers_url":"https://api.github.com/users/rafalcieslak/followers","following_url":"https://api.github.com/users/rafalcieslak/following{/other_user}","gists_url":"https://api.github.com/users/rafalcieslak/gists{/gist_id}","starred_url":"https://api.github.com/users/rafalcieslak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rafalcieslak/subscriptions","organizations_url":"https://api.github.com/users/rafalcieslak/orgs","repos_url":"https://api.github.com/users/rafalcieslak/repos","events_url":"https://api.github.com/users/rafalcieslak/events{/privacy}","received_events_url":"https://api.github.com/users/rafalcieslak/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rafalcieslak/mimiker","description":" An experiment with implementation of very simple operating system for Malta board ","fork":true,"url":"https://api.github.com/repos/rafalcieslak/mimiker","forks_url":"https://api.github.com/repos/rafalcieslak/mimiker/forks","keys_url":"https://api.github.com/repos/rafalcieslak/mimiker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rafalcieslak/mimiker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rafalcieslak/mimiker/teams","hooks_url":"https://api.github.com/repos/rafalcieslak/mimiker/hooks","issue_events_url":"https://api.github.com/repos/rafalcieslak/mimiker/issues/events{/number}","events_url":"https://api.github.com/repos/rafalcieslak/mimiker/events","assignees_url":"https://api.github.com/repos/rafalcieslak/mimiker/assignees{/user}","branches_url":"https://api.github.com/repos/rafalcieslak/mimiker/branches{/branch}","tags_url":"https://api.github.com/repos/rafalcieslak/mimiker/tags","blobs_url":"https://api.github.com/repos/rafalcieslak/mimiker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rafalcieslak/mimiker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rafalcieslak/mimiker/git/refs{/sha}","trees_url":"https://api.github.com/repos/rafalcieslak/mimiker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rafalcieslak/mimiker/statuses/{sha}","languages_url":"https://api.github.com/repos/rafalcieslak/mimiker/languages","stargazers_url":"https://api.github.com/repos/rafalcieslak/mimiker/stargazers","contributors_url":"https://api.github.com/repos/rafalcieslak/mimiker/contributors","subscribers_url":"https://api.github.com/repos/rafalcieslak/mimiker/subscribers","subscription_url":"https://api.github.com/repos/rafalcieslak/mimiker/subscription","commits_url":"https://api.github.com/repos/rafalcieslak/mimiker/commits{/sha}","git_commits_url":"https://api.github.com/repos/rafalcieslak/mimiker/git/commits{/sha}","comments_url":"https://api.github.com/repos/rafalcieslak/mimiker/comments{/number}","issue_comment_url":"https://api.github.com/repos/rafalcieslak/mimiker/issues/comments{/number}","contents_url":"https://api.github.com/repos/rafalcieslak/mimiker/contents/{+path}","compare_url":"https://api.github.com/repos/rafalcieslak/mimiker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rafalcieslak/mimiker/merges","archive_url":"https://api.github.com/repos/rafalcieslak/mimiker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rafalcieslak/mimiker/downloads","issues_url":"https://api.github.com/repos/rafalcieslak/mimiker/issues{/number}","pulls_url":"https://api.github.com/repos/rafalcieslak/mimiker/pulls{/number}","milestones_url":"https://api.github.com/repos/rafalcieslak/mimiker/milestones{/number}","notifications_url":"https://api.github.com/repos/rafalcieslak/mimiker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rafalcieslak/mimiker/labels{/name}","releases_url":"https://api.github.com/repos/rafalcieslak/mimiker/releases{/id}","deployments_url":"https://api.github.com/repos/rafalcieslak/mimiker/deployments","created_at":"2015-11-30T17:12:17Z","updated_at":"2016-11-05T15:34:25Z","pushed_at":"2016-11-29T20:47:34Z","git_url":"git://github.com/rafalcieslak/mimiker.git","ssh_url":"git@github.com:rafalcieslak/mimiker.git","clone_url":"https://github.com/rafalcieslak/mimiker.git","svn_url":"https://github.com/rafalcieslak/mimiker","homepage":"","size":1603,"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":"cahirwpz:master","ref":"master","sha":"eff816283480b88b1ee1c5a053a728a5774a2c3c","user":{"login":"cahirwpz","id":265236,"avatar_url":"https://avatars.githubusercontent.com/u/265236?v=3","gravatar_id":"","url":"https://api.github.com/users/cahirwpz","html_url":"https://github.com/cahirwpz","followers_url":"https://api.github.com/users/cahirwpz/followers","following_url":"https://api.github.com/users/cahirwpz/following{/other_user}","gists_url":"https://api.github.com/users/cahirwpz/gists{/gist_id}","starred_url":"https://api.github.com/users/cahirwpz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cahirwpz/subscriptions","organizations_url":"https://api.github.com/users/cahirwpz/orgs","repos_url":"https://api.github.com/users/cahirwpz/repos","events_url":"https://api.github.com/users/cahirwpz/events{/privacy}","received_events_url":"https://api.github.com/users/cahirwpz/received_events","type":"User","site_admin":false},"repo":{"id":46346617,"name":"mimiker","full_name":"cahirwpz/mimiker","owner":{"login":"cahirwpz","id":265236,"avatar_url":"https://avatars.githubusercontent.com/u/265236?v=3","gravatar_id":"","url":"https://api.github.com/users/cahirwpz","html_url":"https://github.com/cahirwpz","followers_url":"https://api.github.com/users/cahirwpz/followers","following_url":"https://api.github.com/users/cahirwpz/following{/other_user}","gists_url":"https://api.github.com/users/cahirwpz/gists{/gist_id}","starred_url":"https://api.github.com/users/cahirwpz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cahirwpz/subscriptions","organizations_url":"https://api.github.com/users/cahirwpz/orgs","repos_url":"https://api.github.com/users/cahirwpz/repos","events_url":"https://api.github.com/users/cahirwpz/events{/privacy}","received_events_url":"https://api.github.com/users/cahirwpz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cahirwpz/mimiker","description":"An experiment with implementation of very simple operating system for Malta board","fork":false,"url":"https://api.github.com/repos/cahirwpz/mimiker","forks_url":"https://api.github.com/repos/cahirwpz/mimiker/forks","keys_url":"https://api.github.com/repos/cahirwpz/mimiker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cahirwpz/mimiker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cahirwpz/mimiker/teams","hooks_url":"https://api.github.com/repos/cahirwpz/mimiker/hooks","issue_events_url":"https://api.github.com/repos/cahirwpz/mimiker/issues/events{/number}","events_url":"https://api.github.com/repos/cahirwpz/mimiker/events","assignees_url":"https://api.github.com/repos/cahirwpz/mimiker/assignees{/user}","branches_url":"https://api.github.com/repos/cahirwpz/mimiker/branches{/branch}","tags_url":"https://api.github.com/repos/cahirwpz/mimiker/tags","blobs_url":"https://api.github.com/repos/cahirwpz/mimiker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cahirwpz/mimiker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cahirwpz/mimiker/git/refs{/sha}","trees_url":"https://api.github.com/repos/cahirwpz/mimiker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cahirwpz/mimiker/statuses/{sha}","languages_url":"https://api.github.com/repos/cahirwpz/mimiker/languages","stargazers_url":"https://api.github.com/repos/cahirwpz/mimiker/stargazers","contributors_url":"https://api.github.com/repos/cahirwpz/mimiker/contributors","subscribers_url":"https://api.github.com/repos/cahirwpz/mimiker/subscribers","subscription_url":"https://api.github.com/repos/cahirwpz/mimiker/subscription","commits_url":"https://api.github.com/repos/cahirwpz/mimiker/commits{/sha}","git_commits_url":"https://api.github.com/repos/cahirwpz/mimiker/git/commits{/sha}","comments_url":"https://api.github.com/repos/cahirwpz/mimiker/comments{/number}","issue_comment_url":"https://api.github.com/repos/cahirwpz/mimiker/issues/comments{/number}","contents_url":"https://api.github.com/repos/cahirwpz/mimiker/contents/{+path}","compare_url":"https://api.github.com/repos/cahirwpz/mimiker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cahirwpz/mimiker/merges","archive_url":"https://api.github.com/repos/cahirwpz/mimiker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cahirwpz/mimiker/downloads","issues_url":"https://api.github.com/repos/cahirwpz/mimiker/issues{/number}","pulls_url":"https://api.github.com/repos/cahirwpz/mimiker/pulls{/number}","milestones_url":"https://api.github.com/repos/cahirwpz/mimiker/milestones{/number}","notifications_url":"https://api.github.com/repos/cahirwpz/mimiker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cahirwpz/mimiker/labels{/name}","releases_url":"https://api.github.com/repos/cahirwpz/mimiker/releases{/id}","deployments_url":"https://api.github.com/repos/cahirwpz/mimiker/deployments","created_at":"2015-11-17T12:46:47Z","updated_at":"2016-10-23T17:00:09Z","pushed_at":"2016-11-30T11:02:34Z","git_url":"git://github.com/cahirwpz/mimiker.git","ssh_url":"git@github.com:cahirwpz/mimiker.git","clone_url":"https://github.com/cahirwpz/mimiker.git","svn_url":"https://github.com/cahirwpz/mimiker","homepage":"","size":1758,"stargazers_count":6,"watchers_count":6,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":15,"forks":13,"open_issues":15,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cahirwpz/mimiker/pulls/154"},"html":{"href":"https://github.com/cahirwpz/mimiker/pull/154"},"issue":{"href":"https://api.github.com/repos/cahirwpz/mimiker/issues/154"},"comments":{"href":"https://api.github.com/repos/cahirwpz/mimiker/issues/154/comments"},"review_comments":{"href":"https://api.github.com/repos/cahirwpz/mimiker/pulls/154/comments"},"review_comment":{"href":"https://api.github.com/repos/cahirwpz/mimiker/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cahirwpz/mimiker/pulls/154/commits"},"statuses":{"href":"https://api.github.com/repos/cahirwpz/mimiker/statuses/e69c4d1f42195c869314aaf7c053dc4d2f7336d0"}}}}
{"actor":{"display_login":"cahirwpz"}}