PSPSDK 2024-10-31
Loading...
Searching...
No Matches
psputils.h
Go to the documentation of this file.
1/*
2 * PSP Software Development Kit - https://github.com/pspdev
3 * -----------------------------------------------------------------------
4 * Licensed under the BSD license, see LICENSE in PSPSDK root for details.
5 *
6 * psputils.h - Prototypes for the sceUtils library.
7 *
8 * Copyright (c) 2005 Marcus R. Brown <mrbrown@ocgnet.org>
9 * Copyright (c) 2005 James Forshaw <tyranid@gmail.com>
10 * Copyright (c) 2005 John Kelley <ps2dev@kelley.ca>
11 *
12 */
13#ifndef __UTILS_H__
14#define __UTILS_H__
15
16#include <psptypes.h>
17#include <sys/time.h>
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
23/* Some of the structures and definitions in this file were extracted from the japanese
24 puzzle bobble main executable */
25
32#include <sys/time.h>
33#include <time.h>
34
43
49
54
59
64
69
73void sceKernelDcacheWritebackRange(const void *p, unsigned int size);
74
78void sceKernelDcacheWritebackInvalidateRange(const void *p, unsigned int size);
79
83void sceKernelDcacheInvalidateRange(const void *p, unsigned int size);
84
89
93void sceKernelIcacheInvalidateRange(const void *p, unsigned int size);
94
97 unsigned int count;
98 unsigned int state[624];
100
117
125
135
146
163
174
184
193
204
222
233
243
246#ifdef __cplusplus
247}
248#endif
249
250#endif
int sceKernelUtilsMd5BlockResult(SceKernelUtilsMd5Context *ctx, u8 *digest)
Function to get the digest result of the MD5 hash.
void sceKernelDcacheWritebackInvalidateAll(void)
Write back and invalidate the data cache.
struct _SceKernelUtilsMt19937Context SceKernelUtilsMt19937Context
Structure for holding a mersenne twister context.
void sceKernelDcacheWritebackRange(const void *p, unsigned int size)
Write back a range of addresses from the data cache to memory.
int sceKernelUtilsSha1BlockResult(SceKernelUtilsSha1Context *ctx, u8 *digest)
Function to get the result of the SHA1 hash.
void sceKernelDcacheWritebackInvalidateRange(const void *p, unsigned int size)
Write back and invalidate a range of addresses in the data cache.
int sceKernelUtilsSha1Digest(u8 *data, u32 size, u8 *digest)
Function to SHA1 hash a data block.
void sceKernelDcacheWritebackAll(void)
Write back the data cache to memory.
int sceKernelUtilsMd5Digest(u8 *data, u32 size, u8 *digest)
Function to perform an MD5 digest of a data block.
struct _SceKernelUtilsSha1Context SceKernelUtilsSha1Context
Type to hold a sha1 context.
clock_t sceKernelLibcClock(void)
Get the processor clock used since the start of the process.
void sceKernelIcacheInvalidateRange(const void *p, unsigned int size)
Invalidate a range of addresses in the instruction cache.
time_t sceKernelLibcTime(time_t *t)
Get the time in seconds since the epoc (1st Jan 1970)
int sceKernelUtilsMd5BlockInit(SceKernelUtilsMd5Context *ctx)
Function to initialise a MD5 digest context.
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.
struct _SceKernelUtilsMd5Context SceKernelUtilsMd5Context
Structure to hold the MD5 context.
void sceKernelIcacheInvalidateAll(void)
Invalidate the instruction cache.
int sceKernelUtilsMt19937Init(SceKernelUtilsMt19937Context *ctx, u32 seed)
Function to initialise a mersenne twister context.
int sceKernelUtilsMd5BlockUpdate(SceKernelUtilsMd5Context *ctx, u8 *data, u32 size)
Function to update the MD5 digest with a block of data.
u32 sceKernelUtilsMt19937UInt(SceKernelUtilsMt19937Context *ctx)
Function to return a new psuedo random number.
int sceKernelLibcGettimeofday(struct SceKernelTimeval *tp, struct timezone *tzp)
Get the current time of time and time zone information.
void sceKernelDcacheInvalidateRange(const void *p, unsigned int size)
Invalidate a range of addresses in data cache.
unsigned char size
Definition pspsysmem_kernel.h:6
uint16_t SceUShort16
Definition psptypes.h:79
uint8_t u8
Definition psptypes.h:38
float x
Definition psptypes.h:0
uint64_t SceULong64
Definition psptypes.h:82
uint32_t u32
Definition psptypes.h:41
This struct is needed because tv_sec size is different from what newlib expect Newlib expects 64bits ...
Definition psputils.h:39
uint32_t tv_sec
Definition psputils.h:40
uint32_t tv_usec
Definition psputils.h:41
Structure to hold the MD5 context.
Definition psputils.h:127
unsigned char buf[64]
Definition psputils.h:133
SceUShort16 usRemains
Definition psputils.h:130
SceULong64 ullTotalLen
Definition psputils.h:132
SceUShort16 usComputed
Definition psputils.h:131
unsigned int h[4]
Definition psputils.h:128
unsigned int pad
Definition psputils.h:129
Structure for holding a mersenne twister context.
Definition psputils.h:96
unsigned int state[624]
Definition psputils.h:98
unsigned int count
Definition psputils.h:97
Type to hold a sha1 context.
Definition psputils.h:186
unsigned char buf[64]
Definition psputils.h:191
SceULong64 ullTotalLen
Definition psputils.h:190
unsigned int h[5]
Definition psputils.h:187
SceUShort16 usRemains
Definition psputils.h:188
SceUShort16 usComputed
Definition psputils.h:189