JPH03148735A - Memory managing device - Google Patents

Memory managing device

Info

Publication number
JPH03148735A
JPH03148735A JP1288411A JP28841189A JPH03148735A JP H03148735 A JPH03148735 A JP H03148735A JP 1288411 A JP1288411 A JP 1288411A JP 28841189 A JP28841189 A JP 28841189A JP H03148735 A JPH03148735 A JP H03148735A
Authority
JP
Japan
Prior art keywords
mode
memory protection
protection exception
cpu
privileged mode
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.)
Granted
Application number
JP1288411A
Other languages
Japanese (ja)
Other versions
JP2936603B2 (en
Inventor
Shigeru Kawamata
川又 滋
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 JP1288411A priority Critical patent/JP2936603B2/en
Publication of JPH03148735A publication Critical patent/JPH03148735A/en
Application granted granted Critical
Publication of JP2936603B2 publication Critical patent/JP2936603B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Abstract

PURPOSE:To reduce the overhead of an operating system (OS) by providing a mode unchanged flag on every specified area of a virtual space so that a memory protection exception processing can be executed while maintaining the traveling mode of a CPU at a non-priviledge mode when the flag shows a mode unchange. CONSTITUTION:On every specified area of the virtual space, the mode unchanged flag is provided to show whether the memory protection exception processing is executed by the priviledge mode or the non-priviledge mode of a CPU 5. When memory protection exception is detected by a memory protection exception detecting means 3, a mode unchanged flag deciding means 4 refers to the mode unchanged flag and when the memory protection exception processing in the non-priviledge mode is instructed, a mode unchanged informing signal 9 is formed of the CPU 5. Thus, since the CPU 5 executes the memory protection exception processing while maintaining the non-priviledge mode, when the traveling mode of the CPU is changed from the non-priviledge mode to the priviledge mode, the overhead of the OS can be reduced.

Description

【発明の詳細な説明】 (産業上の利用分野) 本発明はメモリ管理装置に関し、特に中央処理ユニット
c以下、CPUと略記する)の非特権モードで走行する
アプリケーションプログラム(以下、APと略記する)
が参照を許可されていない仮想空間を参照したときに不
正な参[(以下、メモリ保護例外という)が起こったこ
とを検出してあらかじめ設定されているアドレスにCP
Uの制御を移して特定の処理(以下、メモリ保護例外処
理という)を行わせるメモリ管理装置に関する。
DETAILED DESCRIPTION OF THE INVENTION (Industrial Application Field) The present invention relates to a memory management device, and particularly to an application program (hereinafter abbreviated as AP) running in a non-privileged mode of a central processing unit below (hereinafter abbreviated as CPU). )
Detects that an illegal reference (hereinafter referred to as a memory protection exception) has occurred when the user references a virtual space that is not allowed to reference, and sends the CP to a preset address.
The present invention relates to a memory management device that transfers control of U to perform specific processing (hereinafter referred to as memory protection exception processing).

〔従来の技術〕[Conventional technology]

従来、この種のメモリ管理装置は、CPUの非特権モー
ドで走行するAPによるメモリ保護例外が検出されたと
きにCPUにメモリ保護例外の発生を通知しており、C
PUは、この通知を受けて走行モードを非特権モードか
ら特権モードに切り換えた後に、あらかじめ設定されて
いるアドレスにallmを移してメモリ保護例外処理を
実行していた。
Conventionally, this type of memory management device notifies the CPU of the occurrence of a memory protection exception when a memory protection exception caused by an AP running in a non-privileged mode of the CPU is detected.
Upon receiving this notification, the PU switched the running mode from non-privileged mode to privileged mode, moved allm to a preset address, and executed memory protection exception handling.

このように、メモリ保護例外の発生時にCPUの走行モ
ードを非特権コードから特権モードに切り換えるのは、
メモリ保護例外が発生するのは、通常、APが本来参照
してはいはないアドレスを参照した場合であるので、こ
れを検出および処理するのはオペレーティングシステム
(以下、OSと略記する)の役割だからである。
In this way, switching the CPU running mode from non-privileged code to privileged mode when a memory protection exception occurs is as follows:
Memory protection exceptions usually occur when the AP refers to an address that it should not originally refer to, so it is the responsibility of the operating system (hereinafter abbreviated as OS) to detect and handle this. It is.

ところで、OSでは、一般に、複数のAPが自分の仮想
空間に同一の911111空間を割り付けてその物理空
間を共有する手段を提供している。このようなOSにお
いて、あるAPIおよびAP2が物理空間を共有してい
る場合に、APIが同一の物理空間を割り付けられてい
る仮想空間に、例えば書込みを行ったことをAP2が検
出できる仕組みを実現しようとすると、APIの同一の
物理空間を割り付けられている仮想空間に対する書込み
の参R1i権をあらかじめなくしておき、メモリ保Wi
例外が発生したときに書込みが起こったことをOSから
AP2に通知するという手続きが必要であった。
By the way, the OS generally provides a means for multiple APs to allocate the same 911111 space to their own virtual space and share the physical space. In such an OS, when a certain API and AP2 share a physical space, a mechanism is realized in which AP2 can detect, for example, that an API has written to a virtual space to which the same physical space is allocated. If you try to do this, first remove the R1i right to write to the virtual space that is allocated to the same physical space of the API, and then
When an exception occurs, a procedure is required in which the OS notifies the AP 2 that writing has occurred.

詳しくは、従来のメモリ管理装置を使った場合、API
の同一の物理空間を割り付けられている仮想空間および
AP2の同一の物理空間を割り付けられている仮想空間
のページテーブル中にある書込み可能かどうかを示すペ
ージ参照権フラグを落として(オフして)おき、API
およびAP2のどちらかが−一の物理空間を割り付けら
れている仮想空間の書込みを行った際に発生したメモリ
保護例外をメモリ保護例外処理の中でもう一方のAPに
知らせるようにしていた。
For details, when using a conventional memory management device, the API
Drop (turn off) the page reference flag indicating whether writing is possible in the page table of the virtual space to which the same physical space of AP2 is allocated and the virtual space to which the same physical space of AP2 is allocated. Ok, API
A memory protection exception that occurs when one of AP2 and AP2 writes in a virtual space to which the physical space of -1 is allocated is notified to the other AP during memory protection exception processing.

しかし、ページ参照権フラグをあえて落としである仮想
空間への書込みは本来は正当な書込み(不正な領域への
書込みではない)であり、書込みの頻度も高い、したが
って、このような処理をするためだけにメモリ保護例外
の発生時にCPUの走行モードを非特権モードから特権
モードへと切り換えていたのでは、APIが同一の物理
空間に割り付けられた仮想空間を参照するたびにCPU
の走行モードを切り換えるという操作が必要となるばか
りでなく、メモリ保護例外処理の終了時に再びCPUの
走行モードを特権モードから非特権モードに切り換えな
ければならないので、OSのオーバヘッドが高くなって
しまう。
However, writing to the virtual space by intentionally dropping the page reference flag is originally a legitimate write (not a write to an invalid area), and the frequency of writing is high. However, if the CPU running mode was switched from non-privileged mode to privileged mode when a memory protection exception occurred, every time the API references a virtual space allocated to the same physical space, the CPU
Not only is it necessary to switch the running mode of the CPU, but also the running mode of the CPU must be switched from privileged mode to non-privileged mode again at the end of memory protection exception handling, which increases the overhead of the OS.

〔発明が解決しようとする課題〕[Problem to be solved by the invention]

上述した従来のメモリ管理装置では、メモリ保護例外が
発生するたびにCPUの走行モードを非特権そードから
特権モードに切り換えていたので、CPUの走行モード
の非特権モードから特権モードへの切換えによるOSの
オーバヘフトが太きくなるとともに、CPUの走行モー
ドを特権モードから非特権モードに戻すための切換えも
必要になり、そのためのOSのオーバヘッドも大きくな
るという欠点がある。
In the conventional memory management device described above, the CPU running mode was switched from non-privileged mode to privileged mode every time a memory protection exception occurred. This increases the overhead of the OS, and it also becomes necessary to switch the running mode of the CPU from privileged mode back to non-privileged mode, which also increases the overhead of the OS.

本発明の目的は、上述の点に鑑み、仮想空間の特定の領
域ごとにモード不変更フラグを設けてメモリ保護例外の
発生時にモード不変更フラグがモード不変更を示してい
るかどうかを判定し、モード不変更を示している場合に
はCPUの走行モードが非特権モードのままメモリ保護
例外処理を行うようにしたメモリ管理装置を提供するこ
とにある。
In view of the above-mentioned points, an object of the present invention is to provide a mode unchanged flag for each specific area of a virtual space, and determine whether the mode unchanged flag indicates mode unchanged when a memory protection exception occurs. An object of the present invention is to provide a memory management device which performs memory protection exception handling while the running mode of a CPU remains in a non-privileged mode when the mode is not changed.

〔課題を解決するための手段} 本発明のメモリ管理装置は、記憶装置の物理アドレスを
CPUが認識するアドレス空間である仮想空間に割り付
けるアドレス変換機構を有し、CPUの非特権モードで
走行するアプリケーションプログラムが参照を許可され
ていない仮想空間を参照したときにメモリ保護例外が発
生したことをメモリ保護例外検出手段が検出してあらか
じめ設定されているアドレスにCPUの制御を移してメ
モリ保護例外処理を行わせるメモリ管理装置において、
仮想空間の特定の領域ごとにCPUの特権モードおよび
非特権モードのいずれでメモリ保護例外処理を実行する
かを示すモード不変更フラグと、前記メモリ保護例外検
出手段によりメモリ保護例外が検出されたときに前記モ
ード不変更フラグを参照して非特権モードでのメモリ保
護例外処理が指示されていればCPUの非特権モードか
ら特権モードへの切換えを抑制させるモード不変更フラ
グ判定手段とを有する。
[Means for Solving the Problems] The memory management device of the present invention has an address translation mechanism that allocates a physical address of a storage device to a virtual space that is an address space recognized by a CPU, and runs in a non-privileged mode of the CPU. A memory protection exception detection means detects that a memory protection exception occurs when an application program references a virtual space that is not permitted to reference, and transfers CPU control to a preset address to handle the memory protection exception. In a memory management device that performs
A mode unchanged flag indicating whether memory protection exception handling is to be executed in privileged mode or non-privileged mode of the CPU for each specific area of the virtual space, and when a memory protection exception is detected by the memory protection exception detection means. and a mode unchanged flag determination means that refers to the mode unchanged flag and suppresses switching of the CPU from the non-privileged mode to the privileged mode if memory protection exception handling in the non-privileged mode is instructed.

〔作用〕[Effect]

本発明のメモリ管理装置では、モード不変更フラグが仮
想空間の特定の領域ごとにCPUの特権モードおよび非
特権モードのいずれでメモリ保護例外処理を実行するか
を示し、モード不変更フラグ判定手段がメモリ保護例外
検出手段によりメモリ保護例外が検出されたときにモー
ド不変更フラグを参照して非特権モードでのメモリ保護
例外処理が指示されていればCPUの非特権モードから
特権モードへの切換えを抑制させる。
In the memory management device of the present invention, the mode unchanged flag indicates whether memory protection exception handling is to be executed in a privileged mode or a non-privileged mode of the CPU for each specific area of the virtual space, and the mode unchanged flag determination means When a memory protection exception is detected by the memory protection exception detection means, the mode unchanged flag is referenced and if memory protection exception handling in non-privileged mode is instructed, the CPU is switched from non-privileged mode to privileged mode. suppress.

〔実施例〕〔Example〕

次に、本発明について図面を参照して詳細に説明する。 Next, the present invention will be explained in detail with reference to the drawings.

第1図は、本発明の一実施例に係るメモリ管理装置の構
成を示すブロック図である。本実施例のメモリ管理装置
1は、アドレス変換機構2と、メモリ保護例外検出手段
3と、モード不変更フラグ判定手段4とを含んで構成さ
れている。
FIG. 1 is a block diagram showing the configuration of a memory management device according to an embodiment of the present invention. The memory management device 1 of this embodiment includes an address translation mechanism 2, a memory protection exception detection means 3, and a mode unchanged flag determination means 4.

アドレス変換11tizは、CPU5から出力される仮
想アドレス6を物理アドレスフに変換する。
The address conversion 11tiz converts the virtual address 6 output from the CPU 5 into a physical address.

メモリ保護例外検出手段3は、アドレス変aa構2にお
けるメモリ保護例外の発生を監視し、メモリ保護例外が
検出されたときにメモリ保護例外通知信号8をCPU5
に通知する。
The memory protection exception detection means 3 monitors the occurrence of a memory protection exception in the address change aa structure 2, and sends a memory protection exception notification signal 8 to the CPU 5 when a memory protection exception is detected.
to notify.

モード不変更フラグ判定手段4は、メモリ保護例外検出
手段3によるメモリ保護例外の検出時にアドレス変換機
構2におけるモード不変更フラグ11a(第2図参照)
を参照して、モード不変更フラグllaがオンのとき(
非特権モードでのメモリ保護例外処理が指示されている
とき)には、CPUSにモード不変更通知信号9を通知
する。
The mode unchanged flag determination means 4 detects the mode unchanged flag 11a (see FIG. 2) in the address translation mechanism 2 when the memory protection exception detection means 3 detects a memory protection exception.
Refer to , when the mode unchanged flag lla is on (
(When memory protection exception processing in non-privileged mode is instructed), a mode unchanged notification signal 9 is notified to the CPU.

CPUSは、メモリ保護例外通知信号8を受けたが、モ
ード不変更通知信号9を受けなかったときには、走行モ
ードを非特権モードから特権モードに切り換え、あらか
じめ設定されたアドレスに制御を移してメモリ保護例外
処理を特権モードで実行する。また、cpusは、モー
ド不変更通知信号9を受けたときには、メモリ保護例外
通知信号8を受けたにもかかわらず、走行モードの非特
権モードから特権モードへの切換えを抑制し、あらかじ
め設定されたアドレスにWA御を移してメモリ保護例外
処理を非特権モードで実行する。
When the CPU receives the memory protection exception notification signal 8 but does not receive the mode no change notification signal 9, it switches the running mode from the non-privileged mode to the privileged mode, transfers control to a preset address, and protects the memory. Execute exception handling in privileged mode. Furthermore, when the CPU receives the mode no change notification signal 9, it suppresses the switching of the running mode from the non-privileged mode to the privileged mode despite receiving the memory protection exception notification signal 8, and Transfers WA control to the address and executes memory protection exception handling in non-privileged mode.

第2図は、アドレス変換機構2によるアドレス変換の概
要を説明するための図である。アドレス変換機構2では
、仮想アドレス6を物理アドレスフに変換するためにエ
リアテーブル10−およびページテーブル20を使用し
ており、仮想アドレス6を分解した値を用いてエリアテ
ーブル1Gとページテーブル20とを参照している。す
なわち、アドレス変換機構2は、仮想アドレス6を、エ
リアテーブルエントリ決定フィールド6a、ページテー
ブルエントリ決定フィールド6bおよびページ内オフセ
ット決定フィールド6cのように分解して認識する。
FIG. 2 is a diagram for explaining an overview of address translation by the address translation mechanism 2. As shown in FIG. Address conversion mechanism 2 uses area table 10- and page table 20 to convert virtual address 6 to physical address, and converts area table 1G and page table 20 using the decomposed values of virtual address 6. is referring to. That is, the address translation mechanism 2 recognizes the virtual address 6 by decomposing it into an area table entry determination field 6a, a page table entry determination field 6b, and an intra-page offset determination field 6c.

エリアテーブルlOは、複数のエリアテーブルエントリ
11から構成されており、仮想アドレス6のエリアテー
ブルエントリ決定フィールド6aの値によって1つのエ
リアテーブルエントリ11が指示される、     エリアテーブルエントリ11には、メモリ保護例外が発
生したときにメモリ保護例外処理をCPU5の特権モー
ドで行うか非特権モードで行うかを示すモード不変更フ
ラグllaが設けられている。
The area table IO is composed of a plurality of area table entries 11, and one area table entry 11 is designated by the value of the area table entry determination field 6a of the virtual address 6. A mode unchanged flag lla is provided which indicates whether memory protection exception handling is to be performed in the privileged mode or non-privileged mode of the CPU 5 when an exception occurs.

ページテーブル20は、複数のページテーブルエントリ
21から構成されており、仮想アドレス6のページテー
ブルエントリ決定フィールド6bの値によって1つのペ
ージテーブルエントリ21が指示される。
The page table 20 is composed of a plurality of page table entries 21, and one page table entry 21 is designated by the value of the page table entry determination field 6b of the virtual address 6.

ページテーブルエントリ21には、物理空間40上の物
理ページ41への参照が可能かどうかを示すページ参照
権フラグ21aが設けられている。
The page table entry 21 is provided with a page reference right flag 21a that indicates whether or not the physical page 41 in the physical space 40 can be referenced.

第2図の例では、ページ参照権フラグ21aとして読出
し、書込みおよび実行の3つのフラグが設けられている
In the example of FIG. 2, three flags, read, write, and execute, are provided as the page reference flag 21a.

次記、このように構成された本実施例のメモリ管理装置
の動作について説明する。
Next, the operation of the memory management device of this embodiment configured as described above will be explained.

あるAPが仮想空間の参照を許可されている(ページ参
照権フラグ12がオンしている)ページの仮想アドレス
6を参照した場合には、CPUSから出力された仮想ア
ドレス6は、メモリ管理装wllのアドレス変換機構2
により物理アドレス内にアドレス変換される。
When a certain AP refers to the virtual address 6 of a page that is allowed to refer to the virtual space (the page reference flag 12 is on), the virtual address 6 output from the CPU is address translation mechanism 2
The address is translated into a physical address by

詳しくは、アドレス変換機構2は、まず仮想アドレス6
のエリアテーブルエントリ決定フィールド6aを使用し
て、エリアテーブル10中の1つのエリアテーブルエン
トリ11を選ぶ、次に、アドレス変!負機構2は、選ん
だエリアテーブルエントリll中のページテーブル20
のアドレスと仮想アドレス6のページテーブルエントリ
決定フィールド6bとを使用して、ページテーブル20
中の1つのページテーブルエントリ21を選ぶ、最後に
、アドレス変換機構2は、選んだページテーブルエント
リ21中の物理アドレス内の物理ページ41の番号と仮
想アドレス6のページ内オフセット決定フィールド6C
とを使用して、物理空間40のIkTlベージ41中の
物理アドレス内を決定する。
Specifically, the address translation mechanism 2 first converts the virtual address 6
Select one area table entry 11 in the area table 10 using the area table entry determination field 6a of the address change! The negative mechanism 2 is the page table 20 in the selected area table entry ll.
, and the page table entry determination field 6b of the virtual address 6.
Finally, the address translation mechanism 2 selects one of the page table entries 21 in the selected page table entry 21, and calculates the number of the physical page 41 in the physical address in the selected page table entry 21 and the intra-page offset determination field 6C of the virtual address 6.
is used to determine the physical address in the IkTl page 41 of the physical space 40.

アドレス変換機構2によりcpusから出力された仮想
アドレス6がアドレス変換されている最中に、メモリ保
護例外検出手段3は、ベージテーブルエントリ21のペ
ージ参照権フラグ21aを参照して正当な仮想アドレス
6かどうかをチェフクする。正当な仮想アドレス6の場
合には、アドレス変換機構2は、物理アドレス内を出力
する。
While the address translation mechanism 2 is converting the virtual address 6 output from the CPU, the memory protection exception detection means 3 refers to the page reference right flag 21a of the page table entry 21 to determine which virtual address 6 is valid. Check whether or not. If the virtual address 6 is valid, the address translation mechanism 2 outputs the physical address.

この結果、記憶装置の物理メモリの参照が行われる。As a result, the physical memory of the storage device is referenced.

一方、あるAPが仮想空間の参照を許可されていない(
ページ参照権フラグ21aがオンでない)ページの仮想
アドレス6を参照した場合には、アドレス変換機構2に
よりCILJ5から出力された仮想アドレス6をアドレ
ス変換している最中に、メモリ保護例外検出手段3は、
ページテーブルエントリ21のページ参照権フラグ21
aを参照して正当な仮想アドレス6かどうかをチェック
して、参照が許可されていない不正な仮想アドレス6で
あるので、メモリ保護例外の発生を検出して、CPU5
にメモリ保護例外通知信号8を出力する。
On the other hand, a certain AP is not allowed to reference the virtual space (
When the virtual address 6 of a page (the page reference right flag 21a is not on) is referenced, the memory protection exception detection means 3 teeth,
Page reference right flag 21 of page table entry 21
A is referenced to check whether it is a valid virtual address 6, and since it is an invalid virtual address 6 that is not allowed to be referenced, it is detected that a memory protection exception has occurred, and the CPU 5
A memory protection exception notification signal 8 is output to the memory protection exception notification signal 8.

また、メモリ保護例外検出手段3によりメモリ保護例外
の発生が検出された場合には、モード不変更フラグ判定
手段4は、エリアテーブルエンドリ l lのモード不
変更フラグttaを参照してCPU5の走行モードを非
特権モードから特権モードに切り換えるかどうかを決定
し、CPU5の走行モードの切換えが指示されていると
きにはCPU5にモード不変更通知信号9を出力しない
、このため、cpusは、メモリ保護例外通知13号8
を受けて走行モードを非特権モードから特権モードに切
り換えた後に、あらかじめ設定されているアドレスに制
御を移して特権モードでメモリ保護例外処理を実行する
Further, when the memory protection exception detection means 3 detects the occurrence of a memory protection exception, the mode unchanged flag determination means 4 refers to the mode unchanged flag tta of the area table end entry l l and determines the running mode of the CPU 5. The CPU determines whether to switch from a non-privileged mode to a privileged mode, and does not output a mode change notification signal 9 to the CPU 5 when switching the running mode of the CPU 5 is instructed. Therefore, the CPU sends a memory protection exception notification 13 No. 8
In response to this, the running mode is switched from non-privileged mode to privileged mode, and then control is transferred to a preset address and memory protection exception handling is executed in privileged mode.

他方、エリアテーブルエントリ11のモード不変更フラ
グllaを参照してCPLJ5の走行モードの切換えが
指示されていないときには、モード不変更フラグ判定手
段4は、cpusにモード不変更通知信号9を出力する
。このため、cpusは、メモリ保護例外通知信号8を
受けたにもかかわらず、走行モードを変更せずにあらか
じめ設定されているアドレスに制御を移して非特権モー
ドでメモリ保護例外処理を実行する。
On the other hand, when switching the driving mode of the CPLJ 5 is not instructed by referring to the mode unchanged flag lla of the area table entry 11, the mode unchanged flag determining means 4 outputs a mode unchanged notification signal 9 to the CPU. Therefore, despite receiving the memory protection exception notification signal 8, the CPU transfers control to a preset address without changing the running mode and executes memory protection exception handling in a non-privileged mode.

このように、非特権モードで走行しているAPがメモリ
保護例外を起こしたときには、モード不変更フラグll
aのオン/オフに応じて、選択的に非特権モードでメモ
リ保護例外処理を実行することができる。
In this way, when an AP running in unprivileged mode causes a memory protection exception, the mode unchanged flag ll
Memory protection exception handling can be selectively executed in non-privileged mode depending on whether a is turned on or off.

第3図を参照すると、APIおよびAP2は、同一の物
理空間32をそれぞれの仮想空間34および35に割り
付けている。ここで、例えばAPIとAP2とがお互い
に相手が仮想空間34または仮想空間35に書込みを行
ったことを検出する仕組みをOSが提供しようとしたと
する。
Referring to FIG. 3, API and AP2 allocate the same physical space 32 to their respective virtual spaces 34 and 35. For example, suppose that the OS attempts to provide a mechanism for the API and AP2 to detect that the other party has written to the virtual space 34 or the virtual space 35.

本実施例のメモリ管理装置lを使用した場合には、AP
Iの仮想空間31およびAI2の仮想空間33の通信領
域36および38に同一の物理空間37をそれぞれ割り
付けておき、対応するページテーブルエントリ21のペ
ージ参照権フラグ21aをオフしておき、対応するエリ
アテーブルエントリ11のモード不変更フラグl1mを
オンとしてお(,そして、例えばAPIが仮想空間34
に書込みを行った場合には、メモリ保護例外が検出され
るものの、cpusの走行モードの切換えは行われず、
メモリ保護例外処理が非特権モードで行われるので、そ
のメモリ保護例外処理の中で通1ε領域36にメモリ保
護例外が発生したことを  書いてお(,すると、AP
2は、自分が動作を始めたときに通信領域38を見るこ
とにより、APIが仮想空間34に書込みを行ったこと
を知ることができる。このように、APIの仮想空間3
4への書込み時にCPUSの走行モードの切換えが起こ
らないなめに、OSのオーバヘフトを最小限に抑えるこ
とができる。
When using the memory management device l of this embodiment, the AP
The same physical space 37 is allocated to the communication areas 36 and 38 of the virtual space 31 of I and the virtual space 33 of AI2, and the page reference right flag 21a of the corresponding page table entry 21 is turned off. If the mode unchanged flag l1m of table entry 11 is turned on (and, for example, if the API
When writing to , a memory protection exception is detected, but the CPU running mode is not switched.
Since memory protection exception handling is performed in non-privileged mode, write that a memory protection exception has occurred in the 1ε area 36 during the memory protection exception handling (then, the AP
2 can know that the API has written to the virtual space 34 by looking at the communication area 38 when it starts its operation. In this way, API virtual space 3
Since switching of the CPU running mode does not occur when writing to 4, OS overheft can be minimized.

なお、上記実施例では、モード不変更フラグllaを仮
想空間のエリア単位となるようにエリアテーブルエント
リ11に設けた場合について説明したが、モード不変更
フラグは仮想空間のページ単位となるようにページテー
ブルエントリ21中に設けるようにしても本発明が同様
に適用できることはいうまでもない。
In the above embodiment, the case where the mode unchanged flag lla is provided in the area table entry 11 for each area of the virtual space has been described, but the mode unchanged flag is set for each page of the virtual space. It goes without saying that the present invention can be similarly applied even if it is provided in the table entry 21.

〔発明の効果J 以上説明したように本発明は、仮想空間の特定の領域ご
とにモード不変更フラグを設けてメモリ保護例外の発生
時にモード不変更フラグ判定手段によりモード不変更で
あるかどうかを判定し、モード不変更の場合にはCPU
の走行モードを非特権モードのままメモリ保護例外処理
を行うようにしたことにより、CPUの走行モードの非
特権モードから特権モードへの変更に伴うOSのオーバ
ヘフトを削減することができるとともに、メモリ保護例
外処理の終了時にCPUの走行モードを特権モードから
非特権モードに戻すためのOSのオーバヘフトも削減す
ることができるという効果がある。
[Effect of the Invention J As explained above, the present invention provides a mode unchanged flag for each specific area of the virtual space, and when a memory protection exception occurs, the mode unchanged flag determining means determines whether the mode is unchanged. If the mode is unchanged, the CPU
By performing memory protection exception handling while keeping the running mode of the CPU in non-privileged mode, it is possible to reduce the OS overhead caused by changing the running mode of the CPU from non-privileged mode to privileged mode, and also to avoid memory protection. This has the effect that the overhead of the OS for returning the CPU running mode from the privileged mode to the non-privileged mode at the end of exception handling can also be reduced.

【図面の簡単な説明】[Brief explanation of the drawing]

  第1図は本発明の一実施例に係るメモリ管理装置の
構成を示すブロック図、 第2図は第1図中の7ドレス変換機構によるアドレス変
換を説明するための図、   −第3図は異なったAP
が同一の物理空間を共有している一例を示す図である。 図において、 l・・・メモリ管理装置、 2・・・アドレス変換機構、 3・・・メモリ保護例外検出手段、 4・・・モード不変更フラグ判定手段、5・・・cpu
。 6・・・仮想7ドレス、 6a・・エリアテーブルエントリ決定フィールド、 6b・・ページテーブルエントリ決定フィールド、 6C・・ページ内オフセント決定フィールド、7・・・
物理アドレス、 8・・・メモリ保護例外通知信号、 9・・・モード不変更通知信号、 lO・・エリアテーブル、 11・・エリアテーブルエントリ、 tta・モード不変更フラグ、 20・・ページテーブル、 21・・ページテーブルエントリ、 21a・ページ参照権フラグ、 40・・物理空間、 41・・物理ページである。
1 is a block diagram showing the configuration of a memory management device according to an embodiment of the present invention; FIG. 2 is a diagram for explaining address conversion by the 7-address conversion mechanism in FIG. 1; different AP
FIG. 3 is a diagram illustrating an example in which two devices share the same physical space. In the figure, l...Memory management device, 2...Address translation mechanism, 3...Memory protection exception detection means, 4...Mode unchanged flag determination means, 5...CPU
. 6...Virtual 7 dress, 6a...Area table entry determination field, 6b...Page table entry determination field, 6C...Intra-page offcent determination field, 7...
Physical address, 8...Memory protection exception notification signal, 9...Mode unchanged notification signal, lO...Area table, 11...Area table entry, tta-Mode unchanged flag, 20...Page table, 21 ...Page table entry, 21a.Page reference right flag, 40..Physical space, 41..Physical page.

Claims (1)

【特許請求の範囲】 記憶装置の物理アドレスをCPUが認識するアドレス空
間である仮想空間に割り付けるアドレス変換機構を有し
、CPUの非特権モードで走行するアプリケーションプ
ログラムが参照を許可されていない仮想空間を参照した
ときにメモリ保護例外検出手段がメモリ保護例外が発生
したことを検出してあらかじめ設定されているアドレス
にCPUの制御を移してメモリ保護例外処理を行わせる
メモリ管理装置において、 仮想空間の特定の領域ごとにCPUの特権モードおよび
非特権モードのいずれでメモリ保護例外処理を実行する
かを示すモード不変更フラグと、前記メモリ保護例外検
出手段によりメモリ保護例外が検出されたときに前記モ
ード不変更フラグを参照して非特権モードでのメモリ保
護例外処理が指示されていればCPUの非特権モードか
ら特権モードへの切換えを抑制させるモード不変更フラ
グ判定手段と を有することを特徴とするメモリ管理装置。
[Claims] A virtual space that has an address conversion mechanism that allocates the physical address of a storage device to a virtual space that is an address space recognized by the CPU, and that application programs running in the non-privileged mode of the CPU are not permitted to reference. In a memory management device, a memory protection exception detection means detects that a memory protection exception has occurred when a memory protection exception has occurred, and transfers control of the CPU to a preset address to perform memory protection exception handling. A mode unchanged flag indicating whether memory protection exception handling is to be executed in privileged mode or non-privileged mode of the CPU for each specific area, and a mode change flag indicating whether memory protection exception handling is to be executed in privileged mode or non-privileged mode of the CPU, and when a memory protection exception is detected by the memory protection exception detection means, the mode The present invention is characterized by comprising mode unchanged flag determining means that refers to the unchanged flag and suppresses switching of the CPU from the non-privileged mode to the privileged mode if memory protection exception handling in the non-privileged mode is instructed. Memory management device.
JP1288411A 1989-11-06 1989-11-06 Memory management device Expired - Lifetime JP2936603B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1288411A JP2936603B2 (en) 1989-11-06 1989-11-06 Memory management device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1288411A JP2936603B2 (en) 1989-11-06 1989-11-06 Memory management device

Publications (2)

Publication Number Publication Date
JPH03148735A true JPH03148735A (en) 1991-06-25
JP2936603B2 JP2936603B2 (en) 1999-08-23

Family

ID=17729863

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1288411A Expired - Lifetime JP2936603B2 (en) 1989-11-06 1989-11-06 Memory management device

Country Status (1)

Country Link
JP (1) JP2936603B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010044768A (en) * 2003-10-29 2010-02-25 Qualcomm Inc System for providing transitions between operating modes of device
JP2011008760A (en) * 2009-05-22 2011-01-13 Renesas Electronics Corp Microcomputer

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010044768A (en) * 2003-10-29 2010-02-25 Qualcomm Inc System for providing transitions between operating modes of device
JP2011008760A (en) * 2009-05-22 2011-01-13 Renesas Electronics Corp Microcomputer

Also Published As

Publication number Publication date
JP2936603B2 (en) 1999-08-23

Similar Documents

Publication Publication Date Title
JP3600095B2 (en) Interrupt management device and interrupt management method
JPH0619798A (en) Method and system for avoidance of loading of value of selector
WO2022037182A1 (en) Computer device, abnormality processing method and interrupt processing method
JPH05250183A (en) Microprocessor system and cpu interrupting method
JP2006302289A (en) Computing with both lock-step and free-step processor modes
JP3970609B2 (en) Processor system
Wiseman et al. Eliminating the threat of kernel stack overflows
JPH03148735A (en) Memory managing device
JPH05257808A (en) Microprocessor and its operation converting method
KR100928866B1 (en) Apparatus and method for running an application in a virtual environment
JPS6290728A (en) Interruption processing method
Wiseman et al. Safer Operating System for Vehicle Telematics
US20120054773A1 (en) Processor support for secure device driver architecture
JP3018336B2 (en) Information processing device
US20160350161A1 (en) Multiple processor modes execution method and apparatus including signal handling
JPS63282542A (en) Virtual space managing device
JPH02176946A (en) Program runaway detecting method
JPH06295265A (en) Instruction suspending information store control method in virtual storage control
JPS59111557A (en) Address converting device
JPH0659981A (en) Information processor
JPS62154166A (en) Microcomputer
JPH01211129A (en) Information processor
JPH045729A (en) Processor device
JPH02173828A (en) Interruption process system
JPH11134202A (en) Task switching device