<commit_before>/**
 * \file
 * \brief initializeStack() implementation for ARMv7-M (Cortex-M3 / Cortex-M4)
 *
 * \author Copyright (C) 2014 <NAME> http://www.distortec.com http://www.freddiechopin.info
 *
 * \par License
 * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not
 * distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * \date 2014-07-24
 */

#include "distortos/architecture.hpp"

#include <type_traits>

#include <cstdint>

namespace distortos
{

namespace architecture
{

/*---------------------------------------------------------------------------------------------------------------------+
| global functions
+---------------------------------------------------------------------------------------------------------------------*/

void * initializeStack(void * const buffer, const size_t size, void * (&function)(void *), void * const arguments,
		void (&trap)(void *))
{
	auto stack_pointer = reinterpret_cast<uint32_t *>(static_cast<uint8_t *>(buffer) + size);

	using StackElement = std::remove_reference<decltype(*stack_pointer)>::type;
<commit_msg>source/architecture/ARM/ARMv7-M: use std::decay<> instead of std::remove_reference<><commit_after>/**
 * \file
 * \brief initializeStack() implementation for ARMv7-M (Cortex-M3 / Cortex-M4)
 *
 * \author Copyright (C) 2014 <NAME> http://www.distortec.com http://www.freddiechopin.info
 *
 * \par License
 * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not
 * distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * \date 2014-07-31
 */

#include "distortos/architecture.hpp"

#include <type_traits>

#include <cstdint>

namespace distortos
{

namespace architecture
{

/*---------------------------------------------------------------------------------------------------------------------+
| global functions
+---------------------------------------------------------------------------------------------------------------------*/

void * initializeStack(void * const buffer, const size_t size, void * (&function)(void *), void * const arguments,
		void (&trap)(void *))
{
	auto stack_pointer = reinterpret_cast<uint32_t *>(static_cast<uint8_t *>(buffer) + size);

	using StackElement = std::decay<decltype(*stack_pointer)>::type;

{'fraction_non_alphanumeric': 0.30862646566164154, 'fraction_numerical': 0.018844221105527637, 'mean_word_length': 1.8852657004830917, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '5215179', 'n_tokens_mistral': 681, 'n_tokens_neox': 635, 'n_words': 183}