JP2001147822A - Real time monitor - Google Patents

Real time monitor

Info

Publication number
JP2001147822A
JP2001147822A JP32949899A JP32949899A JP2001147822A JP 2001147822 A JP2001147822 A JP 2001147822A JP 32949899 A JP32949899 A JP 32949899A JP 32949899 A JP32949899 A JP 32949899A JP 2001147822 A JP2001147822 A JP 2001147822A
Authority
JP
Japan
Prior art keywords
general
register
registers
task
processing
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.)
Pending
Application number
JP32949899A
Other languages
Japanese (ja)
Inventor
Koichiro Tsuruno
幸一郎 鶴野
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.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial Co Ltd
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 Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP32949899A priority Critical patent/JP2001147822A/en
Publication of JP2001147822A publication Critical patent/JP2001147822A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To provide a real time monitor for using general registers to be used for a plurality of uses by limiting one part of the general registers to be used by a mult-task in a CPU having general registers such as RISC even when register saving and restoring processing increasing in proportion to the number of the general registers results in one factor of the increase of the overhead of a real time monitor. SOLUTION: In this real time monitor, the number of general registers to be used can be limited by using general resisters whose use is clear for other uses, or temporarily saving the general registers in stacks.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は,マルチタスクシス
テムであるマイクロプロセッサ組み込み装置におけるリ
アルタイムモニタに関するものである。
[0001] 1. Field of the Invention [0002] The present invention relates to a real-time monitor in a microprocessor embedded device which is a multitask system.

【0002】[0002]

【従来の技術】一般的なリアルタイムモニタでは、タス
ク切換えのたびに発生するレジスタ退避・復帰の処理に
おいて、CPUが持っている汎用レジスタをすべて退避
・復帰しているので、特に、RISCのようなCPUで
は、汎用レジスタ数が多く、リアルタイムモニタのオー
バーヘッドの一因となっている。
2. Description of the Related Art A general real-time monitor saves and restores all general-purpose registers of a CPU in register save / restore processing that occurs each time a task is switched. In the CPU, the number of general-purpose registers is large, which contributes to the overhead of the real-time monitor.

【0003】このように構成された従来のリアルタイム
モニタの動作について説明する。リアルタイムモニタが
有する機能の中にはタスク制御がある。複数のタスクの
実行制御をタスクを切換えながら行っている。あるタス
クが動作中に、タスク切換えが起こると、そのタスクが
再開されるための準備として、そのタスクの状態を保持
する必要がある。保持する情報の中に、レジスタの退避
がある。また、次に実行されるタスクについても、タス
クが再開される前に予め退避しておいたレジスタを復帰
させてから、実行を行う。
The operation of the conventional real-time monitor configured as described above will be described. One of the functions of the real-time monitor is task control. Execution control of a plurality of tasks is performed while switching tasks. When a task is switched while a task is running, it is necessary to maintain the state of the task in preparation for the task to be restarted. Among the information to be held, there is a save of a register. Also, the next task to be executed is executed after restoring the previously saved register before the task is restarted.

【0004】このレジスタの退避・復帰の処理は、一般
的なリアルタイムモニタでは全レジスタについて、退避
・復帰を行うが、RISC CPUのようにレジスタ数
が多いと、システムの中でリアルタイムモニタがCPU
を使用する時間、つまりオーバーヘッドを大きくし、結
果として、システムのパフォーマンスを下げる一因とな
っている。
In this process of saving and restoring registers, a general real-time monitor performs saving and restoring for all registers. However, if the number of registers is large, such as a RISC CPU, the real-time monitor is not used in the system.
Increases the time, or overhead, to use, and consequently reduces system performance.

【0005】例えば、日立製RISC CPUのSH−
1(7032/7034)では、汎用レジスタがR0か
らR14まで、15本用意されている。しかも、R0か
らR7までのレジスタは、用途が明確である。そこで、
この8本のレジスタを別の用途に併用したり、スタック
に一時退避することによって、使用する汎用レジスタの
数を制限することが出来る。
[0005] For example, the SH-
In 1 (7032/7034), 15 general-purpose registers from R0 to R14 are prepared. Moreover, the registers R0 to R7 have clear uses. Therefore,
The number of general-purpose registers to be used can be limited by using these eight registers together for another purpose or by temporarily saving them on the stack.

