JP3202351B2 - Task switching processing method - Google Patents

Task switching processing method

Info

Publication number
JP3202351B2
JP3202351B2 JP26873692A JP26873692A JP3202351B2 JP 3202351 B2 JP3202351 B2 JP 3202351B2 JP 26873692 A JP26873692 A JP 26873692A JP 26873692 A JP26873692 A JP 26873692A JP 3202351 B2 JP3202351 B2 JP 3202351B2
Authority
JP
Japan
Prior art keywords
task
processing
switching
task switching
tasks
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP26873692A
Other languages
Japanese (ja)
Other versions
JPH06119190A (en
Inventor
保 岩▲崎▼
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP26873692A priority Critical patent/JP3202351B2/en
Publication of JPH06119190A publication Critical patent/JPH06119190A/en
Application granted granted Critical
Publication of JP3202351B2 publication Critical patent/JP3202351B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【産業上の利用分野】本発明はタスク切替処理方に関
し、特に組込みシステム用のリアルタイム・オペレーテ
ィングシステム用いられるタスク切替処理方に関す
る。
The present invention relates to a task associated with <br/> the switching process how, Ru especially <br/> relates to a task switching process how to use the real-time operating system for embedded seen systems.

【0002】[0002]

【従来の技術】従来、マイクロプロセッサ用のリアルタ
イム・オペレーティングシステム(以下、RTOSと略
称する)は、実行形式においてのみ販売されているのが
一般である。これは、ユーザーがRTOSをソフトウェ
アの一部品として、ブラックボックス的に使用するため
である。しかしながら、最近のRTOSは、機能および
コードサイズ等の拡大化に伴ない、当該機能をユーザー
において選択して組込むことができるようになってきて
いる。
2. Description of the Related Art Conventionally, a real-time operating system (hereinafter abbreviated as RTOS) for a microprocessor is generally sold only in an executable form. This is because the user uses the RTOS as a black box as a component of the software. However, with recent RTOSs, with the expansion of functions and code sizes, it has become possible for the user to select and incorporate the functions.

【0003】RTOSの機能は、大きく分けて次の二つ
に分類される。
The functions of the RTOS are roughly classified into the following two.

【0004】(1) システム・コール処理 (2) タスク切替処理 システム・コール処理は、各システム・コールを単位と
して独立しているために、容易に組込みの選択が可能で
ある。しかし、タスク管理/切替処理はRTOSの核と
なる機能であり、その性能も要求される。このために、
ユーザーによる機能選択は不可能な構造となっている。
このタスク切替処理について、図9を参照して説明す
る。
(1) System call processing (2) Task switching processing Since the system call processing is independent for each system call, it is possible to easily select a built-in system call. However, the task management / switching process is a core function of the RTOS, and its performance is also required. For this,
The function cannot be selected by the user.
This task switching process will be described with reference to FIG.

【0005】図9はタスク切替処理の手順を示すフロー
チャートである。簡単のために、タスクは、タスク1と
タスク2の二つであるものとする。タスクの処理は、タ
スク1およびタスク2ともに、コプロセッサを使用して
行われる処理である。今、タスク1が動作しており、自
ら発行したシステム・コールによってタスク2に切替え
られる。この切替処理は、図9に示されるフローチャー
トに従って行われる。なお、タスク1のコンテキスト
は、システムコール処理の段階において、スタックに退
避されているものとする。
FIG. 9 is a flowchart showing a procedure of a task switching process. For the sake of simplicity, assume that the tasks are two, task 1 and task 2. The task processing is processing performed using a coprocessor for both task 1 and task 2. Now, task 1 is operating, and is switched to task 2 by a system call issued by itself. This switching process is performed according to the flowchart shown in FIG. The context of task 1
Leaves the stack at the system call processing stage.
It has been evaded.

【0006】タスク切替処理においては、現在がネスト
したシステム・コール処理か否かの判定処理が行われ
(ステップ81)、次いで割込み処理中に発行されたシ
ステム・コール処理か否かの判定処理が行われる(ステ
ップ82)。この動作説明においては、タスクが通常通
り発行されたシステム・コールの処理であるために、
図9におけるステップ83に移行する。まず、CPUの
割当てを待っている(以下「レディ状態」と云う)タス
クの中から、最も優先順位の高いタスクを捜す(ステッ
プ83)。次に、このタスクとシステム・コールを発行
したタスクが同一か否かが判定される(ステップ8
4)。この動作説明においては、タスク1からタスク2
に切替えるために、処理はステップ85に移行する。
[0006] In task switching process, currently the determination process whether or not the system call processing nested is performed (step 81), then whether issued system call processing during interrupt processing determination processing Is performed (step 82). In this description, since the task is in the process of system calls issued as usual,
The process moves to step 83 in FIG. First, a task having the highest priority is searched for from tasks waiting for CPU assignment (hereinafter referred to as "ready state") (step 83). Next, it is determined whether this task and the task that issued the system call are the same (step 8).
4). In this description of the operation, task 1 to task 2
The processing shifts to step 85 to switch to.

