{"action":"created","comment":{"url":"https://api.github.com/repos/citra-emu/citra/pulls/comments/90383164","pull_request_review_id":10901704,"id":90383164,"diff_hunk":"@@ -9,29 +9,205 @@\n #include <unordered_map>\n #include <boost/container/flat_map.hpp>\n #include \"common/common_types.h\"\n-#include \"core/hle/kernel/session.h\"\n+#include \"core/hle/kernel/client_port.h\"\n+#include \"core/hle/kernel/thread.h\"\n #include \"core/hle/result.h\"\n+#include \"core/memory.h\"\n+\n+namespace Kernel {\n+class ServerSession;\n+\n+// TODO(Subv): Move these declarations out of here\n+static const int kCommandHeaderOffset = 0x80; ///< Offset into command buffer of header","path":"src/core/hle/service/service.h","position":14,"original_position":14,"commit_id":"2eceee3a4cc2786dae4e9b80a8b5f3bb666d3fc6","original_commit_id":"2eceee3a4cc2786dae4e9b80a8b5f3bb666d3fc6","user":{"login":"Subv","id":357072,"avatar_url":"https://avatars.githubusercontent.com/u/357072?v=3","gravatar_id":"","url":"https://api.github.com/users/Subv","html_url":"https://github.com/Subv","followers_url":"https://api.github.com/users/Subv/followers","following_url":"https://api.github.com/users/Subv/following{/other_user}","gists_url":"https://api.github.com/users/Subv/gists{/gist_id}","starred_url":"https://api.github.com/users/Subv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Subv/subscriptions","organizations_url":"https://api.github.com/users/Subv/orgs","repos_url":"https://api.github.com/users/Subv/repos","events_url":"https://api.github.com/users/Subv/events{/privacy}","received_events_url":"https://api.github.com/users/Subv/received_events","type":"User","site_admin":false},"body":"Where would be a good place to put these?","created_at":"2016-12-01T04:52:49Z","updated_at":"2016-12-01T04:52:49Z","html_url":"https://github.com/citra-emu/citra/pull/2249#discussion_r90383164","pull_request_url":"https://api.github.com/repos/citra-emu/citra/pulls/2249","_links":{"self":{"href":"https://api.github.com/repos/citra-emu/citra/pulls/comments/90383164"},"html":{"href":"https://github.com/citra-emu/citra/pull/2249#discussion_r90383164"},"pull_request":{"href":"https://api.github.com/repos/citra-emu/citra/pulls/2249"}}},"pull_request":{"url":"https://api.github.com/repos/citra-emu/citra/pulls/2249","id":96025391,"html_url":"https://github.com/citra-emu/citra/pull/2249","diff_url":"https://github.com/citra-emu/citra/pull/2249.diff","patch_url":"https://github.com/citra-emu/citra/pull/2249.patch","issue_url":"https://api.github.com/repos/citra-emu/citra/issues/2249","number":2249,"state":"open","locked":false,"title":"[RFC] Kernel/IPC: Use Ports and Sessions as the fundamental building block of Inter Process Communication.","user":{"login":"Subv","id":357072,"avatar_url":"https://avatars.githubusercontent.com/u/357072?v=3","gravatar_id":"","url":"https://api.github.com/users/Subv","html_url":"https://github.com/Subv","followers_url":"https://api.github.com/users/Subv/followers","following_url":"https://api.github.com/users/Subv/following{/other_user}","gists_url":"https://api.github.com/users/Subv/gists{/gist_id}","starred_url":"https://api.github.com/users/Subv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Subv/subscriptions","organizations_url":"https://api.github.com/users/Subv/orgs","repos_url":"https://api.github.com/users/Subv/repos","events_url":"https://api.github.com/users/Subv/events{/privacy}","received_events_url":"https://api.github.com/users/Subv/received_events","type":"User","site_admin":false},"body":"This is an overhaul of #1911 and a continuation of #1842\r\n\r\nThis PR is part of an ongoing effort to implement multiprocess support in Citra.\r\n\r\nAll handles obtained via srv::GetServiceHandle or svcConnectToPort are references to ClientSessions.\r\nService modules will wait on the counterpart of those ClientSessions (Called ServerSessions) using svcReplyAndReceive or svcWaitSynchronization[1|N], and will be awoken when a SyncRequest is performed.\r\n\r\nAll IPC parameter translation for LLE modules will happen inside the implementation of svcReplyAndReceive, this is not implemented in this PR.\r\n\r\nAll IPC parameter translation for HLE modules should happen in the SessionRequestHandler class, this is not implemented in this PR.\r\n\r\nHLE Interfaces are no longer kernel objects, and now derive from SessionRequestHandler, they are bound to a Session pair when a connection request is initiated by the emulated application (See svcConnectToPort and srv:GetServiceHandle).\r\n\r\nThere is currently a very important unimplemented feature related to #2125. SyncRequests should put the calling thread to sleep until the server counterpart of the session handles and answers the request (by means of svcReplyAndReceive), but this is all instantaneous in our current HLE modules.\r\nIt is also speculated that the real kernel preempts the threads running in the AppCore and reschedules to another thread if said thread was waiting on a SyncRequest and the request was completed. (This speculation comes from the aforementioned #2125 and reverse engineering of the svcReplyAndReceive handler in the ARM11 kernel)\r\n","created_at":"2016-12-01T04:42:47Z","updated_at":"2016-12-01T04:52:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"332d1acf71a2e556c39bf5bf9cea16487017b0c9","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/citra-emu/citra/pulls/2249/commits","review_comments_url":"https://api.github.com/repos/citra-emu/citra/pulls/2249/comments","review_comment_url":"https://api.github.com/repos/citra-emu/citra/pulls/comments{/number}","comments_url":"https://api.github.com/repos/citra-emu/citra/issues/2249/comments","statuses_url":"https://api.github.com/repos/citra-emu/citra/statuses/2eceee3a4cc2786dae4e9b80a8b5f3bb666d3fc6","head":{"label":"Subv:sessions_v3","ref":"sessions_v3","sha":"2eceee3a4cc2786dae4e9b80a8b5f3bb666d3fc6","user":{"login":"Subv","id":357072,"avatar_url":"https://avatars.githubusercontent.com/u/357072?v=3","gravatar_id":"","url":"https://api.github.com/users/Subv","html_url":"https://github.com/Subv","followers_url":"https://api.github.com/users/Subv/followers","following_url":"https://api.github.com/users/Subv/following{/other_user}","gists_url":"https://api.github.com/users/Subv/gists{/gist_id}","starred_url":"https://api.github.com/users/Subv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Subv/subscriptions","organizations_url":"https://api.github.com/users/Subv/orgs","repos_url":"https://api.github.com/users/Subv/repos","events_url":"https://api.github.com/users/Subv/events{/privacy}","received_events_url":"https://api.github.com/users/Subv/received_events","type":"User","site_admin":false},"repo":{"id":22818827,"name":"citra","full_name":"Subv/citra","owner":{"login":"Subv","id":357072,"avatar_url":"https://avatars.githubusercontent.com/u/357072?v=3","gravatar_id":"","url":"https://api.github.com/users/Subv","html_url":"https://github.com/Subv","followers_url":"https://api.github.com/users/Subv/followers","following_url":"https://api.github.com/users/Subv/following{/other_user}","gists_url":"https://api.github.com/users/Subv/gists{/gist_id}","starred_url":"https://api.github.com/users/Subv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Subv/subscriptions","organizations_url":"https://api.github.com/users/Subv/orgs","repos_url":"https://api.github.com/users/Subv/repos","events_url":"https://api.github.com/users/Subv/events{/privacy}","received_events_url":"https://api.github.com/users/Subv/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Subv/citra","description":"Nintendo 3DS emulator/debugger","fork":true,"url":"https://api.github.com/repos/Subv/citra","forks_url":"https://api.github.com/repos/Subv/citra/forks","keys_url":"https://api.github.com/repos/Subv/citra/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Subv/citra/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Subv/citra/teams","hooks_url":"https://api.github.com/repos/Subv/citra/hooks","issue_events_url":"https://api.github.com/repos/Subv/citra/issues/events{/number}","events_url":"https://api.github.com/repos/Subv/citra/events","assignees_url":"https://api.github.com/repos/Subv/citra/assignees{/user}","branches_url":"https://api.github.com/repos/Subv/citra/branches{/branch}","tags_url":"https://api.github.com/repos/Subv/citra/tags","blobs_url":"https://api.github.com/repos/Subv/citra/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Subv/citra/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Subv/citra/git/refs{/sha}","trees_url":"https://api.github.com/repos/Subv/citra/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Subv/citra/statuses/{sha}","languages_url":"https://api.github.com/repos/Subv/citra/languages","stargazers_url":"https://api.github.com/repos/Subv/citra/stargazers","contributors_url":"https://api.github.com/repos/Subv/citra/contributors","subscribers_url":"https://api.github.com/repos/Subv/citra/subscribers","subscription_url":"https://api.github.com/repos/Subv/citra/subscription","commits_url":"https://api.github.com/repos/Subv/citra/commits{/sha}","git_commits_url":"https://api.github.com/repos/Subv/citra/git/commits{/sha}","comments_url":"https://api.github.com/repos/Subv/citra/comments{/number}","issue_comment_url":"https://api.github.com/repos/Subv/citra/issues/comments{/number}","contents_url":"https://api.github.com/repos/Subv/citra/contents/{+path}","compare_url":"https://api.github.com/repos/Subv/citra/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Subv/citra/merges","archive_url":"https://api.github.com/repos/Subv/citra/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Subv/citra/downloads","issues_url":"https://api.github.com/repos/Subv/citra/issues{/number}","pulls_url":"https://api.github.com/repos/Subv/citra/pulls{/number}","milestones_url":"https://api.github.com/repos/Subv/citra/milestones{/number}","notifications_url":"https://api.github.com/repos/Subv/citra/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Subv/citra/labels{/name}","releases_url":"https://api.github.com/repos/Subv/citra/releases{/id}","deployments_url":"https://api.github.com/repos/Subv/citra/deployments","created_at":"2014-08-10T21:13:43Z","updated_at":"2016-11-22T00:35:06Z","pushed_at":"2016-12-01T04:28:37Z","git_url":"git://github.com/Subv/citra.git","ssh_url":"git@github.com:Subv/citra.git","clone_url":"https://github.com/Subv/citra.git","svn_url":"https://github.com/Subv/citra","homepage":null,"size":15376,"stargazers_count":5,"watchers_count":5,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":0,"forks":3,"open_issues":0,"watchers":5,"default_branch":"master"}},"base":{"label":"citra-emu:master","ref":"master","sha":"68c00ee771791e5975912c4e0d4be0fb5ab6b8fa","user":{"login":"citra-emu","id":7605670,"avatar_url":"https://avatars.githubusercontent.com/u/7605670?v=3","gravatar_id":"","url":"https://api.github.com/users/citra-emu","html_url":"https://github.com/citra-emu","followers_url":"https://api.github.com/users/citra-emu/followers","following_url":"https://api.github.com/users/citra-emu/following{/other_user}","gists_url":"https://api.github.com/users/citra-emu/gists{/gist_id}","starred_url":"https://api.github.com/users/citra-emu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/citra-emu/subscriptions","organizations_url":"https://api.github.com/users/citra-emu/orgs","repos_url":"https://api.github.com/users/citra-emu/repos","events_url":"https://api.github.com/users/citra-emu/events{/privacy}","received_events_url":"https://api.github.com/users/citra-emu/received_events","type":"Organization","site_admin":false},"repo":{"id":19866730,"name":"citra","full_name":"citra-emu/citra","owner":{"login":"citra-emu","id":7605670,"avatar_url":"https://avatars.githubusercontent.com/u/7605670?v=3","gravatar_id":"","url":"https://api.github.com/users/citra-emu","html_url":"https://github.com/citra-emu","followers_url":"https://api.github.com/users/citra-emu/followers","following_url":"https://api.github.com/users/citra-emu/following{/other_user}","gists_url":"https://api.github.com/users/citra-emu/gists{/gist_id}","starred_url":"https://api.github.com/users/citra-emu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/citra-emu/subscriptions","organizations_url":"https://api.github.com/users/citra-emu/orgs","repos_url":"https://api.github.com/users/citra-emu/repos","events_url":"https://api.github.com/users/citra-emu/events{/privacy}","received_events_url":"https://api.github.com/users/citra-emu/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/citra-emu/citra","description":"Nintendo 3DS Emulator","fork":false,"url":"https://api.github.com/repos/citra-emu/citra","forks_url":"https://api.github.com/repos/citra-emu/citra/forks","keys_url":"https://api.github.com/repos/citra-emu/citra/keys{/key_id}","collaborators_url":"https://api.github.com/repos/citra-emu/citra/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/citra-emu/citra/teams","hooks_url":"https://api.github.com/repos/citra-emu/citra/hooks","issue_events_url":"https://api.github.com/repos/citra-emu/citra/issues/events{/number}","events_url":"https://api.github.com/repos/citra-emu/citra/events","assignees_url":"https://api.github.com/repos/citra-emu/citra/assignees{/user}","branches_url":"https://api.github.com/repos/citra-emu/citra/branches{/branch}","tags_url":"https://api.github.com/repos/citra-emu/citra/tags","blobs_url":"https://api.github.com/repos/citra-emu/citra/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/citra-emu/citra/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/citra-emu/citra/git/refs{/sha}","trees_url":"https://api.github.com/repos/citra-emu/citra/git/trees{/sha}","statuses_url":"https://api.github.com/repos/citra-emu/citra/statuses/{sha}","languages_url":"https://api.github.com/repos/citra-emu/citra/languages","stargazers_url":"https://api.github.com/repos/citra-emu/citra/stargazers","contributors_url":"https://api.github.com/repos/citra-emu/citra/contributors","subscribers_url":"https://api.github.com/repos/citra-emu/citra/subscribers","subscription_url":"https://api.github.com/repos/citra-emu/citra/subscription","commits_url":"https://api.github.com/repos/citra-emu/citra/commits{/sha}","git_commits_url":"https://api.github.com/repos/citra-emu/citra/git/commits{/sha}","comments_url":"https://api.github.com/repos/citra-emu/citra/comments{/number}","issue_comment_url":"https://api.github.com/repos/citra-emu/citra/issues/comments{/number}","contents_url":"https://api.github.com/repos/citra-emu/citra/contents/{+path}","compare_url":"https://api.github.com/repos/citra-emu/citra/compare/{base}...{head}","merges_url":"https://api.github.com/repos/citra-emu/citra/merges","archive_url":"https://api.github.com/repos/citra-emu/citra/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/citra-emu/citra/downloads","issues_url":"https://api.github.com/repos/citra-emu/citra/issues{/number}","pulls_url":"https://api.github.com/repos/citra-emu/citra/pulls{/number}","milestones_url":"https://api.github.com/repos/citra-emu/citra/milestones{/number}","notifications_url":"https://api.github.com/repos/citra-emu/citra/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/citra-emu/citra/labels{/name}","releases_url":"https://api.github.com/repos/citra-emu/citra/releases{/id}","deployments_url":"https://api.github.com/repos/citra-emu/citra/deployments","created_at":"2014-05-16T18:33:15Z","updated_at":"2016-11-30T21:21:42Z","pushed_at":"2016-12-01T04:42:47Z","git_url":"git://github.com/citra-emu/citra.git","ssh_url":"git@github.com:citra-emu/citra.git","clone_url":"https://github.com/citra-emu/citra.git","svn_url":"https://github.com/citra-emu/citra","homepage":"https://citra-emu.org","size":22756,"stargazers_count":2514,"watchers_count":2514,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":654,"mirror_url":null,"open_issues_count":219,"forks":654,"open_issues":219,"watchers":2514,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/citra-emu/citra/pulls/2249"},"html":{"href":"https://github.com/citra-emu/citra/pull/2249"},"issue":{"href":"https://api.github.com/repos/citra-emu/citra/issues/2249"},"comments":{"href":"https://api.github.com/repos/citra-emu/citra/issues/2249/comments"},"review_comments":{"href":"https://api.github.com/repos/citra-emu/citra/pulls/2249/comments"},"review_comment":{"href":"https://api.github.com/repos/citra-emu/citra/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/citra-emu/citra/pulls/2249/commits"},"statuses":{"href":"https://api.github.com/repos/citra-emu/citra/statuses/2eceee3a4cc2786dae4e9b80a8b5f3bb666d3fc6"}}}}
{"actor":{"display_login":"Subv"}}