<commit_before>/******************************************************************************

    @file    IntrOS: oscore.h
    @author  <NAME>
    @date    28.08.2017
    @brief   IntrOS port file for STM8 uC.

 ******************************************************************************

    IntrOS - Copyright (C) 2013 <NAME>.

    This file is part of IntrOS distribution.

    IntrOS is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published
    by the Free Software Foundation; either version 3 of the License,
    or (at your option) any later version.

    IntrOS is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program. If not, see <http://www.gnu.org/licenses/>.

 ******************************************************************************/

#ifndef __INTROSCORE_H
#define __INTROSCORE_H

#include <osbase.h>

#ifdef __cplusplus
extern "C" {
#endif

/* -------------------------------------------------------------------------- */

#ifndef  OS_STACK_SIZE
#define  OS_STACK_SIZE      128 /* default task stack size in bytes           */
#endif

/* -------------------------------------------------------------------------- */

#ifndef  OS_FUNCTIONAL

#define  OS_FUNCTIONAL        0 /* c++ functional library header not included */

#elif    OS_FUNCTIONAL

#error   c++ functional library not allowed for this compiler.

#endif //OS_FUNCTIONAL

/* -------------------------------------------------------------------------- */

typedef  uint8_t              lck_t;
typedef  uint8_t              stk_t;

/* -------------------------------------------------------------------------- */

#if      defined(__CSMC__)
extern   stk_t               _stack[];
#define  MAIN_TOP            _stack+1
#endif

#define  ASIZE( size ) \
  (((unsigned)( size )+(sizeof(stk_t)-1))/sizeof(stk_t))

/* -------------------------------------------------------------------------- */

// task context

typedef struct __ctx ctx_t;

#if   defined(__CSMC__)

struct __ctx
{
	void   * sp;
	fun_t  * pc;

};

#elif defined(__SDCC)

struct __ctx
{
	fun_t  * pc;
	void   * sp;

};

#endif

#define _CTX_INIT() { 0, 0 }
<commit_msg>ASIZE definition moved to oskernel<commit_after>/******************************************************************************

    @file    IntrOS: oscore.h
    @author  <NAME>
    @date    29.08.2017
    @brief   IntrOS port file for STM8 uC.

 ******************************************************************************

    IntrOS - Copyright (C) 2013 <NAME>.

    This file is part of IntrOS distribution.

    IntrOS is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published
    by the Free Software Foundation; either version 3 of the License,
    or (at your option) any later version.

    IntrOS is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program. If not, see <http://www.gnu.org/licenses/>.

 ******************************************************************************/

#ifndef __INTROSCORE_H
#define __INTROSCORE_H

#include <osbase.h>

#ifdef __cplusplus
extern "C" {
#endif

/* -------------------------------------------------------------------------- */

#ifndef  OS_STACK_SIZE
#define  OS_STACK_SIZE      128 /* default task stack size in bytes           */
#endif

/* -------------------------------------------------------------------------- */

#ifndef  OS_FUNCTIONAL

#define  OS_FUNCTIONAL        0 /* c++ functional library header not included */

#elif    OS_FUNCTIONAL

#error   c++ functional library not allowed for this compiler.

#endif //OS_FUNCTIONAL

/* -------------------------------------------------------------------------- */

typedef  uint8_t              lck_t;
typedef  uint8_t              stk_t;

/* -------------------------------------------------------------------------- */

#if      defined(__CSMC__)
extern   stk_t               _stack[];
#define  MAIN_TOP            _stack+1
#endif

/* -------------------------------------------------------------------------- */

// task context

typedef struct __ctx ctx_t;

#if   defined(__CSMC__)

struct __ctx
{
	void   * sp;
	fun_t  * pc;

};

#elif defined(__SDCC)

struct __ctx
{
	fun_t  * pc;
	void   * sp;

};

#endif

#define _CTX_INIT() { 0, 0 }

{'fraction_non_alphanumeric': 0.3109053497942387, 'fraction_numerical': 0.009670781893004115, 'mean_word_length': 1.7587968217934167, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '2940383', 'n_tokens_mistral': 1279, 'n_tokens_neox': 1180, 'n_words': 436}