Ignore:
Timestamp:
Jul 3, 2020, 7:19:17 PM (4 years ago)
Author:
coas-nagasima
Message:

ASP3, TINET, mbed を更新

File:
1 edited

Legend:

Unmodified
Added
Removed
  • EcnlProtoTool/trunk/asp3_dcre/kernel/kernel_impl.h

    r321 r429  
    66 *  Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory
    77 *                              Toyohashi Univ. of Technology, JAPAN
    8  *  Copyright (C) 2004-2016 by Embedded and Real-Time Systems Laboratory
     8 *  Copyright (C) 2004-2018 by Embedded and Real-Time Systems Laboratory
    99 *              Graduate School of Information Science, Nagoya Univ., JAPAN
    1010 *
     
    7171
    7272/*
    73  *  型キャストを行うマクロの定義
    74  */
    75 #ifndef CAST
    76 #define CAST(type, val)         ((type)(val))
    77 #endif /* CAST */
     73 *  トレースログに関する設定
     74 */
     75#ifdef TOPPERS_ENABLE_TRACE
     76#include "arch/tracelog/trace_log.h"
     77#endif /* TOPPERS_ENABLE_TRACE */
    7878
    7979/*
     
    157157#endif /* TARGET_ISRATR */
    158158
     159#ifndef TARGET_MIN_STKSZ                        /* タスクのスタックサイズの最小値 */
     160#define TARGET_MIN_STKSZ        1U              /* 未定義の場合は0でないことをチェック */
     161#endif /* TARGET_MIN_STKSZ */
     162
    159163/*
    160164 *  ヘッダファイルを持たないモジュールの関数・変数の宣言
     
    173177
    174178/*
    175  *  初期化ルーチンの実行(kernel_cfg.c)
    176  */
    177 extern void     call_inirtn(void);
    178 
    179 /*
    180  *  終了処理ルーチンの実行(kernel_cfg.c)
    181  */
    182 extern void     call_terrtn(void);
     179 *  初期化ルーチン関係の定義(kernel_cfg.c)
     180 */
     181typedef struct initialization_routine_block {
     182        INIRTN          inirtn;                                 /* 初期化ルーチンの先頭番地 */
     183        intptr_t        exinf;                                  /* 初期化ルーチンの拡張情報 */
     184} INIRTNB;
     185
     186extern const uint_t     tnum_inirtn;            /* 初期化ルーチンの数 */
     187
     188extern const INIRTNB inirtnb_table[];   /* 初期化ルーチンブロックテーブル */
     189
     190/*
     191 *  終了処理ルーチン関係の定義(kernel_cfg.c)
     192 */
     193typedef struct termination_routine_block {
     194        TERRTN          terrtn;                                 /* 終了処理ルーチンの先頭番地 */
     195        intptr_t        exinf;                                  /* 終了処理ルーチンの拡張情報 */
     196} TERRTNB;
     197
     198extern const uint_t     tnum_terrtn;            /* 終了処理ルーチンの数 */
     199
     200extern const TERRTNB terrtnb_table[];   /* 終了処理ルーチンブロックテーブル */
    183201
    184202/*
     
    192210
    193211/*
    194  *  カーネルが割り付けるメモリ領域(kernel_cfg.c)
    195  */
    196 extern const size_t     kmmsz;          /* カーネルが割り付けるメモリ領域のサイズ */
    197 extern MB_T *const      kmm;            /* カーネルが割り付けるメモリ領域の先頭番地 */
     212 *  カーネルメモリプール領域(kernel_cfg.c)
     213 */
     214extern const size_t     mpksz;          /* カーネルメモリプール領域のサイズ */
     215extern MB_T *const      mpk;            /* カーネルメモリプール領域の先頭番地 */
    198216
    199217/*
     
    203221
    204222/*
     223 *  カーネルメモリプール領域有効フラグ(startup.c)
     224 */
     225extern bool_t   mpk_valid;
     226
     227/*
    205228 *  カーネルの起動(startup.c)
    206229 */
     
    213236
    214237/*
    215  *  カーネルの割り付けるメモリ領域の管理(startup.c)
    216  */
    217 extern void initialize_kmm(void);
    218 extern void *kernel_malloc(size_t size);
    219 extern void kernel_free(void *ptr);
     238 *  メモリプール領域の管理(startup.c)
     239 */
     240extern bool_t initialize_mempool(MB_T *mempool, size_t size);
     241extern void *malloc_mempool(MB_T *mempool, size_t size);
     242extern void free_mempool(MB_T *mempool, void *ptr);
     243
     244/*
     245 *  カーネルメモリプール領域からのメモリ獲得/解放
     246 */
     247Inline void *
     248malloc_mpk(size_t size)
     249{
     250        if (mpk_valid) {
     251                return(malloc_mempool(mpk, size));
     252        }
     253        else {
     254                return(NULL);
     255        }
     256}
     257
     258Inline void
     259free_mpk(void *ptr)
     260{
     261        if (mpk_valid) {
     262                free_mempool(mpk, ptr);
     263        }
     264}
    220265
    221266/*
     
    225270
    226271/*
    227  *  通知方法のエラーチェック
     272 *  通知方法のエラーチェック(time_manage.c)
    228273 */
    229274extern ER check_nfyinfo(const T_NFYINFO *p_nfyinfo);
    230275
    231276/*
    232  *  通知ハンドラ
     277 *  通知ハンドラ(time_manage.c)
    233278 */
    234279extern void notify_handler(intptr_t exinf);
Note: See TracChangeset for help on using the changeset viewer.