Use rtems_task_exit()

This commit is contained in:
Sebastian Huber 2022-06-01 10:31:22 +02:00
parent 61f646d9b9
commit ed25b390fc
19 changed files with 26 additions and 45 deletions

View File

@ -1155,7 +1155,7 @@ dhcpcd_task(rtems_task_argument arg)
(*config->destroy)(config, exit_code); (*config->destroy)(config, exit_code);
} }
rtems_task_delete(RTEMS_SELF); rtems_task_exit();
} }
rtems_status_code rtems_status_code

View File

@ -3114,7 +3114,7 @@ rtems_filesystem_location_info_t old;
rtems_filesystem_current->location = old; rtems_filesystem_current->location = old;
} }
rtems_semaphore_release(rpa->sync); rtems_semaphore_release(rpa->sync);
rtems_task_delete(RTEMS_SELF); rtems_task_exit();
} }

View File

@ -71,7 +71,7 @@ static rtems_task pppTask(rtems_task_argument arg)
/* terminate myself */ /* terminate myself */
rtems_pppd_taskid = 0; rtems_pppd_taskid = 0;
rtems_task_delete(RTEMS_SELF); rtems_task_exit();
} }
int rtems_pppd_initialize(void) int rtems_pppd_initialize(void)

View File

@ -75,7 +75,7 @@ racoon_task(rtems_task_argument arg)
} }
clean_up_args(args); clean_up_args(args);
rtems_task_delete(RTEMS_SELF); rtems_task_exit();
} }
rtems_status_code rtems_status_code

View File

@ -763,7 +763,7 @@ rc_conf_worker(rtems_task_argument task_argument)
if (rc_conf->verbose) if (rc_conf->verbose)
printf("rc.conf: finished\n"); printf("rc.conf: finished\n");
rtems_task_delete(RTEMS_SELF); rtems_task_exit();
} }
int int

View File

@ -53,7 +53,7 @@ new_wpa_supplicant_task(rtems_task_argument arg)
free(params->argv); free(params->argv);
free(params); free(params);
rtems_task_delete( RTEMS_SELF ); rtems_task_exit();
} }
int rtems_bsd_command_wpa_supplicant_fork(int argc, char **argv) int rtems_bsd_command_wpa_supplicant_fork(int argc, char **argv)

View File

@ -288,13 +288,6 @@ rtems_bsd_thread_start(struct thread **td_ptr, void (*func)(void *), void *arg,
return eno; return eno;
} }
static __dead2 void
rtems_bsd_thread_delete(void)
{
rtems_task_delete(RTEMS_SELF);
BSD_PANIC("delete self failed");
}
void void
kproc_start(const void *udata) kproc_start(const void *udata)
{ {
@ -320,7 +313,7 @@ kproc_create(void (*func)(void *), void *arg, struct proc **newpp, int flags, in
void void
kproc_exit(int ecode) kproc_exit(int ecode)
{ {
rtems_bsd_thread_delete(); rtems_task_exit();
} }
void void
@ -350,7 +343,7 @@ kthread_add(void (*func)(void *), void *arg, struct proc *p, struct thread **new
void void
kthread_exit(void) kthread_exit(void)
{ {
rtems_bsd_thread_delete(); rtems_task_exit();
} }
int int

View File

@ -341,7 +341,7 @@ evdev_scan_task(rtems_task_argument arg)
} }
} }
otask_active = false; otask_active = false;
rtems_task_delete(RTEMS_SELF); rtems_task_exit();
} }
static void static void
@ -401,7 +401,7 @@ err:
} }
} }
ktask_active = false; ktask_active = false;
rtems_task_delete(RTEMS_SELF); rtems_task_exit();
} }
static void static void
@ -484,7 +484,7 @@ err:
} }
} }
mtask_active = false; mtask_active = false;
rtems_task_delete(RTEMS_SELF); rtems_task_exit();
} }
static void static void
@ -561,7 +561,7 @@ err:
} }
} }
ttask_active = false; ttask_active = false;
rtems_task_delete(RTEMS_SELF); rtems_task_exit();
} }
static void static void

View File

@ -272,8 +272,7 @@ test_main(void)
foobar_register(&question); foobar_register(&question);
rtems_task_delete(RTEMS_SELF); rtems_task_exit();
assert(0);
} }
#define DEFAULT_NETWORK_DHCPCD_ENABLE #define DEFAULT_NETWORK_DHCPCD_ENABLE

View File

@ -79,8 +79,7 @@ test_main(void)
rv = rtems_initialize_ftpd(); rv = rtems_initialize_ftpd();
assert(rv == 0); assert(rv == 0);
rtems_task_delete(RTEMS_SELF); rtems_task_exit();
assert(0);
} }
#define DEFAULT_NETWORK_DHCPCD_ENABLE #define DEFAULT_NETWORK_DHCPCD_ENABLE

View File

