diff options
| author | 2023-02-19 14:42:12 -0500 | |
|---|---|---|
| committer | 2023-03-01 10:39:49 -0500 | |
| commit | 65be230fdda302b25447f2f09b06e3238bd09e79 (patch) | |
| tree | 68250d7bc8151041b236dcd79483df98938952cd /src/core/hle/service/sockets | |
| parent | sm:: remove unused member (diff) | |
| download | yuzu-65be230fdda302b25447f2f09b06e3238bd09e79.tar.gz yuzu-65be230fdda302b25447f2f09b06e3238bd09e79.tar.xz yuzu-65be230fdda302b25447f2f09b06e3238bd09e79.zip | |
service: move hle_ipc from kernel
Diffstat (limited to 'src/core/hle/service/sockets')
| -rw-r--r-- | src/core/hle/service/sockets/bsd.cpp | 66 | ||||
| -rw-r--r-- | src/core/hle/service/sockets/bsd.h | 64 | ||||
| -rw-r--r-- | src/core/hle/service/sockets/sfdnsres.cpp | 8 | ||||
| -rw-r--r-- | src/core/hle/service/sockets/sfdnsres.h | 4 |
4 files changed, 71 insertions, 71 deletions
diff --git a/src/core/hle/service/sockets/bsd.cpp b/src/core/hle/service/sockets/bsd.cpp index 2789fa1ed..bce45d321 100644 --- a/src/core/hle/service/sockets/bsd.cpp +++ b/src/core/hle/service/sockets/bsd.cpp | |||
| @@ -11,8 +11,8 @@ | |||
| 11 | #include "common/microprofile.h" | 11 | #include "common/microprofile.h" |
| 12 | #include "common/socket_types.h" | 12 | #include "common/socket_types.h" |
| 13 | #include "core/core.h" | 13 | #include "core/core.h" |
| 14 | #include "core/hle/ipc_helpers.h" | ||
| 15 | #include "core/hle/kernel/k_thread.h" | 14 | #include "core/hle/kernel/k_thread.h" |
| 15 | #include "core/hle/service/ipc_helpers.h" | ||
| 16 | #include "core/hle/service/sockets/bsd.h" | 16 | #include "core/hle/service/sockets/bsd.h" |
| 17 | #include "core/hle/service/sockets/sockets_translate.h" | 17 | #include "core/hle/service/sockets/sockets_translate.h" |
| 18 | #include "core/internal_network/network.h" | 18 | #include "core/internal_network/network.h" |
| @@ -42,7 +42,7 @@ void BSD::PollWork::Execute(BSD* bsd) { | |||
| 42 | std::tie(ret, bsd_errno) = bsd->PollImpl(write_buffer, read_buffer, nfds, timeout); | 42 | std::tie(ret, bsd_errno) = bsd->PollImpl(write_buffer, read_buffer, nfds, timeout); |
| 43 | } | 43 | } |
| 44 | 44 | ||
| 45 | void BSD::PollWork::Response(Kernel::HLERequestContext& ctx) { | 45 | void BSD::PollWork::Response(HLERequestContext& ctx) { |
| 46 | if (write_buffer.size() > 0) { | 46 | if (write_buffer.size() > 0) { |
| 47 | ctx.WriteBuffer(write_buffer); | 47 | ctx.WriteBuffer(write_buffer); |
| 48 | } | 48 | } |
| @@ -57,7 +57,7 @@ void BSD::AcceptWork::Execute(BSD* bsd) { | |||
| 57 | std::tie(ret, bsd_errno) = bsd->AcceptImpl(fd, write_buffer); | 57 | std::tie(ret, bsd_errno) = bsd->AcceptImpl(fd, write_buffer); |
| 58 | } | 58 | } |
| 59 | 59 | ||
| 60 | void BSD::AcceptWork::Response(Kernel::HLERequestContext& ctx) { | 60 | void BSD::AcceptWork::Response(HLERequestContext& ctx) { |
| 61 | if (write_buffer.size() > 0) { | 61 | if (write_buffer.size() > 0) { |
| 62 | ctx.WriteBuffer(write_buffer); | 62 | ctx.WriteBuffer(write_buffer); |
| 63 | } | 63 | } |
| @@ -73,7 +73,7 @@ void BSD::ConnectWork::Execute(BSD* bsd) { | |||
| 73 | bsd_errno = bsd->ConnectImpl(fd, addr); | 73 | bsd_errno = bsd->ConnectImpl(fd, addr); |
| 74 | } | 74 | } |
| 75 | 75 | ||
| 76 | void BSD::ConnectWork::Response(Kernel::HLERequestContext& ctx) { | 76 | void BSD::ConnectWork::Response(HLERequestContext& ctx) { |
| 77 | IPC::ResponseBuilder rb{ctx, 4}; | 77 | IPC::ResponseBuilder rb{ctx, 4}; |
| 78 | rb.Push(ResultSuccess); | 78 | rb.Push(ResultSuccess); |
| 79 | rb.Push<s32>(bsd_errno == Errno::SUCCESS ? 0 : -1); | 79 | rb.Push<s32>(bsd_errno == Errno::SUCCESS ? 0 : -1); |
| @@ -84,7 +84,7 @@ void BSD::RecvWork::Execute(BSD* bsd) { | |||
| 84 | std::tie(ret, bsd_errno) = bsd->RecvImpl(fd, flags, message); | 84 | std::tie(ret, bsd_errno) = bsd->RecvImpl(fd, flags, message); |
| 85 | } | 85 | } |
| 86 | 86 | ||
| 87 | void BSD::RecvWork::Response(Kernel::HLERequestContext& ctx) { | 87 | void BSD::RecvWork::Response(HLERequestContext& ctx) { |
| 88 | ctx.WriteBuffer(message); | 88 | ctx.WriteBuffer(message); |
| 89 | 89 | ||
| 90 | IPC::ResponseBuilder rb{ctx, 4}; | 90 | IPC::ResponseBuilder rb{ctx, 4}; |
| @@ -97,7 +97,7 @@ void BSD::RecvFromWork::Execute(BSD* bsd) { | |||
| 97 | std::tie(ret, bsd_errno) = bsd->RecvFromImpl(fd, flags, message, addr); | 97 | std::tie(ret, bsd_errno) = bsd->RecvFromImpl(fd, flags, message, addr); |
| 98 | } | 98 | } |
| 99 | 99 | ||
| 100 | void BSD::RecvFromWork::Response(Kernel::HLERequestContext& ctx) { | 100 | void BSD::RecvFromWork::Response(HLERequestContext& ctx) { |
| 101 | ctx.WriteBuffer(message, 0); | 101 | ctx.WriteBuffer(message, 0); |
| 102 | if (!addr.empty()) { | 102 | if (!addr.empty()) { |
| 103 | ctx.WriteBuffer(addr, 1); | 103 | ctx.WriteBuffer(addr, 1); |
| @@ -114,7 +114,7 @@ void BSD::SendWork::Execute(BSD* bsd) { | |||
| 114 | std::tie(ret, bsd_errno) = bsd->SendImpl(fd, flags, message); | 114 | std::tie(ret, bsd_errno) = bsd->SendImpl(fd, flags, message); |
| 115 | } | 115 | } |
| 116 | 116 | ||
| 117 | void BSD::SendWork::Response(Kernel::HLERequestContext& ctx) { | 117 | void BSD::SendWork::Response(HLERequestContext& ctx) { |
| 118 | IPC::ResponseBuilder rb{ctx, 4}; | 118 | IPC::ResponseBuilder rb{ctx, 4}; |
| 119 | rb.Push(ResultSuccess); | 119 | rb.Push(ResultSuccess); |
| 120 | rb.Push<s32>(ret); | 120 | rb.Push<s32>(ret); |
| @@ -125,14 +125,14 @@ void BSD::SendToWork::Execute(BSD* bsd) { | |||
| 125 | std::tie(ret, bsd_errno) = bsd->SendToImpl(fd, flags, message, addr); | 125 | std::tie(ret, bsd_errno) = bsd->SendToImpl(fd, flags, message, addr); |
| 126 | } | 126 | } |
| 127 | 127 | ||
| 128 | void BSD::SendToWork::Response(Kernel::HLERequestContext& ctx) { | 128 | void BSD::SendToWork::Response(HLERequestContext& ctx) { |
| 129 | IPC::ResponseBuilder rb{ctx, 4}; | 129 | IPC::ResponseBuilder rb{ctx, 4}; |
| 130 | rb.Push(ResultSuccess); | 130 | rb.Push(ResultSuccess); |
| 131 | rb.Push<s32>(ret); | 131 | rb.Push<s32>(ret); |
| 132 | rb.PushEnum(bsd_errno); | 132 | rb.PushEnum(bsd_errno); |
| 133 | } | 133 | } |
| 134 | 134 | ||
| 135 | void BSD::RegisterClient(Kernel::HLERequestContext& ctx) { | 135 | void BSD::RegisterClient(HLERequestContext& ctx) { |
| 136 | LOG_WARNING(Service, "(STUBBED) called"); | 136 | LOG_WARNING(Service, "(STUBBED) called"); |
| 137 | 137 | ||
| 138 | IPC::ResponseBuilder rb{ctx, 3}; | 138 | IPC::ResponseBuilder rb{ctx, 3}; |
| @@ -141,7 +141,7 @@ void BSD::RegisterClient(Kernel::HLERequestContext& ctx) { | |||
| 141 | rb.Push<s32>(0); // bsd errno | 141 | rb.Push<s32>(0); // bsd errno |
| 142 | } | 142 | } |
| 143 | 143 | ||
| 144 | void BSD::StartMonitoring(Kernel::HLERequestContext& ctx) { | 144 | void BSD::StartMonitoring(HLERequestContext& ctx) { |
| 145 | LOG_WARNING(Service, "(STUBBED) called"); | 145 | LOG_WARNING(Service, "(STUBBED) called"); |
| 146 | 146 | ||
| 147 | IPC::ResponseBuilder rb{ctx, 2}; | 147 | IPC::ResponseBuilder rb{ctx, 2}; |
| @@ -149,7 +149,7 @@ void BSD::StartMonitoring(Kernel::HLERequestContext& ctx) { | |||
| 149 | rb.Push(ResultSuccess); | 149 | rb.Push(ResultSuccess); |
| 150 | } | 150 | } |
| 151 | 151 | ||
| 152 | void BSD::Socket(Kernel::HLERequestContext& ctx) { | 152 | void BSD::Socket(HLERequestContext& ctx) { |
| 153 | IPC::RequestParser rp{ctx}; | 153 | IPC::RequestParser rp{ctx}; |
| 154 | const u32 domain = rp.Pop<u32>(); | 154 | const u32 domain = rp.Pop<u32>(); |
| 155 | const u32 type = rp.Pop<u32>(); | 155 | const u32 type = rp.Pop<u32>(); |
| @@ -166,7 +166,7 @@ void BSD::Socket(Kernel::HLERequestContext& ctx) { | |||
| 166 | rb.PushEnum(bsd_errno); | 166 | rb.PushEnum(bsd_errno); |
| 167 | } | 167 | } |
| 168 | 168 | ||
| 169 | void BSD::Select(Kernel::HLERequestContext& ctx) { | 169 | void BSD::Select(HLERequestContext& ctx) { |
| 170 | LOG_WARNING(Service, "(STUBBED) called"); | 170 | LOG_WARNING(Service, "(STUBBED) called"); |
| 171 | 171 | ||
| 172 | IPC::ResponseBuilder rb{ctx, 4}; | 172 | IPC::ResponseBuilder rb{ctx, 4}; |
| @@ -176,7 +176,7 @@ void BSD::Select(Kernel::HLERequestContext& ctx) { | |||
| 176 | rb.Push<u32>(0); // bsd errno | 176 | rb.Push<u32>(0); // bsd errno |
| 177 | } | 177 | } |
| 178 | 178 | ||
| 179 | void BSD::Poll(Kernel::HLERequestContext& ctx) { | 179 | void BSD::Poll(HLERequestContext& ctx) { |
| 180 | IPC::RequestParser rp{ctx}; | 180 | IPC::RequestParser rp{ctx}; |
| 181 | const s32 nfds = rp.Pop<s32>(); | 181 | const s32 nfds = rp.Pop<s32>(); |
| 182 | const s32 timeout = rp.Pop<s32>(); | 182 | const s32 timeout = rp.Pop<s32>(); |
| @@ -191,7 +191,7 @@ void BSD::Poll(Kernel::HLERequestContext& ctx) { | |||
| 191 | }); | 191 | }); |
| 192 | } | 192 | } |
| 193 | 193 | ||
| 194 | void BSD::Accept(Kernel::HLERequestContext& ctx) { | 194 | void BSD::Accept(HLERequestContext& ctx) { |
| 195 | IPC::RequestParser rp{ctx}; | 195 | IPC::RequestParser rp{ctx}; |
| 196 | const s32 fd = rp.Pop<s32>(); | 196 | const s32 fd = rp.Pop<s32>(); |
| 197 | 197 | ||
| @@ -203,7 +203,7 @@ void BSD::Accept(Kernel::HLERequestContext& ctx) { | |||
| 203 | }); | 203 | }); |
| 204 | } | 204 | } |
| 205 | 205 | ||
| 206 | void BSD::Bind(Kernel::HLERequestContext& ctx) { | 206 | void BSD::Bind(HLERequestContext& ctx) { |
| 207 | IPC::RequestParser rp{ctx}; | 207 | IPC::RequestParser rp{ctx}; |
| 208 | const s32 fd = rp.Pop<s32>(); | 208 | const s32 fd = rp.Pop<s32>(); |
| 209 | 209 | ||
| @@ -211,7 +211,7 @@ void BSD::Bind(Kernel::HLERequestContext& ctx) { | |||
| 211 | BuildErrnoResponse(ctx, BindImpl(fd, ctx.ReadBuffer())); | 211 | BuildErrnoResponse(ctx, BindImpl(fd, ctx.ReadBuffer())); |
| 212 | } | 212 | } |
| 213 | 213 | ||
| 214 | void BSD::Connect(Kernel::HLERequestContext& ctx) { | 214 | void BSD::Connect(HLERequestContext& ctx) { |
| 215 | IPC::RequestParser rp{ctx}; | 215 | IPC::RequestParser rp{ctx}; |
| 216 | const s32 fd = rp.Pop<s32>(); | 216 | const s32 fd = rp.Pop<s32>(); |
| 217 | 217 | ||
| @@ -223,7 +223,7 @@ void BSD::Connect(Kernel::HLERequestContext& ctx) { | |||
| 223 | }); | 223 | }); |
| 224 | } | 224 | } |
| 225 | 225 | ||
| 226 | void BSD::GetPeerName(Kernel::HLERequestContext& ctx) { | 226 | void BSD::GetPeerName(HLERequestContext& ctx) { |
| 227 | IPC::RequestParser rp{ctx}; | 227 | IPC::RequestParser rp{ctx}; |
| 228 | const s32 fd = rp.Pop<s32>(); | 228 | const s32 fd = rp.Pop<s32>(); |
| 229 | 229 | ||
| @@ -241,7 +241,7 @@ void BSD::GetPeerName(Kernel::HLERequestContext& ctx) { | |||
| 241 | rb.Push<u32>(static_cast<u32>(write_buffer.size())); | 241 | rb.Push<u32>(static_cast<u32>(write_buffer.size())); |
| 242 | } | 242 | } |
| 243 | 243 | ||
| 244 | void BSD::GetSockName(Kernel::HLERequestContext& ctx) { | 244 | void BSD::GetSockName(HLERequestContext& ctx) { |
| 245 | IPC::RequestParser rp{ctx}; | 245 | IPC::RequestParser rp{ctx}; |
| 246 | const s32 fd = rp.Pop<s32>(); | 246 | const s32 fd = rp.Pop<s32>(); |
| 247 | 247 | ||
| @@ -259,7 +259,7 @@ void BSD::GetSockName(Kernel::HLERequestContext& ctx) { | |||
| 259 | rb.Push<u32>(static_cast<u32>(write_buffer.size())); | 259 | rb.Push<u32>(static_cast<u32>(write_buffer.size())); |
| 260 | } | 260 | } |
| 261 | 261 | ||
| 262 | void BSD::GetSockOpt(Kernel::HLERequestContext& ctx) { | 262 | void BSD::GetSockOpt(HLERequestContext& ctx) { |
| 263 | IPC::RequestParser rp{ctx}; | 263 | IPC::RequestParser rp{ctx}; |
| 264 | const s32 fd = rp.Pop<s32>(); | 264 | const s32 fd = rp.Pop<s32>(); |
| 265 | const u32 level = rp.Pop<u32>(); | 265 | const u32 level = rp.Pop<u32>(); |
| @@ -278,7 +278,7 @@ void BSD::GetSockOpt(Kernel::HLERequestContext& ctx) { | |||
| 278 | rb.Push<u32>(static_cast<u32>(optval.size())); | 278 | rb.Push<u32>(static_cast<u32>(optval.size())); |
| 279 | } | 279 | } |
| 280 | 280 | ||
| 281 | void BSD::Listen(Kernel::HLERequestContext& ctx) { | 281 | void BSD::Listen(HLERequestContext& ctx) { |
| 282 | IPC::RequestParser rp{ctx}; | 282 | IPC::RequestParser rp{ctx}; |
| 283 | const s32 fd = rp.Pop<s32>(); | 283 | const s32 fd = rp.Pop<s32>(); |
| 284 | const s32 backlog = rp.Pop<s32>(); | 284 | const s32 backlog = rp.Pop<s32>(); |
| @@ -288,7 +288,7 @@ void BSD::Listen(Kernel::HLERequestContext& ctx) { | |||
| 288 | BuildErrnoResponse(ctx, ListenImpl(fd, backlog)); | 288 | BuildErrnoResponse(ctx, ListenImpl(fd, backlog)); |
| 289 | } | 289 | } |
| 290 | 290 | ||
| 291 | void BSD::Fcntl(Kernel::HLERequestContext& ctx) { | 291 | void BSD::Fcntl(HLERequestContext& ctx) { |
| 292 | IPC::RequestParser rp{ctx}; | 292 | IPC::RequestParser rp{ctx}; |
| 293 | const s32 fd = rp.Pop<s32>(); | 293 | const s32 fd = rp.Pop<s32>(); |
| 294 | const s32 cmd = rp.Pop<s32>(); | 294 | const s32 cmd = rp.Pop<s32>(); |
| @@ -304,7 +304,7 @@ void BSD::Fcntl(Kernel::HLERequestContext& ctx) { | |||
| 304 | rb.PushEnum(bsd_errno); | 304 | rb.PushEnum(bsd_errno); |
| 305 | } | 305 | } |
| 306 | 306 | ||
| 307 | void BSD::SetSockOpt(Kernel::HLERequestContext& ctx) { | 307 | void BSD::SetSockOpt(HLERequestContext& ctx) { |
| 308 | IPC::RequestParser rp{ctx}; | 308 | IPC::RequestParser rp{ctx}; |
| 309 | 309 | ||
| 310 | const s32 fd = rp.Pop<s32>(); | 310 | const s32 fd = rp.Pop<s32>(); |
| @@ -328,7 +328,7 @@ void BSD::SetSockOpt(Kernel::HLERequestContext& ctx) { | |||
| 328 | BuildErrnoResponse(ctx, SetSockOptImpl(fd, level, optname, optlen, optval)); | 328 | BuildErrnoResponse(ctx, SetSockOptImpl(fd, level, optname, optlen, optval)); |
| 329 | } | 329 | } |
| 330 | 330 | ||
| 331 | void BSD::Shutdown(Kernel::HLERequestContext& ctx) { | 331 | void BSD::Shutdown(HLERequestContext& ctx) { |
| 332 | IPC::RequestParser rp{ctx}; | 332 | IPC::RequestParser rp{ctx}; |
| 333 | 333 | ||
| 334 | const s32 fd = rp.Pop<s32>(); | 334 | const s32 fd = rp.Pop<s32>(); |
| @@ -339,7 +339,7 @@ void BSD::Shutdown(Kernel::HLERequestContext& ctx) { | |||
| 339 | BuildErrnoResponse(ctx, ShutdownImpl(fd, how)); | 339 | BuildErrnoResponse(ctx, ShutdownImpl(fd, how)); |
| 340 | } | 340 | } |
| 341 | 341 | ||
| 342 | void BSD::Recv(Kernel::HLERequestContext& ctx) { | 342 | void BSD::Recv(HLERequestContext& ctx) { |
| 343 | IPC::RequestParser rp{ctx}; | 343 | IPC::RequestParser rp{ctx}; |
| 344 | 344 | ||
| 345 | const s32 fd = rp.Pop<s32>(); | 345 | const s32 fd = rp.Pop<s32>(); |
| @@ -354,7 +354,7 @@ void BSD::Recv(Kernel::HLERequestContext& ctx) { | |||
| 354 | }); | 354 | }); |
| 355 | } | 355 | } |
| 356 | 356 | ||
| 357 | void BSD::RecvFrom(Kernel::HLERequestContext& ctx) { | 357 | void BSD::RecvFrom(HLERequestContext& ctx) { |
| 358 | IPC::RequestParser rp{ctx}; | 358 | IPC::RequestParser rp{ctx}; |
| 359 | 359 | ||
| 360 | const s32 fd = rp.Pop<s32>(); | 360 | const s32 fd = rp.Pop<s32>(); |
| @@ -371,7 +371,7 @@ void BSD::RecvFrom(Kernel::HLERequestContext& ctx) { | |||
| 371 | }); | 371 | }); |
| 372 | } | 372 | } |
| 373 | 373 | ||
| 374 | void BSD::Send(Kernel::HLERequestContext& ctx) { | 374 | void BSD::Send(HLERequestContext& ctx) { |
| 375 | IPC::RequestParser rp{ctx}; | 375 | IPC::RequestParser rp{ctx}; |
| 376 | 376 | ||
| 377 | const s32 fd = rp.Pop<s32>(); | 377 | const s32 fd = rp.Pop<s32>(); |
| @@ -386,7 +386,7 @@ void BSD::Send(Kernel::HLERequestContext& ctx) { | |||
| 386 | }); | 386 | }); |
| 387 | } | 387 | } |
| 388 | 388 | ||
| 389 | void BSD::SendTo(Kernel::HLERequestContext& ctx) { | 389 | void BSD::SendTo(HLERequestContext& ctx) { |
| 390 | IPC::RequestParser rp{ctx}; | 390 | IPC::RequestParser rp{ctx}; |
| 391 | const s32 fd = rp.Pop<s32>(); | 391 | const s32 fd = rp.Pop<s32>(); |
| 392 | const u32 flags = rp.Pop<u32>(); | 392 | const u32 flags = rp.Pop<u32>(); |
| @@ -402,7 +402,7 @@ void BSD::SendTo(Kernel::HLERequestContext& ctx) { | |||
| 402 | }); | 402 | }); |
| 403 | } | 403 | } |
| 404 | 404 | ||
| 405 | void BSD::Write(Kernel::HLERequestContext& ctx) { | 405 | void BSD::Write(HLERequestContext& ctx) { |
| 406 | IPC::RequestParser rp{ctx}; | 406 | IPC::RequestParser rp{ctx}; |
| 407 | const s32 fd = rp.Pop<s32>(); | 407 | const s32 fd = rp.Pop<s32>(); |
| 408 | 408 | ||
| @@ -415,7 +415,7 @@ void BSD::Write(Kernel::HLERequestContext& ctx) { | |||
| 415 | }); | 415 | }); |
| 416 | } | 416 | } |
| 417 | 417 | ||
| 418 | void BSD::Read(Kernel::HLERequestContext& ctx) { | 418 | void BSD::Read(HLERequestContext& ctx) { |
| 419 | IPC::RequestParser rp{ctx}; | 419 | IPC::RequestParser rp{ctx}; |
| 420 | const s32 fd = rp.Pop<s32>(); | 420 | const s32 fd = rp.Pop<s32>(); |
| 421 | 421 | ||
| @@ -427,7 +427,7 @@ void BSD::Read(Kernel::HLERequestContext& ctx) { | |||
| 427 | rb.Push<u32>(0); // bsd errno | 427 | rb.Push<u32>(0); // bsd errno |
| 428 | } | 428 | } |
| 429 | 429 | ||
| 430 | void BSD::Close(Kernel::HLERequestContext& ctx) { | 430 | void BSD::Close(HLERequestContext& ctx) { |
| 431 | IPC::RequestParser rp{ctx}; | 431 | IPC::RequestParser rp{ctx}; |
| 432 | const s32 fd = rp.Pop<s32>(); | 432 | const s32 fd = rp.Pop<s32>(); |
| 433 | 433 | ||
| @@ -436,7 +436,7 @@ void BSD::Close(Kernel::HLERequestContext& ctx) { | |||
| 436 | BuildErrnoResponse(ctx, CloseImpl(fd)); | 436 | BuildErrnoResponse(ctx, CloseImpl(fd)); |
| 437 | } | 437 | } |
| 438 | 438 | ||
| 439 | void BSD::EventFd(Kernel::HLERequestContext& ctx) { | 439 | void BSD::EventFd(HLERequestContext& ctx) { |
| 440 | IPC::RequestParser rp{ctx}; | 440 | IPC::RequestParser rp{ctx}; |
| 441 | const u64 initval = rp.Pop<u64>(); | 441 | const u64 initval = rp.Pop<u64>(); |
| 442 | const u32 flags = rp.Pop<u32>(); | 442 | const u32 flags = rp.Pop<u32>(); |
| @@ -447,7 +447,7 @@ void BSD::EventFd(Kernel::HLERequestContext& ctx) { | |||
| 447 | } | 447 | } |
| 448 | 448 | ||
| 449 | template <typename Work> | 449 | template <typename Work> |
| 450 | void BSD::ExecuteWork(Kernel::HLERequestContext& ctx, Work work) { | 450 | void BSD::ExecuteWork(HLERequestContext& ctx, Work work) { |
| 451 | work.Execute(this); | 451 | work.Execute(this); |
| 452 | work.Response(ctx); | 452 | work.Response(ctx); |
| 453 | } | 453 | } |
| @@ -862,7 +862,7 @@ bool BSD::IsFileDescriptorValid(s32 fd) const noexcept { | |||
| 862 | return true; | 862 | return true; |
| 863 | } | 863 | } |
| 864 | 864 | ||
| 865 | void BSD::BuildErrnoResponse(Kernel::HLERequestContext& ctx, Errno bsd_errno) const noexcept { | 865 | void BSD::BuildErrnoResponse(HLERequestContext& ctx, Errno bsd_errno) const noexcept { |
| 866 | IPC::ResponseBuilder rb{ctx, 4}; | 866 | IPC::ResponseBuilder rb{ctx, 4}; |
| 867 | 867 | ||
| 868 | rb.Push(ResultSuccess); | 868 | rb.Push(ResultSuccess); |
diff --git a/src/core/hle/service/sockets/bsd.h b/src/core/hle/service/sockets/bsd.h index 56bb3f8b1..30ae9c140 100644 --- a/src/core/hle/service/sockets/bsd.h +++ b/src/core/hle/service/sockets/bsd.h | |||
| @@ -41,7 +41,7 @@ private: | |||
| 41 | 41 | ||
| 42 | struct PollWork { | 42 | struct PollWork { |
| 43 | void Execute(BSD* bsd); | 43 | void Execute(BSD* bsd); |
| 44 | void Response(Kernel::HLERequestContext& ctx); | 44 | void Response(HLERequestContext& ctx); |
| 45 | 45 | ||
| 46 | s32 nfds; | 46 | s32 nfds; |
| 47 | s32 timeout; | 47 | s32 timeout; |
| @@ -53,7 +53,7 @@ private: | |||
| 53 | 53 | ||
| 54 | struct AcceptWork { | 54 | struct AcceptWork { |
| 55 | void Execute(BSD* bsd); | 55 | void Execute(BSD* bsd); |
| 56 | void Response(Kernel::HLERequestContext& ctx); | 56 | void Response(HLERequestContext& ctx); |
| 57 | 57 | ||
| 58 | s32 fd; | 58 | s32 fd; |
| 59 | std::vector<u8> write_buffer; | 59 | std::vector<u8> write_buffer; |
| @@ -63,7 +63,7 @@ private: | |||
| 63 | 63 | ||
| 64 | struct ConnectWork { | 64 | struct ConnectWork { |
| 65 | void Execute(BSD* bsd); | 65 | void Execute(BSD* bsd); |
| 66 | void Response(Kernel::HLERequestContext& ctx); | 66 | void Response(HLERequestContext& ctx); |
| 67 | 67 | ||
| 68 | s32 fd; | 68 | s32 fd; |
| 69 | std::span<const u8> addr; | 69 | std::span<const u8> addr; |
| @@ -72,7 +72,7 @@ private: | |||
| 72 | 72 | ||
| 73 | struct RecvWork { | 73 | struct RecvWork { |
| 74 | void Execute(BSD* bsd); | 74 | void Execute(BSD* bsd); |
| 75 | void Response(Kernel::HLERequestContext& ctx); | 75 | void Response(HLERequestContext& ctx); |
| 76 | 76 | ||
| 77 | s32 fd; | 77 | s32 fd; |
| 78 | u32 flags; | 78 | u32 flags; |
| @@ -83,7 +83,7 @@ private: | |||
| 83 | 83 | ||
| 84 | struct RecvFromWork { | 84 | struct RecvFromWork { |
| 85 | void Execute(BSD* bsd); | 85 | void Execute(BSD* bsd); |
| 86 | void Response(Kernel::HLERequestContext& ctx); | 86 | void Response(HLERequestContext& ctx); |
| 87 | 87 | ||
| 88 | s32 fd; | 88 | s32 fd; |
| 89 | u32 flags; | 89 | u32 flags; |
| @@ -95,7 +95,7 @@ private: | |||
| 95 | 95 | ||
| 96 | struct SendWork { | 96 | struct SendWork { |
| 97 | void Execute(BSD* bsd); | 97 | void Execute(BSD* bsd); |
| 98 | void Response(Kernel::HLERequestContext& ctx); | 98 | void Response(HLERequestContext& ctx); |
| 99 | 99 | ||
| 100 | s32 fd; | 100 | s32 fd; |
| 101 | u32 flags; | 101 | u32 flags; |
| @@ -106,7 +106,7 @@ private: | |||
| 106 | 106 | ||
| 107 | struct SendToWork { | 107 | struct SendToWork { |
| 108 | void Execute(BSD* bsd); | 108 | void Execute(BSD* bsd); |
| 109 | void Response(Kernel::HLERequestContext& ctx); | 109 | void Response(HLERequestContext& ctx); |
| 110 | 110 | ||
| 111 | s32 fd; | 111 | s32 fd; |
| 112 | u32 flags; | 112 | u32 flags; |
| @@ -116,32 +116,32 @@ private: | |||
| 116 | Errno bsd_errno{}; | 116 | Errno bsd_errno{}; |
| 117 | }; | 117 | }; |
| 118 | 118 | ||
| 119 | void RegisterClient(Kernel::HLERequestContext& ctx); | 119 | void RegisterClient(HLERequestContext& ctx); |
| 120 | void StartMonitoring(Kernel::HLERequestContext& ctx); | 120 | void StartMonitoring(HLERequestContext& ctx); |
| 121 | void Socket(Kernel::HLERequestContext& ctx); | 121 | void Socket(HLERequestContext& ctx); |
| 122 | void Select(Kernel::HLERequestContext& ctx); | 122 | void Select(HLERequestContext& ctx); |
| 123 | void Poll(Kernel::HLERequestContext& ctx); | 123 | void Poll(HLERequestContext& ctx); |
| 124 | void Accept(Kernel::HLERequestContext& ctx); | 124 | void Accept(HLERequestContext& ctx); |
| 125 | void Bind(Kernel::HLERequestContext& ctx); | 125 | void Bind(HLERequestContext& ctx); |
| 126 | void Connect(Kernel::HLERequestContext& ctx); | 126 | void Connect(HLERequestContext& ctx); |
| 127 | void GetPeerName(Kernel::HLERequestContext& ctx); | 127 | void GetPeerName(HLERequestContext& ctx); |
| 128 | void GetSockName(Kernel::HLERequestContext& ctx); | 128 | void GetSockName(HLERequestContext& ctx); |
| 129 | void GetSockOpt(Kernel::HLERequestContext& ctx); | 129 | void GetSockOpt(HLERequestContext& ctx); |
| 130 | void Listen(Kernel::HLERequestContext& ctx); | 130 | void Listen(HLERequestContext& ctx); |
| 131 | void Fcntl(Kernel::HLERequestContext& ctx); | 131 | void Fcntl(HLERequestContext& ctx); |
| 132 | void SetSockOpt(Kernel::HLERequestContext& ctx); | 132 | void SetSockOpt(HLERequestContext& ctx); |
| 133 | void Shutdown(Kernel::HLERequestContext& ctx); | 133 | void Shutdown(HLERequestContext& ctx); |
| 134 | void Recv(Kernel::HLERequestContext& ctx); | 134 | void Recv(HLERequestContext& ctx); |
| 135 | void RecvFrom(Kernel::HLERequestContext& ctx); | 135 | void RecvFrom(HLERequestContext& ctx); |
| 136 | void Send(Kernel::HLERequestContext& ctx); | 136 | void Send(HLERequestContext& ctx); |
| 137 | void SendTo(Kernel::HLERequestContext& ctx); | 137 | void SendTo(HLERequestContext& ctx); |
| 138 | void Write(Kernel::HLERequestContext& ctx); | 138 | void Write(HLERequestContext& ctx); |
| 139 | void Read(Kernel::HLERequestContext& ctx); | 139 | void Read(HLERequestContext& ctx); |
| 140 | void Close(Kernel::HLERequestContext& ctx); | 140 | void Close(HLERequestContext& ctx); |
| 141 | void EventFd(Kernel::HLERequestContext& ctx); | 141 | void EventFd(HLERequestContext& ctx); |
| 142 | 142 | ||
| 143 | template <typename Work> | 143 | template <typename Work> |
| 144 | void ExecuteWork(Kernel::HLERequestContext& ctx, Work work); | 144 | void ExecuteWork(HLERequestContext& ctx, Work work); |
| 145 | 145 | ||
| 146 | std::pair<s32, Errno> SocketImpl(Domain domain, Type type, Protocol protocol); | 146 | std::pair<s32, Errno> SocketImpl(Domain domain, Type type, Protocol protocol); |
| 147 | std::pair<s32, Errno> PollImpl(std::vector<u8>& write_buffer, std::span<const u8> read_buffer, | 147 | std::pair<s32, Errno> PollImpl(std::vector<u8>& write_buffer, std::span<const u8> read_buffer, |
| @@ -166,7 +166,7 @@ private: | |||
| 166 | s32 FindFreeFileDescriptorHandle() noexcept; | 166 | s32 FindFreeFileDescriptorHandle() noexcept; |
| 167 | bool IsFileDescriptorValid(s32 fd) const noexcept; | 167 | bool IsFileDescriptorValid(s32 fd) const noexcept; |
| 168 | 168 | ||
| 169 | void BuildErrnoResponse(Kernel::HLERequestContext& ctx, Errno bsd_errno) const noexcept; | 169 | void BuildErrnoResponse(HLERequestContext& ctx, Errno bsd_errno) const noexcept; |
| 170 | 170 | ||
| 171 | std::array<std::optional<FileDescriptor>, MAX_FD> file_descriptors; | 171 | std::array<std::optional<FileDescriptor>, MAX_FD> file_descriptors; |
| 172 | 172 | ||
diff --git a/src/core/hle/service/sockets/sfdnsres.cpp b/src/core/hle/service/sockets/sfdnsres.cpp index e96eda7f3..132dd5797 100644 --- a/src/core/hle/service/sockets/sfdnsres.cpp +++ b/src/core/hle/service/sockets/sfdnsres.cpp | |||
| @@ -8,7 +8,7 @@ | |||
| 8 | #include "common/string_util.h" | 8 | #include "common/string_util.h" |
| 9 | #include "common/swap.h" | 9 | #include "common/swap.h" |
| 10 | #include "core/core.h" | 10 | #include "core/core.h" |
| 11 | #include "core/hle/ipc_helpers.h" | 11 | #include "core/hle/service/ipc_helpers.h" |
| 12 | #include "core/hle/service/sockets/sfdnsres.h" | 12 | #include "core/hle/service/sockets/sfdnsres.h" |
| 13 | #include "core/memory.h" | 13 | #include "core/memory.h" |
| 14 | 14 | ||
| @@ -185,7 +185,7 @@ static std::vector<u8> SerializeAddrInfo(const addrinfo* addrinfo, s32 result_co | |||
| 185 | return data; | 185 | return data; |
| 186 | } | 186 | } |
| 187 | 187 | ||
| 188 | static std::pair<u32, s32> GetAddrInfoRequestImpl(Kernel::HLERequestContext& ctx) { | 188 | static std::pair<u32, s32> GetAddrInfoRequestImpl(HLERequestContext& ctx) { |
| 189 | struct Parameters { | 189 | struct Parameters { |
| 190 | u8 use_nsd_resolve; | 190 | u8 use_nsd_resolve; |
| 191 | u32 unknown; | 191 | u32 unknown; |
| @@ -221,7 +221,7 @@ static std::pair<u32, s32> GetAddrInfoRequestImpl(Kernel::HLERequestContext& ctx | |||
| 221 | return std::make_pair(data_size, result_code); | 221 | return std::make_pair(data_size, result_code); |
| 222 | } | 222 | } |
| 223 | 223 | ||
| 224 | void SFDNSRES::GetAddrInfoRequest(Kernel::HLERequestContext& ctx) { | 224 | void SFDNSRES::GetAddrInfoRequest(HLERequestContext& ctx) { |
| 225 | auto [data_size, result_code] = GetAddrInfoRequestImpl(ctx); | 225 | auto [data_size, result_code] = GetAddrInfoRequestImpl(ctx); |
| 226 | 226 | ||
| 227 | IPC::ResponseBuilder rb{ctx, 4}; | 227 | IPC::ResponseBuilder rb{ctx, 4}; |
| @@ -231,7 +231,7 @@ void SFDNSRES::GetAddrInfoRequest(Kernel::HLERequestContext& ctx) { | |||
| 231 | rb.Push(data_size); // serialized size | 231 | rb.Push(data_size); // serialized size |
| 232 | } | 232 | } |
| 233 | 233 | ||
| 234 | void SFDNSRES::GetAddrInfoRequestWithOptions(Kernel::HLERequestContext& ctx) { | 234 | void SFDNSRES::GetAddrInfoRequestWithOptions(HLERequestContext& ctx) { |
| 235 | // Additional options are ignored | 235 | // Additional options are ignored |
| 236 | auto [data_size, result_code] = GetAddrInfoRequestImpl(ctx); | 236 | auto [data_size, result_code] = GetAddrInfoRequestImpl(ctx); |
| 237 | 237 | ||
diff --git a/src/core/hle/service/sockets/sfdnsres.h b/src/core/hle/service/sockets/sfdnsres.h index 96018ea77..18e3cd60c 100644 --- a/src/core/hle/service/sockets/sfdnsres.h +++ b/src/core/hle/service/sockets/sfdnsres.h | |||
| @@ -17,8 +17,8 @@ public: | |||
| 17 | ~SFDNSRES() override; | 17 | ~SFDNSRES() override; |
| 18 | 18 | ||
| 19 | private: | 19 | private: |
| 20 | void GetAddrInfoRequest(Kernel::HLERequestContext& ctx); | 20 | void GetAddrInfoRequest(HLERequestContext& ctx); |
| 21 | void GetAddrInfoRequestWithOptions(Kernel::HLERequestContext& ctx); | 21 | void GetAddrInfoRequestWithOptions(HLERequestContext& ctx); |
| 22 | }; | 22 | }; |
| 23 | 23 | ||
| 24 | } // namespace Service::Sockets | 24 | } // namespace Service::Sockets |