mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-26 12:42:41 +01:00
sys_net: add vm::temporary_unlock
This commit is contained in:
parent
f5ee8c1292
commit
e1293b14f8
@ -24,8 +24,6 @@
|
||||
#include <poll.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
LOG_CHANNEL(sys_net);
|
||||
|
||||
static std::vector<ppu_thread*> s_to_awake;
|
||||
@ -267,6 +265,8 @@ lv2_socket::~lv2_socket()
|
||||
|
||||
s32 sys_net_bnet_accept(ppu_thread& ppu, s32 s, vm::ptr<sys_net_sockaddr> addr, vm::ptr<u32> paddrlen)
|
||||
{
|
||||
vm::temporary_unlock(ppu);
|
||||
|
||||
sys_net.warning("sys_net_bnet_accept(s=%d, addr=*0x%x, paddrlen=*0x%x)", s, addr, paddrlen);
|
||||
|
||||
lv2_socket::socket_type native_socket = -1;
|
||||
@ -395,6 +395,8 @@ s32 sys_net_bnet_accept(ppu_thread& ppu, s32 s, vm::ptr<sys_net_sockaddr> addr,
|
||||
|
||||
s32 sys_net_bnet_bind(ppu_thread& ppu, s32 s, vm::cptr<sys_net_sockaddr> addr, u32 addrlen)
|
||||
{
|
||||
vm::temporary_unlock(ppu);
|
||||
|
||||
sys_net.warning("sys_net_bnet_bind(s=%d, addr=*0x%x, addrlen=%u)", s, addr, addrlen);
|
||||
|
||||
if (addr->sa_family != SYS_NET_AF_INET)
|
||||
@ -431,6 +433,8 @@ s32 sys_net_bnet_bind(ppu_thread& ppu, s32 s, vm::cptr<sys_net_sockaddr> addr, u
|
||||
|
||||
s32 sys_net_bnet_connect(ppu_thread& ppu, s32 s, vm::ptr<sys_net_sockaddr> addr, u32 addrlen)
|
||||
{
|
||||
vm::temporary_unlock(ppu);
|
||||
|
||||
sys_net.warning("sys_net_bnet_connect(s=%d, addr=*0x%x, addrlen=%u)", s, addr, addrlen);
|
||||
|
||||
s32 result = 0;
|
||||
@ -580,6 +584,8 @@ s32 sys_net_bnet_connect(ppu_thread& ppu, s32 s, vm::ptr<sys_net_sockaddr> addr,
|
||||
|
||||
s32 sys_net_bnet_getpeername(ppu_thread& ppu, s32 s, vm::ptr<sys_net_sockaddr> addr, vm::ptr<u32> paddrlen)
|
||||
{
|
||||
vm::temporary_unlock(ppu);
|
||||
|
||||
sys_net.warning("sys_net_bnet_getpeername(s=%d, addr=*0x%x, paddrlen=*0x%x)", s, addr, paddrlen);
|
||||
|
||||
const auto sock = idm::check<lv2_socket>(s, [&](lv2_socket& sock) -> s32
|
||||
@ -621,6 +627,8 @@ s32 sys_net_bnet_getpeername(ppu_thread& ppu, s32 s, vm::ptr<sys_net_sockaddr> a
|
||||
|
||||
s32 sys_net_bnet_getsockname(ppu_thread& ppu, s32 s, vm::ptr<sys_net_sockaddr> addr, vm::ptr<u32> paddrlen)
|
||||
{
|
||||
vm::temporary_unlock(ppu);
|
||||
|
||||
sys_net.warning("sys_net_bnet_getsockname(s=%d, addr=*0x%x, paddrlen=*0x%x)", s, addr, paddrlen);
|
||||
|
||||
const auto sock = idm::check<lv2_socket>(s, [&](lv2_socket& sock) -> s32
|
||||
@ -662,6 +670,8 @@ s32 sys_net_bnet_getsockname(ppu_thread& ppu, s32 s, vm::ptr<sys_net_sockaddr> a
|
||||
|
||||
s32 sys_net_bnet_getsockopt(ppu_thread& ppu, s32 s, s32 level, s32 optname, vm::ptr<void> optval, vm::ptr<u32> optlen)
|
||||
{
|
||||
vm::temporary_unlock(ppu);
|
||||
|
||||
sys_net.warning("sys_net_bnet_getsockopt(s=%d, level=0x%x, optname=0x%x, optval=*0x%x, optlen=*0x%x)", s, level, optname, optval, optlen);
|
||||
|
||||
int native_level = -1;
|
||||
@ -850,6 +860,8 @@ s32 sys_net_bnet_getsockopt(ppu_thread& ppu, s32 s, s32 level, s32 optname, vm::
|
||||
|
||||
s32 sys_net_bnet_listen(ppu_thread& ppu, s32 s, s32 backlog)
|
||||
{
|
||||
vm::temporary_unlock(ppu);
|
||||
|
||||
sys_net.warning("sys_net_bnet_listen(s=%d, backlog=%d)", s, backlog);
|
||||
|
||||
const auto sock = idm::check<lv2_socket>(s, [&](lv2_socket& sock) -> s32
|
||||
@ -874,6 +886,8 @@ s32 sys_net_bnet_listen(ppu_thread& ppu, s32 s, s32 backlog)
|
||||
|
||||
s32 sys_net_bnet_recvfrom(ppu_thread& ppu, s32 s, vm::ptr<void> buf, u32 len, s32 flags, vm::ptr<sys_net_sockaddr> addr, vm::ptr<u32> paddrlen)
|
||||
{
|
||||
vm::temporary_unlock(ppu);
|
||||
|
||||
sys_net.warning("sys_net_bnet_recvfrom(s=%d, buf=*0x%x, len=%u, flags=0x%x, addr=*0x%x, paddrlen=*0x%x)", s, buf, len, flags, addr, paddrlen);
|
||||
|
||||
if (flags & ~(SYS_NET_MSG_PEEK | SYS_NET_MSG_DONTWAIT | SYS_NET_MSG_WAITALL))
|
||||
@ -1010,18 +1024,24 @@ s32 sys_net_bnet_recvfrom(ppu_thread& ppu, s32 s, vm::ptr<void> buf, u32 len, s3
|
||||
|
||||
s32 sys_net_bnet_recvmsg(ppu_thread& ppu, s32 s, vm::ptr<sys_net_msghdr> msg, s32 flags)
|
||||
{
|
||||
vm::temporary_unlock(ppu);
|
||||
|
||||
sys_net.todo("sys_net_bnet_recvmsg(s=%d, msg=*0x%x, flags=0x%x)", s, msg, flags);
|
||||
return 0;
|
||||
}
|
||||
|
||||
s32 sys_net_bnet_sendmsg(ppu_thread& ppu, s32 s, vm::cptr<sys_net_msghdr> msg, s32 flags)
|
||||
{
|
||||
vm::temporary_unlock(ppu);
|
||||
|
||||
sys_net.todo("sys_net_bnet_sendmsg(s=%d, msg=*0x%x, flags=0x%x)", s, msg, flags);
|
||||
return 0;
|
||||
}
|
||||
|
||||
s32 sys_net_bnet_sendto(ppu_thread& ppu, s32 s, vm::cptr<void> buf, u32 len, s32 flags, vm::cptr<sys_net_sockaddr> addr, u32 addrlen)
|
||||
{
|
||||
vm::temporary_unlock(ppu);
|
||||
|
||||
sys_net.warning("sys_net_bnet_sendto(s=%d, buf=*0x%x, len=%u, flags=0x%x, addr=*0x%x, addrlen=%u)", s, buf, len, flags, addr, addrlen);
|
||||
|
||||
if (flags & ~(SYS_NET_MSG_DONTWAIT | SYS_NET_MSG_WAITALL))
|
||||
@ -1149,6 +1169,8 @@ s32 sys_net_bnet_sendto(ppu_thread& ppu, s32 s, vm::cptr<void> buf, u32 len, s32
|
||||
|
||||
s32 sys_net_bnet_setsockopt(ppu_thread& ppu, s32 s, s32 level, s32 optname, vm::cptr<void> optval, u32 optlen)
|
||||
{
|
||||
vm::temporary_unlock(ppu);
|
||||
|
||||
sys_net.warning("sys_net_bnet_setsockopt(s=%d, level=0x%x, optname=0x%x, optval=*0x%x, optlen=%u)", s, level, optname, optval, optlen);
|
||||
|
||||
int native_int = 0;
|
||||
@ -1334,6 +1356,8 @@ s32 sys_net_bnet_setsockopt(ppu_thread& ppu, s32 s, s32 level, s32 optname, vm::
|
||||
|
||||
s32 sys_net_bnet_shutdown(ppu_thread& ppu, s32 s, s32 how)
|
||||
{
|
||||
vm::temporary_unlock(ppu);
|
||||
|
||||
sys_net.warning("sys_net_bnet_shutdown(s=%d, how=%d)", s, how);
|
||||
|
||||
if (how < 0 || how > 2)
|
||||
@ -1373,6 +1397,8 @@ s32 sys_net_bnet_shutdown(ppu_thread& ppu, s32 s, s32 how)
|
||||
|
||||
s32 sys_net_bnet_socket(ppu_thread& ppu, s32 family, s32 type, s32 protocol)
|
||||
{
|
||||
vm::temporary_unlock(ppu);
|
||||
|
||||
sys_net.warning("sys_net_bnet_socket(family=%d, type=%d, protocol=%d)", family, type, protocol);
|
||||
|
||||
if (family != SYS_NET_AF_INET && family != SYS_NET_AF_UNSPEC)
|
||||
@ -1426,6 +1452,8 @@ s32 sys_net_bnet_socket(ppu_thread& ppu, s32 family, s32 type, s32 protocol)
|
||||
|
||||
s32 sys_net_bnet_close(ppu_thread& ppu, s32 s)
|
||||
{
|
||||
vm::temporary_unlock(ppu);
|
||||
|
||||
sys_net.warning("sys_net_bnet_close(s=%d)", s);
|
||||
|
||||
const auto sock = idm::withdraw<lv2_socket>(s);
|
||||
@ -1443,6 +1471,8 @@ s32 sys_net_bnet_close(ppu_thread& ppu, s32 s)
|
||||
|
||||
s32 sys_net_bnet_poll(ppu_thread& ppu, vm::ptr<sys_net_pollfd> fds, s32 nfds, s32 ms)
|
||||
{
|
||||
vm::temporary_unlock(ppu);
|
||||
|
||||
sys_net.warning("sys_net_bnet_poll(fds=*0x%x, nfds=%d, ms=%d)", fds, nfds, ms);
|
||||
|
||||
atomic_t<s32> signaled{0};
|
||||
@ -1612,6 +1642,8 @@ s32 sys_net_bnet_poll(ppu_thread& ppu, vm::ptr<sys_net_pollfd> fds, s32 nfds, s3
|
||||
|
||||
s32 sys_net_bnet_select(ppu_thread& ppu, s32 nfds, vm::ptr<sys_net_fd_set> readfds, vm::ptr<sys_net_fd_set> writefds, vm::ptr<sys_net_fd_set> exceptfds, vm::ptr<sys_net_timeval> _timeout)
|
||||
{
|
||||
vm::temporary_unlock(ppu);
|
||||
|
||||
sys_net.warning("sys_net_bnet_select(nfds=%d, readfds=*0x%x, writefds=*0x%x, exceptfds=*0x%x, timeout=*0x%x)", nfds, readfds, writefds, exceptfds, _timeout);
|
||||
|
||||
atomic_t<s32> signaled{0};
|
||||
@ -1823,60 +1855,80 @@ s32 sys_net_bnet_select(ppu_thread& ppu, s32 nfds, vm::ptr<sys_net_fd_set> readf
|
||||
|
||||
s32 _sys_net_open_dump(ppu_thread& ppu, s32 len, s32 flags)
|
||||
{
|
||||
vm::temporary_unlock(ppu);
|
||||
|
||||
sys_net.todo("_sys_net_open_dump(len=%d, flags=0x%x)", len, flags);
|
||||
return 0;
|
||||
}
|
||||
|
||||
s32 _sys_net_read_dump(ppu_thread& ppu, s32 id, vm::ptr<void> buf, s32 len, vm::ptr<s32> pflags)
|
||||
{
|
||||
vm::temporary_unlock(ppu);
|
||||
|
||||
sys_net.todo("_sys_net_read_dump(id=0x%x, buf=*0x%x, len=%d, pflags=*0x%x)", id, buf, len, pflags);
|
||||
return 0;
|
||||
}
|
||||
|
||||
s32 _sys_net_close_dump(ppu_thread& ppu, s32 id, vm::ptr<s32> pflags)
|
||||
{
|
||||
vm::temporary_unlock(ppu);
|
||||
|
||||
sys_net.todo("_sys_net_close_dump(id=0x%x, pflags=*0x%x)", id, pflags);
|
||||
return 0;
|
||||
}
|
||||
|
||||
s32 _sys_net_write_dump(ppu_thread& ppu, s32 id, vm::cptr<void> buf, s32 len, u32 unknown)
|
||||
{
|
||||
vm::temporary_unlock(ppu);
|
||||
|
||||
sys_net.todo(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
s32 sys_net_abort(ppu_thread& ppu, s32 type, u64 arg, s32 flags)
|
||||
{
|
||||
vm::temporary_unlock(ppu);
|
||||
|
||||
sys_net.todo("sys_net_abort(type=%d, arg=0x%x, flags=0x%x)", type, arg, flags);
|
||||
return 0;
|
||||
}
|
||||
|
||||
s32 sys_net_infoctl(ppu_thread& ppu, s32 cmd, vm::ptr<void> arg)
|
||||
{
|
||||
vm::temporary_unlock(ppu);
|
||||
|
||||
sys_net.todo("sys_net_infoctl(cmd=%d, arg=*0x%x)", cmd, arg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
s32 sys_net_control(ppu_thread& ppu, u32 arg1, s32 arg2, vm::ptr<void> arg3, s32 arg4)
|
||||
{
|
||||
vm::temporary_unlock(ppu);
|
||||
|
||||
sys_net.todo("sys_net_control(0x%x, %d, *0x%x, %d)", arg1, arg2, arg3, arg4);
|
||||
return 0;
|
||||
}
|
||||
|
||||
s32 sys_net_bnet_ioctl(ppu_thread& ppu, s32 arg1, u32 arg2, u32 arg3)
|
||||
{
|
||||
vm::temporary_unlock(ppu);
|
||||
|
||||
sys_net.todo("sys_net_bnet_ioctl(%d, 0x%x, 0x%x)", arg1, arg2, arg3);
|
||||
return 0;
|
||||
}
|
||||
|
||||
s32 sys_net_bnet_sysctl(ppu_thread& ppu, u32 arg1, u32 arg2, u32 arg3, vm::ptr<void> arg4, u32 arg5, u32 arg6)
|
||||
{
|
||||
vm::temporary_unlock(ppu);
|
||||
|
||||
sys_net.todo("sys_net_bnet_sysctl(0x%x, 0x%x, 0x%x, *0x%x, 0x%x, 0x%x)", arg1, arg2, arg3, arg4, arg5, arg6);
|
||||
return 0;
|
||||
}
|
||||
|
||||
s32 sys_net_eurus_post_command(ppu_thread& ppu, s32 arg1, u32 arg2, u32 arg3)
|
||||
{
|
||||
vm::temporary_unlock(ppu);
|
||||
|
||||
sys_net.todo("sys_net_eurus_post_command(%d, 0x%x, 0x%x)", arg1, arg2, arg3);
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user