@ -133,7 +133,7 @@ static rtems_task workerTask(rtems_task_argument arg)
if (close(s) < 0) if (close(s) < 0)
printf("Can't close worker task socket: %s\n", strerror(errno)); printf("Can't close worker task socket: %s\n", strerror(errno));
printf("Worker task terminating.\n"); printf("Worker task terminating.\n");
rtems_task_delete(RTEMS_SELF); rtems_task_exit();
} }
/* /*
@ -230,7 +230,7 @@ static rtems_task clientTask(rtems_task_argument arg)
clientWorker(arg); clientWorker(arg);
sendClientEventToMasterTask(arg); sendClientEventToMasterTask(arg);
printf("Client task terminating.\n"); printf("Client task terminating.\n");
rtems_task_delete( RTEMS_SELF ); rtems_task_exit();
} }
/* /*

View File

@ -397,8 +397,7 @@ test_main(void)
test_nfs(mount_point); test_nfs(mount_point);
rtems_task_delete(RTEMS_SELF); rtems_task_exit();
assert(0);
} }
#define CONFIGURE_SHELL_COMMANDS_ALL #define CONFIGURE_SHELL_COMMANDS_ALL

View File

@ -272,8 +272,7 @@ test_main(void)
rv = rtems_pppd_connect(); rv = rtems_pppd_connect();
assert(rv == 0); assert(rv == 0);
rtems_task_delete(RTEMS_SELF); rtems_task_exit();
assert(0);
} }
RTEMS_BSD_DEFINE_NEXUS_DEVICE(ppp, 0, 0, NULL); RTEMS_BSD_DEFINE_NEXUS_DEVICE(ppp, 0, 0, NULL);

View File

@ -75,8 +75,7 @@ test_main(void)
rtems_status_code sc = rtems_telnetd_initialize(); rtems_status_code sc = rtems_telnetd_initialize();
assert(sc == RTEMS_SUCCESSFUL); assert(sc == RTEMS_SUCCESSFUL);
rtems_task_delete(RTEMS_SELF); rtems_task_exit();
assert(0);
} }
#define DEFAULT_NETWORK_SHELL #define DEFAULT_NETWORK_SHELL

View File

@ -109,13 +109,10 @@ wait_for_worker_thread(void)
static void static void
non_bsd_thread(rtems_task_argument arg) non_bsd_thread(rtems_task_argument arg)
{ {
rtems_status_code sc;
test_curthread(""); test_curthread("");
wake_up_main_thread(); wake_up_main_thread();
rtems_task_exit();
sc = rtems_task_delete(RTEMS_SELF);
assert(sc == RTEMS_SUCCESSFUL);
} }
static void static void

View File

@ -32,8 +32,6 @@
* SUCH DAMAGE. * SUCH DAMAGE.
*/ */
#include <assert.h>
#include <rtems.h> #include <rtems.h>
#include <rtems/shell.h> #include <rtems/shell.h>
#include <rtems/console.h> #include <rtems/console.h>
@ -44,8 +42,7 @@
static void static void
test_main(void) test_main(void)
{ {
rtems_task_delete(RTEMS_SELF); rtems_task_exit();
assert(0);
} }
#define SHELL_TTCP_COMMAND_ENABLE #define SHELL_TTCP_COMMAND_ENABLE

View File

@ -101,7 +101,7 @@ usb_keyboard_read_task(rtems_task_argument arg)
rtems_message_queue_send(omid, &msg, sizeof(msg)); rtems_message_queue_send(omid, &msg, sizeof(msg));
} }
rtask_active = false; rtask_active = false;
rtems_task_delete(RTEMS_SELF); rtems_task_exit();
} }
static void static void
@ -141,7 +141,7 @@ usb_keyboard_open_task(rtems_task_argument arg)
printf("keyboard device closed\n"); printf("keyboard device closed\n");
} }
otask_active = false; otask_active = false;
rtems_task_delete(RTEMS_SELF); rtems_task_exit();
} }
static void static void

View File

@ -103,7 +103,7 @@ usb_mouse_read_task(rtems_task_argument arg)
} }
rtask_active = false; rtask_active = false;
rtems_task_delete(RTEMS_SELF); rtems_task_exit();
} }
static void static void
@ -143,7 +143,7 @@ usb_mouse_open_task(rtems_task_argument arg)
printf("mouse device closed\n"); printf("mouse device closed\n");
} }
otask_active = false; otask_active = false;
rtems_task_delete(RTEMS_SELF); rtems_task_exit();
} }
static void static void

View File

@ -240,8 +240,7 @@ test_main(void)
sc = rtems_task_start(id, network_flood_task, (rtems_task_argument) bc); sc = rtems_task_start(id, network_flood_task, (rtems_task_argument) bc);
assert(sc == RTEMS_SUCCESSFUL); assert(sc == RTEMS_SUCCESSFUL);
rtems_task_delete(RTEMS_SELF); rtems_task_exit();
assert(0);
} }
#define DEFAULT_NETWORK_DHCPCD_ENABLE #define DEFAULT_NETWORK_DHCPCD_ENABLE