<commit_before>/*
 * Copyright (c) 2018 Intel Corporation.
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#include <zephyr.h>
#include <tc_util.h>
#include <ztest.h>
#include <kernel.h>

#define CPU1_STACK_SIZE 1024

K_THREAD_STACK_DEFINE(cpu1_stack, CPU1_STACK_SIZE);

int cpu_arg;

volatile int cpu_running;

void cpu1_fn(int key, void *arg)
{
	zassert_true(key, "bad irq key");
	zassert_true(arg == &cpu_arg && *(int *)arg == 12345, "wrong arg");

	cpu_running = 1;

	while (1) {
	}
}

void test_mp_start(void)
{
	cpu_arg = 12345;

	_arch_start_cpu(1, cpu1_stack, CPU1_STACK_SIZE, cpu1_fn, &cpu_arg);
<commit_msg>tests: mp: Add description, RTM links and doxygen group<commit_after>/*
 * Copyright (c) 2018 Intel Corporation.
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#include <zephyr.h>
#include <tc_util.h>
#include <ztest.h>
#include <kernel.h>

#define CPU1_STACK_SIZE 1024

K_THREAD_STACK_DEFINE(cpu1_stack, CPU1_STACK_SIZE);

int cpu_arg;

volatile int cpu_running;

/**
 * @brief Tests for multi processing
 *
 * @defgroup kernel_mp_tests MP Tests
 *
 * @ingroup all_tests
 *
 * @{
 * @}
 */
void cpu1_fn(int key, void *arg)
{
	zassert_true(key, "bad irq key");
	zassert_true(arg == &cpu_arg && *(int *)arg == 12345, "wrong arg");

	cpu_running = 1;

	while (1) {
	}
}

/**
 * @brief Test to verify CPU start
 *
 * @ingroup kernel_mp_tests
 *
 * @see _arch_start_cpu()
 */
void test_mp_start(void)
{
	cpu_arg = 12345;

	_arch_start_cpu(1, cpu1_stack, CPU1_STACK_SIZE, cpu1_fn, &cpu_arg);

{'fraction_non_alphanumeric': 0.1437125748502994, 'fraction_numerical': 0.03992015968063872, 'mean_word_length': 4.57037037037037, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6582747', 'n_tokens_mistral': 664, 'n_tokens_neox': 619, 'n_words': 139}