Skip to content

Commit a35364d

Browse files
aescolarAnas Nashif
authored andcommitted
native: minor consistency rename
rename main_clean_up() to posix_exit() for consistency with all other global functions of this architecture Signed-off-by: Alberto Escolar Piedras <[email protected]>
1 parent a5bde70 commit a35364d

File tree

6 files changed

+12
-10
lines changed

6 files changed

+12
-10
lines changed

arch/posix/soc/inf_clock/posix_board_if.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ extern "C" {
2222
#endif
2323

2424
void posix_irq_handler(void);
25-
void main_clean_up(int exit_code);
25+
void posix_exit(int exit_code);
2626

2727
#if defined(CONFIG_ARCH_HAS_CUSTOM_BUSY_WAIT)
2828
void k_busy_wait(u32_t usec_to_wait);

arch/posix/soc/inf_clock/soc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ void posix_interrupt_raised(void)
124124
* we stop immediately.
125125
*/
126126
if (soc_terminate) {
127-
main_clean_up(0);
127+
posix_exit(0);
128128
}
129129
}
130130

@@ -225,7 +225,7 @@ void posix_boot_cpu(void)
225225
}
226226

227227
if (soc_terminate) {
228-
main_clean_up(0);
228+
posix_exit(0);
229229
}
230230
}
231231

boards/posix/native_posix/doc/board.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,16 @@ Therefore these limitations apply:
9292
9393
/* We expect the peripheral done and ready to do something else */
9494
95+
9596
- This port is not meant to, and could not possibly help debug races between
9697
HW and SW, or similar timing related issues.
9798

9899
- You may not use hard coded memory addresses because there is no I/O or
99100
MMU emulation.
100101

102+
101103
Working around these limitations
102-
==================================
104+
================================
103105

104106
If a busy wait loop exists, it will become evident as the application will be
105107
stalled in it. To find the loop, you can run the binary in a debugger and
@@ -162,8 +164,8 @@ Application tests using the ``ztest`` framework will exit after all
162164
tests have completed.
163165

164166
If you want your application to gracefully finish when it reaches some point,
165-
you may add a conditionally compiled (CONFIG_BOARD_NATIVE_POSIX) call to
166-
``main_clean_up(exit_code)`` at that point.
167+
you may add a conditionally compiled (:option:`CONFIG_ARCH_POSIX`) call to
168+
``posix_exit(int status)`` at that point.
167169

168170
Debugging
169171
=========

boards/posix/native_posix/hw_models_top.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ static void hwm_sleep_until_next_timer(void)
103103
posix_print_trace("\nStopped after %.3Lfs\n",
104104
((long double)device_time)/1.0e6);
105105

106-
main_clean_up(0);
106+
posix_exit(0);
107107
}
108108
}
109109

boards/posix/native_posix/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@
2828
#define STOP_AFTER_5_SECONDS 0
2929

3030

31-
void main_clean_up(int exit_code)
31+
void posix_exit(int exit_code)
3232
{
3333
static int max_exit_code;
3434

3535
max_exit_code = max(exit_code, max_exit_code);
3636
/*
3737
* posix_soc_clean_up may not return if this is called from a SW thread,
38-
* but instead it would get main_clean_up() recalled again
38+
* but instead it would get posix_exit() recalled again
3939
* ASAP from the HW thread
4040
*/
4141
posix_soc_clean_up();

boards/posix/native_posix/tracing.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ void posix_print_error_and_exit(const char *format, ...)
2222
va_start(variable_args, format);
2323
vfprintf(stderr, format, variable_args);
2424
va_end(variable_args);
25-
main_clean_up(1);
25+
posix_exit(1);
2626
}
2727

2828
void posix_print_warning(const char *format, ...)

0 commit comments

Comments
 (0)