PSPSDK 1.0+beta2
Loading...
Searching...
No Matches
Utils Library

Data Structures

struct  SceKernelTimeval
 This struct is needed because tv_sec size is different from what newlib expect Newlib expects 64bits for seconds and PSP expects 32bits. More...
 
struct  _SceKernelUtilsMt19937Context
 Structure for holding a mersenne twister context. More...
 
struct  _SceKernelUtilsMd5Context
 Structure to hold the MD5 context. More...
 
struct  _SceKernelUtilsSha1Context
 Type to hold a sha1 context. More...
 

Typedefs

typedef struct SceKernelTimeval SceKernelTimeval
 This struct is needed because tv_sec size is different from what newlib expect Newlib expects 64bits for seconds and PSP expects 32bits.
 
typedef struct _SceKernelUtilsMt19937Context SceKernelUtilsMt19937Context
 Structure for holding a mersenne twister context.
 
typedef struct _SceKernelUtilsMd5Context SceKernelUtilsMd5Context
 Structure to hold the MD5 context.
 
typedef struct _SceKernelUtilsSha1Context SceKernelUtilsSha1Context
 Type to hold a sha1 context.
 

Functions

time_t sceKernelLibcTime (time_t *t)
 Get the time in seconds since the epoc (1st Jan 1970)
 
clock_t sceKernelLibcClock (void)
 Get the processor clock used since the start of the process.
 
int sceKernelLibcGettimeofday (struct SceKernelTimeval *tp, struct timezone *tzp)
 Get the current time of time and time zone information.
 
void sceKernelDcacheWritebackAll (void)
 Write back the data cache to memory.
 
void sceKernelDcacheWritebackInvalidateAll (void)
 Write back and invalidate the data cache.
 
void sceKernelDcacheWritebackRange (const void *p, unsigned int size)
 Write back a range of addresses from the data cache to memory.
 
void sceKernelDcacheWritebackInvalidateRange (const void *p, unsigned int size)
 Write back and invalidate a range of addresses in the data cache.
 
void sceKernelDcacheInvalidateRange (const void *p, unsigned int size)
 Invalidate a range of addresses in data cache.
 
void sceKernelIcacheInvalidateAll (void)
 Invalidate the instruction cache.
 
void sceKernelIcacheInvalidateRange (const void *p, unsigned int size)
 Invalidate a range of addresses in the instruction cache.
 
int sceKernelUtilsMt19937Init (SceKernelUtilsMt19937Context *ctx, u32 seed)
 Function to initialise a mersenne twister context.
 
u32 sceKernelUtilsMt19937UInt (SceKernelUtilsMt19937Context *ctx)
 Function to return a new psuedo random number.
 
int sceKernelUtilsMd5Digest (u8 *data, u32 size, u8 *digest)
 Function to perform an MD5 digest of a data block.
 
int sceKernelUtilsMd5BlockInit (SceKernelUtilsMd5Context *ctx)
 Function to initialise a MD5 digest context.
 
int sceKernelUtilsMd5BlockUpdate (SceKernelUtilsMd5Context *ctx, u8 *data, u32 size)
 Function to update the MD5 digest with a block of data.
 
int sceKernelUtilsMd5BlockResult (SceKernelUtilsMd5Context *ctx, u8 *digest)
 Function to get the digest result of the MD5 hash.
 
int sceKernelUtilsSha1Digest (u8 *data, u32 size, u8 *digest)
 Function to SHA1 hash a data block.
 
int sceKernelUtilsSha1BlockInit (SceKernelUtilsSha1Context *ctx)
 Function to initialise a context for SHA1 hashing.
 
int sceKernelUtilsSha1BlockUpdate (SceKernelUtilsSha1Context *ctx, u8 *data, u32 size)
 Function to update the current hash.
 
int sceKernelUtilsSha1BlockResult (SceKernelUtilsSha1Context *ctx, u8 *digest)
 Function to get the result of the SHA1 hash.
 

Detailed Description

Typedef Documentation

◆ SceKernelTimeval

This struct is needed because tv_sec size is different from what newlib expect Newlib expects 64bits for seconds and PSP expects 32bits.

◆ SceKernelUtilsMd5Context

◆ SceKernelUtilsMt19937Context

Structure for holding a mersenne twister context.

◆ SceKernelUtilsSha1Context

Function Documentation

◆ sceKernelDcacheInvalidateRange()

void sceKernelDcacheInvalidateRange ( const void p,
unsigned int  size 
)

Invalidate a range of addresses in data cache.

◆ sceKernelDcacheWritebackAll()

void sceKernelDcacheWritebackAll ( void  )

Write back the data cache to memory.

Referenced by pspSdkFixupImports().

◆ sceKernelDcacheWritebackInvalidateAll()

void sceKernelDcacheWritebackInvalidateAll ( void  )

Write back and invalidate the data cache.

◆ sceKernelDcacheWritebackInvalidateRange()

void sceKernelDcacheWritebackInvalidateRange ( const void p,
unsigned int  size 
)

Write back and invalidate a range of addresses in the data cache.

◆ sceKernelDcacheWritebackRange()

void sceKernelDcacheWritebackRange ( const void p,
unsigned int  size 
)

Write back a range of addresses from the data cache to memory.

◆ sceKernelIcacheInvalidateAll()

void sceKernelIcacheInvalidateAll ( void  )

Invalidate the instruction cache.

◆ sceKernelIcacheInvalidateRange()

void sceKernelIcacheInvalidateRange ( const void p,
unsigned int  size 
)

Invalidate a range of addresses in the instruction cache.

◆ sceKernelLibcClock()

clock_t sceKernelLibcClock ( void  )

Get the processor clock used since the start of the process.

◆ sceKernelLibcGettimeofday()

int sceKernelLibcGettimeofday ( struct SceKernelTimeval tp,
struct timezone tzp 
)

Get the current time of time and time zone information.

◆ sceKernelLibcTime()

time_t sceKernelLibcTime ( time_t t)

Get the time in seconds since the epoc (1st Jan 1970)

◆ sceKernelUtilsMd5BlockInit()

int sceKernelUtilsMd5BlockInit ( SceKernelUtilsMd5Context ctx)

Function to initialise a MD5 digest context.

Parameters
ctx- A context block to initialise
Returns
< 0 on error.
Example:
u8 digest[16];
int sceKernelUtilsMd5BlockResult(SceKernelUtilsMd5Context *ctx, u8 *digest)
Function to get the digest result of the MD5 hash.
int sceKernelUtilsMd5BlockInit(SceKernelUtilsMd5Context *ctx)
Function to initialise a MD5 digest context.
int sceKernelUtilsMd5BlockUpdate(SceKernelUtilsMd5Context *ctx, u8 *data, u32 size)
Function to update the MD5 digest with a block of data.
uint8_t u8
Definition psptypes.h:38
float x
Definition psptypes.h:0
Structure to hold the MD5 context.
Definition psputils.h:127

◆ sceKernelUtilsMd5BlockResult()

int sceKernelUtilsMd5BlockResult ( SceKernelUtilsMd5Context ctx,
u8 digest 
)

Function to get the digest result of the MD5 hash.

Parameters
ctx- A filled in context block.
digest- A 16 byte array to hold the digest.
Returns
< 0 on error.

◆ sceKernelUtilsMd5BlockUpdate()

int sceKernelUtilsMd5BlockUpdate ( SceKernelUtilsMd5Context ctx,
u8 data,
u32  size 
)

Function to update the MD5 digest with a block of data.

Parameters
ctx- A filled in context block.
data- The data block to hash.
size- The size of the data to hash
Returns
< 0 on error.

◆ sceKernelUtilsMd5Digest()

int sceKernelUtilsMd5Digest ( u8 data,
u32  size,
u8 digest 
)

Function to perform an MD5 digest of a data block.

Parameters
data- Pointer to a data block to make a digest of.
size- Size of the data block.
digest- Pointer to a 16byte buffer to store the resulting digest
Returns
< 0 on error.

◆ sceKernelUtilsMt19937Init()

int sceKernelUtilsMt19937Init ( SceKernelUtilsMt19937Context ctx,
u32  seed 
)

Function to initialise a mersenne twister context.

Parameters
ctx- Pointer to a context
seed- A seed for the random function.
Example:
int sceKernelUtilsMt19937Init(SceKernelUtilsMt19937Context *ctx, u32 seed)
Function to initialise a mersenne twister context.
u32 sceKernelUtilsMt19937UInt(SceKernelUtilsMt19937Context *ctx)
Function to return a new psuedo random number.
#define NULL
Definition psptypes.h:31
Structure for holding a mersenne twister context.
Definition psputils.h:96
Returns
< 0 on error.

◆ sceKernelUtilsMt19937UInt()

u32 sceKernelUtilsMt19937UInt ( SceKernelUtilsMt19937Context ctx)

Function to return a new psuedo random number.

Parameters
ctx- Pointer to a pre-initialised context.
Returns
A pseudo random number (between 0 and MAX_INT).

◆ sceKernelUtilsSha1BlockInit()

int sceKernelUtilsSha1BlockInit ( SceKernelUtilsSha1Context ctx)

Function to initialise a context for SHA1 hashing.

Parameters
ctx- Pointer to a context.
Returns
< 0 on error.
Example:
u8 digest[20];
int sceKernelUtilsSha1BlockResult(SceKernelUtilsSha1Context *ctx, u8 *digest)
Function to get the result of the SHA1 hash.
int sceKernelUtilsSha1BlockUpdate(SceKernelUtilsSha1Context *ctx, u8 *data, u32 size)
Function to update the current hash.
int sceKernelUtilsSha1BlockInit(SceKernelUtilsSha1Context *ctx)
Function to initialise a context for SHA1 hashing.
Type to hold a sha1 context.
Definition psputils.h:186

◆ sceKernelUtilsSha1BlockResult()

int sceKernelUtilsSha1BlockResult ( SceKernelUtilsSha1Context ctx,
u8 digest 
)

Function to get the result of the SHA1 hash.

Parameters
ctx- Pointer to a prefilled context.
digest- A pointer to a 20 byte array to contain the digest.
Returns
< 0 on error.

◆ sceKernelUtilsSha1BlockUpdate()

int sceKernelUtilsSha1BlockUpdate ( SceKernelUtilsSha1Context ctx,
u8 data,
u32  size 
)

Function to update the current hash.

Parameters
ctx- Pointer to a prefilled context.
data- The data block to hash.
size- The size of the data block
Returns
< 0 on error.

◆ sceKernelUtilsSha1Digest()

int sceKernelUtilsSha1Digest ( u8 data,
u32  size,
u8 digest 
)

Function to SHA1 hash a data block.

Parameters
data- The data to hash.
size- The size of the data.
digest- Pointer to a 20 byte array for storing the digest
Returns
< 0 on error.