JP2677458B2 - System call execution device - Google Patents

System call execution device

Info

Publication number
JP2677458B2
JP2677458B2 JP3007338A JP733891A JP2677458B2 JP 2677458 B2 JP2677458 B2 JP 2677458B2 JP 3007338 A JP3007338 A JP 3007338A JP 733891 A JP733891 A JP 733891A JP 2677458 B2 JP2677458 B2 JP 2677458B2
Authority
JP
Japan
Prior art keywords
task
privileged
instruction
address
system call
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
JP3007338A
Other languages
Japanese (ja)
Other versions
JPH04241032A (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.)
Panasonic Corp
Panasonic Holdings Corp
Original Assignee
Panasonic Corp
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 Panasonic Corp, Matsushita Electric Industrial Co Ltd filed Critical Panasonic Corp
Priority to JP3007338A priority Critical patent/JP2677458B2/en
Publication of JPH04241032A publication Critical patent/JPH04241032A/en
Application granted granted Critical
Publication of JP2677458B2 publication Critical patent/JP2677458B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30003Arrangements for executing specific machine instructions
    • G06F9/3005Arrangements for executing specific machine instructions to perform operations for flow control
    • G06F9/30054Unconditional branch instructions
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/32Address formation of the next instruction, e.g. by incrementing the instruction counter
    • G06F9/322Address formation of the next instruction, e.g. by incrementing the instruction counter for non-sequential address
    • G06F9/323Address formation of the next instruction, e.g. by incrementing the instruction counter for non-sequential address for indirect branch instructions

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Executing Machine-Instructions (AREA)

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、分岐処理、システムコ
ール処理や割込み処理時に発生するスタックエリアへの
自動待避処理を一律に行うのではなく、必要なときのみ
実行し、かつ上記処理を特権モードで行うときは特権モ
ードへの移行を実行するシステムコール実行装置に関す
るものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention does not uniformly perform automatic save processing to a stack area that occurs during branch processing, system call processing, and interrupt processing, but executes it only when necessary, and the above processing is privileged. The present invention relates to a system call execution device that executes a shift to privileged mode when performed in the mode.

【0002】[0002]

【従来の技術】従来、システム管理に関連するタスクは
システム制御レジスタなどのCPU状態を決定する動作
を制御しており、ユーザーアプリケーションプログラム
で構成されたユーザータスクの暴走などの要因により上
記レジスタの誤設定やCPUの状態を決定する命令の実
行を回避するため、システム管理を扱うタスクにはハー
ドウェアで保護機能を動作させ、システムの信頼性を向
上させていた。システムタスク上では割込みの受理処理
やタスクスケジュールリング処理やIOドライバの起動
が行われるが、マルチバンクで構成されたシステムでは
ユーザータスクを起動後、特権タスクを実行していたバ
ンクでの処理が発生せず、システムコール発生持ちや割
込み発生待ち状態であるシステムも存在している。ま
た、システムコール発生や割込み発生によってハードウ
ェアでは特権タスクを実行するバンクのCPU演算部の
結果や特権タスクのインストラクションポインタ、ある
いはCPUの状態を決定するレジスタを待避し、バンク
の状態を保存しておいてからシステムコール処理や割込
み処理を実行していた。したがって、上記の待ち状態に
あるバンクでは待避動作が必要ないにもかかわらず、待
避処理が実行されていた。
2. Description of the Related Art Conventionally, tasks related to system management control operations such as system control registers that determine the CPU state. Due to factors such as runaway of user tasks configured by user application programs, errors in the above registers may occur. In order to avoid execution of instructions that determine settings and the state of the CPU, the protection function is operated by hardware for tasks that handle system management to improve system reliability. Although interrupt acceptance processing, task scheduling processing, and IO driver startup are performed on system tasks, in a system configured with multiple banks, processing is performed in the bank that was executing privileged tasks after user tasks are started. However, there are systems that have a system call and are waiting for an interrupt. When a system call or an interrupt occurs, the hardware saves the state of the bank by saving the result of the CPU operation unit of the bank that executes the privileged task, the instruction pointer of the privileged task, or the register that determines the state of the CPU. Since then, system call processing and interrupt processing have been executed. Therefore, although the bank in the waiting state does not need the save operation, the save process is executed.

【0003】一方、システムコールの際にハードウェア
で特権モードに自動設定されるシステムコール命令を使
用せず、分岐命令の実行により直接特権プログラムを実
行するものがある。
On the other hand, there is one that directly executes a privileged program by executing a branch instruction without using a system call instruction which is automatically set to a privileged mode by hardware at the time of a system call.

