Commit a35364dd authored by Alberto Escolar Piedras's avatar Alberto Escolar Piedras Committed by Anas Nashif
Browse files

native: minor consistency rename



rename main_clean_up() to posix_exit() for consistency
with all other global functions of this architecture

Signed-off-by: default avatarAlberto Escolar Piedras <alpi@oticon.com>
parent a5bde70d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ extern "C" {
#endif

void posix_irq_handler(void);
void main_clean_up(int exit_code);
void posix_exit(int exit_code);

#if defined(CONFIG_ARCH_HAS_CUSTOM_BUSY_WAIT)
void k_busy_wait(u32_t usec_to_wait);
+2 −2
Original line number Diff line number Diff line
@@ -124,7 +124,7 @@ void posix_interrupt_raised(void)
	 * we stop immediately.
	 */
	if (soc_terminate) {
		main_clean_up(0);
		posix_exit(0);
	}
}

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

	if (soc_terminate) {
		main_clean_up(0);
		posix_exit(0);
	}
}

+5 −3
Original line number Diff line number Diff line
@@ -92,14 +92,16 @@ Therefore these limitations apply:

     /* We expect the peripheral done and ready to do something else */


- This port is not meant to, and could not possibly help debug races between
  HW and SW, or similar timing related issues.

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


Working around these limitations
==================================
================================

If a busy wait loop exists, it will become evident as the application will be
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
tests have completed.

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

Debugging
=========
+1 −1
Original line number Diff line number Diff line
@@ -103,7 +103,7 @@ static void hwm_sleep_until_next_timer(void)
		posix_print_trace("\nStopped after %.3Lfs\n",
				((long double)device_time)/1.0e6);

		main_clean_up(0);
		posix_exit(0);
	}
}

+2 −2
Original line number Diff line number Diff line
@@ -28,14 +28,14 @@
#define STOP_AFTER_5_SECONDS 0


void main_clean_up(int exit_code)
void posix_exit(int exit_code)
{
	static int max_exit_code;

	max_exit_code = max(exit_code, max_exit_code);
	/*
	 * posix_soc_clean_up may not return if this is called from a SW thread,
	 * but instead it would get main_clean_up() recalled again
	 * but instead it would get posix_exit() recalled again
	 * ASAP from the HW thread
	 */
	posix_soc_clean_up();
Loading