【0006】ところで、通常のように汎用レジスタ15
本をすべて退避・復帰させると、レジスタ1本あたり1
μ秒かかると仮定して、15μ秒かかってしまう。そこ
で、タスクで使用するレジスタを制限して、8本にすれ
ば、8μ秒で済む。例えば、タスク数60として、全タ
スクでタスク切換えが起こるとすると、レジスタ復帰6
0回、レジスタ退避60回が必要である。退避・復帰す
る汎用レジスタが15本の場合は、15μ秒*(60+
60)=1800μ秒=1.8m秒かかる事になる。退
避するレジスタが8本の場合は、8μ秒*(60+6
0)=960μ秒かかる。つまり、退避するレジスタ数
が半減すれば、そのまま処理時間も半減される。タスク
数が多くなればなるほど、レジスタ退避・復帰処理の時
間短縮の効果がある。
Incidentally, the general-purpose register 15 is used as usual.
If all the books are saved and restored, 1 per register
Assuming that it takes μ second, it takes 15 μ second. Therefore, if the number of registers used in the task is limited to eight, it takes only 8 μs. For example, assuming that task switching occurs in all tasks with the number of tasks being 60, register return 6
0 times and register save 60 times are required. If there are 15 general-purpose registers to be saved and restored, 15 μs * (60+
60) = 1800 μsec = 1.8 msec. If there are eight registers to save, 8 μs * (60 + 6
0) = 960 μs. That is, if the number of registers to be saved is reduced by half, the processing time is also reduced by half. As the number of tasks increases, the effect of reducing the time for register save / restore processing is obtained.

【0007】SH−1は、割込み禁止処理を行う場合
に、汎用レジスタを使用する。よって、タスク切換えに
て、レジスタを退避させる前に、割込み禁止処理を行う
と、割込み禁止処理で使われた汎用レジスタの内容が破
壊される不具合がある。そこで、そのレジスタの内容が
破壊されないためには、割込み禁止処理の前に、前もっ
て、退避する必要がある。退避・復帰する汎用レジスタ
数を制限する事により、別の効果として、割込み禁止・
許可の処理の際に、退避・復帰させないレジスタを使っ
て、割込み禁止許可処理を行えば、割込み禁止する前
に、退避する必要がなくなる。
The SH-1 uses a general-purpose register when performing interrupt prohibition processing. Therefore, if the interrupt prohibition process is performed before the register is saved in the task switching, there is a problem that the contents of the general-purpose registers used in the interrupt prohibition process are destroyed. Therefore, in order to prevent the contents of the register from being destroyed, it is necessary to save the contents before the interrupt prohibition processing. By limiting the number of general-purpose registers to be saved and restored, another effect is to disable interrupts.
If the interrupt prohibition permission process is performed by using a register that is not saved / restored at the time of the permission process, it is not necessary to save before interrupt prohibition.

【0008】割込み禁止処理を行う場合に、禁止する前
の状態レジスタの内容を保持しておく必要がある。それ
をローカル変数で宣言する。しかし、前述のように割込
み禁止処理で汎用レジスタを使用するため、割込み禁止
処理の前に、前もって退避する必要がある。その為、退
避途中のスタックに退避するため、スタックポインタの
制御が余分に必要になる。これに使用していない汎用レ
ジスタを適用すれば、請求項2と同様の効果がある。
When performing the interrupt prohibition process, it is necessary to hold the contents of the status register before the prohibition. Declare it as a local variable. However, since the general-purpose register is used in the interrupt prohibition processing as described above, it is necessary to save beforehand before the interrupt prohibition processing. For this reason, since the stack is saved on the stack in the middle of saving, extra control of the stack pointer is required. If a general-purpose register not used for this is applied, the same effect as in claim 2 can be obtained.

【0009】[0009]

【発明が解決しようとする課題】一般的なリアルタイム
モニタでは、タスク切換えのたびに発生するレジスタ退
避・復帰の処理において、CPUが持っている汎用レジ
スタをすべて退避・復帰している。しかしながら、特に
RISCのようなCPUでは、汎用レジスタ数が多く、
レジスタ復帰・退避の処理時間の長さがリアルタイムモ
ニタのオーバーヘッドの一因となっているという問題点
を有していた。
In a general real-time monitor, all general-purpose registers of the CPU are saved and restored in a register saving and restoring process that occurs each time a task is switched. However, especially in a CPU such as RISC, the number of general-purpose registers is large,
There has been a problem that the length of the processing time for register restoration / save is a factor in the overhead of the real-time monitor.