【0004】[0004]

【発明が解決しようとする課題】しかし、上記のような
構成では、通常の分岐命令ではユーザーモード状態のま
まであり、ユーザーモードの状態から特権モード状態に
切り替えは不可能であった。この問題を解決する手段と
して、特権モード状態かユーザーモード状態かを示すフ
ラグをユーザーモードからも変更できたり、特権モード
でのみ実行可能ないわゆる特権命令の実行により特権状
態に移行したりする方法がとられるが、このようなシス
テムでは十分な保護機能を提供できなかった。
However, in the above configuration, the normal branch instruction remains in the user mode state, and it is impossible to switch from the user mode state to the privileged mode state. As a means of solving this problem, there is a method of changing the flag indicating the privilege mode state or the user mode state also from the user mode, or shifting to the privilege state by executing a so-called privileged instruction that can be executed only in the privilege mode. However, such a system could not provide sufficient protection.

【0005】本発明は上記従来の問題を解決するもの
で、分岐処理、システムコール処理や割込み処理の場
合、それらの処理を実行するバンク上の状態を自動待避
するかどうかをユーザーが任意に指定でき、かつユーザ
ー状態から特権状態への移行に際して保護機能が働くシ
ステムコール実行装置を提供することを目的とするもの
である。
The present invention solves the above-mentioned conventional problems. In the case of branch processing, system call processing and interrupt processing, the user arbitrarily specifies whether or not to automatically save the state on the bank that executes those processing. It is an object of the present invention to provide a system call execution device that can perform a protection function at the time of transition from a user state to a privileged state.

【0006】[0006]

【課題を解決するための手段】この課題を解決するため
に本発明のシステムコール実行装置は、ベクタアドレス
のテーブルアドレスにより分岐処理、システムコール処
理や割込み処理の実行前にバンク状態を待避するかどう
かを判断し、ベクタアドレス領域へのアクセスは無条件
に特権モードに移行するようにされ、分岐命令によるベ
クタアドレステーブルへの分岐には2重間接アドレスで
のアクセスのみ認め、保護をかけるように構成されてい
る。
In order to solve this problem, the system call execution device of the present invention saves the bank state before executing branch processing, system call processing or interrupt processing by the table address of the vector address. It is determined whether access to the vector address area is unconditionally switched to the privilege mode, and only the double indirect address access is allowed and protected for branching to the vector address table by a branch instruction. It is configured.

【0007】[0007]

【0008】[0008]

【0009】[0009]

【作用】この構成により、リアルタイム処理が可能とな
り、システムのスループットを向上することができ、か
つユーザータスクからシステムタスクへの移行に保護機
能を付加することができ、システムの高信頼性を実現で
きる。
With this configuration, real-time processing becomes possible, the throughput of the system can be improved, and a protection function can be added to the transition from the user task to the system task, so that the high reliability of the system can be realized. .

【0010】[0010]

【実施例】【Example】

以下本発明の一実施例を図面に基づいて説明する。 図1は本発明の一実施例のシステムコール実行装置の構
成図であり、アドレステーブルによりスタックへの自動
待避動作をするかどうかを決定し、かつユーザータスク
処理から特権タスク処理に移行したときに特権モードに
切り替える構成を示している。
Hereinafter, an embodiment of the present invention will be described with reference to the drawings. FIG. 1 is a block diagram of a system call execution unit according to an embodiment of the present invention. When it is determined whether to perform an automatic save operation to a stack by an address table and when the user task process shifts to a privileged task process. The structure which switches to the privilege mode is shown.

【0011】図1において、分岐命令1は2重間接アド
レッシングの指定が可能であり、1重目の間接アドレッ
シングによりアドレステーブル指定14が行われ、メモリ
空間4のアドレステーブル領域6内のアドレスが選択さ
れる。アドレステーブル領域6のデータにはプログラム
の開始アドレスが格納されている。分岐命令1は2重目
の間接アドレッシングにより分岐先プログラムに分岐
し、プログラムが開始される。アドレステーブル領域6
には実行するプログラムの開始アドレスが格納されてお
り、アドレステーブル領域6内の一部にはハードウェア
による自動待避処理が一切発生しないアドレステーブル
領域5がある。
In FIG. 1, the branch instruction 1 can specify double indirect addressing, the address table specification 14 is performed by the first indirect addressing, and the address in the address table area 6 of the memory space 4 is selected. To be done. The data in the address table area 6 stores the start address of the program. The branch instruction 1 is branched to the branch destination program by the second indirect addressing, and the program is started. Address table area 6
Stores the start address of the program to be executed, and a part of the address table area 6 has an address table area 5 in which no automatic save processing by hardware occurs.

