wavelength 1.0.0
Loading...
Searching...
No Matches
AsyncBlock Class Reference

Header of one datagram in the ring buffer of an AsyncInfo. More...

#include <asyncblock.h>

Collaboration diagram for AsyncBlock:

Public Member Functions

int InitRing (unsigned int size)
 Turn a buffer into a ring buffer of one empty block.
int MeasureFree (unsigned int size, unsigned int *free)
 Measure the empty blocks that start here.

Static Public Member Functions

static AsyncBlock * At (unsigned char *ring, unsigned int offset)
 The block that starts a byte offset into a ring buffer.

Public Attributes

int mUsed
int mPadding
unsigned int mCapacity
unsigned int mLength
sceInetAddress mAddress
int mPort
int mFlags
int mResult
AsyncBlock * mSelf
unsigned int mReserved [3]
int mValid
unsigned char mData []

Static Public Attributes

static constexpr unsigned int kHeaderSize = 0x40
 Size of the header, and the granularity of the ring buffer.

Detailed Description

Header of one datagram in the ring buffer of an AsyncInfo.

The datagram follows the header, and the next header follows the datagram's capacity. The ring buffer has a copy in EE memory that each side updates by SIF DMA.

The module was built without RTTI. The name is inferred from the module's routines.

Member Function Documentation

◆ InitRing()

int AsyncBlock::InitRing ( unsigned int size)

Turn a buffer into a ring buffer of one empty block.

Parameters
sizeBuffer size, at least two headers.
Returns
Zero, or 2 for a null buffer or a buffer that is too small.
Ghidra address:
NTSC-U/C: 0x0000367c
Ghidra address:
PAL: 0x000034ec

◆ MeasureFree()

int AsyncBlock::MeasureFree ( unsigned int size,
unsigned int * free )

Measure the empty blocks that start here.

Parameters
sizeBytes from this block to the end of the ring buffer.
freeReceives the byte count of the empty blocks, headers included.
Returns
Zero, or 2 for a null argument.
Ghidra address:
NTSC-U/C: 0x000036c4
Ghidra address:
PAL: 0x00003534

◆ At()

AsyncBlock * AsyncBlock::At ( unsigned char * ring,
unsigned int offset )
static

The block that starts a byte offset into a ring buffer.

Parameters
ringRing buffer.
offsetByte offset of the block.
Returns
The block.

Member Data Documentation

◆ kHeaderSize

unsigned int AsyncBlock::kHeaderSize = 0x40
staticconstexpr

Size of the header, and the granularity of the ring buffer.

◆ mUsed

int AsyncBlock::mUsed

1 while the block stores a datagram.

◆ mPadding

int AsyncBlock::mPadding

1 when the block only fills the end of the ring buffer.

◆ mCapacity

unsigned int AsyncBlock::mCapacity

Bytes after the header that belong to the block.

◆ mLength

unsigned int AsyncBlock::mLength

Length of the datagram.

◆ mAddress

sceInetAddress AsyncBlock::mAddress

Remote address of the datagram.

◆ mPort

int AsyncBlock::mPort

Remote port of the datagram.

◆ mFlags

int AsyncBlock::mFlags

Flags of the transfer.

◆ mResult

int AsyncBlock::mResult

Result of sending the datagram.

◆ mSelf

AsyncBlock* AsyncBlock::mSelf

Address of the block in the memory of the side that filled it.

◆ mReserved

unsigned int AsyncBlock::mReserved[3]

◆ mValid

int AsyncBlock::mValid

1 when the datagram is complete.

◆ mData

unsigned char AsyncBlock::mData[]

The datagram.


The documentation for this class was generated from the following file: