From d96a9e0c11d653a88bfee53e7ff11c4ba7a159a7 Mon Sep 17 00:00:00 2001
From: Yuri Kunde Schlesner <yuriks@yuriks.net>
Date: Tue, 6 Jun 2017 01:29:46 -0700
Subject: [PATCH] Service: Remove unnecessary includes from service.h

This has a huge fallout in terms of needing to fix other files because
all service implementations included that file.
---
 src/citra_qt/debugger/graphics/graphics_cmdlists.cpp |  1 +
 src/core/hle/service/ac/ac.cpp                       |  5 +++++
 src/core/hle/service/am/am.cpp                       |  6 ++++--
 src/core/hle/service/boss/boss.cpp                   |  3 +++
 src/core/hle/service/cam/cam.cpp                     |  4 ++++
 src/core/hle/service/cecd/cecd.cpp                   |  3 +++
 src/core/hle/service/cfg/cfg.cpp                     |  3 +++
 src/core/hle/service/csnd_snd.cpp                    |  3 +++
 src/core/hle/service/dlp/dlp_srvr.cpp                |  1 +
 src/core/hle/service/dsp_dsp.cpp                     |  6 ++++++
 src/core/hle/service/err_f.cpp                       |  2 +-
 src/core/hle/service/frd/frd.cpp                     |  5 +++++
 src/core/hle/service/fs/archive.cpp                  |  3 +++
 src/core/hle/service/fs/fs_user.cpp                  |  3 +++
 src/core/hle/service/gsp_gpu.cpp                     |  2 ++
 src/core/hle/service/hid/hid.cpp                     |  2 ++
 src/core/hle/service/ir/ir_rst.cpp                   |  1 +
 src/core/hle/service/ir/ir_user.cpp                  |  1 +
 src/core/hle/service/ldr_ro/ldr_ro.cpp               |  1 +
 src/core/hle/service/mic_u.cpp                       |  2 ++
 src/core/hle/service/ndm/ndm.cpp                     |  2 ++
 src/core/hle/service/nfc/nfc.cpp                     |  2 ++
 src/core/hle/service/nim/nim.cpp                     |  1 +
 src/core/hle/service/nwm/nwm_uds.cpp                 |  1 +
 src/core/hle/service/nwm/uds_beacon.cpp              |  7 +++----
 src/core/hle/service/service.cpp                     |  1 +
 src/core/hle/service/service.h                       | 12 +++++++-----
 src/core/hle/service/sm/sm.cpp                       |  1 +
 src/core/hle/service/sm/srv.cpp                      |  3 +++
 src/core/hle/service/soc_u.cpp                       |  1 +
 src/core/hle/service/ssl_c.cpp                       |  2 ++
 src/core/hle/service/y2r_u.cpp                       |  2 ++
 32 files changed, 80 insertions(+), 12 deletions(-)

diff --git a/src/citra_qt/debugger/graphics/graphics_cmdlists.cpp b/src/citra_qt/debugger/graphics/graphics_cmdlists.cpp
index c68fe753b2..7d06ec28a4 100644
--- a/src/citra_qt/debugger/graphics/graphics_cmdlists.cpp
+++ b/src/citra_qt/debugger/graphics/graphics_cmdlists.cpp
@@ -17,6 +17,7 @@
 #include "citra_qt/util/spinbox.h"
 #include "citra_qt/util/util.h"
 #include "common/vector_math.h"
+#include "core/memory.h"
 #include "video_core/debug_utils/debug_utils.h"
 #include "video_core/pica_state.h"
 #include "video_core/regs.h"
diff --git a/src/core/hle/service/ac/ac.cpp b/src/core/hle/service/ac/ac.cpp
index aa270a2c3b..e3dd23949f 100644
--- a/src/core/hle/service/ac/ac.cpp
+++ b/src/core/hle/service/ac/ac.cpp
@@ -4,11 +4,16 @@
 
 #include <array>
 
+#include "common/common_types.h"
 #include "common/logging/log.h"
+#include "core/hle/ipc.h"
 #include "core/hle/kernel/event.h"
+#include "core/hle/kernel/handle_table.h"
+#include "core/hle/result.h"
 #include "core/hle/service/ac/ac.h"
 #include "core/hle/service/ac/ac_i.h"
 #include "core/hle/service/ac/ac_u.h"
