آµt-kernel specification - tron خ¼t-kernel خ¼t-kernel

Download آµT-Kernel Specification - TRON 

خ¼T-Kernel خ¼T-Kernel

Post on 05-Mar-2020

0 views

Category:

Documents

0 download

Embed Size (px)

TRANSCRIPT

  • TEF020-S004-01.01.01/en

    µT-Kernel Specification ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬

    µT-Kernel 1.01.01

    Copyright © 2006–2012 by T-Engine Forum

  • TEF020-S004-01.01.01/en

    Copyright © 2006–2012 by T-Engine Forum µT-Kernel 1.01.01

    _______________________________________________

    µT-Kernel Specification Version 1.01.01

    Copyright © 2006-2012 by T-Engine Forum

    TRON Architecture: Designed by Ken Sakamura

    _______________________________________________

  • TEF020-S004-01.01.01/en CONTENTS iii

    Copyright © 2006–2012 by T-Engine Forum µT-Kernel 1.01.01

    Contents

    Change List ..........................................................................................................................................xi System Call Notation ......................................................................................................................... xii Index of µT-Kernel API .....................................................................................................................xiv

    μT-Kernel Overview ............................................................................................................................. 1

    1.1 Positioning for μT-Kernel ..................................................................................................... 1 1.2 Background ........................................................................................................................... 1 1.3 Design Policy ........................................................................................................................ 1 1.4 Reference Code ..................................................................................................................... 2 1.5 Adaptation ............................................................................................................................. 2

    Concepts Underlying the μT-Kernel Specification ................................................................................... 3 2.1 Meaning of Basic Terminology ............................................................................................. 3

    2.1.1 Terminology about Implementation .............................................................................. 3 2.1.2 Meaning of Other Basic Terms ..................................................................................... 3

    2.2 Task States and Scheduling Rules ......................................................................................... 4 2.2.1 Task States ..................................................................................................................... 4 2.2.2 Task Scheduling Rules .................................................................................................. 8

    2.3 Interrupt Handling ............................................................................................................... 10 2.4 System States ...................................................................................................................... 10

    2.4.1 System States While Non-task Portion Is Executing .................................................. 10 2.4.2 Task-Independent Portion and Quasi-Task Portion ............................................................ 11

    2.5 Objects ................................................................................................................................ 12 2.6 Memory ............................................................................................................................... 13

    2.6.1 Address Space ............................................................................................................. 13 2.6.2 Nonresident Memory .................................................................................................. 13 2.6.3 Protection Levels ........................................................................................................ 13

    Common μT-Kernel Specifications ..................................................................................................... 14 3.1 Data Types........................................................................................................................... 14

    3.1.1 General Data Types ..................................................................................................... 14 3.1.2 Other Defined Data Types ........................................................................................... 15

    3.2 System Calls ....................................................................................................................... 16 3.2.1 System Call Format ..................................................................................................... 16 3.2.2 System Calls Possible from Task-Independent Portion and Dispatching Prohibited State 16 3.2.3 Restricting System Call Invocation ............................................................................. 17

  • TEF020-S004-01.01.01/en iv CONTENTS

    Copyright © 2006–2012 by T-Engine Forum µT-Kernel 1.01.01

    3.2.4 Modifying a Parameter Packet .................................................................................... 17 3.2.5 Function Codes ........................................................................................................... 17 3.2.6 Error Codes ................................................................................................................. 18 3.2.7 Timeout ....................................................................................................................... 18 3.2.8 Relative Time and System Time ................................................................................. 18

    3.3 High-Level Language Support Routines ............................................................................. 19 μT-Kernel Functions ........................................................................................................................... 21

    4.1 Task Management Functions .............................................................................................. 23 tk_cre_tsk ................................................................................................................................ 24 tk_del_tsk ................................................................................................................................ 27 tk_sta_tsk ................................................................................................................................ 28 tk_ext_tsk ................................................................................................................................ 29 tk_exd_tsk ............................................................................................................................... 30 tk_ter_tsk ................................................................................................................................ 31 tk_chg_pri ............................................................................................................................... 33 tk_get_reg ............................................................................................................................... 35 tk_set_reg ................................................................................................................................ 36 tk_ref_tsk ................................................................................................................................ 37

    4.2 Task-Dependent Synchronization Functions ....................................................................... 40 tk_slp_tsk ................................................................................................................................ 41 tk_wup_tsk .............................................................................................................................. 43 tk_can_wup ............................................................................................................................. 44 tk_rel_wai ............................................................................................................................... 45 tk_sus_tsk ................................................................................................................................ 47 tk_rsm_tsk ............................................................................................................................... 49 tk_frsm_tsk ............................................................................................................................. 49 tk_dly_tsk ................................................................................................................................ 51

    4.3 Synchronization and Communication Functions ................................................................ 52 4.3.1 Semaphore ................................................................................................................... 53

    tk_cre_sem .............................................................................................................................. 54 tk_del_sem .............................................................................................................................. 56 tk_sig_sem ..................................................................................................