PSPSDK 2024-12-16
Loading...
Searching...
No Matches
crt0.c File Reference
#include <stdlib.h>
#include <string.h>
#include <pspkerneltypes.h>
#include <pspmoduleinfo.h>
#include <pspthreadman.h>
#include <psploadexec.h>
#include <pspmodulemgr.h>
Include dependency graph for crt0.c:

Data Structures

struct  _library_entry
 

Macros

#define ARG_MAX   19
 
#define DEFAULT_THREAD_PRIORITY   32
 
#define DEFAULT_THREAD_ATTRIBUTE   PSP_THREAD_ATTR_USER
 
#define DEFAULT_THREAD_STACK_KB_SIZE   256
 
#define DEFAULT_MAIN_THREAD_NAME   "user_main"
 

Functions

int sce_newlib_nocreate_thread_in_start __attribute__ ((weak))
 
void __libcglue_init (int argc, char *argv[])
 
void __libcglue_deinit ()
 
void _init (void)
 
void _fini (void)
 
int main (int argc, char *argv[])
 
void _main (SceSize args, void *argp)
 Main program thread.
 
 __attribute__ ((__noreturn__))
 
int _start (SceSize args, void *argp)
 Startup thread.
 

Variables

const charname
 
unsigned short version
 
unsigned short attribute
 
unsigned char entLen
 
unsigned char varCount
 
unsigned short funcCount
 
voidentrytable
 

Macro Definition Documentation

◆ ARG_MAX

#define ARG_MAX   19

◆ DEFAULT_MAIN_THREAD_NAME

#define DEFAULT_MAIN_THREAD_NAME   "user_main"

◆ DEFAULT_THREAD_ATTRIBUTE

#define DEFAULT_THREAD_ATTRIBUTE   PSP_THREAD_ATTR_USER

◆ DEFAULT_THREAD_PRIORITY

#define DEFAULT_THREAD_PRIORITY   32

◆ DEFAULT_THREAD_STACK_KB_SIZE

#define DEFAULT_THREAD_STACK_KB_SIZE   256

Function Documentation

◆ __attribute__() [1/2]

◆ __attribute__() [2/2]

int sce_newlib_nocreate_thread_in_start __attribute__ ( (weak )
extern

◆ __libcglue_deinit()

void __libcglue_deinit ( )
extern

Referenced by __attribute__().

◆ __libcglue_init()

void __libcglue_init ( int  argc,
char argv[] 
)
extern

Referenced by _main().

◆ _fini()

void _fini ( void  )
extern

Referenced by __attribute__().

◆ _init()

void _init ( void  )
extern

Referenced by _main().

◆ _main()

void _main ( SceSize  args,
void argp 
)

Main program thread.

Initializes runtime parameters and calls the program's main().

Parameters
args- Size (in bytes) of the argp parameter.
argp- Pointer to program arguments. Each argument is a NUL-terminated string.

References __libcglue_init(), _init(), ARG_MAX, main(), NULL, and x.

Referenced by _start().

◆ _start()

int _start ( SceSize  args,
void argp 
)

Startup thread.

Creates the main program thread based on variables defined by the program.

Parameters
args- Size (in bytes) of arguments passed to the program by the kernel.
argp- Pointer to arguments passed by the kernel.

References _main(), attribute, DEFAULT_MAIN_THREAD_NAME, DEFAULT_THREAD_ATTRIBUTE, DEFAULT_THREAD_PRIORITY, DEFAULT_THREAD_STACK_KB_SIZE, _scemoduleinfo::modattribute, module_info, NULL, PSP_MODULE_KERNEL, PSP_THREAD_ATTR_USBWLAN, PSP_THREAD_ATTR_USER, PSP_THREAD_ATTR_VSH, sceKernelCreateThread(), sceKernelStartThread(), and x.

◆ main()

int main ( int  argc,
char argv[] 
)
extern

Variable Documentation

◆ attribute

unsigned short attribute

Referenced by _start().

◆ entLen

unsigned char entLen

◆ entrytable

void* entrytable

◆ funcCount

unsigned short funcCount

◆ name

const char* name

◆ varCount

unsigned char varCount

◆ version

unsigned short version