【0007】ステップ85においては、コプロセッサを
使用するか否かの判断が行われて、切替えられるタスク
2は、コプロセッサを使用するために、現在使用してい
るタスク1のコプロセッサ・コンテキストがセーブされ
る(ステップ86)。続いて、タスク2のコプロセッサ
・コンテキストがロードされて(ステップ87)、最後
に、タスク1のスタックに退避されているコンテキスト
がセーブされ(ステップ88)、タスク2のコンテキス
トがセーブされて(ステップ89)、タスク2のコンテ
キストがロードされる(ステップ90)。
In step 85, it is determined whether or not to use the coprocessor. In order to use the coprocessor, the task 2 to be switched uses the coprocessor context of the currently used task 1 in order to use the coprocessor. It is saved (step 86). Subsequently, the coprocessor context of task 2 is loaded (step 87). Finally, the context saved on the stack of task 1 is saved (step 88), and the context of task 2 is saved (step 87). 89), the context of task 2 is loaded (step 90).

【0008】以上のようにして、タスク1からタスク2
へとタスク切替処理が行われる。
As described above, the tasks 1 to 2
A task switching process is performed.

【0009】[0009]

【発明が解決しようとする課題】上述した従来のタスク
切替処理方式においては、RTOSのタスク切替処理
は、ユーザーにとってブラック・ボックスとして提供さ
れている。このために、下記に示される欠点がある。
In the conventional task switching processing method described above, the task switching processing of the RTOS is provided as a black box to the user. This has the following disadvantages.

【0010】第1の欠点は、ユーザーが不必要な機能で
あっても、そのままシステムに組込まれてしまうことで
ある。
A first drawback is that even if a function is unnecessary for the user, it is directly incorporated into the system.

【0011】タスク切替処理においては、RTOSが各
タスクごとに割当てている資源を切替えなければならな
い。コプロセッサの例をとって見ると、コプロセッサを
全く使用しない場合、または一つのタスクでのみ使用す
る場合には、タスク切替処理内でのサポートは不必要で
ある。組込みシステムでは、装置コストを削減するため
に、ソフトウェアのメモリサイズが制限されている。こ
のために、搭載されるソフトウェアは、不必要な部分に
ついては、1バイトでも多く無駄を省かなければならな
い。従来のタスク切替処理方式では、この不要部分を削
除することは不可能である。このために、ユーザー・ア
プリケーションに必要以上のサイズ面の制限を生じさせ
てしまう結果となる。
In the task switching process, the resources allocated by the RTOS for each task must be switched. Taking the example of the coprocessor, if the coprocessor is not used at all or is used only for one task, support in the task switching process is unnecessary. In embedded systems, the memory size of software is limited in order to reduce device costs. For this reason, in the installed software, unnecessary portions must be reduced by one byte for unnecessary portions. In the conventional task switching processing method, it is impossible to delete this unnecessary part. This results in unnecessary size restrictions on the user application.

【0012】第2の欠点は、拡張性がないことである。A second drawback is that it is not extensible.

【0013】ユーザー・アプリケーションでは、RTO
Sが本来サポートしているタスクごとの資源以外に、切
替えたい資源が生じる場合がある。例えば、日本電気製
のCPU「μPD70136」を考えると、他のCPU
とは異なり、メモリ管理のための「ページ・レジスタ」
が備えられている。タスク切替えの際に、このページ・
レジスタを切替えようとしても、従来の処理方式では拡
張性がないために、不可能である。これでは、アプリケ
ーションを組む上での柔軟性を阻害し、大きな制約を課
することになる。
In the user application, the RTO
In addition to the resources for each task that S originally supports, there are cases where resources to be switched occur. For example, considering a CPU “μPD70136” made by NEC, other CPUs
Unlike "page registers" for memory management
Is provided. When switching tasks, this page
It is not possible to switch the registers because the conventional processing method does not have expandability. This hinders flexibility in building applications and imposes significant restrictions.

【0014】[0014]

【課題を解決するための手段】本発明の構成は、タスク
切替処理が機能別のモジュールに分けられ、それらのア
ドレスがアドレス・テーブルに登録された組込みシステ
ム用のオペレーティング・システムにおける、現在所定
のCPUに対して割当てられているタスクを、他のタス
クに切替える際のタスク切替処理方法において前記
ドレス・テーブルに登録された最初のタスク切替処理ル
ーチンアドレスを取得する第1の処理ステップと、
第1の処理ステップ得られた前記タスク切替処理ル
ーチンを実行する第2の処理ステップと、この第2の処
理ステップ実行された前記タスク切替処理ルーチンの
次に登録されているタスク切替処理ルーチンのアドレス
を取得して、前記第1の処理ステップに制御を移行する
第3の処理ステップとを有し、予め前記アドレス・テー
ブルに登録されているタスク切替処理ルーチンを逐次呼
出して、切替対象のタスク個別資源を順次切替えること
を特徴とする
Means for Solving the Problems The configuration of the present invention, task
The switching process is divided into function-specific modules,
Dress definitive operating system for embedded systems that are registered in the address table, a task that is currently assigned to a given CPU, the task switching processing method when switching to another task, the A <br /> a first processing step of acquiring the address of the first task switching processing routine registered in the address table, this
First processing and the second processing step of executing the task switching processing routine obtained in step, the task switching process that is registered in the next said task switching processing routine executed in the second process step to obtain the address of a routine, the first processing and a third processing step of transferring control to step, and sequentially calls the task switch processing routine that is pre-registered in the address table, the switching object and switches the task individual resources sequentially.

【0015】なお、前記アドレス・テーブルは前記タス
クごとに保有してもよく、または前記タスク共通に保有
するとともに、併せて前記タスク個別に保有するように
してもよい。
The address table may be held for each of the tasks, or may be held for the tasks in common and separately for the tasks.

【0016】[0016]

【実施例】次に、本発明について図面を参照して説明す
る。
Next, the present invention will be described with reference to the drawings.

【0017】図1は本発明の第1の実施例のタスク切替
前処理のフローチャートであり、図2は、本実施例のコ
プロセッサ切替処理のフローチャート、図3は、タスク
切替後処理フローチャートである。また、図4は、SB
T内のアドレス・テーブルの構造を示す図である。な
お、タスクは、前述の従来例の場合と同様にタスク1か
らタスク2に切り替わるものとし、タスク1のコンテキ
ストはシステムコール処理の段階において、スタックに
退避されているものとする。
FIG. 1 is a flowchart of a pre-switching process of the first embodiment of the present invention, FIG. 2 is a flowchart of a coprocessor switching process of the present embodiment, and FIG. 3 is a flowchart of a post-switching process. . Also, FIG.
FIG. 4 is a diagram showing a structure of an address table in T. The task is task 1 as in the case of the above-described conventional example .
Is switched to Task 2 and the context of Task 1
Strikes on the stack during system call processing.
It is assumed that she has been evacuated .

【0018】システム・コール処理がネストした場合や
割込み処理中に発行されたシステム・コール処理では、
タスク切替処理をスキップする必要があるため、まず
ストしたシステム・コール処理中か否かが判定され(ス
テップ11)、次いで割込み処理中に発行されたシステ
ム・コール処理中か否かが判定される(ステップ1
2)。この動作説明においては、タスクが通常通りに発
行されたシステム・コールの処理であるために、ステッ
プ13の処理に移行する。まず、レディー状態のタスク
の中から、最も優先順位の高いタスクを捜す(ステップ
13)。次に、このタスクとシステム・コールを発行し
たタスクが同一か否かが判定される(ステップ14)。
この動作説明においては、タスク1からタスク2に切替
えるために、処理はステップ15に移行する。
When system call processing is nested,
In system call processing issued during interrupt processing,
It is necessary to skip the task switching processing, first Ne <br/> whether in strike the system call processing is determined (step 11), then either in system call processing is issued during the interrupt processing not Is determined (step 1
2). In this description of the operation, the process proceeds to step 13 because the task is the process of a system call issued as usual. First, the task with the highest priority is searched for from the tasks in the ready state (step 13). Next, it is determined whether or not this task and the task that issued the system call are the same (step 14).
In this operation description, the process proceeds to step 15 in order to switch from task 1 to task 2.

【0019】ステップ15においては、図4に示される
テーブルのアドレスと、当該テーブル内の最初のエント
リのポインターが得られる。最初のエントリにある処理
ルーチンのアドレスは、コプロセッサの切替処理ルーチ
ンのアドレスである。従って、処理は図3に示されるス
テップ31に移行する。ステップ31においては、コプ
ロセッサ使用の判断処理が行われて、切替えられるタス
ク2は、コプロセッサを使用するために、現在使用して
いるタスク1のコプロセッサ・コンテキストがセーブさ
れる(ステップ32)。続いて、タスク2のコプロセッ
サ・コンテキストがロードされる(ステップ33)。こ
のようにして、コプロセッサの切替処理が終了して、図
1のステップ17の処理に戻る。
In step 15, the address of the table shown in FIG. 4 and the pointer of the first entry in the table are obtained. The address of the processing routine in the first entry is the address of the switching processing routine of the coprocessor. Therefore, the process proceeds to step 31 shown in FIG. In step 31, a coprocessor use determination process is performed, and the task 2 to be switched uses the coprocessor, so that the coprocessor context of the currently used task 1 is saved (step 32). . Subsequently, the coprocessor context of task 2 is loaded (step 33). In this way, the coprocessor switching process ends, and the process returns to step 17 in FIG.

【0020】図1におけるステップ17においては、前
述したテーブルのエントリへのポインターが更新され、
次のエントリにある処理ルーチンのアドレスは、タスク
切替処理ルーチンのアドレスである。従って、処理は図
2に示されるステップ21に移行する。図2に示される
タスク切替後処理ルーチンにおいては、まずタスク1の
スタックに退避されているコンテキストがセーブされ
(ステップ21)、続いて、タスク2のコンテキストが
ロードされ、タスク切替の無い場合には、スタックに退
避されているコンテキストが復帰される。(ステップ2
2)。
In step 17 in FIG. 1, the pointer to the entry of the table described above is updated,
The address of the processing routine in the next entry is the address of the task switching processing routine. Therefore, the process proceeds to step 21 shown in FIG. In the post-task switching processing routine shown in FIG.
The context saved on the stack is saved (step 21). Subsequently, the context of task 2 is loaded. If there is no task switching, the context is saved on the stack.
The evacuated context is restored. (Step 2
2).

【0021】以上のようにして、タスク切替後処理ルー
チンの処理が終了し、タスク1からタスク2に処理が切
替えられる。
As described above, the processing of the post-task switching processing routine ends, and the processing is switched from task 1 to task 2.

【0022】次に、本発明の第2の実施例について説明
する。図5は、本実施例のタスク切替処理のフローチャ
ート、図6は、コプロセッサ処理のフローチャート、図
7は、レジスタ処理のフローチャート、そして図8は、
タスク・コントロール・ブロック(以下、TCBと略称
する)内のアドレス・テーブルの構造を示す図である。
なお、タスクは、前述の従来例の場合と同様の状態であ
るものとする。
Next, a second embodiment of the present invention will be described. 5 is a flowchart of a task switching process according to the present embodiment, FIG. 6 is a flowchart of a coprocessor process, FIG. 7 is a flowchart of a register process, and FIG.
FIG. 3 is a diagram showing a structure of an address table in a task control block (hereinafter, abbreviated as TCB).
The task is assumed to be in the same state as in the case of the above-described conventional example.

【0023】システム・コール処理からタスク切替処理
に移行すると、現在がネストしたシステム・コール処理
か否かが判定され(図5におけるステップ41)、次い
で割込み処理中に発行されたシステム・コール処理か否
かが判定される(ステップ42)。この動作説明におい
ては、タスクが通常通りに発行されたシステム・コール
の処理であるために、ステップ43の処理に移行する。
まず、レディー状態のタスクの中から、最も優先順位の
高いタスクを捜す(ステップ43)。次に、このタスク
とシステム・コールを発行したタスクが同一か否かが判
定される(ステップ44)。この動作説明においては、
タスク1からタスク2に切替えるために、処理はステッ
プ45に移行する。
When the process shifts from the system call process to the task switching process, it is determined whether or not the current system call process is a nested system call process (step 41 in FIG. 5). It is determined whether or not it is (step 42). In this description of the operation, since the task is the processing of the system call issued as usual, the processing shifts to the processing of step 43.
First, the task with the highest priority is searched for from the tasks in the ready state (step 43). Next, it is determined whether or not this task and the task that issued the system call are the same (step 44). In this operation description,
In order to switch from task 1 to task 2, the process proceeds to step 45.

【0024】ステップ45においては、切替えられるこ
とを示すフラグが、図8に示されるTCBの切替処理識
別フラグ領域にセットされ、続いて、タスク1のTCB
内のテーブルの最初のエントリのポインターが得られる
(ステップ46)。最初のエントリにある処理ルーチン
のアドレスは、コプロセッサ処理ルーチンのアドレスで
ある。従って、処理は、図6に示されるフローチャート
のステップ61に移行する。図6におけるステップ61
においては、前述した識別フラグがセットされているか
否かが判定される。タスク1のフラグは、図5のステッ
プ45においてセットされているために、図6における
ステップ62に処理が移行する。切替えられるタスク2
は、コプロセッサを使用するために、現在使用している
タスク1のコプロセッサ・コンテキストがセーブされる
(ステップ63)。このようにして、コプロセッサ処理
が終了して、図5の処理フローにおけるステップ48に
処理が戻る。
In step 45, a flag indicating that switching is to be performed is set in the switching process identification flag area of the TCB shown in FIG.
A pointer to the first entry of the table in is obtained (step 46). The address of the processing routine in the first entry is the address of the coprocessor processing routine. Therefore, the process proceeds to step 61 of the flowchart shown in FIG. Step 61 in FIG.
In, it is determined whether or not the above-described identification flag is set. Since the flag of task 1 is set in step 45 of FIG. 5, the processing shifts to step 62 of FIG. Task 2 that can be switched
Saves the currently used coprocessor context of task 1 to use the coprocessor (step 63). Thus, the coprocessor processing ends, and the processing returns to step 48 in the processing flow of FIG.

【0025】図5におけるステップ48においては、前
述したエントリへのポインターが更新されて、次のエン
トリにある処理ルーチンのアドレスは、レジスタ処理ル
ーチンのアドレスである。従って、処理は図7に示され
る処理フローのステップ71に移行する。ステップ71
においては、図6におけるステップ61の処理と同様
に、識別フラグがセットされているか否かが判定され
る。タスク1のフラグはセットされているため、タスク
1のコンテキストがセーブされて(ステップ72)、レ
ジスタ処理は終了する。そして、処理手順は、図5の処
理フローにおけるステップ48に移行する。再度ステッ
プ48において、前述したエントリへのポインタが更新
される。次のエントリにある処理ルーチンのアドレス
は、「0」である。従って、処理は、図5のステップ5
0に移行する。ステップ50においては、前述したタス
ク1の識別フラグがクリアされ、続いてタスク2のTC
B内のテーブルの最初のエントリのポインターが得られ
る(ステップ51)。
In step 48 in FIG. 5, the pointer to the above-mentioned entry is updated, and the address of the processing routine in the next entry is the address of the register processing routine. Accordingly, the processing shifts to step 71 of the processing flow shown in FIG. Step 71
In, similarly to the processing in step 61 in FIG. 6, it is determined whether or not the identification flag is set. Since the flag of task 1 is set, the context of task 1 is saved (step 72), and the register processing ends. Then, the processing procedure shifts to Step 48 in the processing flow of FIG. Again at step 48, the pointer to the entry described above is updated. The address of the processing routine in the next entry is “0”. Therefore, the processing is performed in step 5 of FIG.
Move to 0. In step 50, the identification flag of task 1 is cleared, and then the TC of task 2 is cleared.
A pointer to the first entry of the table in B is obtained (step 51).