【0012】アドレステーブル指定14によりアドレステ
ーブル領域6の自動待避処理のないアドレステーブル領
域5が選択されたかどうかは、アドレステーブル領域判
定部7により判定される。アドレステーブル領域判定部
7にはアドレステーブル領域6の上限アドレス10と下限
アドレス11、自動待避処理のないアドレステーブル領域
5の上限アドレス8と下限アドレス9が入力され、アド
レステーブル指定14との比較が行われる。分岐命令1の
1重目の間接のアドレス指定がアドレステーブル領域6
の上限アドレス10と下限アドレス11の間のアドレスであ
った場合、アドレステーブル領域判定部7は特権/ユー
ザーモード管理部13に制御信号15を出力し、ソフトウェ
アの介入なしでCPUモード信号16を特権モードに切り
替える。さらに、アドレステーブル指定14が自動待避処
理のないアドレステーブル領域5の上限アドレス8と下
限アドレス9のアドレスであった場合、アドレステーブ
ル領域判定部7はμROM12に対して制御信号15を出力
し、特権バンク上のプログラム情報のスタックエリアへ
の自動待避を行わない。
The address table area determining unit 7 determines whether or not the address table area 5 which is not subject to the automatic save processing of the address table area 6 is selected by the address table designation 14. The upper limit address 10 and the lower limit address 11 of the address table region 6 and the upper limit address 8 and the lower limit address 9 of the address table region 5 without automatic save processing are input to the address table region determination unit 7 and are compared with the address table designation 14. Done. The first indirect addressing of the branch instruction 1 is the address table area 6
If the address is between the upper limit address 10 and the lower limit address 11, the address table area determination unit 7 outputs the control signal 15 to the privilege / user mode management unit 13 and the CPU mode signal 16 is privileged without software intervention. Switch to mode. Further, when the address table designation 14 is the address of the upper limit address 8 and the lower limit address 9 of the address table area 5 without automatic save processing, the address table area determination unit 7 outputs the control signal 15 to the μROM 12 and Do not automatically save the program information on the bank to the stack area.

【0013】システムコール命令2はユーザータスクか
らシステムタスクをコールする命令であり、アドレステ
ーブル指定子を持ち、アドレステーブル領域6内のアド
レスをベクタアドレスとし、特権プログラムに起動をか
ける。また、割込み3は割込み発生要因によりアドレス
テーブル領域6内のアドレスをベクタアドレスとする。
分岐命令1と同様に、システムコール命令2と割込み3
によりアドレステーブル指定14がアドレステーブル領域
判定部7に入力され、指定されたアドレステーブル領域
により特権バンク情報が自動待避されるかどうかが判断
され、また、特権モードに自動的に変更される。
The system call instruction 2 is an instruction for calling a system task from a user task, has an address table specifier, and uses an address in the address table area 6 as a vector address to activate a privileged program. Further, the interrupt 3 uses an address in the address table area 6 as a vector address due to an interrupt generation factor.
Similar to branch instruction 1, system call instruction 2 and interrupt 3
The address table designation 14 is input to the address table area determination unit 7, and it is determined whether or not the privileged bank information is automatically saved by the designated address table area, and the privileged mode is automatically changed.

【0014】アドレステーブルという特定のアドレス領
域の指定と、分岐命令1では2重間接アドレッシングで
ないと正常動作しないこととから、保護機能が働く。ま
た特権モードへの移行にはソフトウェアが介入せず、特
権バンク上のプログラム情報のスタックエリアへの自動
待避処理実行について実行するか否かを選択でき、高速
に処理をすることができる。
The protection function works from the specification of a specific address area called the address table and the fact that the branch instruction 1 does not operate normally unless double indirect addressing is performed. Further, the software does not intervene in the shift to the privileged mode, and it is possible to select whether or not to execute the automatic save processing execution to the stack area of the program information on the privileged bank, and the processing can be performed at high speed.

【0015】[0015]

【0016】[0016]

【0017】[0017]

【0018】[0018]

【0019】[0019]

【0020】[0020]

【0021】[0021]

