@@ -64,22 +64,26 @@ extern "C" {
6464#define LWP_ARG_MAX 8
6565
6666/**
67- * Light-weight process memory objects structure
67+ * @brief Light-weight process memory objects structure
6868 */
6969struct rt_lwp_objs
7070{
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 */
7373};
7474
7575/**
76- * Light-weight process notification structure
76+ * @brief Light-weight process notification structure
7777 */
7878struct rt_lwp_notify
7979{
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_slist_t list_node ; /**< List node for notification */
8387};
8488
8589struct lwp_tty ;
@@ -99,122 +103,122 @@ typedef struct rt_session *rt_session_t;
99103typedef struct rt_processgroup * rt_processgroup_t ;
100104
101105/**
102- * Session control structure for process groups
106+ * @brief Session control structure for process groups
103107 */
104108struct rt_session {
105109 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 */
110+ rt_lwp_t leader ; /**< Session leader process */
111+ rt_list_t processgroup ; /**< List head of process groups in this session */
112+ pid_t sid ; /**< Session ID */
113+ pid_t foreground_pgid ; /**< Foreground process group ID */
114+ struct rt_mutex mutex ; /**< Mutex for session operations synchronization */
115+ struct lwp_tty * ctty ; /**< Control terminal */
112116};
113117
114118/**
115- * Process group control structure
119+ * @brief Process group control structure
116120 */
117121struct rt_processgroup {
118122 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 */
123+ rt_lwp_t leader ; /**< Process group leader process */
124+ rt_list_t process ; /**< List head of processes in this process group */
125+ rt_list_t pgrp_list_node ; /**< List node for process group */
126+ pid_t pgid ; /**< Process group ID */
127+ pid_t sid ; /**< Session ID */
128+ struct rt_session * session ; /**< Session pointer */
129+ struct rt_mutex mutex ; /**< Mutex for process group operations synchronization */
126130
127- rt_atomic_t ref ; /* Reference count for process group */
131+ rt_atomic_t ref ; /**< Reference count for process group */
128132
129133 /* flags on process group */
130- unsigned int is_orphaned :1 ; /* Whether the process group is orphaned */
134+ unsigned int is_orphaned :1 ; /**< Whether the process group is orphaned */
131135};
132136
133137/**
134- * Light-weight process structure
138+ * @brief Light-weight process structure
135139 */
136140struct rt_lwp
137141{
138142#ifdef ARCH_MM_MMU
139- size_t end_heap ; /* End address of heap */
140- rt_aspace_t aspace ; /* Address space associated with this LWP */
143+ size_t end_heap ; /**< End address of heap */
144+ rt_aspace_t aspace ; /**< Address space associated with this LWP */
141145#else
142146#ifdef ARCH_MM_MPU
143- struct rt_mpu_info mpu_info ; /* MPU information for this LWP */
147+ struct rt_mpu_info mpu_info ; /**< MPU information for this LWP */
144148#endif /* ARCH_MM_MPU */
145149#endif /* ARCH_MM_MMU */
146150
147151#ifdef RT_USING_SMP
148- int bind_cpu ; /* CPU ID to which the LWP is bound */
152+ int bind_cpu ; /**< CPU ID to which the LWP is bound */
149153#endif
150154
151- uint8_t lwp_type ; /* Type of LWP */
155+ uint8_t lwp_type ; /**< Type of LWP */
152156 uint8_t reserv [3 ];
153157
154158 /* 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 */
159+ unsigned int terminated :1 ; /**< Process termination flag */
160+ unsigned int background :1 ; /**< Background process flag */
161+ unsigned int term_ctrlterm :1 ; /**< have control terminal? */
162+ unsigned int did_exec :1 ; /**< Whether exec has been performed */
163+ unsigned int jobctl_stopped :1 ; /**< job control: current proc is stopped */
164+ unsigned int wait_reap_stp :1 ; /**< job control: has wait event for parent */
165+ unsigned int sig_protected :1 ; /**< signal: protected proc cannot be killed or stopped */
166+
167+ struct rt_lwp * parent ; /**< parent process */
168+ struct rt_lwp * first_child ; /**< first child process */
169+ struct rt_lwp * sibling ; /**< sibling(child) process */
170+
171+ struct rt_wqueue waitpid_waiters ; /**< Wait queue for waitpid system call */
172+ lwp_status_t lwp_status ; /**< Status of LWP */
173+
174+ void * text_entry ; /**< Entry point of text segment */
175+ uint32_t text_size ; /**< Size of text segment */
176+ void * data_entry ; /**< Entry point of data segment */
177+ uint32_t data_size ; /**< Size of data segment */
178+
179+ rt_atomic_t ref ; /**< Reference count for LWP */
180+ void * args ; /**< Arguments passed to LWP */
181+ uint32_t args_length ; /**< Length of arguments */
182+ pid_t pid ; /**< Process ID */
183+ pid_t sid ; /**< session ID */
184+ pid_t pgid ; /**< process group ID */
181185 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 */
186+ rt_list_t pgrp_node ; /**< process group node */
187+ rt_list_t t_grp ; /**< thread group */
188+ rt_list_t timer ; /**< POSIX timer object binding to a process */
185189
186- struct dfs_fdtable fdt ; /* File descriptor table */
187- char cmd [RT_NAME_MAX ]; /* process name */
188- char * exe_file ; /* process file path */
190+ struct dfs_fdtable fdt ; /**< File descriptor table */
191+ char cmd [RT_NAME_MAX ]; /**< process name */
192+ char * exe_file ; /**< process file path */
189193
190194 /* POSIX signal */
191- struct lwp_signal signal ; /* Signal handling structure */
195+ struct lwp_signal signal ; /**< Signal handling structure */
192196
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 */
197+ struct lwp_avl_struct * object_root ; /**< AVL tree root for objects */
198+ struct rt_mutex object_mutex ; /**< Mutex for object operations synchronization */
199+ struct rt_user_context user_ctx ; /**< User context for LWP */
196200
197- struct rt_wqueue wait_queue ; /* wait queue for console */
198- struct tty_struct * tty ; /* Controlling terminal, NULL if no tty */
201+ struct rt_wqueue wait_queue ; /**< wait queue for console */
202+ struct tty_struct * tty ; /**< Controlling terminal, NULL if no tty */
199203
200- struct lwp_avl_struct * address_search_head ; /* for addressed object fast search */
201- char working_directory [DFS_PATH_MAX ]; /* Current working directory */
204+ struct lwp_avl_struct * address_search_head ; /**< for addressed object fast search */
205+ char working_directory [DFS_PATH_MAX ]; /**< Current working directory */
202206
203- int debug ; /* Debug flag */
204- rt_uint32_t bak_first_inst ; /* backup of first instruction */
207+ int debug ; /**< Debug flag */
208+ rt_uint32_t bak_first_inst ; /**< backup of first instruction */
205209
206- struct rt_mutex lwp_lock ; /* Mutex for LWP operations synchronization */
210+ struct rt_mutex lwp_lock ; /**< Mutex for LWP operations synchronization */
207211
208- rt_slist_t signalfd_notify_head ; /* Signal file descriptor notification head */
212+ rt_slist_t signalfd_notify_head ; /**< Signal file descriptor notification head */
209213
210214#ifdef LWP_ENABLE_ASID
211- uint64_t generation ; /* ASID generation */
212- unsigned int asid ; /* Address space ID */
215+ uint64_t generation ; /**< ASID generation */
216+ unsigned int asid ; /**< Address space ID */
213217#endif
214- struct rusage rt_rusage ; /* Resource usage information */
218+ struct rusage rt_rusage ; /**< Resource usage information */
215219
216220#ifdef RT_USING_VDSO
217- void * vdso_vbase ; /* VDSO base address */
221+ void * vdso_vbase ; /**< VDSO base address */
218222#endif
219223};
220224
@@ -223,11 +227,14 @@ struct rt_lwp *lwp_self(void);
223227rt_err_t lwp_children_register (struct rt_lwp * parent , struct rt_lwp * child );
224228rt_err_t lwp_children_unregister (struct rt_lwp * parent , struct rt_lwp * child );
225229
230+ /**
231+ * @brief LWP exit request type
232+ */
226233enum lwp_exit_request_type
227234{
228- LWP_EXIT_REQUEST_NONE = 0 ,
229- LWP_EXIT_REQUEST_TRIGGERED ,
230- LWP_EXIT_REQUEST_IN_PROCESS ,
235+ LWP_EXIT_REQUEST_NONE = 0 , /**< No exit request */
236+ LWP_EXIT_REQUEST_TRIGGERED , /**< Exit request triggered */
237+ LWP_EXIT_REQUEST_IN_PROCESS , /**< Exit request in process */
231238};
232239struct termios * get_old_termios (void );
233240void lwp_setcwd (char * buf );
@@ -397,36 +404,36 @@ sysret_t lwp_teardown(struct rt_lwp *lwp, void (*cb)(void));
397404#define AT_SYSINFO_EHDR 33
398405
399406/**
400- * Process auxiliary vector item
407+ * @brief Process auxiliary vector item
401408 */
402409struct process_aux_item
403410{
404- size_t key ;
405- size_t value ;
411+ size_t key ; /**< Auxiliary vector key */
412+ size_t value ; /**< Auxiliary vector value */
406413};
407414
408415/**
409- * Process auxiliary vector
416+ * @brief Process auxiliary vector
410417 */
411418struct process_aux
412419{
413- struct process_aux_item item [AUX_ARRAY_ITEMS_NR ];
420+ struct process_aux_item item [AUX_ARRAY_ITEMS_NR ]; /**< Auxiliary vector items */
414421};
415422
416423/**
417- * Debug operations structure
424+ * @brief Debug operations structure
418425 */
419426struct dbg_ops_t
420427{
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 */
428+ int (* dbg )(int argc , char * * argv ); /**< Debug function */
429+ uint32_t (* arch_get_ins )(void ); /**< Architecture-specific instruction getter */
430+ void (* arch_activate_step )(void ); /**< Architecture-specific step activation */
431+ void (* arch_deactivate_step )(void ); /**< Architecture-specific step deactivation */
432+ int (* check_debug_event )(struct rt_hw_exp_stack * regs , unsigned long esr ); /**< Debug event checker */
433+ rt_channel_t (* gdb_get_server_channel )(void ); /**< GDB server channel getter */
434+ int (* gdb_get_step_type )(void ); /**< GDB step type getter */
435+ void (* lwp_check_debug_attach_req )(void * pc ); /**< LWP debug attach request checker */
436+ int (* lwp_check_debug_suspend )(void ); /**< LWP debug suspend checker */
430437};
431438extern struct dbg_ops_t * rt_dbg_ops ;
432439
0 commit comments