【0026】最初のエントリにある処理ルーチンのアド
レスは、コプロセッサ処理ルーチンのアドレスである。
従って、処理は、図6の処理フローにおけるステップ6
1に移行し、ステップ61においては、識別フラグがセ
ットされているか否かが判定される。タスク2のフラグ
がクリアされているために、図6におけるステップ64
に処理が移行し、ステップ64においてタスク2のコプ
ロセッサ・コンテキストがロードされて、コプロセッサ
処理は終了する。そして、処理フローは、図5に示され
るステップ53に戻る。ステップ53においては、前述
したエントリへのポインターが更新され、次のエントリ
にある処理ルーチンのアドレスは、レジスタ処理ルーチ
ンのアドレスである。従って、処理フローは、図7に示
されるステップ71の処理に移行する。図6の処理フロ
ーにおけるステップ61の処理と同様に、ステップ71
においては、識別フラグがセットされているか否かが判
定される。タスク2のフラグはクリアされていないため
に、タスク2のコンテキストがロードされて(ステップ
73)、レジスタ処理が終了する。これにより、処理フ
ローは、図5に示されるステップ53の処理に移行す
る。ステップ53においては、再度、前述したエントリ
へのポインターが更新され、次のエントリにある処理ル
ーチンのアドレスは「0」である。従って、タスク切替
処理は終了となる。
The address of the processing routine in the first entry is the address of the coprocessor processing routine.
Therefore, the processing is performed in step 6 in the processing flow of FIG.
Then, in step 61, it is determined whether or not the identification flag is set. Since the flag of task 2 has been cleared, step 64 in FIG.
, The coprocessor context of task 2 is loaded in step 64, and the coprocessor process ends. Then, the processing flow returns to step 53 shown in FIG. In step 53, the pointer to the above-mentioned entry is updated, and the address of the processing routine in the next entry is the address of the register processing routine. Therefore, the processing flow shifts to the processing of step 71 shown in FIG. As in the processing of step 61 in the processing flow of FIG.
In, it is determined whether or not the identification flag is set. Since the flag of task 2 has not been cleared, the context of task 2 is loaded (step 73), and the register processing ends. Thereby, the processing flow shifts to the processing of step 53 shown in FIG. In step 53, the pointer to the aforementioned entry is updated again, and the address of the processing routine in the next entry is "0". Therefore, the task switching process ends.

【0027】以上のような処理手順を介して、タスク1
の処理からタスク2の処理えのタスク切替えが行われ
る。
Through the above processing procedure, the task 1
The task switching from the processing of the task 2 to the processing of the task 2 is performed.

【0028】[0028]

【発明の効果】以上説明したように、本発明は、タスク
切替処理を機能別のモジュールに分けて、それらのアド
レスをテーブルにより管理することにより、タスク切替
処理における機能選択を、単にテーブルを書換えること
により容易に実現することが可能となり、これにより、
RTOSに対する機能追加が簡単に実現されるという効
果がある。
As described above, according to the present invention, the task switching process is divided into function-specific modules and their addresses are managed in a table, so that the function selection in the task switching process can be simply rewritten by rewriting the table. Can be easily realized by this,
There is an effect that a function can be easily added to the RTOS.

【0029】また、前記テーブルをタスクごとに保有す
ることにより、タスク切替え時における画一的な処理を
回避することが可能となり、これにより、コンテキスト
切替え時における処理時間を大幅に短縮することができ
るという効果がある。
Further, by holding the table for each task, it is possible to avoid uniform processing at the time of task switching, thereby greatly reducing the processing time at the time of context switching. This has the effect.

【図面の簡単な説明】[Brief description of the drawings]

【図1】本発明の第1の実施例のタスク切替前処理のフ
ローチャートを示す図である。
FIG. 1 is a diagram showing a flowchart of a task switching pre-processing according to a first embodiment of the present invention.

【図2】前記第1の実施例のコプロセッサ切替処理のフ
ローチャートを示す図である。
FIG. 2 is a diagram showing a flowchart of a coprocessor switching process of the first embodiment.

【図3】前記第1の実施例のタスク切替後処理のフロー
チャートを示す図である。
FIG. 3 is a diagram showing a flowchart of post-task switching processing of the first embodiment.

【図4】SBT内のアドレス・テーブルの構造を示す図
である。
FIG. 4 is a diagram showing a structure of an address table in the SBT.

【図5】本発明の第2の実施例のタスク切替処理のフロ
ーチャートを示す図である。
FIG. 5 is a diagram illustrating a flowchart of a task switching process according to the second embodiment of this invention.

【図6】前記第2の実施例のコプロセッサ切替処理のフ
ローチャートを示す図である。
FIG. 6 is a diagram showing a flowchart of a coprocessor switching process of the second embodiment.

【図7】前記第2の実施例のレジスタ切替処理のフロー
チャートを示す図である。
FIG. 7 is a diagram showing a flowchart of a register switching process of the second embodiment.

【図8】TCB内のアドレス・テーブルの構造を示す図
である。
FIG. 8 is a diagram showing a structure of an address table in the TCB.

【図9】従来例のタスク切替処理のフローチャートを示
す図である。
FIG. 9 is a diagram showing a flowchart of a task switching process in a conventional example.

【符号の説明】[Explanation of symbols]

11、41、81 シテテム・コール処理判定ステッ
プ 12、42、82 割込み処理判定ステップ 13、43、83 レディータスク検索ステップ 14、44、84 現タスクの同一判定ステップ 15、17、46、48、51、54 エントリ取得
ステップ 16、47、52 種々の処理ステップ 21、88 タスク・コンテキストをセーブするステ
ップ 22、55、73、89 タスク・コンテキストをロ
ードするステップ 31、62、85 プロセッサ使用判定ステップ 32、63、72、86 コプロセッサ・コンテキス
トをセーブするステップ 33、64、87 コプロセッサのコンテキストをロ
ードするステップ 45 フラグをセットするステップ 49 「0」判定ステップ 50 フラグをクリアするステップ 61、71 フラグのセット判定ステップ
11, 41, 81 System call processing determination step 12, 42, 82 Interrupt processing determination step 13, 43, 83 Ready task search step 14, 44, 84 Same task determination step of current task 15, 17, 46, 48, 51, 54 entry acquisition step 16, 47, 52 various processing steps 21, 88 step for saving task context 22, 55, 73, 89 step for loading task context 31, 62, 85 processor use determination step 32, 63, 72, 86 Step of saving coprocessor context 33, 64, 87 Step of loading coprocessor context 45 Step of setting flag 49 Step of determining "0" 50 Step of clearing flag 61, 71 Setting of flag Determining step

Claims (3)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 タスク切替処理が機能別のモジュールに
分けられ、それらのアドレスがアドレス・テーブルに登
録された組込みシステム用のオペレーティング・システ
ムにおける、現在所定のCPUに対して割当てられてい
るタスクを、他のタスクに切替える際のタスク切替処理
方法において前記 アドレス・テーブルに登録された最初のタスク切替
処理ルーチンのアドレスを取得する第1の処理ステップ
と、この 第1の処理ステップ得られた前記タスク切替処理
ルーチンを実行する第2の処理ステップと、この 第2の処理ステップ実行された前記タスク切替
理ルーチンの次に登録されているタスク切替処理ルーチ
ンのアドレスを取得して、前記第1の処理ステップに制
御を移行する第3の処理ステップとを有し、予め前記ア
ドレス・テーブルに登録されているタスク切替処理ルー
チンを逐次呼出して、切替対象のタスク個別資源を順次
切替えることを特徴とするタスク切替処理方
1. A task switching process is performed by a module for each function.
And the addresses are entered in the address table.
Definitive the recording has been operating system for embedded systems, task switching process when switching a task that is currently assigned to a given CPU, the other tasks
In the method, performed a first processing step of acquiring the address of the first task switching <br/> routine registered in the address table, the task switching processing routine obtained in this first process step to a second processing step, the second process obtains the address of the task switching processing routine which is registered in the following were performed the task switching processing <br/> service routine at step the first and a third processing step of transferring control to the processing step, advance said sequential calling task switching processing routine that is registered in the address table, characterized in that successively switches the task individual resources of the switching target task switching process how.
【請求項2】 前記アドレス・テーブルを、前記タスク
ごとに保有する請求項1記載のタスク切替処理方
Wherein said address table, the task switching process how according to claim 1, wherein held for each of the tasks.
【請求項3】 前記アドレス・テーブルを、前記タスク
共通に保有するとともに、前記タスク個別にも保有し、
全タスク共通の切替処理とタスク個別の切替処理とを分
けて保有できるようにした請求項1記載のタスク切替処
理方
3. The address table is held in common for the tasks and also for the tasks individually .
The switching process common to all tasks and the switching process for individual tasks are separated.
Only by the task switching process how according to claim 1 wherein to allow possession.
JP26873692A 1992-10-07 1992-10-07 Task switching processing method Expired - Fee Related JP3202351B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP26873692A JP3202351B2 (en) 1992-10-07 1992-10-07 Task switching processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP26873692A JP3202351B2 (en) 1992-10-07 1992-10-07 Task switching processing method

Publications (2)

Publication Number Publication Date
JPH06119190A JPH06119190A (en) 1994-04-28
JP3202351B2 true JP3202351B2 (en) 2001-08-27

Family

ID=17462637

Family Applications (1)

Application Number Title Priority Date Filing Date
JP26873692A Expired - Fee Related JP3202351B2 (en) 1992-10-07 1992-10-07 Task switching processing method

Country Status (1)

Country Link
JP (1) JP3202351B2 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7360872B2 (en) 1997-07-15 2008-04-22 Silverbrook Research Pty Ltd Inkjet printhead chip with nozzle assemblies incorporating fluidic seals
US7434915B2 (en) 1997-07-15 2008-10-14 Silverbrook Research Pty Ltd Inkjet printhead chip with a side-by-side nozzle arrangement layout
US7631956B2 (en) 1997-07-15 2009-12-15 Silverbrook Research Pty Ltd Ink jet printhead with glass nozzle chambers

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7360872B2 (en) 1997-07-15 2008-04-22 Silverbrook Research Pty Ltd Inkjet printhead chip with nozzle assemblies incorporating fluidic seals
US7434915B2 (en) 1997-07-15 2008-10-14 Silverbrook Research Pty Ltd Inkjet printhead chip with a side-by-side nozzle arrangement layout
US7631956B2 (en) 1997-07-15 2009-12-15 Silverbrook Research Pty Ltd Ink jet printhead with glass nozzle chambers

Also Published As

Publication number Publication date
JPH06119190A (en) 1994-04-28

Similar Documents

Publication Publication Date Title
JPH086796A (en) Down-loading method, network system therefor and data file updating method
US20020194532A1 (en) Communication control device and control method
JP3202351B2 (en) Task switching processing method
US20030172215A1 (en) Interrupt- controller
US6718405B2 (en) Hardware chain pull
US6766448B2 (en) Microcomputer for transferring program data to an internal memory from an external memory connected via a bus and a method therefor
JP3717722B2 (en) Task management method using memory area of real-time OS
JP2616419B2 (en) Information processing device
JPH02139630A (en) Online task exchange device
JP3008521B2 (en) Call function execution control method
JP2927102B2 (en) Instruction string switching method and arithmetic processor using the same
JPH0495137A (en) Context switching method for operating system
JP2000250762A (en) Microcomputer
JP2002328841A (en) System and method for demand paging swap out of kernel space
JPH0262633A (en) Inter-program communication system
CN116361079A (en) Stack switching method, stack switching device, processor and storage medium
JPS59144955A (en) Information processor
JPS6353650A (en) Computer
JPH08339303A (en) Os switching device
JPH03182945A (en) Transfer system for data in main storage
WO2005085994A2 (en) Multi-tasking data processing system
JPS58142451A (en) Interruption control system
JPH10293691A (en) Register allocating method
JPH05265846A (en) Memory managing system
JPH05216754A (en) Memory bank switching system

Legal Events

Date Code Title Description
A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 19990601

LAPS Cancellation because of no payment of annual fees