【発明の効果】以上のように本発明によれば、特権モー
ドへの移行にはソフトウェアが介入せず、特権バンク上
のプログラム情報のスタックエリアへの自動待避処理実
行について実行するか否かを選択できて、リアルタイム
処理が可能となり、システムのスループットを向上する
ことができる。また、ユーザータスクからシステムタス
クへの移行に保護機能を付加することができ、ユーザー
タスクによるシステム環境の破壊を回避でき、システム
の高信頼性を実現できる。
As described above, according to the present invention, the software does not intervene in the transition to the privileged mode, and whether or not to execute the automatic save processing execution to the stack area of the program information on the privileged bank is executed. It can be selected, real-time processing becomes possible, and the throughput of the system can be improved. Also, a protection function can be added to the transition from the user task to the system task, the destruction of the system environment due to the user task can be avoided, and high reliability of the system can be realized.

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

【図1】本発明の一実施例の、アドレステーブルにより
スタックへの自動待避動作をするかどうかを決定し、か
つユーザータスク処理から特権タスク処理に移行したと
きに特権モードに切り替えるシステムコール実行装置を
示す構成図である。
FIG. 1 is a system call execution device according to an embodiment of the present invention, which determines whether or not an automatic save operation to a stack is performed by an address table, and switches to a privileged mode when transitioning from user task processing to privileged task processing. It is a block diagram which shows.

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

1,17 分岐命令 2 システムコール命令 3 割込み 4,19 メモリ空間 5 自動待避処理のないアドレステーブル領域 6 アドレステーブル領域 7,18 アドレステーブル領域判定部 8,9 自動待避処理のないアドレステーブル領域の
上限アドレスと下限アドレス 10,11 アドレステーブル領域の上限アドレスと下限
アドレス 12,37 μROM 13,24 特権/ユーザーモード管理部 14 アドレステーブル指定 15 制御信号 16,25 CPUモード信号 20 特権プログラム領域 21,22 特権プログラム領域の上限アドレスと下限ア
ドレス 23 特権モード 26 分岐処理 27 システムコール 28 割込み処理 29 バンク管理部 30 レジスタファイル群 31 スタック自動待避フラグ 32 インバータ回路 33 ユーザータスク起動信号 34 プログラム、端子による設定 35 AND回路 36 特権バンク実行中信号
1,17 Branch instruction 2 System call instruction 3 Interrupt 4,19 Memory space 5 Address table area without automatic save processing 6 Address table area 7,18 Address table area determination unit 8, 9 Upper limit of address table area without automatic save processing Address and lower limit address 10, 11 Upper and lower address of address table area 12, 37 μROM 13, 24 Privilege / user mode management section 14 Address table designation 15 Control signal 16, 25 CPU mode signal 20 Privileged program area 21, 22 Privilege Upper and lower address of program area 23 Privileged mode 26 Branch processing 27 System call 28 Interrupt processing 29 Bank management section 30 Register file group 31 Stack automatic save flag 32 Inverter circuit 33 User task start signal 34 Setting by program and pin 35 AND circuit 36 privilege van Running signal

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 システム管理を行う特権タスクとユーザ
ータスクからタスクが構成され、かつユーザータスク処
理から特権タスク処理に移行する場合、特権タスクが使
用していたCPUモード(演算結果フラグ)とインスト
ラクションポインタとメモリエリアあるいはレジスタエ
リア内のデータ待避をするか、もしくは前記データ待避
を全く行わないで特権タスクに制御を移行するかを切り
替え可能に構成され、さらに、ユーザータスク上でのシ
ステムコール発行時に、このシステムコール発行がシス
テムコールオペコードと特権バンクの実行インストラク
ションの開始アドレスが格納されているアドレステーブ
ルの値で構成されるシステムコール命令を実行すること
によりシステムコール処理をする第1の手段と、ユーザ
ータスク上での分岐命令の実行時に、この分岐命令が分
岐命令オペコードと特権バンクの実行インストラクショ
ンの開始アドレスが格納されているアドレステーブルを
指定することにより、間接的に前記インストラクション
の開始アドレスを指定可能な2重間接アドレスで構成さ
れる分岐命令を実行することにより分岐処理をする第2
の手段と、割込みの実行時に、割込み処理要因毎に指定
される割込み処理開始アドレスが格納されているアドレ
ステーブルにより割込み処理をする第3の手段とを備
え、前記3つの手段のいずれかによる実行時に、特権タ
スクへの移行と、待避処理を行うかどうかをアドレステ
ーブル自身のアドレスにより判断し、かつユーザータス
ク処理から特権タスク処理に移行したときにソフトウェ
アの介入なしでCPUを特権モードに切り替える手段を
備えたことを特徴とするシステムコール実行装置。
1. A CPU mode (calculation result flag) and an instruction pointer used by a privileged task when the task is composed of a privileged task and a user task for system management, and the transition from the user task process to the privileged task process is performed. It is configured to be able to switch between saving data in the memory area or register area, or transferring control to a privileged task without saving the data at all, and when issuing a system call on the user task, This system call issuance executes a system call instruction consisting of a system call opcode and a value in an address table in which the start address of the execution instruction of the privilege bank is executed, and a first means for processing the system call and a user. Branch on task When the instruction is executed, this branch instruction indirectly specifies the start address of the instruction by specifying the address table in which the branch instruction opcode and the start address of the privileged bank execution instruction are stored. Second branch processing is executed by executing a branch instruction composed of
Means and a third means for performing interrupt processing by an address table that stores an interrupt processing start address specified for each interrupt processing factor when the interrupt is executed, and is executed by any one of the three means. Sometimes, a means for switching to a privileged task and determining whether or not to perform a save process based on the address of the address table itself, and for switching the CPU to a privileged mode without software intervention when a transition is made from the user task process to the privileged task process. A system call execution device comprising:
JP3007338A 1991-01-25 1991-01-25 System call execution device Expired - Fee Related JP2677458B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3007338A JP2677458B2 (en) 1991-01-25 1991-01-25 System call execution device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3007338A JP2677458B2 (en) 1991-01-25 1991-01-25 System call execution device