【0010】本発明は上記従来の問題点を解決するもの
で,タスクで使用するCPU所有の汎用レジスタの数を
制限し、リアルタイムモニタのオーバーヘッドを軽減
し、システムのパフォーマンス向上を行うことができる
ようにしたリアルタイムモニタを提供することを目的と
する。
SUMMARY OF THE INVENTION The present invention solves the above-mentioned conventional problems. The present invention limits the number of general-purpose registers owned by a CPU used in a task, reduces overhead of a real-time monitor, and improves system performance. It is an object of the present invention to provide a real-time monitor.

【0011】[0011]

【課題を解決するための手段】上記課題を解決するため
に本発明は、マルチタスクシステムにおいて、汎用レジ
スタを複数有するCPUを使用する場合に、タスクで使
用する汎用レジスタを複数の用途に用いて汎用レジスタ
を一部制限し使用するようにした。
SUMMARY OF THE INVENTION In order to solve the above-mentioned problems, the present invention provides a multitasking system in which, when a CPU having a plurality of general purpose registers is used, a general purpose register used in a task is used for a plurality of purposes. Some general-purpose registers have been restricted and used.

【0012】本発明によれば、タスクで使用するCPU
所有の汎用レジスタの数を制限し、リアルタイムモニタ
のオーバーヘッドを軽減し、システムのパフォーマンス
向上を行うことができるようにしたリアルタイムモニタ
を実現できるように構成したものである。
According to the present invention, a CPU used in a task
The configuration is such that the number of owned general-purpose registers is limited, the overhead of the real-time monitor is reduced, and a real-time monitor capable of improving the performance of the system can be realized.

【0013】[0013]

【発明の実施の形態】本発明の請求項1に記載の発明
は、マルチタスクシステムにおいて、汎用レジスタを複
数有するCPUを使用する場合に、タスクで使用する汎
用レジスタを複数の用途に用いて汎用レジスタを一部制
限し使用するようにしたものであり、明確な用途が決ま
っている汎用レジスタを再利用したり、スタックに退避
することによって、タスクが使用しない汎用レジスタを
リアルタイムモニタ自身で使用する別の用途に利用でき
る。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS The invention described in claim 1 of the present invention is a general-purpose system which uses a general-purpose register used for a task for a plurality of purposes when a CPU having a plurality of general-purpose registers is used in a multitask system. Registers are restricted and used, and general-purpose registers that are not used by tasks are used by the real-time monitor itself by reusing general-purpose registers for which a specific use has been determined or saving them to the stack. Can be used for other purposes.

【0014】本発明の請求項2に記載の発明は、請求項
1記載の発明において、タスクで使用しない汎用レジス
タを割込み禁止処理に用いるものであり、これによりタ
スクで使用する汎用レジスタの退避・復帰処理におい
て、割込み禁止処理による汎用レジスタの内容の破壊を
防ぐことができる。
According to a second aspect of the present invention, in the first aspect, a general-purpose register not used in the task is used for interrupt disabling processing. In the return processing, it is possible to prevent the contents of the general-purpose registers from being destroyed due to the interrupt inhibition processing.

【0015】本発明の請求項3に記載の発明は、請求項
1記載の発明において、タスクで使用しない汎用レジス
タを割込み禁止処理以前の状態レジスタの一時退避に用
いるものであり、これにより状態レジスタの復帰・退避
処理において、スタックポインタの制御を省略できる。
According to a third aspect of the present invention, in the first aspect of the present invention, a general-purpose register not used in a task is used for temporarily saving a status register before interrupt disable processing. The control of the stack pointer can be omitted in the return / evacuation processing of.

【0016】以下、本発明の実施の形態について説明す
る。図1は、本発明の一実施の形態におけるCPUの有
する汎用レジスタに明確な用途例を示した図である。図
2は同CPUの有する汎用レジスタとスタック間におけ
るレジスタ退避・復帰処理の説明図、図3は、同レジス
タ退避・復帰処理のフローチャートである。図4は、同
割込み禁止処理における汎用レジスタの使用状況説明
図、図5は、同割込み禁止処理における割込みマスク
(状態レジスタ)の保存を行っている説明図である。
Hereinafter, embodiments of the present invention will be described. FIG. 1 is a diagram showing a clear application example of a general-purpose register included in a CPU according to an embodiment of the present invention. FIG. 2 is an explanatory diagram of a register save / restore process between a general-purpose register and a stack of the CPU, and FIG. 3 is a flowchart of the register save / restore process. FIG. 4 is a diagram illustrating the use of general-purpose registers in the interrupt prohibition process, and FIG. 5 is a diagram illustrating saving of an interrupt mask (status register) in the interrupt prohibition process.

【0017】まず、本発明の内容を説明するための前提
条件の一例を仮定しておく。CPUの所有する汎用レジ
スタの数は、便宜上、レジスタを区別するために、各レ
ジスタをR0からR15の16本とする。また、R0か
らR7をタスクで使用するレジスタとし、R8からR1
5をリアルタイムモニタで使用するレジスタとする。明
確な用途が定義されているレジスタとして、R0からR
7、R15とする。各レジスタの用途定義例を以下に示
す。R0は、関数の戻り値を保持するレジスタ、R1か
らR3は、一時値を保持するレジスタ、R4からR7
は、関数の引数を保持するレジスタ、R15をスタック
ポインタとする。R0は、関数の戻り値を保持するレジ
スタであるが、最終的に戻り値を保持すればいいので、
それ以前は、別の用途に使用することが出来る。R4か
らR7の引数を保持するレジスタに付いては、即座に処
理してしまうか、あるいは、一時スタック等に退避する
ことにより、別の用途に使用することが出来る。R1か
らR3の一時値を保持するレジスタについても、同様に
して、別の用途に使用することが出来る。よって、R0
からR7までのレジスタを複数の用途に使用することが
出来る。
First, an example of preconditions for explaining the contents of the present invention is assumed. For the sake of convenience, the number of general-purpose registers owned by the CPU is assumed to be 16 from R0 to R15 in order to distinguish registers. Also, R0 to R7 are used as registers for tasks, and R8 to R1 are used as registers.
5 is a register used in the real-time monitor. R0 to R
7, R15. An example of usage definition of each register is shown below. R0 is a register for holding the return value of the function, R1 to R3 are registers for holding the temporary value, and R4 to R7.
Is a register for holding a function argument, and R15 is a stack pointer. R0 is a register for holding the return value of the function, but since it is sufficient to finally hold the return value,
Before that, it can be used for other purposes. The registers holding the arguments of R4 to R7 can be used for another purpose by immediately processing them or saving them to a temporary stack or the like. The registers holding the temporary values of R1 to R3 can be similarly used for other purposes. Therefore, R0
To R7 can be used for multiple purposes.

【0018】図1において、R0からR7(1から8)
と、R15(16)は、明確な用途が決まっており、R
0(1)は、関数からの戻り値を格納するものであり、
R1からR3(2から4)は、計算等を行うときの一時
的に値を保持するためのものであり、R4からR7(5
から8)は、関数が呼ばれた際の引数を格納するもので
あり、R15(16)は、スタックポインタを格納する
ものである。
In FIG. 1, R0 to R7 (1 to 8)
And R15 (16) have clear uses, and R15 (16)
0 (1) stores the return value from the function,
R1 to R3 (2 to 4) are used to temporarily hold values when performing calculations and the like, and R4 to R7 (5
To 8) store the arguments when the function is called, and R15 (16) stores the stack pointer.

【0019】一般的には、R8からR14(9から1
5)までの汎用レジスタも、何らかの用途に用いられて
いる。その何からの用途を明確な用途が決まっている汎
用レジスタで代用して行うことによって、使用するレジ
スタ数を制限することが出来る。例えば図1の(A)
は、関数呼出し時の汎用レジスタの使用情況を示す。引
数がある場合、ドットで網掛けされているR4からR7
(5から8)には、関数が呼ばれた際の引数が格納され
るので、このまま別の用途に使用しようとすると、値を
壊してしまい、正常な動作が保証できない。そこで、レ
ジスタの値を処理してしまうか、あるいは予め未使用の
別の汎用レジスタやスタック等に退避すれば、別の用途
に使用できる。
Generally, R8 to R14 (9 to 1)
General-purpose registers up to 5) are also used for some purposes. The number of registers to be used can be limited by substituting a general purpose register for which a clear purpose is determined for the purpose. For example, FIG.
Indicates the usage status of the general-purpose register at the time of function call. If there is an argument, R4 to R7 shaded with dots
In (5 to 8), the argument at the time the function is called is stored, so if it is used for another purpose as it is, the value will be destroyed and normal operation cannot be guaranteed. Therefore, if the value of the register is processed or saved in another unused general-purpose register or stack in advance, it can be used for another purpose.

【0020】(B)は、関数処理途中の汎用レジスタの
使用情況を示す。斜線で網掛けされているR1からR3
(2から4)は、計算途中の値などを一時的に保持する
ために使われている。(A)の場合と同様に、レジスタ
の値を処理してしまうか、あるいは予め未使用の別の汎
用レジスタやスタック等に退避すれば、別の用途に使用
できる。
FIG. 3B shows the usage status of the general-purpose register during function processing. R1 to R3 shaded with diagonal lines
(2 to 4) are used to temporarily hold values during calculation and the like. As in the case of (A), if the value of the register is processed or saved in another unused general-purpose register or stack in advance, it can be used for another purpose.

【0021】(C)は、関数戻り直前時の汎用レジスタ
の使用状態を示す。縦線で網掛けされているR0(1)
は、関数からの戻り値を格納するものであるが、戻り値
は、関数の終了直前に格納すればいいので、それまで
は、別の用途に使用する事が出来る。このことにより、
タスク切換えの際に必要なレジスタ退避・復帰の処理の
高速化を図ることができ、また使用を制限した汎用レジ
スタをリアルタイムモニタの別の用途に用いることによ
って、処理の簡略化を図ることができる。
FIG. 2C shows the use state of the general-purpose register immediately before the function returns. R0 (1) shaded by a vertical line
Stores the return value from the function. Since the return value may be stored immediately before the end of the function, it can be used for another purpose until then. This allows
It is possible to speed up the process of saving and restoring registers necessary for task switching, and to simplify the process by using general-purpose registers whose use is restricted for other purposes of the real-time monitor. .

【0022】一般的にマルチタスク処理を行うシステム
では、複数のタスクが存在し、それぞれの処理を行う。
その処理をそれぞれ進めており、その為にタスクを切り
替えている。そのタスク切換えの都度、レジスタの退避
・復帰を行う。図2の左側は、従来方法である一般的な
レジスタ退避・復帰の場合であり、汎用レジスタR0か
らR14(17から31)の汎用レジスタ15本をスタ
ック(32)に退避させている。右側は、今回の発明の
場合のレジスタ退避・復帰の場合の例であり、汎用レジ
スタR0からR7(33から40)の汎用レジスタ8本
をスタック(41)に退避させている。退避・復帰する
汎用レジスタ数が本発明である右側のほうが約半数とな
り、明らかに退避・復帰処理時間がほぼ半減できる。
Generally, in a system that performs multitask processing, there are a plurality of tasks, and each processing is performed.
Each process is being advanced, and tasks are switched for that purpose. Each time the task is switched, the register is saved and restored. The left side of FIG. 2 shows a case of general register saving / restoring, which is a conventional method, in which 15 general registers R0 to R14 (17 to 31) are saved in a stack (32). The right side shows an example of register save / restore in the present invention, in which eight general registers R0 to R7 (33 to 40) are saved in a stack (41). The number of general-purpose registers to be saved and restored is about half on the right side according to the present invention, and the saving and restoring processing time can be obviously reduced by almost half.

【0023】次に、レジスタ退避・復帰処理について、
説明する。前述のように、マルチタスクシステムにおい
ては、複数のタスクを有し、タスクを切り替えながら、
それぞれのタスクの行うべき処理を進めている。タスク
を切り替える場合に、タスクが再開できるように、切り
替える直前の状態を保持しておく必要がある。それがレ
ジスタの退避により行われる。また、次に起動するタス
クの準備として、保持されていた状態をCPUに復帰さ
せる必要がある。それがレジスタの復帰により行われ
る。
Next, regarding the register save / restore processing,
explain. As described above, a multitask system has a plurality of tasks, and while switching tasks,
Processing to be performed for each task is in progress. When switching tasks, it is necessary to maintain the state immediately before switching so that the task can be restarted. This is done by saving the register. In addition, it is necessary to return the held state to the CPU in preparation for the task to be started next. That is done by restoring the register.