+#include "core/memory.h"
 
 namespace Service {
 namespace AC {
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp
index d344a622f8..961305e9f7 100644
--- a/src/core/hle/service/am/am.cpp
+++ b/src/core/hle/service/am/am.cpp
@@ -2,8 +2,12 @@
 // Licensed under GPLv2 or any later version
 // Refer to the license.txt file included.
 
+#include <array>
 #include <cinttypes>
+#include "common/common_types.h"
 #include "common/logging/log.h"
+#include "core/hle/ipc.h"
+#include "core/hle/result.h"
 #include "core/hle/service/am/am.h"
 #include "core/hle/service/am/am_app.h"
 #include "core/hle/service/am/am_net.h"
@@ -176,8 +180,6 @@ void GetTicketList(Service::Interface* self) {
 }
 
 void Init() {
-    using namespace Kernel;
-
     AddService(new AM_APP_Interface);
     AddService(new AM_NET_Interface);
     AddService(new AM_SYS_Interface);
diff --git a/src/core/hle/service/boss/boss.cpp b/src/core/hle/service/boss/boss.cpp
index 91056189a6..2bba3aff63 100644
--- a/src/core/hle/service/boss/boss.cpp
+++ b/src/core/hle/service/boss/boss.cpp
@@ -3,6 +3,9 @@
 // Refer to the license.txt file included.
 
 #include <cinttypes>
+#include "common/logging/log.h"
+#include "core/hle/ipc.h"
+#include "core/hle/result.h"
 #include "core/hle/service/boss/boss.h"
 #include "core/hle/service/boss/boss_p.h"
 #include "core/hle/service/boss/boss_u.h"
diff --git a/src/core/hle/service/cam/cam.cpp b/src/core/hle/service/cam/cam.cpp
index 85af70a3f8..7394c844f9 100644
--- a/src/core/hle/service/cam/cam.cpp
+++ b/src/core/hle/service/cam/cam.cpp
@@ -11,13 +11,17 @@
 #include "common/logging/log.h"
 #include "core/core_timing.h"
 #include "core/frontend/camera/factory.h"
+#include "core/hle/ipc.h"
+#include "core/hle/ipc_helpers.h"
 #include "core/hle/kernel/event.h"
+#include "core/hle/result.h"
 #include "core/hle/service/cam/cam.h"
 #include "core/hle/service/cam/cam_c.h"
 #include "core/hle/service/cam/cam_q.h"
 #include "core/hle/service/cam/cam_s.h"
 #include "core/hle/service/cam/cam_u.h"
 #include "core/hle/service/service.h"
+#include "core/memory.h"
 #include "core/settings.h"
 
 namespace Service {
diff --git a/src/core/hle/service/cecd/cecd.cpp b/src/core/hle/service/cecd/cecd.cpp
index eb04273dbd..bd98142446 100644
--- a/src/core/hle/service/cecd/cecd.cpp
+++ b/src/core/hle/service/cecd/cecd.cpp
@@ -3,7 +3,10 @@
 // Refer to the license.txt file included.
 
 #include "common/logging/log.h"
+#include "core/hle/ipc.h"
 #include "core/hle/kernel/event.h"
+#include "core/hle/kernel/handle_table.h"
+#include "core/hle/result.h"
 #include "core/hle/service/cecd/cecd.h"
 #include "core/hle/service/cecd/cecd_ndm.h"
 #include "core/hle/service/cecd/cecd_s.h"
diff --git a/src/core/hle/service/cfg/cfg.cpp b/src/core/hle/service/cfg/cfg.cpp
index caa41ded72..5a7878b317 100644
--- a/src/core/hle/service/cfg/cfg.cpp
+++ b/src/core/hle/service/cfg/cfg.cpp
@@ -13,6 +13,8 @@
 #include "core/file_sys/archive_systemsavedata.h"
 #include "core/file_sys/errors.h"
 #include "core/file_sys/file_backend.h"
+#include "core/hle/ipc.h"
+#include "core/hle/ipc_helpers.h"
 #include "core/hle/result.h"
 #include "core/hle/service/cfg/cfg.h"
 #include "core/hle/service/cfg/cfg_i.h"
@@ -21,6 +23,7 @@
 #include "core/hle/service/cfg/cfg_u.h"
 #include "core/hle/service/fs/archive.h"
 #include "core/hle/service/service.h"
+#include "core/memory.h"
 #include "core/settings.h"
 
 namespace Service {
diff --git a/src/core/hle/service/csnd_snd.cpp b/src/core/hle/service/csnd_snd.cpp
index 6cf62f9bc2..1455f20ca5 100644
--- a/src/core/hle/service/csnd_snd.cpp
+++ b/src/core/hle/service/csnd_snd.cpp
@@ -4,9 +4,12 @@
 
 #include <cstring>
 #include "common/alignment.h"
+#include "core/hle/ipc.h"
+#include "core/hle/kernel/handle_table.h"
 #include "core/hle/kernel/mutex.h"
 #include "core/hle/kernel/shared_memory.h"
 #include "core/hle/service/csnd_snd.h"
+#include "core/memory.h"
 
 namespace Service {
 namespace CSND {
diff --git a/src/core/hle/service/dlp/dlp_srvr.cpp b/src/core/hle/service/dlp/dlp_srvr.cpp
index 25c07f4010..32cfa2c449 100644
--- a/src/core/hle/service/dlp/dlp_srvr.cpp
+++ b/src/core/hle/service/dlp/dlp_srvr.cpp
@@ -4,6 +4,7 @@
 
 #include "common/common_types.h"
 #include "common/logging/log.h"
+#include "core/hle/ipc.h"
 #include "core/hle/result.h"
 #include "core/hle/service/dlp/dlp_srvr.h"
 
diff --git a/src/core/hle/service/dsp_dsp.cpp b/src/core/hle/service/dsp_dsp.cpp
index 79171a0bc1..363066d147 100644
--- a/src/core/hle/service/dsp_dsp.cpp
+++ b/src/core/hle/service/dsp_dsp.cpp
@@ -3,12 +3,18 @@
 // Refer to the license.txt file included.
 
 #include <algorithm>
+#include <array>
 #include <cinttypes>
 #include "audio_core/hle/pipe.h"
+#include "common/assert.h"
 #include "common/hash.h"
 #include "common/logging/log.h"
+#include "core/hle/ipc.h"
 #include "core/hle/kernel/event.h"
+#include "core/hle/kernel/handle_table.h"
+#include "core/hle/result.h"
 #include "core/hle/service/dsp_dsp.h"
+#include "core/memory.h"
 
 using DspPipe = DSP::HLE::DspPipe;
 
diff --git a/src/core/hle/service/err_f.cpp b/src/core/hle/service/err_f.cpp
index 4f4dc6dc70..7c8f4339fe 100644
--- a/src/core/hle/service/err_f.cpp
+++ b/src/core/hle/service/err_f.cpp
@@ -6,11 +6,11 @@
 #include <chrono>
 #include <iomanip>
 #include <sstream>
-
 #include "common/bit_field.h"
 #include "common/common_types.h"
 #include "common/logging/log.h"
 #include "core/core.h"
+#include "core/hle/ipc.h"
 #include "core/hle/result.h"
 #include "core/hle/service/err_f.h"
 
diff --git a/src/core/hle/service/frd/frd.cpp b/src/core/hle/service/frd/frd.cpp
index 34fdf7f535..76ecda8b70 100644
--- a/src/core/hle/service/frd/frd.cpp
+++ b/src/core/hle/service/frd/frd.cpp
@@ -2,11 +2,16 @@
 // Licensed under GPLv2 or any later version
 // Refer to the license.txt file included.
 
+#include "common/assert.h"
+#include "common/logging/log.h"
 #include "common/string_util.h"
+#include "core/hle/ipc.h"
+#include "core/hle/result.h"
 #include "core/hle/service/frd/frd.h"
 #include "core/hle/service/frd/frd_a.h"
 #include "core/hle/service/frd/frd_u.h"
 #include "core/hle/service/service.h"
+#include "core/memory.h"
 
 namespace Service {
 namespace FRD {
diff --git a/src/core/hle/service/fs/archive.cpp b/src/core/hle/service/fs/archive.cpp
index bbc5f80675..3605ef175d 100644
--- a/src/core/hle/service/fs/archive.cpp
+++ b/src/core/hle/service/fs/archive.cpp
@@ -24,7 +24,10 @@
 #include "core/file_sys/directory_backend.h"
 #include "core/file_sys/errors.h"
 #include "core/file_sys/file_backend.h"
+#include "core/hle/ipc.h"
+#include "core/hle/kernel/client_port.h"
 #include "core/hle/kernel/client_session.h"
+#include "core/hle/kernel/handle_table.h"
 #include "core/hle/kernel/server_session.h"
 #include "core/hle/result.h"
 #include "core/hle/service/fs/archive.h"
diff --git a/src/core/hle/service/fs/fs_user.cpp b/src/core/hle/service/fs/fs_user.cpp
index fe50403b96..34e1783ecd 100644
--- a/src/core/hle/service/fs/fs_user.cpp
+++ b/src/core/hle/service/fs/fs_user.cpp
@@ -10,6 +10,9 @@
 #include "common/string_util.h"
 #include "core/core.h"
 #include "core/file_sys/errors.h"
+#include "core/hle/ipc.h"
+#include "core/hle/ipc_helpers.h"
+#include "core/hle/kernel/client_port.h"
 #include "core/hle/kernel/client_session.h"
 #include "core/hle/kernel/server_session.h"
 #include "core/hle/result.h"
diff --git a/src/core/hle/service/gsp_gpu.cpp b/src/core/hle/service/gsp_gpu.cpp
index 94f6b8a9c7..6ff0f4812c 100644
--- a/src/core/hle/service/gsp_gpu.cpp
+++ b/src/core/hle/service/gsp_gpu.cpp
@@ -5,7 +5,9 @@
 #include "common/bit_field.h"
 #include "common/microprofile.h"
 #include "core/core.h"
+#include "core/hle/ipc.h"
 #include "core/hle/kernel/event.h"
+#include "core/hle/kernel/handle_table.h"
 #include "core/hle/kernel/shared_memory.h"
 #include "core/hle/result.h"
 #include "core/hle/service/gsp_gpu.h"
diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp
index 64d01cdd7d..5255f6dc82 100644
--- a/src/core/hle/service/hid/hid.cpp
+++ b/src/core/hle/service/hid/hid.cpp
@@ -10,7 +10,9 @@
 #include "core/core_timing.h"
 #include "core/frontend/emu_window.h"
 #include "core/frontend/input.h"
+#include "core/hle/ipc.h"
 #include "core/hle/kernel/event.h"
+#include "core/hle/kernel/handle_table.h"
 #include "core/hle/kernel/shared_memory.h"
 #include "core/hle/service/hid/hid.h"
 #include "core/hle/service/hid/hid_spvr.h"
diff --git a/src/core/hle/service/ir/ir_rst.cpp b/src/core/hle/service/ir/ir_rst.cpp
index 53807cd918..0de6980031 100644
--- a/src/core/hle/service/ir/ir_rst.cpp
+++ b/src/core/hle/service/ir/ir_rst.cpp
@@ -6,6 +6,7 @@
 #include "common/bit_field.h"
 #include "core/core_timing.h"
 #include "core/frontend/input.h"
+#include "core/hle/ipc_helpers.h"
 #include "core/hle/kernel/event.h"
 #include "core/hle/kernel/shared_memory.h"
 #include "core/hle/service/hid/hid.h"
diff --git a/src/core/hle/service/ir/ir_user.cpp b/src/core/hle/service/ir/ir_user.cpp
index 369115f092..fdecdce649 100644
--- a/src/core/hle/service/ir/ir_user.cpp
+++ b/src/core/hle/service/ir/ir_user.cpp
@@ -7,6 +7,7 @@
 #include <boost/optional.hpp>
 #include "common/string_util.h"
 #include "common/swap.h"
+#include "core/hle/ipc_helpers.h"
 #include "core/hle/kernel/event.h"
 #include "core/hle/kernel/shared_memory.h"
 #include "core/hle/service/ir/extra_hid.h"
diff --git a/src/core/hle/service/ldr_ro/ldr_ro.cpp b/src/core/hle/service/ldr_ro/ldr_ro.cpp
index d1e6d869f2..7255ea0269 100644
--- a/src/core/hle/service/ldr_ro/ldr_ro.cpp
+++ b/src/core/hle/service/ldr_ro/ldr_ro.cpp
@@ -7,6 +7,7 @@
 #include "common/logging/log.h"
 #include "core/arm/arm_interface.h"
 #include "core/core.h"
+#include "core/hle/ipc_helpers.h"
 #include "core/hle/kernel/process.h"
 #include "core/hle/kernel/vm_manager.h"
 #include "core/hle/service/ldr_ro/cro_helper.h"
diff --git a/src/core/hle/service/mic_u.cpp b/src/core/hle/service/mic_u.cpp
index e98388560f..35212b59b7 100644
--- a/src/core/hle/service/mic_u.cpp
+++ b/src/core/hle/service/mic_u.cpp
@@ -3,7 +3,9 @@
 // Refer to the license.txt file included.
 
 #include "common/logging/log.h"
+#include "core/hle/ipc.h"
 #include "core/hle/kernel/event.h"
+#include "core/hle/kernel/handle_table.h"
 #include "core/hle/kernel/kernel.h"
 #include "core/hle/kernel/shared_memory.h"
 #include "core/hle/service/mic_u.h"
diff --git a/src/core/hle/service/ndm/ndm.cpp b/src/core/hle/service/ndm/ndm.cpp
index 5eb97f0d3e..096c0cdac9 100644
--- a/src/core/hle/service/ndm/ndm.cpp
+++ b/src/core/hle/service/ndm/ndm.cpp
@@ -2,8 +2,10 @@
 // Licensed under GPLv2 or any later version
 // Refer to the license.txt file included.
 
+#include <array>
 #include "common/common_types.h"
 #include "common/logging/log.h"
+#include "core/hle/ipc.h"
 #include "core/hle/service/ndm/ndm.h"
 #include "core/hle/service/ndm/ndm_u.h"
 #include "core/hle/service/service.h"
diff --git a/src/core/hle/service/nfc/nfc.cpp b/src/core/hle/service/nfc/nfc.cpp
index fd3c7d9c22..b44a9f6688 100644
--- a/src/core/hle/service/nfc/nfc.cpp
+++ b/src/core/hle/service/nfc/nfc.cpp
@@ -2,7 +2,9 @@
 // Licensed under GPLv2 or any later version
 // Refer to the license.txt file included.
 
+#include "core/hle/ipc.h"
 #include "core/hle/kernel/event.h"
+#include "core/hle/kernel/handle_table.h"
 #include "core/hle/service/nfc/nfc.h"
 #include "core/hle/service/nfc/nfc_m.h"
 #include "core/hle/service/nfc/nfc_u.h"
diff --git a/src/core/hle/service/nim/nim.cpp b/src/core/hle/service/nim/nim.cpp
index 63c334cb2b..d5624fe54f 100644
--- a/src/core/hle/service/nim/nim.cpp
+++ b/src/core/hle/service/nim/nim.cpp
@@ -4,6 +4,7 @@
 
 #include "common/common_types.h"
 #include "common/logging/log.h"
+#include "core/hle/ipc.h"
 #include "core/hle/service/nim/nim.h"
 #include "core/hle/service/nim/nim_aoc.h"
 #include "core/hle/service/nim/nim_s.h"
diff --git a/src/core/hle/service/nwm/nwm_uds.cpp b/src/core/hle/service/nwm/nwm_uds.cpp
index 581816e811..084113188c 100644
--- a/src/core/hle/service/nwm/nwm_uds.cpp
+++ b/src/core/hle/service/nwm/nwm_uds.cpp
@@ -9,6 +9,7 @@
 #include "common/common_types.h"
 #include "common/logging/log.h"
 #include "core/core_timing.h"
+#include "core/hle/ipc_helpers.h"
 #include "core/hle/kernel/event.h"
 #include "core/hle/kernel/shared_memory.h"
 #include "core/hle/result.h"
diff --git a/src/core/hle/service/nwm/uds_beacon.cpp b/src/core/hle/service/nwm/uds_beacon.cpp
index c6e5bc5f1e..6332b404cc 100644
--- a/src/core/hle/service/nwm/uds_beacon.cpp
+++ b/src/core/hle/service/nwm/uds_beacon.cpp
@@ -3,14 +3,13 @@
 // Refer to the license.txt file included.
 
 #include <cstring>
-
-#include "core/hle/service/nwm/nwm_uds.h"
-#include "core/hle/service/nwm/uds_beacon.h"
-
 #include <cryptopp/aes.h>
 #include <cryptopp/md5.h>
 #include <cryptopp/modes.h>
 #include <cryptopp/sha.h>
+#include "common/assert.h"
+#include "core/hle/service/nwm/nwm_uds.h"
+#include "core/hle/service/nwm/uds_beacon.h"
 
 namespace Service {
 namespace NWM {
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp
index 1b64ee77d3..0d443aa447 100644
--- a/src/core/hle/service/service.cpp
+++ b/src/core/hle/service/service.cpp
@@ -4,6 +4,7 @@
 
 #include "common/logging/log.h"
 #include "common/string_util.h"
+#include "core/hle/kernel/client_port.h"
 #include "core/hle/kernel/server_port.h"
 #include "core/hle/kernel/server_session.h"
 #include "core/hle/service/ac/ac.h"
diff --git a/src/core/hle/service/service.h b/src/core/hle/service/service.h
index 7010b116bb..8933d57ccf 100644
--- a/src/core/hle/service/service.h
+++ b/src/core/hle/service/service.h
@@ -8,17 +8,19 @@
 #include <string>
 #include <unordered_map>
 #include <boost/container/flat_map.hpp>
+#include "common/bit_field.h"
 #include "common/common_types.h"
-#include "core/hle/ipc.h"
-#include "core/hle/ipc_helpers.h"
-#include "core/hle/kernel/client_port.h"
 #include "core/hle/kernel/hle_ipc.h"
-#include "core/hle/result.h"
-#include "core/memory.h"
+#include "core/hle/kernel/kernel.h"
 
 ////////////////////////////////////////////////////////////////////////////////////////////////////
 // Namespace Service
 
+namespace Kernel {
+class ClientPort;
+class ServerSession;
+}
+
 namespace Service {
 
 static const int kMaxPortSize = 8; ///< Maximum size of a port name (8 characters)
diff --git a/src/core/hle/service/sm/sm.cpp b/src/core/hle/service/sm/sm.cpp
index 40df0f0dd7..361f7a0a9d 100644
--- a/src/core/hle/service/sm/sm.cpp
+++ b/src/core/hle/service/sm/sm.cpp
@@ -3,6 +3,7 @@
 // Refer to the license.txt file included.
 
 #include <tuple>
+#include "core/hle/kernel/client_port.h"
 #include "core/hle/kernel/client_session.h"
 #include "core/hle/kernel/server_port.h"
 #include "core/hle/result.h"
diff --git a/src/core/hle/service/sm/srv.cpp b/src/core/hle/service/sm/srv.cpp
index 34166289c6..063b1b0fcc 100644
--- a/src/core/hle/service/sm/srv.cpp
+++ b/src/core/hle/service/sm/srv.cpp
@@ -6,7 +6,10 @@
 
 #include "common/common_types.h"
 #include "common/logging/log.h"
+#include "core/hle/ipc.h"
+#include "core/hle/kernel/client_port.h"
 #include "core/hle/kernel/client_session.h"
+#include "core/hle/kernel/handle_table.h"
 #include "core/hle/kernel/semaphore.h"
 #include "core/hle/kernel/server_session.h"
 #include "core/hle/service/sm/sm.h"
diff --git a/src/core/hle/service/soc_u.cpp b/src/core/hle/service/soc_u.cpp
index 530614e6fd..3d215d42dd 100644
--- a/src/core/hle/service/soc_u.cpp
+++ b/src/core/hle/service/soc_u.cpp
@@ -11,6 +11,7 @@
 #include "common/common_types.h"
 #include "common/logging/log.h"
 #include "common/scope_exit.h"
+#include "core/hle/ipc.h"
 #include "core/hle/kernel/server_session.h"
 #include "core/hle/result.h"
 #include "core/hle/service/soc_u.h"
diff --git a/src/core/hle/service/ssl_c.cpp b/src/core/hle/service/ssl_c.cpp
index 09ced9d7ab..300acca75e 100644
--- a/src/core/hle/service/ssl_c.cpp
+++ b/src/core/hle/service/ssl_c.cpp
@@ -4,7 +4,9 @@
 
 #include <random>
 #include "common/common_types.h"
+#include "core/hle/ipc.h"
 #include "core/hle/service/ssl_c.h"
+#include "core/memory.h"
 
 namespace Service {
 namespace SSL {
diff --git a/src/core/hle/service/y2r_u.cpp b/src/core/hle/service/y2r_u.cpp
index c0837d49d3..bb7bf2d674 100644
--- a/src/core/hle/service/y2r_u.cpp
+++ b/src/core/hle/service/y2r_u.cpp
@@ -6,6 +6,8 @@
 #include "common/common_funcs.h"
 #include "common/common_types.h"
 #include "common/logging/log.h"
+#include "core/hle/ipc.h"
+#include "core/hle/ipc_helpers.h"
 #include "core/hle/kernel/event.h"
 #include "core/hle/kernel/kernel.h"
 #include "core/hle/service/y2r_u.h"