Publications (2)

Publication Number Publication Date
JPH04241032A JPH04241032A (en) 1992-08-28
JP2677458B2 true JP2677458B2 (en) 1997-11-17

Family

ID=11663160

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3007338A Expired - Fee Related JP2677458B2 (en) 1991-01-25 1991-01-25 System call execution device

Country Status (1)

Country Link
JP (1) JP2677458B2 (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5237616A (en) * 1992-09-21 1993-08-17 International Business Machines Corporation Secure computer system having privileged and unprivileged memories
KR100505106B1 (en) * 2002-05-29 2005-07-29 삼성전자주식회사 Smart card with enhanced security
JP4728619B2 (en) * 2004-10-01 2011-07-20 富士通株式会社 Software falsification detection device, falsification prevention device, falsification detection method and falsification prevention method
JP2008269597A (en) * 2008-04-09 2008-11-06 Net Kuriasu Systems Kk Task processor
JP5177205B2 (en) * 2010-10-29 2013-04-03 富士通株式会社 Software falsification preventing apparatus and falsification preventing method
JP5177206B2 (en) * 2010-10-29 2013-04-03 富士通株式会社 Software falsification detection device and falsification detection method

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH02118727A (en) * 1988-10-27 1990-05-07 Kobe Nippon Denki Software Kk System for calling system sub-routine
JPH02272640A (en) * 1989-04-14 1990-11-07 Nec Corp Task switching system

Also Published As

Publication number Publication date
JPH04241032A (en) 1992-08-28

Similar Documents

Publication Publication Date Title
US5701493A (en) Exception handling method and apparatus in data processing systems
US20050138257A1 (en) Interrupt masking control
JP2655615B2 (en) Information processing device
JP3970609B2 (en) Processor system
JP2004157636A (en) Data processing apparatus
JP2677458B2 (en) System call execution device
JP4114946B2 (en) Data processing device
JP2723847B2 (en) Microprocessor
JPH0484335A (en) Virtual computer controlling system
JPH0668725B2 (en) Device for responding to interrupt condition in data processing system and method for responding to asynchronous interrupt condition
JPS6376028A (en) Method for controlling execution of instruction step in virtual computer system
JP2585905B2 (en) Multitask execution device
JPS61184644A (en) Virtual computer system control method
JPH04256027A (en) Microcomputer
JPH03126134A (en) Task switching system for cpu
JP2761324B2 (en) High-speed processing method
JPH02183342A (en) interrupt controller
JPH0683640A (en) Interrupt response processing method
JPH02176832A (en) Microcomputer
JPH05250161A (en) Microcomputer device
JPH0855034A (en) Arithmetic processor and interrupt processing system using the processor
JPH01216433A (en) Interruption control system
JP2000148511A (en) Interruption processor for microcomputer and its interruption processing method
JPH01297732A (en) Interrupt control method
JPH0325674A (en) Information processor

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees