@@ -64,22 +64,27 @@ extern "C" {
64
64
#define LWP_ARG_MAX 8
65
65
66
66
/**
67
- * Light-weight process memory objects structure
67
+ * @brief Light-weight process memory objects structure
68
68
*/
69
69
struct rt_lwp_objs
70
70
{
71
- rt_aspace_t source ; /* The address space associated with this LWP */
72
- struct rt_mem_obj mem_obj ; /* The memory object containing memory management information */
71
+ rt_aspace_t source ; /**< The address space associated with this LWP */
72
+ struct rt_mem_obj mem_obj ; /**< The memory object containing memory management information */
73
73
};
74
74
75
75
/**
76
- * Light-weight process notification structure
76
+ * @brief Light-weight process notification structure
77
77
*/
78
78
struct rt_lwp_notify
79
79
{
80
- void (* notify )(rt_wqueue_t * signalfd_queue , int signo ); /* Callback function pointer for signal notification */
81
- rt_wqueue_t * signalfd_queue ; /* Wait queue for signal file descriptors */
82
- rt_slist_t list_node ; /* List node for notification */
80
+ /**
81
+ * @brief Callback function pointer for signal notification
82
+ * @param signalfd_queue Wait queue for signal file descriptors
83
+ * @param signo Signal number
84
+ */
85
+ void (* notify )(rt_wqueue_t * signalfd_queue , int signo );
86
+ rt_wqueue_t * signalfd_queue ; /**< Wait queue for signal file descriptors */
87
+ rt_slist_t list_node ; /**< List node for notification */
83
88
};
84
89
85
90
struct lwp_tty ;
@@ -99,122 +104,122 @@ typedef struct rt_session *rt_session_t;
99
104
typedef struct rt_processgroup * rt_processgroup_t ;
100
105
101
106
/**
102
- * Session control structure for process groups
107
+ * @brief Session control structure for process groups
103
108
*/
104
109
struct rt_session {
105
110
struct rt_object object ;
106
- rt_lwp_t leader ; /* Session leader process */
107
- rt_list_t processgroup ; /* List head of process groups in this session */
108
- pid_t sid ; /* Session ID */
109
- pid_t foreground_pgid ; /* Foreground process group ID */
110
- struct rt_mutex mutex ; /* Mutex for session operations synchronization */
111
- struct lwp_tty * ctty ; /* Control terminal */
111
+ rt_lwp_t leader ; /**< Session leader process */
112
+ rt_list_t processgroup ; /**< List head of process groups in this session */
113
+ pid_t sid ; /**< Session ID */
114
+ pid_t foreground_pgid ; /**< Foreground process group ID */
115
+ struct rt_mutex mutex ; /**< Mutex for session operations synchronization */
116
+ struct lwp_tty * ctty ; /**< Control terminal */
112
117
};
113
118
114
119
/**
115
- * Process group control structure
120
+ * @brief Process group control structure
116
121
*/
117
122
struct rt_processgroup {
118
123
struct rt_object object ;
119
- rt_lwp_t leader ; /* Process group leader process */
120
- rt_list_t process ; /* List head of processes in this process group */
121
- rt_list_t pgrp_list_node ; /* List node for process group */
122
- pid_t pgid ; /* Process group ID */
123
- pid_t sid ; /* Session ID */
124
- struct rt_session * session ; /* Session pointer */
125
- struct rt_mutex mutex ; /* Mutex for process group operations synchronization */
124
+ rt_lwp_t leader ; /**< Process group leader process */
125
+ rt_list_t process ; /**< List head of processes in this process group */
126
+ rt_list_t pgrp_list_node ; /**< List node for process group */
127
+ pid_t pgid ; /**< Process group ID */
128
+ pid_t sid ; /**< Session ID */
129
+ struct rt_session * session ; /**< Session pointer */
130
+ struct rt_mutex mutex ; /**< Mutex for process group operations synchronization */
126
131
127
- rt_atomic_t ref ; /* Reference count for process group */
132
+ rt_atomic_t ref ; /**< Reference count for process group */
128
133
129
134
/* flags on process group */
130
- unsigned int is_orphaned :1 ; /* Whether the process group is orphaned */
135
+ unsigned int is_orphaned :1 ; /**< Whether the process group is orphaned */
131
136
};
132
137
133
138
/**
134
- * Light-weight process structure
139
+ * @brief Light-weight process structure
135
140
*/
136
141
struct rt_lwp
137
142
{
138
143
#ifdef ARCH_MM_MMU
139
- size_t end_heap ; /* End address of heap */
140
- rt_aspace_t aspace ; /* Address space associated with this LWP */
144
+ size_t end_heap ; /**< End address of heap */
145
+ rt_aspace_t aspace ; /**< Address space associated with this LWP */
141
146
#else
142
147
#ifdef ARCH_MM_MPU
143
- struct rt_mpu_info mpu_info ; /* MPU information for this LWP */
148
+ struct rt_mpu_info mpu_info ; /**< MPU information for this LWP */
144
149
#endif /* ARCH_MM_MPU */
145
150
#endif /* ARCH_MM_MMU */
146
151
147
152
#ifdef RT_USING_SMP
148
- int bind_cpu ; /* CPU ID to which the LWP is bound */
153
+ int bind_cpu ; /**< CPU ID to which the LWP is bound */
149
154
#endif
150
155
151
- uint8_t lwp_type ; /* Type of LWP */
156
+ uint8_t lwp_type ; /**< Type of LWP */
152
157
uint8_t reserv [3 ];
153
158
154
159
/* flags */
155
- unsigned int terminated :1 ; /* Process termination flag */
156
- unsigned int background :1 ; /* Background process flag */
157
- unsigned int term_ctrlterm :1 ; /* have control terminal? */
158
- unsigned int did_exec :1 ; /* Whether exec has been performed */
159
- unsigned int jobctl_stopped :1 ; /* job control: current proc is stopped */
160
- unsigned int wait_reap_stp :1 ; /* job control: has wait event for parent */
161
- unsigned int sig_protected :1 ; /* signal: protected proc cannot be killed or stopped */
162
-
163
- struct rt_lwp * parent ; /* parent process */
164
- struct rt_lwp * first_child ; /* first child process */
165
- struct rt_lwp * sibling ; /* sibling(child) process */
166
-
167
- struct rt_wqueue waitpid_waiters ; /* Wait queue for waitpid system call */
168
- lwp_status_t lwp_status ; /* Status of LWP */
169
-
170
- void * text_entry ; /* Entry point of text segment */
171
- uint32_t text_size ; /* Size of text segment */
172
- void * data_entry ; /* Entry point of data segment */
173
- uint32_t data_size ; /* Size of data segment */
174
-
175
- rt_atomic_t ref ; /* Reference count for LWP */
176
- void * args ; /* Arguments passed to LWP */
177
- uint32_t args_length ; /* Length of arguments */
178
- pid_t pid ; /* Process ID */
179
- pid_t sid ; /* session ID */
180
- pid_t pgid ; /* process group ID */
160
+ unsigned int terminated :1 ; /**< Process termination flag */
161
+ unsigned int background :1 ; /**< Background process flag */
162
+ unsigned int term_ctrlterm :1 ; /**< have control terminal? */
163
+ unsigned int did_exec :1 ; /**< Whether exec has been performed */
164
+ unsigned int jobctl_stopped :1 ; /**< job control: current proc is stopped */
165
+ unsigned int wait_reap_stp :1 ; /**< job control: has wait event for parent */
166
+ unsigned int sig_protected :1 ; /**< signal: protected proc cannot be killed or stopped */
167
+
168
+ struct rt_lwp * parent ; /**< parent process */
169
+ struct rt_lwp * first_child ; /**< first child process */
170
+ struct rt_lwp * sibling ; /**< sibling(child) process */
171
+
172
+ struct rt_wqueue waitpid_waiters ; /**< Wait queue for waitpid system call */
173
+ lwp_status_t lwp_status ; /**< Status of LWP */
174
+
175
+ void * text_entry ; /**< Entry point of text segment */
176
+ uint32_t text_size ; /**< Size of text segment */
177
+ void * data_entry ; /**< Entry point of data segment */
178
+ uint32_t data_size ; /**< Size of data segment */
179
+
180
+ rt_atomic_t ref ; /**< Reference count for LWP */
181
+ void * args ; /**< Arguments passed to LWP */
182
+ uint32_t args_length ; /**< Length of arguments */
183
+ pid_t pid ; /**< Process ID */
184
+ pid_t sid ; /**< session ID */
185
+ pid_t pgid ; /**< process group ID */
181
186
struct rt_processgroup * pgrp ;
182
- rt_list_t pgrp_node ; /* process group node */
183
- rt_list_t t_grp ; /* thread group */
184
- rt_list_t timer ; /* POSIX timer object binding to a process */
187
+ rt_list_t pgrp_node ; /**< process group node */
188
+ rt_list_t t_grp ; /**< thread group */
189
+ rt_list_t timer ; /**< POSIX timer object binding to a process */
185
190
186
- struct dfs_fdtable fdt ; /* File descriptor table */
187
- char cmd [RT_NAME_MAX ]; /* process name */
188
- char * exe_file ; /* process file path */
191
+ struct dfs_fdtable fdt ; /**< File descriptor table */
192
+ char cmd [RT_NAME_MAX ]; /**< process name */
193
+ char * exe_file ; /**< process file path */
189
194
190
195
/* POSIX signal */
191
- struct lwp_signal signal ; /* Signal handling structure */
196
+ struct lwp_signal signal ; /**< Signal handling structure */
192
197
193
- struct lwp_avl_struct * object_root ; /* AVL tree root for objects */
194
- struct rt_mutex object_mutex ; /* Mutex for object operations synchronization */
195
- struct rt_user_context user_ctx ; /* User context for LWP */
198
+ struct lwp_avl_struct * object_root ; /**< AVL tree root for objects */
199
+ struct rt_mutex object_mutex ; /**< Mutex for object operations synchronization */
200
+ struct rt_user_context user_ctx ; /**< User context for LWP */
196
201
197
- struct rt_wqueue wait_queue ; /* wait queue for console */
198
- struct tty_struct * tty ; /* Controlling terminal, NULL if no tty */
202
+ struct rt_wqueue wait_queue ; /**< wait queue for console */
203
+ struct tty_struct * tty ; /**< Controlling terminal, NULL if no tty */
199
204
200
- struct lwp_avl_struct * address_search_head ; /* for addressed object fast search */
201
- char working_directory [DFS_PATH_MAX ]; /* Current working directory */
205
+ struct lwp_avl_struct * address_search_head ; /**< for addressed object fast search */
206
+ char working_directory [DFS_PATH_MAX ]; /**< Current working directory */
202
207
203
- int debug ; /* Debug flag */
204
- rt_uint32_t bak_first_inst ; /* backup of first instruction */
208
+ int debug ; /**< Debug flag */
209
+ rt_uint32_t bak_first_inst ; /**< backup of first instruction */
205
210
206
- struct rt_mutex lwp_lock ; /* Mutex for LWP operations synchronization */
211
+ struct rt_mutex lwp_lock ; /**< Mutex for LWP operations synchronization */
207
212
208
- rt_slist_t signalfd_notify_head ; /* Signal file descriptor notification head */
213
+ rt_slist_t signalfd_notify_head ; /**< Signal file descriptor notification head */
209
214
210
215
#ifdef LWP_ENABLE_ASID
211
- uint64_t generation ; /* ASID generation */
212
- unsigned int asid ; /* Address space ID */
216
+ uint64_t generation ; /**< ASID generation */
217
+ unsigned int asid ; /**< Address space ID */
213
218
#endif
214
- struct rusage rt_rusage ; /* Resource usage information */
219
+ struct rusage rt_rusage ; /**< Resource usage information */
215
220
216
221
#ifdef RT_USING_VDSO
217
- void * vdso_vbase ; /* VDSO base address */
222
+ void * vdso_vbase ; /**< VDSO base address */
218
223
#endif
219
224
};
220
225
@@ -223,11 +228,14 @@ struct rt_lwp *lwp_self(void);
223
228
rt_err_t lwp_children_register (struct rt_lwp * parent , struct rt_lwp * child );
224
229
rt_err_t lwp_children_unregister (struct rt_lwp * parent , struct rt_lwp * child );
225
230
231
+ /**
232
+ * @brief LWP exit request type
233
+ */
226
234
enum lwp_exit_request_type
227
235
{
228
- LWP_EXIT_REQUEST_NONE = 0 ,
229
- LWP_EXIT_REQUEST_TRIGGERED ,
230
- LWP_EXIT_REQUEST_IN_PROCESS ,
236
+ LWP_EXIT_REQUEST_NONE = 0 , /**< No exit request */
237
+ LWP_EXIT_REQUEST_TRIGGERED , /**< Exit request triggered */
238
+ LWP_EXIT_REQUEST_IN_PROCESS , /**< Exit request in process */
231
239
};
232
240
struct termios * get_old_termios (void );
233
241
void lwp_setcwd (char * buf );
@@ -397,36 +405,36 @@ sysret_t lwp_teardown(struct rt_lwp *lwp, void (*cb)(void));
397
405
#define AT_SYSINFO_EHDR 33
398
406
399
407
/**
400
- * Process auxiliary vector item
408
+ * @brief Process auxiliary vector item
401
409
*/
402
410
struct process_aux_item
403
411
{
404
- size_t key ;
405
- size_t value ;
412
+ size_t key ; /**< Auxiliary vector key */
413
+ size_t value ; /**< Auxiliary vector value */
406
414
};
407
415
408
416
/**
409
- * Process auxiliary vector
417
+ * @brief Process auxiliary vector
410
418
*/
411
419
struct process_aux
412
420
{
413
- struct process_aux_item item [AUX_ARRAY_ITEMS_NR ];
421
+ struct process_aux_item item [AUX_ARRAY_ITEMS_NR ]; /**< Auxiliary vector items */
414
422
};
415
423
416
424
/**
417
- * Debug operations structure
425
+ * @brief Debug operations structure
418
426
*/
419
427
struct dbg_ops_t
420
428
{
421
- int (* dbg )(int argc , char * * argv ); /* Debug function */
422
- uint32_t (* arch_get_ins )(void ); /* Architecture-specific instruction getter */
423
- void (* arch_activate_step )(void ); /* Architecture-specific step activation */
424
- void (* arch_deactivate_step )(void ); /* Architecture-specific step deactivation */
425
- int (* check_debug_event )(struct rt_hw_exp_stack * regs , unsigned long esr ); /* Debug event checker */
426
- rt_channel_t (* gdb_get_server_channel )(void ); /* GDB server channel getter */
427
- int (* gdb_get_step_type )(void ); /* GDB step type getter */
428
- void (* lwp_check_debug_attach_req )(void * pc ); /* LWP debug attach request checker */
429
- int (* lwp_check_debug_suspend )(void ); /* LWP debug suspend checker */
429
+ int (* dbg )(int argc , char * * argv ); /**< Debug function */
430
+ uint32_t (* arch_get_ins )(void ); /**< Architecture-specific instruction getter */
431
+ void (* arch_activate_step )(void ); /**< Architecture-specific step activation */
432
+ void (* arch_deactivate_step )(void ); /**< Architecture-specific step deactivation */
433
+ int (* check_debug_event )(struct rt_hw_exp_stack * regs , unsigned long esr ); /**< Debug event checker */
434
+ rt_channel_t (* gdb_get_server_channel )(void ); /**< GDB server channel getter */
435
+ int (* gdb_get_step_type )(void ); /**< GDB step type getter */
436
+ void (* lwp_check_debug_attach_req )(void * pc ); /**< LWP debug attach request checker */
437
+ int (* lwp_check_debug_suspend )(void ); /**< LWP debug suspend checker */
430
438
};
431
439
extern struct dbg_ops_t * rt_dbg_ops ;
432
440
0 commit comments