fixed alignments
This commit is contained in:
parent
20412e605f
commit
e5242a2ffe
1 changed files with 14 additions and 15 deletions
|
@ -74,8 +74,8 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
{
|
{
|
||||||
BsdSocket NewBsdSocket = new BsdSocket
|
BsdSocket NewBsdSocket = new BsdSocket
|
||||||
{
|
{
|
||||||
Family = Context.RequestData.ReadInt32(),
|
Family = Context.RequestData.ReadInt32(),
|
||||||
Type = Context.RequestData.ReadInt32(),
|
Type = Context.RequestData.ReadInt32(),
|
||||||
Protocol = Context.RequestData.ReadInt32()
|
Protocol = Context.RequestData.ReadInt32()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -95,7 +95,7 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
public long Poll(ServiceCtx Context)
|
public long Poll(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
int PollCount = Context.RequestData.ReadInt32();
|
int PollCount = Context.RequestData.ReadInt32();
|
||||||
int TimeOut = Context.RequestData.ReadInt32();
|
int TimeOut = Context.RequestData.ReadInt32();
|
||||||
|
|
||||||
//https://github.com/torvalds/linux/blob/master/include/uapi/asm-generic/poll.h
|
//https://github.com/torvalds/linux/blob/master/include/uapi/asm-generic/poll.h
|
||||||
//https://msdn.microsoft.com/fr-fr/library/system.net.sockets.socket.poll(v=vs.110).aspx
|
//https://msdn.microsoft.com/fr-fr/library/system.net.sockets.socket.poll(v=vs.110).aspx
|
||||||
|
@ -106,9 +106,9 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
byte[] SentBuffer = Context.Memory.ReadBytes(Context.Request.SendBuff[0].Position,
|
byte[] SentBuffer = Context.Memory.ReadBytes(Context.Request.SendBuff[0].Position,
|
||||||
Context.Request.SendBuff[0].Size);
|
Context.Request.SendBuff[0].Size);
|
||||||
|
|
||||||
int SocketId = Get32(SentBuffer, 0);
|
int SocketId = Get32(SentBuffer, 0);
|
||||||
int RequestedEvents = Get16(SentBuffer, 4);
|
int RequestedEvents = Get16(SentBuffer, 4);
|
||||||
int ReturnedEvents = Get16(SentBuffer, 6);
|
int ReturnedEvents = Get16(SentBuffer, 6);
|
||||||
|
|
||||||
//Todo: Stub - Need to implemented the Type-22 buffer.
|
//Todo: Stub - Need to implemented the Type-22 buffer.
|
||||||
|
|
||||||
|
@ -121,7 +121,7 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
//(u32 socket, u32 flags) -> (i32 ret, u32 bsd_errno, buffer<i8, 0x22, 0> message)
|
//(u32 socket, u32 flags) -> (i32 ret, u32 bsd_errno, buffer<i8, 0x22, 0> message)
|
||||||
public long Recv(ServiceCtx Context)
|
public long Recv(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
int SocketId = Context.RequestData.ReadInt32();
|
int SocketId = Context.RequestData.ReadInt32();
|
||||||
int SocketFlags = Context.RequestData.ReadInt32();
|
int SocketFlags = Context.RequestData.ReadInt32();
|
||||||
|
|
||||||
(long ReceivePosition, long ReceiveLength) = Context.Request.GetBufferType0x22();
|
(long ReceivePosition, long ReceiveLength) = Context.Request.GetBufferType0x22();
|
||||||
|
@ -149,7 +149,7 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
//(u32 socket, u32 flags, buffer<i8, 0x21, 0>) -> (i32 ret, u32 bsd_errno)
|
//(u32 socket, u32 flags, buffer<i8, 0x21, 0>) -> (i32 ret, u32 bsd_errno)
|
||||||
public long Send(ServiceCtx Context)
|
public long Send(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
int SocketId = Context.RequestData.ReadInt32();
|
int SocketId = Context.RequestData.ReadInt32();
|
||||||
int SocketFlags = Context.RequestData.ReadInt32();
|
int SocketFlags = Context.RequestData.ReadInt32();
|
||||||
|
|
||||||
(long SentPosition, long SentSize) = Context.Request.GetBufferType0x21();
|
(long SentPosition, long SentSize) = Context.Request.GetBufferType0x21();
|
||||||
|
@ -175,7 +175,7 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
//(u32 socket, u32 flags, buffer<i8, 0x21, 0>, buffer<sockaddr, 0x21, 0>) -> (i32 ret, u32 bsd_errno)
|
//(u32 socket, u32 flags, buffer<i8, 0x21, 0>, buffer<sockaddr, 0x21, 0>) -> (i32 ret, u32 bsd_errno)
|
||||||
public long SendTo(ServiceCtx Context)
|
public long SendTo(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
int SocketId = Context.RequestData.ReadInt32();
|
int SocketId = Context.RequestData.ReadInt32();
|
||||||
int SocketFlags = Context.RequestData.ReadInt32();
|
int SocketFlags = Context.RequestData.ReadInt32();
|
||||||
|
|
||||||
byte[] SentBuffer = Context.Memory.ReadBytes(Context.Request.SendBuff[0].Position,
|
byte[] SentBuffer = Context.Memory.ReadBytes(Context.Request.SendBuff[0].Position,
|
||||||
|
@ -245,7 +245,7 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
BsdSocket NewBsdSocket = new BsdSocket
|
BsdSocket NewBsdSocket = new BsdSocket
|
||||||
{
|
{
|
||||||
IpAddress = ((IPEndPoint)Sockets[SocketId].Handle.LocalEndPoint).Address,
|
IpAddress = ((IPEndPoint)Sockets[SocketId].Handle.LocalEndPoint).Address,
|
||||||
RemoteEP = ((IPEndPoint)Sockets[SocketId].Handle.LocalEndPoint),
|
RemoteEP = ((IPEndPoint)Sockets[SocketId].Handle.LocalEndPoint),
|
||||||
Handle = HandleAccept
|
Handle = HandleAccept
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -337,7 +337,7 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
public long Listen(ServiceCtx Context)
|
public long Listen(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
int SocketId = Context.RequestData.ReadInt32();
|
int SocketId = Context.RequestData.ReadInt32();
|
||||||
int BackLog = Context.RequestData.ReadInt32();
|
int BackLog = Context.RequestData.ReadInt32();
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -361,7 +361,7 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
{
|
{
|
||||||
int SocketId = Context.RequestData.ReadInt32();
|
int SocketId = Context.RequestData.ReadInt32();
|
||||||
|
|
||||||
SocketOptionLevel SocketLevel = (SocketOptionLevel)Context.RequestData.ReadInt32();
|
SocketOptionLevel SocketLevel = (SocketOptionLevel)Context.RequestData.ReadInt32();
|
||||||
SocketOptionName SocketOptionName = (SocketOptionName)Context.RequestData.ReadInt32();
|
SocketOptionName SocketOptionName = (SocketOptionName)Context.RequestData.ReadInt32();
|
||||||
|
|
||||||
byte[] SocketOptionValue = Context.Memory.ReadBytes(Context.Request.PtrBuff[0].Position,
|
byte[] SocketOptionValue = Context.Memory.ReadBytes(Context.Request.PtrBuff[0].Position,
|
||||||
|
@ -467,9 +467,9 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
{
|
{
|
||||||
BinaryReader Reader = new BinaryReader(MS);
|
BinaryReader Reader = new BinaryReader(MS);
|
||||||
|
|
||||||
int Size = Reader.ReadByte();
|
int Size = Reader.ReadByte();
|
||||||
int Family = Reader.ReadByte();
|
int Family = Reader.ReadByte();
|
||||||
int Port = EndianSwap.Swap16(Reader.ReadUInt16());
|
int Port = EndianSwap.Swap16(Reader.ReadUInt16());
|
||||||
|
|
||||||
string IpAddress = Reader.ReadByte().ToString() + "." +
|
string IpAddress = Reader.ReadByte().ToString() + "." +
|
||||||
Reader.ReadByte().ToString() + "." +
|
Reader.ReadByte().ToString() + "." +
|
||||||
|
@ -477,8 +477,7 @@ namespace Ryujinx.HLE.HOS.Services.Bsd
|
||||||
Reader.ReadByte().ToString();
|
Reader.ReadByte().ToString();
|
||||||
|
|
||||||
Sockets[SocketId].IpAddress = IPAddress.Parse(IpAddress);
|
Sockets[SocketId].IpAddress = IPAddress.Parse(IpAddress);
|
||||||
|
Sockets[SocketId].RemoteEP = new IPEndPoint(Sockets[SocketId].IpAddress, Port);
|
||||||
Sockets[SocketId].RemoteEP = new IPEndPoint(Sockets[SocketId].IpAddress, Port);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue