RetroArch
lwp_threads.h
Go to the documentation of this file.
1 #ifndef __LWP_THREADS_H__
2 #define __LWP_THREADS_H__
3 
4 #include <gctypes.h>
5 #include <stdlib.h>
6 #include "lwp_states.h"
7 #include "lwp_tqdata.h"
8 #include "lwp_watchdog.h"
9 #include "lwp_objmgr.h"
10 #include "context.h"
11 
12 //#define _LWPTHREADS_DEBUG
13 #define LWP_TIMESLICE_TIMER_ID 0x00070040
14 
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18 
19 typedef enum
20 {
24 
25 typedef struct _lwpwaitinfo {
28  void *ret_arg;
29  void *ret_arg_1;
34 } lwp_waitinfo;
35 
36 typedef struct _lwpcntrl {
48 
49  void* (*entry)(void *);
50  void *arg;
51  void *stack;
57  void *libc_reent;
59 
60 extern lwp_cntrl *_thr_main;
61 extern lwp_cntrl *_thr_idle;
63 extern lwp_cntrl *_thr_heir;
67 
69 extern void **__lwp_thr_libc_reent;
70 extern lwp_queue _lwp_thr_ready[];
71 
72 void __thread_dispatch();
73 void __lwp_thread_yield();
84 u32 __lwp_thread_init(lwp_cntrl *,void *,u32,u32,u32,bool);
85 u32 __lwp_thread_start(lwp_cntrl *,void* (*)(void*),void *);
86 void __lwp_thread_exit(void *);
89 void __lwp_thread_stopmultitasking(void (*exitfunc)());
92 
96 void __lwp_thread_delayended(void *);
98 
99 #ifdef LIBOGC_INTERNAL
100 #include <libogc/lwp_threads.inl>
101 #endif
102 
103 #ifdef __cplusplus
104  }
105 #endif
106 
107 #endif
void __lwp_thread_setstate(lwp_cntrl *, u32)
Definition: lwp_threads.c:306
lwp_thrqueue join_list
Definition: lwp_threads.h:55
void __lwp_thread_setpriority(lwp_cntrl *, u32)
Definition: lwp_threads.c:413
Definition: lwp_threads.h:22
Definition: lwp_queue.h:21
Definition: context.h:30
Data type definitions.
prio_cntrl priomap
Definition: lwp_threads.h:46
lwp_cpu_budget_algorithms
Definition: lwp_threads.h:19
lwp_cntrl * _thr_allocated_fp
Definition: lwp_threads.c:22
Definition: lwp_tqdata.h:23
void __lwp_thread_tickle_timeslice(void *)
Definition: lwp_threads.c:119
lwp_cntrl * _thr_idle
Definition: lwp_threads.c:18
Definition: lwp_threads.h:21
vu32 _context_switch_want
Definition: lwp_threads.c:24
void __lwp_thread_yield()
Definition: lwp_threads.c:257
void __lwp_rotate_readyqueue(u32)
Definition: lwp_threads.c:223
lwp_cntrl * _thr_executing
Definition: lwp_threads.c:20
Definition: lwp_objmgr.h:17
u8 cur_prio
Definition: lwp_threads.h:38
Definition: lwp_watchdog.h:82
lwp_cntrl * _thr_heir
Definition: lwp_threads.c:21
lwp_cpu_budget_algorithms budget_algo
Definition: lwp_threads.h:43
Definition: lwp_threads.h:36
struct _lwpcntrl lwp_cntrl
u32 isr_level
Definition: lwp_threads.h:40
void * stack
Definition: lwp_threads.h:51
void * ret_arg_1
Definition: lwp_threads.h:29
bool is_preemptible
Definition: lwp_threads.h:44
void __lwp_thread_exit(void *)
Definition: lwp_threads.c:675
u32 __lwp_thread_start(lwp_cntrl *, void *(*)(void *), void *)
void * arg
Definition: lwp_threads.h:50
void __lwp_thread_closeall()
Definition: lwp_threads.c:649
void __lwp_thread_suspend(lwp_cntrl *)
Definition: lwp_threads.c:423
void ** __lwp_thr_libc_reent
Definition: lwp_threads.c:29
u8 stack_allocated
Definition: lwp_threads.h:53
lwp_cntrl * _thr_main
Definition: lwp_threads.c:17
lwp_obj * __lwp_thread_getobject(lwp_cntrl *)
void __lwp_thread_changepriority(lwp_cntrl *, u32, u32)
Definition: lwp_threads.c:379
lwp_queue block2n
Definition: lwp_threads.h:32
u32 __lwp_evaluatemode()
Definition: lwp_threads.c:366
void __lwp_thread_delayended(void *)
Definition: lwp_threads.c:106
u32 id
Definition: lwp_threads.h:26
void __lwp_thread_stopmultitasking(void(*exitfunc)())
Definition: lwp_threads.c:717
u8 real_prio
Definition: lwp_threads.h:38
lwp_thrqueue * queue
Definition: lwp_threads.h:33
void __lwp_thread_close(lwp_cntrl *)
Definition: lwp_threads.c:616
void __lwp_thread_resume(lwp_cntrl *, u32)
Definition: lwp_threads.c:480
lwp_waitinfo wait
Definition: lwp_threads.h:45
u32 __lwp_thread_init(lwp_cntrl *, void *, u32, u32, u32, bool)
Definition: lwp_threads.c:571
void * ret_arg
Definition: lwp_threads.h:28
void __lwp_thread_startmultitasking()
Definition: lwp_threads.c:699
u32 __lwp_isr_in_progress()
Definition: lwp_threads.c:80
lwp_queue _lwp_thr_ready[]
Definition: lwp_threads.c:30
struct _lwpwaitinfo lwp_waitinfo
u32 suspendcnt
Definition: lwp_threads.h:39
u32 cur_state
Definition: lwp_threads.h:41
void __lwp_thread_ready(lwp_cntrl *)
Definition: lwp_threads.c:549
vu32 _thread_dispatch_disable_level
Definition: lwp_threads.c:25
wd_cntrl timer
Definition: lwp_threads.h:47
u32 res_cnt
Definition: lwp_threads.h:39
void __lwp_thread_clearstate(lwp_cntrl *, u32)
Definition: lwp_threads.c:340
void __thread_dispatch()
Definition: lwp_threads.c:173
struct _lwpcntrl * lwp_cntrl_t
u32 stack_size
Definition: lwp_threads.h:52
u32 cpu_time_budget
Definition: lwp_threads.h:42
lwp_queue * ready
Definition: lwp_threads.h:54
void __lwp_thread_resettimeslice()
Definition: lwp_threads.c:279
volatile u32 vu32
32bit unsigned volatile integer
Definition: gctypes.h:29
void * libc_reent
Definition: lwp_threads.h:57
Definition: lwp_priority.h:14
u32 option
Definition: lwp_threads.h:30
frame_context context
Definition: lwp_threads.h:56
Definition: lwp_threads.h:25
uint8_t u8
8bit unsigned integer
Definition: gctypes.h:17
uint32_t u32
32bit unsigned integer
Definition: gctypes.h:19
u32 ret_code
Definition: lwp_threads.h:31
lwp_obj object
Definition: lwp_threads.h:37
u32 cnt
Definition: lwp_threads.h:27
void __lwp_thread_settransient(lwp_cntrl *)
Definition: lwp_threads.c:456
void __lwp_thread_loadenv(lwp_cntrl *)
Definition: lwp_threads.c:514
wd_cntrl _lwp_wd_timeslice
Definition: lwp_threads.c:27