[PATCH] Use rtems_task_exit()
Sebastian Huber
sebastian.huber at embedded-brains.de
Tue Oct 2 08:22:58 UTC 2018
Update #3530.
Update #3533.
---
bsps/powerpc/mpc55xxevb/net/smsc9218i.c | 2 +-
bsps/powerpc/mvme5500/net/if_100MHz/GT64260eth.c | 2 +-
bsps/powerpc/mvme5500/net/if_1GHz/if_wm.c | 2 +-
bsps/powerpc/shared/net/tsec.c | 4 ++--
bsps/shared/dev/ide/ata.c | 2 +-
bsps/sparc/shared/spw/grspw_pkt.c | 2 +-
cpukit/ftpd/ftpd.c | 2 +-
cpukit/include/rtems/rtems/event.h | 3 +--
cpukit/include/rtems/status-checks.h | 4 ++--
cpukit/libblock/src/bdbuf.c | 6 +++---
cpukit/libcsupport/src/termios.c | 4 ++--
cpukit/libdebugger/rtems-debugger-server.c | 4 ++--
cpukit/libfs/src/nfsclient/src/nfs.c | 2 +-
cpukit/libmisc/cpuuse/cpuusagetop.c | 2 +-
cpukit/libmisc/monitor/mon-server.c | 2 +-
cpukit/libmisc/redirector/stdio-redirect.c | 2 +-
cpukit/libmisc/shell/shell.c | 2 +-
cpukit/libnetworking/rtems/rtems_dhcp.c | 2 +-
cpukit/libnetworking/rtems/rtems_dhcp_failsafe.c | 2 +-
cpukit/librpc/src/rpc/rtems_portmapper.c | 14 +++++++-------
cpukit/pppd/rtemspppd.c | 2 +-
cpukit/score/cpu/i386/sse_test.c | 2 +-
cpukit/telnetd/telnetd.c | 8 ++++----
23 files changed, 38 insertions(+), 39 deletions(-)
diff --git a/bsps/powerpc/mpc55xxevb/net/smsc9218i.c b/bsps/powerpc/mpc55xxevb/net/smsc9218i.c
index 30156a0d4f..1914c24022 100644
--- a/bsps/powerpc/mpc55xxevb/net/smsc9218i.c
+++ b/bsps/powerpc/mpc55xxevb/net/smsc9218i.c
@@ -1500,7 +1500,7 @@ static void smsc9218i_transmit_task(void *arg)
rtems_bsdnet_semaphore_release();
/* Terminate self */
- (void) rtems_task_delete(RTEMS_SELF);
+ rtems_task_exit();
}
#if defined(DEBUG)
diff --git a/bsps/powerpc/mvme5500/net/if_100MHz/GT64260eth.c b/bsps/powerpc/mvme5500/net/if_100MHz/GT64260eth.c
index ea29d766b3..91f90cc4f3 100644
--- a/bsps/powerpc/mvme5500/net/if_100MHz/GT64260eth.c
+++ b/bsps/powerpc/mvme5500/net/if_100MHz/GT64260eth.c
@@ -1569,6 +1569,6 @@ static void GT64260eth_daemon(void *arg)
* theoretically, that variable could already
* hold a newly created TID
*/
- rtems_task_delete(RTEMS_SELF);
+ rtems_task_exit();
}
diff --git a/bsps/powerpc/mvme5500/net/if_1GHz/if_wm.c b/bsps/powerpc/mvme5500/net/if_1GHz/if_wm.c
index 11705ac04b..74873475b8 100644
--- a/bsps/powerpc/mvme5500/net/if_1GHz/if_wm.c
+++ b/bsps/powerpc/mvme5500/net/if_1GHz/if_wm.c
@@ -1694,7 +1694,7 @@ static void i82544EI_daemon(void *arg)
* theoretically, that variable could already
* hold a newly created TID
*/
- rtems_task_delete(RTEMS_SELF);
+ rtems_task_exit();
}
/*
diff --git a/bsps/powerpc/shared/net/tsec.c b/bsps/powerpc/shared/net/tsec.c
index 3dc77b0c8e..c51d47c619 100644
--- a/bsps/powerpc/shared/net/tsec.c
+++ b/bsps/powerpc/shared/net/tsec.c
@@ -776,7 +776,7 @@ static void tsec_rxDaemon
* terminate daemon
*/
sc->rxDaemonTid = 0;
- rtems_task_delete(RTEMS_SELF);
+ rtems_task_exit();
}
/***************************************************************************\
@@ -1126,7 +1126,7 @@ static void tsec_txDaemon
* terminate daemon
*/
sc->txDaemonTid = 0;
- rtems_task_delete(RTEMS_SELF);
+ rtems_task_exit();
}
/***************************************************************************\
diff --git a/bsps/shared/dev/ide/ata.c b/bsps/shared/dev/ide/ata.c
index fe2865fc90..8dc8d78478 100644
--- a/bsps/shared/dev/ide/ata.c
+++ b/bsps/shared/dev/ide/ata.c
@@ -908,7 +908,7 @@ ata_queue_task(rtems_task_argument arg)
default:
#if ATA_DEBUG
ata_printf("ata_queue_task: internal error\n");
- rtems_task_delete (RTEMS_SELF);
+ rtems_task_exit();
#endif
rtems_fatal_error_occurred(RTEMS_INTERNAL_ERROR);
break;
diff --git a/bsps/sparc/shared/spw/grspw_pkt.c b/bsps/sparc/shared/spw/grspw_pkt.c
index f28e4be634..c109a25a6b 100644
--- a/bsps/sparc/shared/spw/grspw_pkt.c
+++ b/bsps/sparc/shared/spw/grspw_pkt.c
@@ -2745,7 +2745,7 @@ void grspw_work_func(rtems_id msgQ)
rtems_message_queue_delete(msgQ);
grspw_work_event(WORKTASK_EV_QUIT, message);
- rtems_task_delete(RTEMS_SELF);
+ rtems_task_exit();
}
STATIC void grspw_isr(void *data)
diff --git a/cpukit/ftpd/ftpd.c b/cpukit/ftpd/ftpd.c
index 3526024063..0d713c03e8 100644
--- a/cpukit/ftpd/ftpd.c
+++ b/cpukit/ftpd/ftpd.c
@@ -2056,7 +2056,7 @@ ftpd_daemon(rtems_task_argument args RTEMS_UNUSED)
}
}
}
- rtems_task_delete(RTEMS_SELF);
+ rtems_task_exit();
}
diff --git a/cpukit/include/rtems/rtems/event.h b/cpukit/include/rtems/rtems/event.h
index 1cd64c0cfa..0307fa4c8c 100644
--- a/cpukit/include/rtems/rtems/event.h
+++ b/cpukit/include/rtems/rtems/event.h
@@ -428,8 +428,7 @@ rtems_status_code rtems_event_system_receive(
* sc = rtems_event_transient_send(req->task_id);
* assert(sc == RTEMS_SUCCESSFUL);
*
- * sc = rtems_task_delete(RTEMS_SELF);
- * assert(sc == RTEMS_SUCCESSFUL);
+ * rtems_task_exit();
* }
*
* void issue_request_and_wait_for_completion(void)
diff --git a/cpukit/include/rtems/status-checks.h b/cpukit/include/rtems/status-checks.h
index 54b045c6a0..94f30209c1 100644
--- a/cpukit/include/rtems/status-checks.h
+++ b/cpukit/include/rtems/status-checks.h
@@ -188,7 +188,7 @@ extern "C" {
#define RTEMS_CHECK_SC_TASK( sc, msg) \
if ((rtems_status_code) (sc) != RTEMS_SUCCESSFUL) { \
RTEMS_SYSLOG_ERROR_WITH_SC( sc, msg); \
- (void) rtems_task_delete( RTEMS_SELF); \
+ rtems_task_exit(); \
return; \
} else { \
RTEMS_DEBUG_OK( msg); \
@@ -237,7 +237,7 @@ extern "C" {
#define RTEMS_CHECK_RV_TASK( rv, msg) \
if ((int) (rv) < 0) { \
RTEMS_SYSLOG_ERROR_WITH_RV( rv, msg); \
- (void) rtems_task_delete( RTEMS_SELF); \
+ rtems_task_exit(); \
return; \
} else { \
RTEMS_DEBUG_OK( msg); \
diff --git a/cpukit/libblock/src/bdbuf.c b/cpukit/libblock/src/bdbuf.c
index e2cdb900ca..1f34618274 100644
--- a/cpukit/libblock/src/bdbuf.c
+++ b/cpukit/libblock/src/bdbuf.c
@@ -2643,7 +2643,7 @@ rtems_bdbuf_swapout_worker_task (rtems_task_argument arg)
free (worker);
- rtems_task_delete (RTEMS_SELF);
+ rtems_task_exit();
}
/**
@@ -2746,7 +2746,7 @@ rtems_bdbuf_swapout_task (rtems_task_argument arg)
free (transfer);
- rtems_task_delete (RTEMS_SELF);
+ rtems_task_exit();
}
static void
@@ -2979,7 +2979,7 @@ rtems_bdbuf_read_ahead_task (rtems_task_argument arg)
rtems_bdbuf_unlock_cache ();
}
- rtems_task_delete (RTEMS_SELF);
+ rtems_task_exit();
}
void rtems_bdbuf_get_device_stats (const rtems_disk_device *dd,
diff --git a/cpukit/libcsupport/src/termios.c b/cpukit/libcsupport/src/termios.c
index 2492efbaba..7cf8ca6814 100644
--- a/cpukit/libcsupport/src/termios.c
+++ b/cpukit/libcsupport/src/termios.c
@@ -1926,7 +1926,7 @@ static rtems_task rtems_termios_txdaemon(rtems_task_argument argument)
);
if ((the_event & TERMIOS_TX_TERMINATE_EVENT) != 0) {
tty->txTaskId = 0;
- rtems_task_delete(RTEMS_SELF);
+ rtems_task_exit();
}
/*
@@ -1974,7 +1974,7 @@ static rtems_task rtems_termios_rxdaemon(rtems_task_argument argument)
);
if ((the_event & TERMIOS_RX_TERMINATE_EVENT) != 0) {
tty->rxTaskId = 0;
- rtems_task_delete(RTEMS_SELF);
+ rtems_task_exit();
}
/*
diff --git a/cpukit/libdebugger/rtems-debugger-server.c b/cpukit/libdebugger/rtems-debugger-server.c
index 6e70d08ebf..411994d8bc 100644
--- a/cpukit/libdebugger/rtems-debugger-server.c
+++ b/cpukit/libdebugger/rtems-debugger-server.c
@@ -1691,7 +1691,7 @@ rtems_debugger_events(rtems_task_argument arg)
if (rtems_debugger_verbose())
rtems_debugger_printf("rtems-db: events finishing\n");
- rtems_task_delete(RTEMS_SELF);
+ rtems_task_exit();
}
static int
@@ -1913,7 +1913,7 @@ rtems_debugger_main(rtems_task_argument arg)
rtems_debugger->server_finished = true;
rtems_debugger_unlock();
- rtems_task_delete(RTEMS_SELF);
+ rtems_task_exit();
}
int
diff --git a/cpukit/libfs/src/nfsclient/src/nfs.c b/cpukit/libfs/src/nfsclient/src/nfs.c
index 6790c6bf77..ddb4dda313 100644
--- a/cpukit/libfs/src/nfsclient/src/nfs.c
+++ b/cpukit/libfs/src/nfsclient/src/nfs.c
@@ -3105,7 +3105,7 @@ rtems_filesystem_location_info_t old;
rtems_filesystem_current->location = old;
}
rtems_binary_semaphore_post(&rpa->sync);
- rtems_task_delete(RTEMS_SELF);
+ rtems_task_exit();
}
diff --git a/cpukit/libmisc/cpuuse/cpuusagetop.c b/cpukit/libmisc/cpuuse/cpuusagetop.c
index c37fae0c56..ee5d79051f 100644
--- a/cpukit/libmisc/cpuuse/cpuusagetop.c
+++ b/cpukit/libmisc/cpuuse/cpuusagetop.c
@@ -495,7 +495,7 @@ rtems_cpuusage_top_thread (rtems_task_argument arg)
data->thread_active = false;
- rtems_task_delete (RTEMS_SELF);
+ rtems_task_exit();
}
void rtems_cpu_usage_top_with_plugin(
diff --git a/cpukit/libmisc/monitor/mon-server.c b/cpukit/libmisc/monitor/mon-server.c
index 9949f66d63..3cb6cdf7ce 100644
--- a/cpukit/libmisc/monitor/mon-server.c
+++ b/cpukit/libmisc/monitor/mon-server.c
@@ -182,7 +182,7 @@ rtems_monitor_server_task(
}
failed:
- rtems_task_delete(RTEMS_SELF);
+ rtems_task_exit();
}
diff --git a/cpukit/libmisc/redirector/stdio-redirect.c b/cpukit/libmisc/redirector/stdio-redirect.c
index a756d5b3cb..7f3e9138a7 100644
--- a/cpukit/libmisc/redirector/stdio-redirect.c
+++ b/cpukit/libmisc/redirector/stdio-redirect.c
@@ -97,7 +97,7 @@ rtems_stdio_redirect_reader(rtems_task_argument arg)
sr->state |= RTEMS_STDIO_REDIRECT_FINISHED;
- rtems_task_delete(RTEMS_SELF);
+ rtems_task_exit();
}
rtems_stdio_redirect*
diff --git a/cpukit/libmisc/shell/shell.c b/cpukit/libmisc/shell/shell.c
index b6aae781c5..d1fc9c65df 100644
--- a/cpukit/libmisc/shell/shell.c
+++ b/cpukit/libmisc/shell/shell.c
@@ -680,7 +680,7 @@ static rtems_task rtems_shell_task(rtems_task_argument task_argument)
rtems_shell_main_loop( shell_env );
if (wake_on_end != RTEMS_INVALID_ID)
rtems_event_send (wake_on_end, RTEMS_EVENT_1);
- rtems_task_delete( RTEMS_SELF );
+ rtems_task_exit();
}
static bool rtems_shell_init_user_env(void)
diff --git a/cpukit/libnetworking/rtems/rtems_dhcp.c b/cpukit/libnetworking/rtems/rtems_dhcp.c
index ca89b19fd5..6d7a1cb892 100644
--- a/cpukit/libnetworking/rtems/rtems_dhcp.c
+++ b/cpukit/libnetworking/rtems/rtems_dhcp.c
@@ -796,7 +796,7 @@ dhcp_task (rtems_task_argument _sdl)
dhcp_task_id = 0;
printf ("dhcpc: exiting lease renewal task.\n");
- rtems_task_delete( RTEMS_SELF);
+ rtems_task_exit();
}
diff --git a/cpukit/libnetworking/rtems/rtems_dhcp_failsafe.c b/cpukit/libnetworking/rtems/rtems_dhcp_failsafe.c
index 10ac661aee..65c107d19b 100644
--- a/cpukit/libnetworking/rtems/rtems_dhcp_failsafe.c
+++ b/cpukit/libnetworking/rtems/rtems_dhcp_failsafe.c
@@ -326,7 +326,7 @@ static void dhcp_monitor_task (rtems_task_argument ifp_arg)
error_out:
printf("Stopping dhcp monitoring application.\n");
- rtems_task_delete(RTEMS_SELF);
+ rtems_task_exit();
}
/*
diff --git a/cpukit/librpc/src/rpc/rtems_portmapper.c b/cpukit/librpc/src/rpc/rtems_portmapper.c
index 9d327b5ded..11724c1508 100644
--- a/cpukit/librpc/src/rpc/rtems_portmapper.c
+++ b/cpukit/librpc/src/rpc/rtems_portmapper.c
@@ -63,7 +63,7 @@ static rtems_task rtems_portmapper (rtems_task_argument unused)
rtems_rpc_task_init ();
if ((sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0) {
perror("portmap cannot create socket");
- rtems_task_delete (RTEMS_SELF);
+ rtems_task_exit();
}
addr.sin_addr.s_addr = 0;
@@ -72,13 +72,13 @@ static rtems_task rtems_portmapper (rtems_task_argument unused)
if (bind(sock, (struct sockaddr *)&addr, len) != 0) {
perror("portmap cannot bind");
close (sock);
- rtems_task_delete (RTEMS_SELF);
+ rtems_task_exit();
}
if ((xprt = svcudp_create(sock)) == (SVCXPRT *)NULL) {
fprintf(stderr, "couldn't do udp_create\n");
close (sock);
- rtems_task_delete (RTEMS_SELF);
+ rtems_task_exit();
}
/* make an entry for ourself */
pml = (struct pmaplist *)malloc(sizeof(struct pmaplist));
@@ -92,18 +92,18 @@ static rtems_task rtems_portmapper (rtems_task_argument unused)
if ((sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0) {
perror("portmap cannot create socket");
close (sock);
- rtems_task_delete (RTEMS_SELF);
+ rtems_task_exit();
}
if (bind(sock, (struct sockaddr *)&addr, len) != 0) {
perror("portmap cannot bind");
close (sock);
- rtems_task_delete (RTEMS_SELF);
+ rtems_task_exit();
}
if ((xprt = svctcp_create(sock, RPCSMALLMSGSIZE, RPCSMALLMSGSIZE))
== (SVCXPRT *)NULL) {
fprintf(stderr, "couldn't do tcp_create\n");
close (sock);
- rtems_task_delete (RTEMS_SELF);
+ rtems_task_exit();
}
/* make an entry for ourself */
pml = (struct pmaplist *)malloc(sizeof(struct pmaplist));
@@ -119,7 +119,7 @@ static rtems_task rtems_portmapper (rtems_task_argument unused)
svc_run();
fprintf(stderr, "run_svc returned unexpectedly\n");
close (sock);
- rtems_task_delete (RTEMS_SELF);
+ rtems_task_exit();
}
static struct pmaplist *
diff --git a/cpukit/pppd/rtemspppd.c b/cpukit/pppd/rtemspppd.c
index 3d11638fdf..e6b1b18639 100644
--- a/cpukit/pppd/rtemspppd.c
+++ b/cpukit/pppd/rtemspppd.c
@@ -72,7 +72,7 @@ static rtems_task pppTask(rtems_task_argument arg)
/* terminate myself */
rtems_pppd_taskid = 0;
- rtems_task_delete(RTEMS_SELF);
+ rtems_task_exit();
}
int rtems_pppd_initialize(void)
diff --git a/cpukit/score/cpu/i386/sse_test.c b/cpukit/score/cpu/i386/sse_test.c
index 416a07f01a..dc87371c1f 100644
--- a/cpukit/score/cpu/i386/sse_test.c
+++ b/cpukit/score/cpu/i386/sse_test.c
@@ -766,7 +766,7 @@ bail:
rtems_task_delete( hp_task );
if ( ! (flags & SSE_TEST_NO_DEL) )
- rtems_task_delete( RTEMS_SELF );
+ rtems_task_exit();
}
static void
diff --git a/cpukit/telnetd/telnetd.c b/cpukit/telnetd/telnetd.c
index f68b08ab3c..81c03b164b 100644
--- a/cpukit/telnetd/telnetd.c
+++ b/cpukit/telnetd/telnetd.c
@@ -211,7 +211,7 @@ rtems_task_telnetd(void *task_argument)
if ((des_socket=socket(PF_INET,SOCK_STREAM,0))<0) {
perror("telnetd:socket");
- rtems_task_delete(RTEMS_SELF);
+ rtems_task_exit();
};
setsockopt(des_socket,SOL_SOCKET,SO_KEEPALIVE,&i,sizeof(i));
@@ -222,12 +222,12 @@ rtems_task_telnetd(void *task_argument)
if ((bind(des_socket,&srv.sa,size_adr))<0) {
perror("telnetd:bind");
close(des_socket);
- rtems_task_delete(RTEMS_SELF);
+ rtems_task_exit();
};
if ((listen(des_socket,5))<0) {
perror("telnetd:listen");
close(des_socket);
- rtems_task_delete(RTEMS_SELF);
+ rtems_task_exit();
};
/* we don't redirect stdio as this probably
@@ -457,7 +457,7 @@ wrap_delete(rtems_task_argument arg)
*/
free(pwa);
t(a);
- rtems_task_delete(RTEMS_SELF);
+ rtems_task_exit();
}
rtems_id
--
2.16.4
More information about the devel
mailing list