【0024】さらに、レジスタ退避・復帰処理の処理の
流れについて、説明する。レジスタ退避とレジスタ復帰
は、ほぼ同様の処理となるので、レジスタ退避処理につ
いて説明する。レジスタ退避処理を行う前に、割込み禁
止処理を行うのが通常の処理である。しかし、割込み禁
止処理において、汎用レジスタを使用する場合があり、
その場合は、割込み禁止処理で用いられる汎用レジスタ
の退避をしないと、使用される汎用レジスタのないよう
が破壊される。
Next, the flow of the register save / restore process will be described. Since register save and register return are almost the same processing, the register save processing will be described. Normal processing is to perform interrupt prohibition processing before performing register saving processing. However, general-purpose registers may be used in interrupt prohibition processing.
In this case, unless the general-purpose registers used in the interrupt prohibiting process are saved, the general-purpose registers used are destroyed.

【0025】ここで、図3を用いて、レジスタ退避処理
を説明する。まず、タスクがCPUの使用権を放棄し、
制御がモニターに渡る(42)。割込み禁止処理で用い
る汎用レジスタの退避(43)を行う。次に、割込み禁
止する直前の状態レジスタの退避を行う(44)。その
上で、割込み禁止処理を行う(45)。そして、残りの
汎用レジスタの退避を行う(46)。
Here, the register save processing will be described with reference to FIG. First, the task relinquishes CPU usage,
Control passes to the monitor (42). The general-purpose registers used in the interrupt prohibition processing are saved (43). Next, the status register immediately before interrupt prohibition is saved (44). Then, an interrupt prohibition process is performed (45). Then, the remaining general-purpose registers are saved (46).

【0026】その次に、(44)で退避した状態レジス
タを復帰し(47)、最後に割込み許可処理を行い(4
8)、レジスタ退避処理を終了する。そして、次に起動
するタスクの検索を行い、検索されると、そのタスクの
起動準備として、レジスタ復帰処理を行う(49)。そ
して最後にモニタからCPUの使用権が次のタスクに渡
されて、次のタスクが起動される(50)。
Then, the status register saved in (44) is restored (47), and finally, interrupt permission processing is performed (4).
8), the register save processing ends. Then, a task to be started next is searched, and when the task is searched, register return processing is performed in preparation for starting the task (49). Finally, the right to use the CPU is passed from the monitor to the next task, and the next task is started (50).

【0027】前述の「リアルタイムモニタの別の用途に
用いることによって」の記述における別の用途を割込み
禁止処理に用いた例が図4である。まず、割込み禁止処
理について説明する。割込み禁止処理は、タスク切換え
の際のレジスタの退避・復帰処理の前に割込みを禁止す
ることによって、割込みによるレジスタの値の破壊を防
ぐために必要な処理である。この例では、割込み禁止処
理に汎用レジスタR0〜R3を用いるとする。しかし、
レジスタを退避する前に、この割込み禁止処理をする
と、汎用レジスタR0〜R3が使用され、退避する前
に、レジスタの値が破壊されてしまう。そこで、この割
込み処理で使用する汎用レジスタをR0〜R3の代用と
して、使用を制限しているR8〜R11(55〜58)
を用いることによって、そのレジスタの値の破壊を防ぐ
ことができる。これは、使用する汎用レジスタを制限し
たことによる別の効果である。
FIG. 4 shows an example in which another use in the above description "by using another use of the real-time monitor" is used for interrupt prohibition processing. First, the interrupt prohibition processing will be described. The interrupt prohibition process is a process necessary to prevent the destruction of the register value due to the interrupt by prohibiting the interrupt before the save / restore process of the register at the time of task switching. In this example, it is assumed that general-purpose registers R0 to R3 are used for the interrupt prohibition processing. But,
If this interrupt prohibition processing is performed before saving the register, the general-purpose registers R0 to R3 are used, and the value of the register is destroyed before saving. Therefore, the general-purpose registers used in the interrupt processing are substituted for R0 to R3, and the use is restricted to R8 to R11 (55 to 58).
, The value of the register can be prevented from being destroyed. This is another effect of limiting the general-purpose registers to be used.

【0028】また、前述の「リアルタイムモニタの別の
用途に用いることによって」の記述における別の用途を
割込み禁止処理における割込みマスクの保持に用いた例
が図5である。まず、割込み禁止処理における割込みマ
スクの保持について説明する。割込み禁止処理は、状態
レジスタの割込み優先度ビットをマスクすることによっ
て行う。よって、マスクされる前の状態を何らかの方法
にて、保持しておき、割込み許可処理において、復帰さ
せる必要がある。そこで、割込み禁止処理される直前の
状態レジスタを使用制限しているR9(64)に退避す
ることによって、そのレジスタの値の破壊を防ぐことが
できる。これは、使用する汎用レジスタを制限したこと
による別の効果である。
FIG. 5 shows an example in which another use in the above description "by using the real-time monitor for another use" is used to hold an interrupt mask in interrupt prohibition processing. First, the holding of the interrupt mask in the interrupt prohibition process will be described. The interrupt disabling process is performed by masking the interrupt priority bit of the status register. Therefore, it is necessary to hold the state before being masked by some method and to return in the interrupt permission processing. Therefore, the status register immediately before the interrupt prohibition process is saved to R9 (64) which restricts the use, so that the value of the register can be prevented from being destroyed. This is another effect of limiting the general-purpose registers to be used.

【0029】[0029]

【発明の効果】以上のように本発明によれば、レジスタ
退避・復帰処理を軽減させることにより、リアルタイム
モニタのオーバーヘッドを軽減し、システムのパフォー
マンスを向上できる。
As described above, according to the present invention, the overhead of the real-time monitor can be reduced and the system performance can be improved by reducing the register save / restore processing.

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

【図1】本発明の一実施の形態におけるCPUの有する
汎用レジスタに明確な用途例を示した図
FIG. 1 is a diagram showing a clear example of use of general-purpose registers of a CPU according to an embodiment of the present invention;

【図2】本発明の一実施の形態におけるCPUの有する
汎用レジスタとスタック間におけるレジスタ退避・復帰
処理の説明図
FIG. 2 is an explanatory diagram of register save / restore processing between a general-purpose register and a stack of a CPU according to an embodiment of the present invention;

【図3】本発明の一実施の形態におけるレジスタ退避・
復帰処理のフローチャート
FIG. 3 shows a register save / restore operation in one embodiment of the present invention.
Flowchart of return processing

【図4】本発明の一実施の形態における割込み禁止処理
における汎用レジスタの使用状況説明図
FIG. 4 is an explanatory diagram of a usage state of general-purpose registers in interrupt prohibition processing according to the embodiment of the present invention;

【図5】本発明の一実施の形態における割込み禁止処理
における割込みマスク(状態レジスタ)の保存を行って
いる説明図
FIG. 5 is an explanatory diagram showing how an interrupt mask (status register) is stored in an interrupt prohibiting process according to the embodiment of the present invention;

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

1,17,33,66 汎用レジスタ(R0) 2,18,34,67 汎用レジスタ(R1) 3,19,35,68 汎用レジスタ(R2) 4,20,36,69 汎用レジスタ(R3) 5,21,37,51,60 汎用レジスタ(R4) 6,22,38,52,61 汎用レジスタ(R5) 7,23,39,53,62 汎用レジスタ(R6) 8,24,40,54,63 汎用レジスタ(R7) 9,25,55 汎用レジスタ(R8) 10,26,56,64 汎用レジスタ(R9) 11,27,57 汎用レジスタ(R10) 12,28,58 汎用レジスタ(R11) 13,29 汎用レジスタ(R12) 14,30 汎用レジスタ(R13) 15,31 汎用レジスタ(R14) 16 汎用レジスタ(R15) 1, 17, 33, 66 General-purpose register (R0) 2, 18, 34, 67 General-purpose register (R1) 3, 19, 35, 68 General-purpose register (R2) 4, 20, 36, 69 General-purpose register (R3) 5, 21, 37, 51, 60 General purpose register (R4) 6, 22, 38, 52, 61 General purpose register (R5) 7, 23, 39, 53, 62 General purpose register (R6) 8, 24, 40, 54, 63 General purpose Register (R7) 9, 25, 55 General-purpose register (R8) 10, 26, 56, 64 General-purpose register (R9) 11, 27, 57 General-purpose register (R10) 12, 28, 58 General-purpose register (R11) 13, 29 General-purpose Register (R12) 14,30 General-purpose register (R13) 15,31 General-purpose register (R14) 16 General-purpose register (R15)

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】マルチタスクシステムにおいて、汎用レジ
スタを複数有するCPUを使用する場合に、タスクで使
用する汎用レジスタを複数の用途に用いて汎用レジスタ
を一部制限し使用することを特徴とするリアルタイムモ
ニタ。
In a multi-task system, when a CPU having a plurality of general-purpose registers is used, the general-purpose registers used in the task are used for a plurality of purposes, and the general-purpose registers are partially used. monitor.
【請求項2】タスクで使用しない汎用レジスタを割込み
禁止処理に用いることを特徴とする請求項1記載のリア
ルタイムモニタ。
2. The real-time monitor according to claim 1, wherein a general-purpose register not used in the task is used for interrupt disabling processing.
【請求項3】タスクで使用しない汎用レジスタを割込み
禁止処理以前の状態レジスタの一時退避に用いることを
特徴とする請求項1記載のリアルタイムモニタ。
3. The real-time monitor according to claim 1, wherein a general-purpose register not used in the task is used for temporarily saving the status register before the interrupt disable processing.
JP32949899A 1999-11-19 1999-11-19 Real time monitor Pending JP2001147822A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP32949899A JP2001147822A (en) 1999-11-19 1999-11-19 Real time monitor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP32949899A JP2001147822A (en) 1999-11-19 1999-11-19 Real time monitor

Publications (1)

Publication Number Publication Date
JP2001147822A true JP2001147822A (en) 2001-05-29

Family

ID=18222053

Family Applications (1)

Application Number Title Priority Date Filing Date
JP32949899A Pending JP2001147822A (en) 1999-11-19 1999-11-19 Real time monitor

Country Status (1)

Country Link
JP (1) JP2001147822A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008269474A (en) * 2007-04-24 2008-11-06 Toshiba Corp Information processor and access control method
JP2017039057A (en) * 2016-12-02 2017-02-23 株式会社ソフイア Game machine
JP2017077481A (en) * 2016-11-25 2017-04-27 株式会社ソフイア Game machine

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008269474A (en) * 2007-04-24 2008-11-06 Toshiba Corp Information processor and access control method
JP2017077481A (en) * 2016-11-25 2017-04-27 株式会社ソフイア Game machine
JP2017039057A (en) * 2016-12-02 2017-02-23 株式会社ソフイア Game machine

Similar Documents

Publication Publication Date Title
JP3600095B2 (en) Interrupt management device and interrupt management method
US5414864A (en) Method for selectively saving/restoring first registers and bypassing second registers in register units based on individual lock/unlock status thereof
JP2655615B2 (en) Information processing device
KR960035262A (en) Method and apparatus for selective control of interrupt wait in data processing system
JP3970609B2 (en) Processor system
JP2001147822A (en) Real time monitor
SE9803632D0 (en) A processor
JP2636722B2 (en) Multitask execution management method
JPH04241032A (en) System call execution device
JPH0414376B2 (en)
JPH10247161A (en) Memory management system
JP2000132409A (en) Stack sharing system for task having no wait state
JP2008225710A (en) Computer system and process-switching method used in the system
JPH10340228A (en) Microprocessor
JP2002073350A (en) Interruption control device and method for controlling interruption
WO2005085994A2 (en) Multi-tasking data processing system
JPH03172937A (en) Asynchronous event processing handling device
JPH11353193A (en) Multiprogramming execution control method
JPH04264625A (en) Register control system
JPH03201138A (en) Method for controlling stack pointer
JPH02239360A (en) System for controlling task execution time
JPH04155532A (en) Task switching system
JP2000293383A (en) Task switching device
JPH04195225A (en) Information processor
JPH0394362A (en) Process switching system considering co-processor using state