WO2007120075A1 - Method for switching context of tasks and procedures in a processor - Google Patents

Method for switching context of tasks and procedures in a processor Download PDF

Info

Publication number
WO2007120075A1
WO2007120075A1 PCT/RU2007/000124 RU2007000124W WO2007120075A1 WO 2007120075 A1 WO2007120075 A1 WO 2007120075A1 RU 2007000124 W RU2007000124 W RU 2007000124W WO 2007120075 A1 WO2007120075 A1 WO 2007120075A1
Authority
WO
WIPO (PCT)
Prior art keywords
context
memory
task
processor
registers
Prior art date
Application number
PCT/RU2007/000124
Other languages
French (fr)
Russian (ru)
Inventor
Sergei Savvich Kovalenko
Sergei Andreevich Khromov
Yury Petrovich Krylatykh
Nikolai Petrovich Vasiliev
Andrei Vladimirovich Vinokurov
Original Assignee
Limited Liability Company (Llc) 'unicorne Microsystems'
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 Limited Liability Company (Llc) 'unicorne Microsystems' filed Critical Limited Liability Company (Llc) 'unicorne Microsystems'
Publication of WO2007120075A1 publication Critical patent/WO2007120075A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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/46Multiprogramming arrangements
    • G06F9/461Saving or restoring of program or task context

Definitions

  • the invention relates to computing, and in particular to processors for data processing, designed to operate in multitasking mode, and can be used, in particular, in embedded applications.
  • the task context includes resources such as instruction counter values, processor status words, general purpose registers, and contexts of all procedures caused by the task.
  • the difference between the task and the procedure is that the task is started by interruption (trp), and the procedure is called from the task (call), possibly with the transfer of parameters and, in essence, is a subroutine or function, upon completion of which it is possible to return the results to the given one task procedure.
  • interruption trp
  • call the procedure is called from the task (call)
  • this is a subprocess of the task process.
  • ALU - arithmetic-logical device included in the processor included in the processor; BI - instruction buffer /
  • BOP - a block of memory access for reading / writing data (LOAD / Store UP) /
  • KSPK - ring stack providing context switching (ring stack context switching); OZU-D - random access memory for data storage /
  • OZU-I - random access memory for storing instructions / ⁇ - sign of the task launch / ⁇ - process priority /
  • SSP - processor status word PSW - processor statusus
  • UV-KSPK - a pointer to the beginning of free space in the KSPK (top pointer KPSK);
  • UD-CBD - a pointer to the beginning of filling the CBD (bottom indicator of the CBD);
  • UD-KSPK - a pointer to the beginning of filling the KSPK (bottom indicator KPSS);
  • UKK-P - a pointer to the end of the context in RAM (pointer to the end of the context); USA-P - a pointer to the address of RAM for writing / reading the next context element
  • CSR-CBD the number of stored CBR RONs of the relevant context.
  • One of the first implementations of context switching support which has become widespread, refers to RISC processors with SPARC V8 architecture ( ⁇ réelle SPARC Architects Map. Version 8. SPARC International IPs, 1992, 303 p.).
  • SPARC V8 is a large register file with circular buffer properties and register window technology.
  • the control of the context switching mechanism should be implemented by software, which leads to a relatively low context switching speed compared to the possible hardware implementation of this mechanism and, therefore, leads to limited processor performance of this architecture.
  • TriCore TM 1. 32-Bit Upgrade Rocessor Core. Volume 1: Vl. implement context switching hardware.
  • all saved contexts are placed in the memory module, the access time to which is significantly longer than the access time to the internal registers of the processor.
  • the closest analogue of the claimed invention is a method of switching context in the processor (patent US6115777A, 09/05/2000), which consists in the operational storage of contexts in a large circular register stack and transferring contexts to memory when it is full. Moreover, each ring stack register, in addition to the data storage area, contains an additional information bit indicating the validity of the stored data.
  • the indicated implementation of the context switching method uses an additional register for temporary storage of the indicated information bits.
  • registers of pointers to storage areas of contexts in external memory were used. This method is also able to provide high speed context switching.
  • the objective of the claimed invention is to minimize hardware costs for the implementation of context switching while maintaining a relatively high speed of context switching and its functionality.
  • the technical result in this case is to increase the switching speed of the context of tasks and procedures.
  • This technical result is provided by a method of switching the context of tasks and procedures in the processor.
  • the processor contains KBP, register SSP, CK and KSPK.
  • KSPK is made with the possibility of storing the values of the SSP and CK context, and data characterizing the placement of task contexts in the RAM.
  • the processor also comprises hardware for context switching control (CMS).
  • CMS context switching control
  • the method includes sequential reservation of contexts in KBP and KSPK with the subsequent restoration, if necessary, of contexts in the reverse order. When an overflow of KBP or KSPK produce the crowding out of the earliest context in memory. If necessary, such repression is repeated until the resources required by the task or procedure to be started are released in KBP and / or KSPK. Upon completion of a task or procedure, contexts are restored from memory to, in the reverse order, the released resources of KBP and KSPK in the absence of the necessary resources in KBP and / or KSPK.
  • the way to switch the context of tasks and procedures in the processor is that it contains a ring buffer of general purpose registers, a status word register a processor, a command counter, a context switching ring stack, configured to store values of the processor status word register and a context command counter, data characterizing the placement of task contexts in RAM and hardware designed to control context switching, and containing sequential reservation of contexts in the ring buffer general purpose registers and ring stack context switching with subsequent recovery, or with context recovery
  • the ring buffer of general purpose registers and the ring context switch stack are overflowed, the earliest context is forced out into the memory by reading 14 from the register reference access ring stack values of the current register of the context switch ring stack, and this extrusion is repeated until release the resources required by the task or procedure to be run in the ring buffer of general purpose registers and / or the ring switch stack text, and upon completion of a task or procedure, contexts are restored from memory in the reverse order to the freed resources of the ring buffer of general registers and the
  • the values of the bits of the fields PRVO, PP, ChSR-KBR, IP, PZZ and MSSP are recorded in the MSS register.
  • the processor is given a command, characterized in that as a result of decoding and execution of this command by the processor, all contexts, except the current one, are sequentially transferred from the processor to memory. Moreover, for each context, the values of BSC, CK, DPRK and UKK-P are transferred. According to the method of initial setting the context switching parameters of tasks and procedures in the processor, the processor is instructed to write new values to the service context switching registers decoded and executed by the processor. Moreover, one of the service registers is the UT-DPRK register.
  • the claimed invention is additionally characterized by the fact that in the method of switching the context of tasks and procedures in the processor, the contexts for all procedures of the task are sequentially placed in memory, inside the context of this task.
  • the data characterizing the placement of task contexts in memory is represented by the values of DPRK and UKK-P associated, respectively, with the value of UCC-P for the previous context and the value of the DPRK of the next context.
  • the QPSC can be arranged to place the SSP and CK values of one context or the values of CCC-P and DPRK in one register of the stack, one of which refers to the first context, and the other to the second context, which are adjacent.
  • the values of RONs, CK, and BSC of the ousted context are sequentially written into the memory.
  • Number of RONs, values which will be stored in the CBD when the context is supplanted is determined based on the values of the fields CSR-KBR and PSZ MSS.
  • the values of all RONs of the problem are recorded, otherwise, the values of RONs, the number of which are specified in the CSR-KBR, are recorded.
  • the DPRK value is recorded for placing the next context, and the value of the CCC-P of the extruded context in the memory is recorded at the beginning of the memory area to place the next context.
  • the processor contains architectural registers DPRK, UKK-P and USA-P.
  • DPRK the values of UKK-P and DPRK from the indicated registers are entered into the KSPK.
  • the DPRK value is obtained from the DPRK table containing all predetermined DPRK values.
  • the initial value of the register UKK-P is set equal to the value of the register DPRK.
  • the tasks in memory increase the value of the UKK-P register by the size of the context elements stored in the memory.
  • write to the memory by means of the PO-P configured to display the memory element with the address contained in the register USA-P.
  • the value of USA-P is increased by a single value.
  • the SSP and UKK-P initially include the attribute field SSP or UKK-P, respectively.
  • a context element with an address from USA-P is read from memory by means of RO-P. If this element has the sign of SSP, then the context to be read is the context of the procedure embedded in the task, to restore which the values of SSP and CK are successively read in the KSPK, and RONs, numerically corresponding to the value of CSR-KBR from SSP, in KBR. If the element originally read from memory has the sign of UKK-P, then the read context is the context of the task.
  • the method for placing the contexts of tasks and procedures in RAM in their particular cases is characterized by the fact that the value of UCC-P is read from the UCC-P field of the KSPK register, and the value of DPRK is read from the DDRK field of the same register. Or, in the case when no procedures were called from the task, the UCC-P value is calculated as the sum of memory elements for placing the RON values, CK values, the SSP value of this task, and the DPRK values of the following context. If there are procedures called up from the task, the sum of the addresses of the memory elements additionally includes the addresses of the memory elements to place the RON values, CK values, and SSP values of all procedures of this task.
  • UKK-P contains a feature field that defines the contents of this register as UKK-P. Moreover, the attribute field UKK-P has a zero value, cannot be changed, and is located in the thirty-second from the beginning of the register bit, which is the last.
  • a DPRK value can be generated in advance, and when the task is started, the corresponding DPRK value is recorded in the CSPC.
  • any of the private implementations of this method can be further characterized in that each context occupies a continuous memory area.
  • the method of forming SSP in special cases is characterized by the fact that the value of the bits of the SSSP field is always set different from the value of the bits having the same position in UKK-P. In this case, the bit of the MSSP field is always set equal, for example, to one.
  • the value of the bit of the PPZ field is set to unity.
  • the values of the bits of the CSR-KBR field are directly set by the processor command having the code 11100100 in their high order bits, and the field of four bits in the first low order bits for the value of the number of stored RONs specified by the write command in the SSP.
  • four bits are sequentially allocated to the FIR fields, the PP field and the CSR-KBR field starting from the beginning of the MSS, the next five bits are allocated to the IP field, and the thirty-second bit, which is the last, is allocated to the MSS field.
  • the command issued to the processor has the code 11101100 in its high order bits.
  • the method of initial setting the parameters for switching the context of tasks and procedures in the processor is additionally characterized by the fact that the service registers include the KSPK working registers, and the new values recorded are DPRK.
  • the method is characterized in that the service registers include the UV-KSPK register.
  • the write command issued to the processor may have a code 11101111 or 11011101 or 01110000 in its bits 25 through 32.
  • Fig. 1 schematic diagram of the context switch
  • Fig. 2 diagram of a general context switching algorithm
  • Fig. 3 diagram of the algorithm for displacing the context in RAM
  • Fig. 4 a sequence diagram of the start of the context switching mechanism
  • Fig. 5 simplified block diagram of the microprocessor "Orchid”.
  • the implementation of the invention is illustrated by the example of a processor in which a fully hardware-based mechanism for switching the context of tasks and procedures is implemented. Initial tasks require only memory areas for placing contexts.
  • the processor contains the architectural registers CK, SSP, DPRK, UKK-P, UT-DPRK and USA-P, as well as the KBR 1 and KSPK 2 shown in FIG.
  • BSC characterizes the task or procedure
  • CK characterizes the stage of their implementation.
  • the architectural registers DPRK, UKK-P, UT-DPRK and USA-P are made separate from KBR 1 and KSPK 2, and are designed to organize the storage of contexts in RAM 3.
  • CBD 1 is a collection of 32-bit registers.
  • the processor directly processes data only from registers falling into the current window (frame) 4. These registers are RONs of the task or procedure being performed. In this example implementation of the method, the RON window contains 16 registers. When switching between tasks or procedures, the shift of window 4 is from 1 to 16 registers.
  • Addressing RONs in CBD 1 is such that the address of the next register is 1 higher than the address of the previous register, and when the address of the most recent register is reached, the next address will belong to the very first register.
  • CBD 1 For the management of CBD 1 are the registers UD-CBD and HC-CBD.
  • KSPK 2 is a stack of registers for storing the values of SSP, CK, DPRK and UKK-P, corresponding to RONs from CBD 1.
  • a pair of values ⁇ KCP, CK ⁇ or a pair of values ⁇ UKK-P, DPRK ⁇ can be written to each register of KSPK 2 .
  • UKK-P should relate to the first of two neighboring contexts, and the value of DPRK to the second context, immediately following the first. Due to this, KSPK 2 implements the functions of the return stack (returp stask) and the stack of memory accesses.
  • the address in KSPK 2 at which the following entry can be made, is contained in the UV-KSPK register. In order to be able to distinguish between occupied and free areas of KSPK 2, use the register UD-KSPK.
  • Reading and writing to the registers KBR 1 and KSPK 2 is carried out through the registers RO-KBR and RO-KSPK, which are the registers of indirect addressing.
  • RO-CBD is configured to display a CBD element 1 with the address contained in the register UD-CBD. Moreover, after reading from the RO-CBD, the value of the address in the register UD-CBD increases by a single value. Before writing to the RO-CBD, the address in the UD-KBR is reduced by a single value.
  • RO-KSPK is made with similar properties in relation to the register UD-KSPK.
  • the BSC format is characterized by the fact that the BSC contains the fields of attributes PRVO, PP, ChSR-KBR, IP, PPZ and PSSP.
  • the value of the bit of the PSSS field is always set different from the value of the bit having the same position in UKK-P, which allows them to be distinguished when restoring the context.
  • the values of the DPRK must be determined, containing data on the size and location in memory of 3 of all areas for the saved contexts. All DPRK at the stage of initial installation of the processor are placed in table 5 DPRK in memory 3. The line for reading from table 5 DPRK determines the value of the register UT-DPRK.
  • the interrupt signal is checked 7 for the availability of free resources in CBD 1 and KSPK 2.
  • a necessary condition for the availability of free resources for a new task in this processor example is the presence of at least 16 free RONs in CBD 1 and at least two free register lines in KSPK 2. If the necessary resources are not available, 8 of the earliest (old) context is forced out of CBD 1 and KSPK 2 in random access memory 3.
  • CBD 1 and KSPK 2 which includes an offset of 10 in KBR 1 of the current RON window by increasing the value of HC-CBD by the value of CSR-KBR from the current SSP.
  • the value of the CSR-CBD is inherited from the previous context or, if necessary, is reinstalled programmatically.
  • the 11 values of the SSP and CK registers related to the current task are stored in KSPK 2 at the address contained in the UV-KSPK 2. These values are written in one register and represent one line in KSPK 2.
  • KSPK 2 write 12 values of DPRK for the new launched task and UKK-P for the current task, which is reserved. Moreover, the value of the DPRK is read from the row of the DPRK table in memory by UT-DPRK, and the UCC-P is calculated as the sum of memory elements for placing RONs, CK, MSS and DPRK. If there are procedures called from the task, the sum of memory elements additionally includes memory elements for 7 000124
  • the crowding out 8 of the earliest context from the CBD 1 and the BSCC 2 into the RAM 3 is illustrated in FIG. 3, and includes reading 14 from the RO-BSCC values of the current register of the BSCC.
  • the number of subsequent reading cycles is set to 16 equal to the total number of RONs of the task - 16.
  • the number of subsequent reading cycles is set to 17 equal to the value of the CSR-CBD from the BSC.
  • the required number of 18 cycles of reading values from the RO-CBD and their writing to the RO-P are performed.
  • Register RO-P is a register of indirect addressing and displays a memory element with the address contained in USA-P. Moreover, before reading from RO-P, the contents of USA-P are increased by a single value, which leads to a shift of the pointer to the next memory element.
  • this context is the 20 context of the task, then a sequential reading of 22 from the RO-KSPK pair of UKK-P and DPRK values is made, writing 23 in the RO-P values of the DPRK, writing 24 in the USA-P values of the DPRK and writing 25 in the RO-P values UKK-P.
  • the extrusion of the task context into RAM 3 is completed 21.
  • the contexts of all procedures caused by this task are sequentially placed inside the context of this task.
  • the processor command system must include a command for transferring the contexts of tasks and procedures to memory 3, as a result of decoding and execution of which all contexts, with the exception of the current one, must be transferred from the processor registers to memory 3.
  • the HC-CBFR decreases by a single value, and at the same time, the HC-CBD decreases.
  • the values of the resulting pointers are compared with the values of UD-KBR and UD-KSPK, on the basis of which the availability of the required data in KBR 1 and KSPK 2 is determined. If there is no data required for restoration in them, the mechanism for their recovery from memory 3 is automatically turned on. Moreover, the value of PO-P already reflects USA-P content, indicating a place in memory 3 from which recovery should be made.
  • this context element is UKK-P, then go to the address contained in it, and then sequentially read in KSPK 2 values DPRK, SSP, CK. The values of 16 RONs are transferred to KCB 1. After that, the value of UKK-P of the previous context located in the last context element in memory 3 is entered in KSPK 2.
  • SSP SSP
  • CK are transferred to KSPK 2
  • RONs are transferred to KCB 1, the number of which is recognized from the CSR-KBR field of the read SSP.
  • RONs 26 CBD 1 and data 27 KSPK 2 represent the context of one task.
  • the context of the task "B” includes two contexts, one of which relates directly to this task - the context "IN”, and the second refers to the procedure called "Bl" from it.
  • Communication contexts in memory 3 is organized due to the fact that in the last element 28 of the previous context "A” write the value DPPK (B) that determines the location of the first context element "B".
  • the value UKK-P (A) is recorded at this memory address, indicating the location of element 28 in memory.
  • to read the values DPPK (B) and UKK-P (A) from KSPK 2 requires one read operation, because these values are located in one register KSPK 2.
  • the processor After removing the RESET signal, the processor starts to execute the program from the specified address. At the same time, the table of interrupt vectors and the DPRK table have not yet been determined. In this mode, the processor cannot respond to interrupts and switch from task to task, but at the same time it can 7 000124
  • a 34 initial processor installation program is executed, after which a 35 command is executed for the initial installation of the mechanism for saving / restoring the context of tasks when the contexts are pushed into memory, and 36 primary tasks are launched.
  • the initial setup program of the processor generates 37 DPRK tables, forms 38 UT-DPRK. Then, a 39 interrupt vector table is generated and a 40 pointer to an interrupt vector table is generated.
  • the RESTART command is executed as a special interrupt without saving the current context.
  • the address of the zero descriptor of the DPRK table should be written in the UT-DPRK register. Then write zero values in the registers UV-CBD, 24
  • UD-KBR UD-KBR
  • UV-KSPK UV-KSPK
  • UD-KSPK UD-KSPK
  • FIG. 5 presents a simplified structural diagram of this processor.
  • Microprocessor "Orchid” is a processor with a reduced set of instructions (RISC) and is characterized by fully automatic support for the mechanism of switching tasks and procedures, and all the necessary steps for this are performed at the hardware level, except for the formation of the DPRK table.
  • RISC reduced set of instructions
  • Order contains KBR 1, ALU 43, DK 44 and BI 45, CK 46 and BFAVI 47, as well as BOP 48, which are typical for a number of RISC processors.
  • the input-output data ALU 43 and the first input-output data BOP 48 are connected to the input-output data CBD 1.
  • DK 44 is connected by its data input to the data output of the RAM-I 50 through the BI 45 through the data bus.
  • Outputs control DC 44 are connected to the control inputs of ALU 43, BOP 48, CK 46 and the first control input of CBD 1.
  • DC 44 is also connected to the control system 49 through the input-output control.
  • the input-output data CK 46 is connected to the input-output data KSPK 2, and the data output is connected to the data input RAM-50 through BFAVI 47 and the address bus.
  • the first output of the CBD 1 data and the output of the KSPK 2 data are connected to the control system 49.
  • the first and second control outputs of the control system 49 are connected, respectively, to the control input of the KSPK 2 and the second control input of the KBR 1.
  • the output of the control system 49 is connected to the data input of the BOP 48.
  • the second input-output data BOP 48 is connected to the input-output data OZU-D 51 via the data bus, and the data input RAM-D 51 is connected to the data output BOP 48 via the address bus.
  • CMSC 49 is an abstract generalization of the hardware needed to control context switching. These hardware, in essence, are means of working with system registers through read and write operations in accordance with a context switching algorithm implemented on the basis of a state machine.
  • the hardware implementation of the control system can have various options and is not difficult with respect to existing technologies. Saving and restoring contexts to / from memory is as follows.
  • a start-up signal is generated for ⁇ 49, during the operation of which data is transferred from KBR 1 and KSPK 2 to RAM-D 51 through BOP 48, which generates the address, data and write signals to RAM- D 51
  • a start-up signal is generated for CPSK 49, which transfers data from RAM-D 51 to KBR 1 and KSPK 2 through BOP 48.
  • BOP 48 generates an address, data and read signals from RAM-D 51.
  • an instruction code is selected, which is subsequently decoded in DC 44 in order to obtain signals for controlling the logic of the SSB register writing, and when the command for transferring task and procedure contexts to RAM-D 51 is executed , from the RAM-I 50, an instruction code is selected, which is further decrypted in DC 44 in order to obtain a logical start signal for the control system 49.
  • the fields of PRVO, PP and CSR-KBR in the SSP "Orchids" occupy four bits starting from the beginning of the MSS, the IP field occupies the next five bits, and the MSSP field occupies the last, thirty-second bit.
  • setting the bits of the CSR-KBR field is carried out by a command with machine code 11100100 in its high order bits, and containing a field of four bits in the first low order bits for the value of the number of stored RONs in KBR 1 set by the write command in the SSP.
  • the command to transfer all saved contexts to the memory for "Orchid" has the code 11101100 in high order, and the write command issued to the processor has the code 11101111 or 11011101 or 01110000 in its bits 25 to 32.

Abstract

The invention relates to computer engineering, in particular to processors used in a multitask operation mode and comprising hardware for automatically switching the task and procedure context. Said invention makes it possible to increase the switching speed of the task and procedure context and to reduce the number of used hardware. The result is attainable by the inventive method consisting in allocating available resources to each new task or procedure in the ring buffer of general-purpose registers for processing data and in a ring context switching stack for data characterising the pre-allocated context space in an external memory and in fully automatically preempting the contexts saved at the hardware level to the memory without using software when the ring buffer of the general-purpose registers and the ring context switching stack are full, wherein data from the ring context switching stack make it possible to organise the contexts preempted to the memory in the form of a linked list and, when necessary to restore the saved contexts.

Description

Меthоd оf Таsкs апd Рrосеdurеs сопtехt switсhiпg iп а рrосеssоr Metof of Taksks apd Rrosedures sopteht switcheship ip and rssessor
Изобретение относится к вычислительной технике, а именно к процессорам для обработки данных, предназначенным для работы в многозадачном режиме, и может быть использовано, в частности, во встраиваемых приложениях.The invention relates to computing, and in particular to processors for data processing, designed to operate in multitasking mode, and can be used, in particular, in embedded applications.
При работе в многозадачном режиме обычно требуется переключение контекста задач и процедур, т.е. осуществление сохранения и восстановления соответствующих им ресурсов процессора. При этом контекст задачи включает такие ресурсы, как значения счетчика команд, слова состояния процессора, регистров общего назначения, и контексты всех вызванных задачей процедур .When working in multitask mode, switching the context of tasks and procedures is usually required, i.e. implementation of the conservation and restoration of their corresponding processor resources. The task context includes resources such as instruction counter values, processor status words, general purpose registers, and contexts of all procedures caused by the task.
Отличие между задачей и процедурой заключается в том, что задача запускается прерыванием (trар) , а процедура вызывается из задачи (саll) , возможно с передачей параметров и, по существу, представляет собой подпрограмму или функцию, по завершении которой возможен возврат результатов в породившую данную процедуру задачу. Для операционной системы это подпроцесс процесса задачи.The difference between the task and the procedure is that the task is started by interruption (trp), and the procedure is called from the task (call), possibly with the transfer of parameters and, in essence, is a subroutine or function, upon completion of which it is possible to return the results to the given one task procedure. For the operating system, this is a subprocess of the task process.
В данном описании использованы следующие сокращенные обозначения терминов :In this description, the following abbreviated notation of terms is used:
АЛУ - арифметико-логическое устройство входящее в состав процессора; БИ - буфер инструкций/ALU - arithmetic-logical device included in the processor; BI - instruction buffer /
БОП - блок обращения к памяти для чтения/записи данных (lоаd/stоrе uпit) /BOP - a block of memory access for reading / writing data (LOAD / Store UP) /
БФАВИ - блок формирования адреса выбираемой инструкции (iпstruсtiоп fеtсh uпit) ; ДК - дешифратор команд/BFAVI - block for generating the address of the selected instruction (ipstructiopopetсh upit); DK - command decoder /
ДПРК - дескриптор начала и размера области памяти для размещения контекста (дескриптор памяти размещения контекста) /DPRK - descriptor of the beginning and size of the memory area for context allocation (context location memory descriptor) /
ИП - идентификатор процесса (PID - рrосеss idепtifiеr) / IP - the identifier of the process (PID - rcеss idеptifiеr) /
КБР - кольцевой буфер РОНов/CBD - ring buffer RONs /
КСПК - кольцевой стек обеспечения переключения контекста (кольцевой стек переключения контекста) ; ОЗУ-Д - оперативное запоминающее устройство для хранения данных/KSPK - ring stack providing context switching (ring stack context switching); OZU-D - random access memory for data storage /
ОЗУ-И - оперативное запоминающее устройство для хранения инструкций/ ПЗЗ - признак запуска задачи/ ПП - приоритет процесса/OZU-I - random access memory for storing instructions / ПЗЗ - sign of the task launch / ПП - process priority /
ПРВО - признаки результата выполненной операции/ ПССП - признак ССП/ РО-КБР - регистр обращения к КБР; РО-КСПК - регистр обращения к КСПК; РО-П - регистр обращения к памяти/ РОНы - регистры общего назначения; CK - счетчик команд;PRVO - signs of the result of the completed operation / MSSP - sign of the BSC / RO-CBD - register of access to the CBD; RO-KSPK - the register of the appeal to KSPK; RO-P - memory access register / RONs - general purpose registers; CK - command counter;
ССП - слово состояния процессора (PSW - рrосеssоr stаtus wоrd) ;SSP - processor status word (PSW - processor statusus);
СУПК - структура управления механизмом переключения контекста и выбором режимов работы КБР и КСПКСУПК - the control structure of the context switching mechanism and the choice of CBD and KSPK operating modes
(структура управления переключением контекста) ; УВ-КБР - указатель начала текущего окна в КБР(context switching control structure); UV-KBR - pointer to the beginning of the current window in the CBD
(указатель верхушки КБР) ;(pointer to the top of the CBD);
УВ-КСПК - указатель начала свободного пространства в КСПК (указатель верхушки КПСК) ;UV-KSPK - a pointer to the beginning of free space in the KSPK (top pointer KPSK);
УД-КБР - указатель начала заполнения КБР (указатель дна КБР) ;UD-CBD - a pointer to the beginning of filling the CBD (bottom indicator of the CBD);
УД-КСПК - указатель начала заполнения КСПК (указатель дна КПСК) ;UD-KSPK - a pointer to the beginning of filling the KSPK (bottom indicator KPSS);
УКК-П - указатель на конец контекста в оперативной памяти (указатель конца контекста) ; УСА-П - указатель на адрес оперативной памяти для записи/считывания следующего элемента контекстаUKK-P - a pointer to the end of the context in RAM (pointer to the end of the context); USA-P - a pointer to the address of RAM for writing / reading the next context element
(указатель следующего адреса в памяти) ; УТ-ДПРК - указатель на строку таблицы ДПРК (указатель таблицы ДПРК) ;(pointer to the next address in memory); UT-DPRK - pointer to a row of the DPRK table (pointer to the DPRK table);
ЧСР-КБР - число сохраняемых РОНов КБР соответствующего контекста . Одна из первых реализаций поддержки переключения контекста, получившая широкое распространение, относится к RISC процессорам с архитектурой SPARC V8 (Тhе SPARC Аrсhitесturе Мапuаl. Vеrsiоп 8. SPARC International Iпс, 1992, 303 р.) . Одной из особенностей SPARC V8 является большой регистровый файл со свойствами циклического буфера и технологией регистрового окна. Однако при этом управление механизмом переключения контекста должно быть реализовано программными средствами, что обуславливает относительно невысокую скорость переключения контекста по сравнению с возможной аппаратной реализацией данного механизма и, следовательно, ведет к ограниченной производительности процессоров данной архитектуры.CSR-CBD - the number of stored CBR RONs of the relevant context. One of the first implementations of context switching support, which has become widespread, refers to RISC processors with SPARC V8 architecture (Те SPARC Architects Map. Version 8. SPARC International IPs, 1992, 303 p.). One of the features of SPARC V8 is a large register file with circular buffer properties and register window technology. However, in this case, the control of the context switching mechanism should be implemented by software, which leads to a relatively low context switching speed compared to the possible hardware implementation of this mechanism and, therefore, leads to limited processor performance of this architecture.
Задача повышения скорости переключения контекста частично решена в процессорах архитектуры ТriСоrе (ТriСоrе™ 1. 32-Bit Uпifiеd Рrосеssоr Соrе. Vоlumе 1: Vl .3 Соrе Аrсhitесturе. Usеr's Мапuаl, Vl .3.6. Iпfiпеоп Тесhпоlоgiеs AG, 2005, 209 р.) , реализующих переключение контекста аппаратными средствами. Однако все сохраненные контексты размещаются в модуле памяти, время доступа к которой существенно превышает время доступа к внутренним регистрам процессора .The task of increasing the context switching speed has been partially solved in the processors of the TriCore architecture (TriCore ™ 1. 32-Bit Upgrade Rocessor Core. Volume 1: Vl. implement context switching hardware. However, all saved contexts are placed in the memory module, the access time to which is significantly longer than the access time to the internal registers of the processor.
Существенное повышение скорости переключения контекста достигнуто благодаря использованию в процессоре двух регистровых файлов для промежуточного хранения контекстов с последующим их переносом в модуль памяти (патент US6553487B1, 22.04.2003). Процедура переключения контекста в данной реализации способа может быть ускорена благодаря применению большего числа регистровых файлов . Однако при увеличении числа регистровых файлов существенно возрастает сложность управления ими.A significant increase in the context switching speed was achieved due to the use of two register files in the processor for intermediate storage of contexts with their subsequent transfer to the memory module (patent US6553487B1, 04/22/2003). The context switching procedure in this implementation of the method can be accelerated by using a larger number of register files. However, as the number of register files increases, the complexity of managing them increases significantly.
Наиболее близким аналогом заявленного изобретения является способ переключения контекста в процессоре (патент US6115777A, 05.09.2000), заключающийся в оперативном хранении контекстов в большом кольцевом регистровом стеке и переносе контекстов в память при его переполнении. При этом каждый регистр кольцевого стека помимо области хранения данных содержит дополнительный информационный бит, указывающий на действительность хранимых данных. Указанная реализация способа переключения контекста использует дополнительный регистр для временного хранения указанных информационных битов. Кроме того, для управления механизмом сохранения и восстановления контекстов, использованы регистры указателей на области хранения контекстов во внешней памяти. Данный способ также способен обеспечить высокую скорость переключения контекста.The closest analogue of the claimed invention is a method of switching context in the processor (patent US6115777A, 09/05/2000), which consists in the operational storage of contexts in a large circular register stack and transferring contexts to memory when it is full. Moreover, each ring stack register, in addition to the data storage area, contains an additional information bit indicating the validity of the stored data. The indicated implementation of the context switching method uses an additional register for temporary storage of the indicated information bits. In addition, to control the mechanism for saving and restoring contexts, registers of pointers to storage areas of contexts in external memory were used. This method is also able to provide high speed context switching.
Задачей заявленного изобретения является достижение минимизации аппаратурных затрат на реализацию переключения контекста при сохранении относительно высокой скорости переключения контекста и его функциональности. бThe objective of the claimed invention is to minimize hardware costs for the implementation of context switching while maintaining a relatively high speed of context switching and its functionality. b
Технический результат при этом заключается в увеличении скорости переключения контекста задач и процедур.The technical result in this case is to increase the switching speed of the context of tasks and procedures.
Данный технический результат обеспечивается способом переключения контекста задач и процедур в процессоре.This technical result is provided by a method of switching the context of tasks and procedures in the processor.
Технический результат достигается за счет того, что согласно способу переключения контекста задач и процедур в процессоре, процессор содержит KBP, регистр ССП, CK и КСПК. Причем КСПК выполнен с возможностью хранения значений ССП и CK контекста, и данных, характеризующих размещение в оперативной памяти контекстов задач. Процессор содержит также аппаратное средство для управления переключением контекста (СУПК) . При этом способ включает в себя последовательное резервирование контекстов в KBP и КСПК с последующим восстановлением, при необходимости, контекстов в обратной последовательности. При переполнении KBP или КСПК производят вытеснение самого раннего контекста в память . При необходимости повторяют такое вытеснение до освобождения требуемых запускаемой задачей или процедурой ресурсов в KBP и/или КСПК. При завершении задачи или процедуры производят восстановление контекстов из памяти в , обратной последовательности в освободившиеся ресурсы KBP и КСПК при отсутствии необходимых ресурсов в KBP и/или КСПК.The technical result is achieved due to the fact that according to the method of switching the context of tasks and procedures in the processor, the processor contains KBP, register SSP, CK and KSPK. Moreover, KSPK is made with the possibility of storing the values of the SSP and CK context, and data characterizing the placement of task contexts in the RAM. The processor also comprises hardware for context switching control (CMS). Moreover, the method includes sequential reservation of contexts in KBP and KSPK with the subsequent restoration, if necessary, of contexts in the reverse order. When an overflow of KBP or KSPK produce the crowding out of the earliest context in memory. If necessary, such repression is repeated until the resources required by the task or procedure to be started are released in KBP and / or KSPK. Upon completion of a task or procedure, contexts are restored from memory to, in the reverse order, the released resources of KBP and KSPK in the absence of the necessary resources in KBP and / or KSPK.
Способ переключения контекста задач и процедур в процессоре заключается в том, что он содержит кольцевой буфер регистров общего назначения, регистр слова состояния процессора, счетчик команд, кольцевой стек переключения контекста, выполненный с возможностью хранения значений регистра слова состояния процессора и счетчика команд контекста, данных характеризующих размещение в оперативной памяти контекстов задач и аппаратное средство, предназначенное для управления переключением контекста, и содержащий последовательное резервирование контекстов в кольцевом буфере регистров общего назначения и кольцевом стеке переключения контекста с последующим восстановлением, или с восстановлением контекстов в обратной последовательности, при переполнении кольцевого буфера регистров общего назначения и кольцевого стека переключения контекста производят вытеснение самого раннего контекста в память, путем чтения 14 из регистра обращения к кольцевому стеку переключения контекста значения текущего регистра кольцевого стека переключения контекста, причем повторяют такое вытеснение до освобождения требуемых запускаемой задачей или процедурой ресурсов в кольцевом буфере регистров общего назначения и/или кольцевого стека переключения контекста, а при завершении задачи или процедуры производят восстановление контекстов из памяти в обратной последовательности в освободившиеся ресурсы кольцевого буфера регистров общего назначения и кольцевого стека переключения контекста, а при отсутствии необходимых ресурсов в кольцевом буфере регистров общего назначения и кольцевом стеке переключения контекста, при размещении контекстов задач и процедур в оперативной памяти в первый элемент контекста задачи записывают указатель на конец контекста в памяти для предыдущего контекста в последний элемент контекста задачи записывают дескриптор начала и размера области памяти для размещения контекста следующей задачи, причем контексты всех процедур задачи последовательно размещают внутри контекста данной задачи, при формировании слова состояния процессора, в регистр слова состояния процессора записывают значения битов полей признаков результата выполненной операции, приоритета процесса, числа сохраняемых регистров общего назначения кольцевого буфера регистров общего назначения контекста данной задачи или процедуры, идентификатора процесса, признака запуска задачи и признака определяющего данное слово как слово состояния процессора при переключении контекста, при переносе контекстов задач и процедур в оперативную память осуществляют подачу команды процессору, причем в результате декодирования и выполнения данной команды процессором все контексты, за исключением текущего, последовательно переносят из процессора в память, причем для каждого контекста переносят значения слова состояния процессора, счетчика команд, дескриптора начала и размера области памяти для размещения контекста и указателя на конец контекста в памяти, при начальной установке параметров переключения контекста задач и процедур в процессоре, процессору подают команды записи новых значений в служебные регистры переключения контекста, декодируемые и исполняемые процессором, причем служебные регистры включают в свое число регистр указателя на строку таблицы дескрипторов начала и размера областей памяти для размещения контекстов .The way to switch the context of tasks and procedures in the processor is that it contains a ring buffer of general purpose registers, a status word register a processor, a command counter, a context switching ring stack, configured to store values of the processor status word register and a context command counter, data characterizing the placement of task contexts in RAM and hardware designed to control context switching, and containing sequential reservation of contexts in the ring buffer general purpose registers and ring stack context switching with subsequent recovery, or with context recovery In the reverse order, when the ring buffer of general purpose registers and the ring context switch stack are overflowed, the earliest context is forced out into the memory by reading 14 from the register reference access ring stack values of the current register of the context switch ring stack, and this extrusion is repeated until release the resources required by the task or procedure to be run in the ring buffer of general purpose registers and / or the ring switch stack text, and upon completion of a task or procedure, contexts are restored from memory in the reverse order to the freed resources of the ring buffer of general registers and the ring stack of context switching, and in the absence of the necessary resources in the ring buffer of general registers and the annular stack of context switching, when placing the contexts of tasks and procedures in the RAM, a pointer to the end of the context in the memory for the previous context is written to the first element of the context of the task; a handle to the beginning and size of the memory area is written to the last element of the context of the task to place the context of the next task, and the contexts of all The procedures of the task are sequentially placed inside the context of the given task, when forming the processor status word, the processor status word is written into the register the values of the bits of the attribute fields of the result of the performed operation, the process priority, the number of general-purpose registers to be saved, the circular buffer registers of the general purpose registers of the context of the given task or procedure, the process identifier, the sign of the task launch and the sign defining this word as the processor status word when switching the context when transferring contexts of tasks and procedures in the RAM provide a command to the processor, and as a result of decoding and execution of this command, the process rum all contexts other than the current sequentially transferred from the processor to the memory, wherein for each context value transferred processor status word, program counter, and start the descriptor storage area to accommodate the size of context and a pointer to the end of the context in the memory during setup context switching parameters of tasks and procedures in the processor, the processor is instructed to write new values to the service context switching registers decoded and executed by the processor, the service registers including a register pointer to a row table of descriptors of the beginning and size of memory areas for placing contexts.
При этом согласно способу размещение контекстов задач и процедур в оперативной памяти, в ячейки памяти ОЗУ-Д, выделенные для первого элемента контекста задачи записывают УКК-П для предыдущего контекста, а в последний элемент контекста задачи таким же образом записывают ДПРК следующей задачи. Причем контексты всех процедур задачи последовательно и непрерывно размещают внутри контекста данной задачи.Moreover, according to the method of placing contexts of tasks and procedures in RAM, in RAM-D memory cells allocated for the first element of the context of the task, write UKK-P for the previous context, and in the last element of the context of the task in the same way write the DPRK of the next task. Moreover, the contexts of all procedures of the task are sequentially and continuously placed inside the context of this task.
Согласно способу формирования ССП, в регистр ССП записывают значения битов полей ПРВО, ПП, ЧСР-КБР, ИП, ПЗЗ и ПССП.According to the method of forming the MSS, the values of the bits of the fields PRVO, PP, ChSR-KBR, IP, PZZ and MSSP are recorded in the MSS register.
Согласно способу переноса контекстов задач и процедур в оперативную память, процессору подают команду, характеризующуюся тем, что в результате декодирования и выполнения данной команды процессором все контексты, за исключением текущего, последовательно переносят из процессора в память . Причем для каждого контекста переносят значения ССП, CK, ДПРК и УКК-П. Согласно способу начальной установки параметров переключения контекста задач и процедур в процессоре, процессору подают команды записи новых значений в служебные регистры переключения контекста, декодируемые и исполняемые процессором. Причем одним из служебных регистров является регистр УТ-ДПРК.According to the method of transferring the contexts of tasks and procedures to RAM, the processor is given a command, characterized in that as a result of decoding and execution of this command by the processor, all contexts, except the current one, are sequentially transferred from the processor to memory. Moreover, for each context, the values of BSC, CK, DPRK and UKK-P are transferred. According to the method of initial setting the context switching parameters of tasks and procedures in the processor, the processor is instructed to write new values to the service context switching registers decoded and executed by the processor. Moreover, one of the service registers is the UT-DPRK register.
В частных случаях своей реализации заявленное изобретение дополнительно характеризуется тем, что в способе переключения контекста задач и процедур в процессоре, контексты для всех процедур задачи последовательно размещают в памяти, внутри контекста этой задачи .In particular cases of its implementation, the claimed invention is additionally characterized by the fact that in the method of switching the context of tasks and procedures in the processor, the contexts for all procedures of the task are sequentially placed in memory, inside the context of this task.
В другом частном случае данные, характеризующие размещение в памяти контекстов задач, представлены значениями ДПРК и УКК-П связанных, соответственно, со значением УКК-П для предыдущего контекста и значением ДПРК следующего контекста.In another particular case, the data characterizing the placement of task contexts in memory is represented by the values of DPRK and UKK-P associated, respectively, with the value of UCC-P for the previous context and the value of the DPRK of the next context.
При этом КСПК может быть выполнен с возможностью размещения в одном регистре стека значений ССП и CK одного контекста или значений УКК-П и ДПРК, одно из которых относится к первому контексту, а другое ко второму контексту, являющимися соседними.At the same time, the QPSC can be arranged to place the SSP and CK values of one context or the values of CCC-P and DPRK in one register of the stack, one of which refers to the first context, and the other to the second context, which are adjacent.
Кроме того, для вытеснения контекста в память, последовательно записывают в память значения РОНов, CK и ССП вытесняемого контекста. Количество РОНов, значения которых будут сохранены в КБР при вытеснении контекста, определяется исходя из значений полей ЧСР-КБР и ПЗЗ ССП. Причем, в случае истинности ПЗЗ записывают значения всех РОНов задачи, в противном случае записывают значения РОНов, число которых задано в ЧСР-КБР . Непосредственно после значения ССП записывают значение ДПРК для размещения следующего контекста, а значение УКК-П вытесняемого контекста в памяти записывают по адресу начала области памяти для размещения следующего контекста.In addition, in order to oust the context into memory, the values of RONs, CK, and BSC of the ousted context are sequentially written into the memory. Number of RONs, values which will be stored in the CBD when the context is supplanted, is determined based on the values of the fields CSR-KBR and PSZ MSS. Moreover, in the case of the truth of the RPS, the values of all RONs of the problem are recorded, otherwise, the values of RONs, the number of which are specified in the CSR-KBR, are recorded. Immediately after the SSP value, the DPRK value is recorded for placing the next context, and the value of the CCC-P of the extruded context in the memory is recorded at the beginning of the memory area to place the next context.
Для такой реализации способа процессор содержит архитектурные регистры ДПРК, УКК-П и УСА-П. При переключении контекста задачи в КСПК заносят значения УКК-П и ДПРК из указанных регистров . Значение ДПРК получают из таблицы ДПРК, содержащей все заранее определенные значения ДПРК. Начальное значение регистра УКК-П устанавливают равным значению регистра ДПРК. При вытеснении контекста задачи в память увеличивают значение регистра УКК-П на величину размера сохраняемых в памяти элементов контекста. Осуществляют запись в память посредством РО-П, выполненного с возможностью отображения элемента памяти с адресом, содержащемся в регистре УСА-П. Причем после записи в РО-П значение УСА-П увеличивают на единичное значение .For such an implementation of the method, the processor contains architectural registers DPRK, UKK-P and USA-P. When switching the context of the task, the values of UKK-P and DPRK from the indicated registers are entered into the KSPK. The DPRK value is obtained from the DPRK table containing all predetermined DPRK values. The initial value of the register UKK-P is set equal to the value of the register DPRK. When the context is supplanted, the tasks in memory increase the value of the UKK-P register by the size of the context elements stored in the memory. Write to the memory by means of the PO-P, configured to display the memory element with the address contained in the register USA-P. Moreover, after recording in RO-P, the value of USA-P is increased by a single value.
Для обеспечения возможности восстановления контекстов из памяти в ССП и УКК-П изначально включают поле признака ССП или УКК-П соответственно. Причем, при восстановлении контекстов из памяти, считывают из памяти элемент контекста с адресом из УСА-П посредством РО-П. Если данный элемент обладает признаком ССП, то считываемый контекст является контекстом вложенной в задачу процедуры, для восстановления которой последовательно считывают значения ССП и CK в КСПК, а РОНы, численно соответствующие значению ЧСР-КБР из ССП, в КБР. В случае, если первоначально прочитанный из памяти элемент обладает признаком УКК-П, то считываемый контекст является контекстом задачи. При этом осуществляют переход по адресу из прочитанного УКК-П, указывающий на конец ранее сохраненного в памяти контекста, после чего последовательно считывают значения ССП и CK в КСПК, а все РОНы данного контекста в КБР.To provide the possibility of reconstructing contexts from memory, in the SSP and UKK-P initially include the attribute field SSP or UKK-P, respectively. Moreover, when recovering contexts from memory, a context element with an address from USA-P is read from memory by means of RO-P. If this element has the sign of SSP, then the context to be read is the context of the procedure embedded in the task, to restore which the values of SSP and CK are successively read in the KSPK, and RONs, numerically corresponding to the value of CSR-KBR from SSP, in KBR. If the element originally read from memory has the sign of UKK-P, then the read context is the context of the task. In this case, a transition to the address from the read UKK-P is carried out, indicating the end of the context previously stored in the memory, after which the values of the SSP and CK are read in sequence in the KSPK, and all RONs of this context in the KBR.
Способ размещения контекстов задач и процедур в оперативной памяти в своих частных случаях характеризуется тем, что значение УКК-П считывают из поля УКК-П регистра КСПК, а значение ДПРК считывают из поля ДПРК этого же регистра. Или, в случае, когда из задачи не были вызваны процедуры, значение УКК-П вычисляют как сумму элементов памяти для размещения значений РОНов, значения CK, значения ССП данной задачи и значения ДПРК следующего контекста. В случае наличия вызванных из задачи процедур, сумма адресов элементов памяти дополнительно включает адреса элементов памяти для размещения значений РОНов, значений CK и значений ССП всех процедур данной задачи. В частном случае данного способа УКК-П содержит поле признака, определяющего содержимое данного регистра как УКК-П. Причем поле признака УКК-П имеет нулевое значение, не подлежит изменению и расположено в тридцать втором от начала регистра бите, являющемся последним.The method for placing the contexts of tasks and procedures in RAM in their particular cases is characterized by the fact that the value of UCC-P is read from the UCC-P field of the KSPK register, and the value of DPRK is read from the DDRK field of the same register. Or, in the case when no procedures were called from the task, the UCC-P value is calculated as the sum of memory elements for placing the RON values, CK values, the SSP value of this task, and the DPRK values of the following context. If there are procedures called up from the task, the sum of the addresses of the memory elements additionally includes the addresses of the memory elements to place the RON values, CK values, and SSP values of all procedures of this task. In the particular case of this method, UKK-P contains a feature field that defines the contents of this register as UKK-P. Moreover, the attribute field UKK-P has a zero value, cannot be changed, and is located in the thirty-second from the beginning of the register bit, which is the last.
Для каждой области памяти, предназначенной для размещения в ней контекста задачи, заранее может быть сформировано значение ДПРК, а при запуске задачи осуществлена запись соответствующего ей значения ДПРК в КСПК.For each memory area intended for placing the context of the task in it, a DPRK value can be generated in advance, and when the task is started, the corresponding DPRK value is recorded in the CSPC.
Любая из частных реализаций данного способа может дополнительно характеризоваться тем, что каждый контекст занимает непрерывную область памяти.Any of the private implementations of this method can be further characterized in that each context occupies a continuous memory area.
Способ формирования ССП в частных случаях характеризуется тем, что значение бита поля ПССП всегда задают отличным от значения бита имеющего такую же позицию в УКК-П. При этом бит поля ПССП всегда задают равным, например, единице.The method of forming SSP in special cases is characterized by the fact that the value of the bits of the SSSP field is always set different from the value of the bits having the same position in UKK-P. In this case, the bit of the MSSP field is always set equal, for example, to one.
В другом частном случае реализации способа, при запуске задачи, значение бита поля ПЗЗ задают равным единице.In another particular case of the implementation of the method, when starting a task, the value of the bit of the PPZ field is set to unity.
В еще одном частном случае значения битов поля ЧСР-КБР непосредственно устанавливают командой процессора, имеющей код 11100100 в своих старших разрядах, и поле из четырех бит в первых младших разрядах для величины задаваемой командой записи в ССП значения числа сохраняемых РОНов . В любом из частных случаев данного способа полям ПРВО, полю ПП и полю ЧСР-КБР выделяют последовательно по четыре бита начиная от начала ССП, полю ИП выделяют последующие пять битов, а полю ПССП выделяют тридцать второй бит, являющийся последним.In another particular case, the values of the bits of the CSR-KBR field are directly set by the processor command having the code 11100100 in their high order bits, and the field of four bits in the first low order bits for the value of the number of stored RONs specified by the write command in the SSP. In any of the particular cases of this method, four bits are sequentially allocated to the FIR fields, the PP field and the CSR-KBR field starting from the beginning of the MSS, the next five bits are allocated to the IP field, and the thirty-second bit, which is the last, is allocated to the MSS field.
В частном случае способа переноса контекстов задач и процедур в оперативную память команда, подаваемая процессору имеет код 11101100 в своих старших разрядах.In the particular case of the method of transferring the contexts of tasks and procedures into the RAM, the command issued to the processor has the code 11101100 in its high order bits.
В одном из частных случаев способ начальной установки параметров переключения контекста задач и процедур в процессоре дополнительно характеризуется тем, что служебные регистры включают в свое число рабочие регистры КСПК, а записываемые новые значения представляют собой ДПРК.In one of the special cases, the method of initial setting the parameters for switching the context of tasks and procedures in the processor is additionally characterized by the fact that the service registers include the KSPK working registers, and the new values recorded are DPRK.
В другом частном случае способ характеризуется тем, что служебные регистры включают в свое число регистр УВ-КСПК.In another particular case, the method is characterized in that the service registers include the UV-KSPK register.
В любом из приведенных частных случаев данного способа команда записи подаваемая процессору может иметь код 11101111 или 11011101 или 01110000 в своих разрядах с 25 по 32.In any of the particular cases of this method, the write command issued to the processor may have a code 11101111 or 11011101 or 01110000 in its bits 25 through 32.
Приведенные совокупности признаков обеспечивают получение указанного технического результата во всех случаях, на которые распространяется испрашиваемый объем правовой охраны.These sets of features provide the specified technical result in all cases to which the requested amount of legal protection applies.
Сущность изобретения поясняют следующие схемы: фиг .1 : принципиальная схема переключения контекста; фиг .2 : схема общего алгоритма переключения контекста; фиг .3 : схема алгоритма вытеснения контекста в оперативную память; фиг .4 : схема последовательности запуска механизма переключения контекста; фиг .5 : упрощенная структурная схема микропроцессора "Орхидея" .The invention is illustrated by the following schemes: Fig. 1: schematic diagram of the context switch; Fig. 2: diagram of a general context switching algorithm; Fig. 3: diagram of the algorithm for displacing the context in RAM; Fig. 4: a sequence diagram of the start of the context switching mechanism; Fig. 5: simplified block diagram of the microprocessor "Orchid".
Осуществление изобретения поясняется на примере процессора, в котором реализован полностью аппаратный механизм переключения контекста задач и процедур. Начального задания требуют только области памяти для размещения контекстов .The implementation of the invention is illustrated by the example of a processor in which a fully hardware-based mechanism for switching the context of tasks and procedures is implemented. Initial tasks require only memory areas for placing contexts.
Процессор содержит архитектурные регистры CK, ССП, ДПРК, УКК-П, УТ-ДПРК и УСА-П, а также показанные на фиг.l КБР 1 и КСПК 2.The processor contains the architectural registers CK, SSP, DPRK, UKK-P, UT-DPRK and USA-P, as well as the KBR 1 and KSPK 2 shown in FIG.
ССП характеризует задачу или процедуру, а CK характеризует стадию их выполнения.BSC characterizes the task or procedure, and CK characterizes the stage of their implementation.
Архитектурные регистры ДПРК, УКК-П, УТ-ДПРК и УСА-П выполнены обособленными от КБР 1 и КСПК 2, и предназначены для организации хранения контекстов в оперативной памяти 3.The architectural registers DPRK, UKK-P, UT-DPRK and USA-P are made separate from KBR 1 and KSPK 2, and are designed to organize the storage of contexts in RAM 3.
КБР 1 представляет собой набор из 32-битных регистров. Процессор непосредственно обрабатывает данные только из регистров попадающих в текущее окно (фрейм) 4. Эти регистры являются РОНами выполняемой задачи или процедуры. В данном примере реализации способа окно РОНов содержит 16 регистров. При переключении между задачами или процедурами смещение окна 4 составляет от 1 до 16 регистров.CBD 1 is a collection of 32-bit registers. The processor directly processes data only from registers falling into the current window (frame) 4. These registers are RONs of the task or procedure being performed. In this example implementation of the method, the RON window contains 16 registers. When switching between tasks or procedures, the shift of window 4 is from 1 to 16 registers.
Адресация РОНов в КБР 1 выполнена так, что адрес следующего регистра на 1 больше адреса предыдущего регистра, а при достижении адреса самого последнего регистра следующий адрес будет принадлежать самому первому регистру .Addressing RONs in CBD 1 is such that the address of the next register is 1 higher than the address of the previous register, and when the address of the most recent register is reached, the next address will belong to the very first register.
Для управления КБР 1 служат регистры УД-КБР и УВ-КБР.For the management of CBD 1 are the registers UD-CBD and HC-CBD.
КСПК 2 представляет собой стек регистров для хранения величин ССП, CK, ДПРК и УКК-П, соответствующих РОНам из КБР 1. В каждый регистр КСПК 2 может быть записана пара значений {CCП,CK} или пара значений {УКК-П, ДПРК} . Причем УКК-П должно относиться к первому из двух соседних контекстов, а значение ДПРК ко второму контексту, следующему непосредственно за первым. Благодаря этому КСПК 2 реализует функции стека возвратов (rеturп stасk) и стека обращений к памяти.KSPK 2 is a stack of registers for storing the values of SSP, CK, DPRK and UKK-P, corresponding to RONs from CBD 1. A pair of values {KCP, CK} or a pair of values {UKK-P, DPRK} can be written to each register of KSPK 2 . Moreover, UKK-P should relate to the first of two neighboring contexts, and the value of DPRK to the second context, immediately following the first. Due to this, KSPK 2 implements the functions of the return stack (returp stask) and the stack of memory accesses.
Адрес в КСПК 2, по которому может быть сделана следующая запись, содержится в регистре УВ-КСПК. Для того, чтобы можно было отличить занятую и свободную области КСПК 2, используют регистр УД-КСПК.The address in KSPK 2, at which the following entry can be made, is contained in the UV-KSPK register. In order to be able to distinguish between occupied and free areas of KSPK 2, use the register UD-KSPK.
Чтение и запись в регистры КБР 1 и КСПК 2 осуществляется посредством регистров РО-КБР и РО-КСПК, являющихся регистрами косвенной адресации.Reading and writing to the registers KBR 1 and KSPK 2 is carried out through the registers RO-KBR and RO-KSPK, which are the registers of indirect addressing.
РО-КБР выполнен с возможностью отображения элемента КБР 1 с адресом, содержащемся в регистре УД-КБР. Причем, после чтения из РО-КБР, значение адреса в регистре УД-КБР увеличивается на единичное значение. Перед записью в РО-КБР адрес в УД-КБР уменьшается на единичное значение.RO-CBD is configured to display a CBD element 1 with the address contained in the register UD-CBD. Moreover, after reading from the RO-CBD, the value of the address in the register UD-CBD increases by a single value. Before writing to the RO-CBD, the address in the UD-KBR is reduced by a single value.
РО-КСПК выполнен с аналогичными свойствами в отношении регистра УД-КСПК.RO-KSPK is made with similar properties in relation to the register UD-KSPK.
Для осуществления механизма переключения контекста в ССП и УКК-П включены специальные поля.To implement the context switching mechanism, special fields are included in the BSC and UKK-P.
Формат ССП характеризуется тем, что ССП содержит поля признаков ПРВО, ПП, ЧСР-КБР, ИП, ПЗЗ и ПССП . Значение бита поля ПССП всегда задают отличным от значения бита имеющего такую же позицию в УКК-П, что позволяет различать их при восстановлении контекста .The BSC format is characterized by the fact that the BSC contains the fields of attributes PRVO, PP, ChSR-KBR, IP, PPZ and PSSP. The value of the bit of the PSSS field is always set different from the value of the bit having the same position in UKK-P, which allows them to be distinguished when restoring the context.
Для функционирования механизма переключения контекста задач должны быть определены значения ДПРК, содержащие данные о размере и расположении в памяти 3 всех областей для сохраняемых контекстов. Все ДПРК на этапе начальной установки процессора помещают в таблицу 5 ДПРК в памяти 3. Строку для чтения из таблицы 5 ДПРК определяет значение регистра УТ-ДПРК.For the switching mechanism of the task context to work, the values of the DPRK must be determined, containing data on the size and location in memory of 3 of all areas for the saved contexts. All DPRK at the stage of initial installation of the processor are placed in table 5 DPRK in memory 3. The line for reading from table 5 DPRK determines the value of the register UT-DPRK.
Переключение контекста в процессоре осуществляется следующим образом.Context switching in the processor is as follows.
После получения б (фиг.2) сигнала прерывания производится проверка 7 наличия свободных ресурсов в КБР 1 и КСПК 2. Необходимым условием доступности свободных ресурсов для новой задачи в данном примере процессора является наличие не менее 16 свободных РОНов в КБР 1 и не менее двух свободных строк-регистров в КСПК 2. В случае, если необходимые ресурсы недоступны, производится вытеснение 8 самого раннего (старого) контекста из КБР 1 и КСПК 2 в оперативную память 3.After receiving b (figure 2) the interrupt signal is checked 7 for the availability of free resources in CBD 1 and KSPK 2. A necessary condition for the availability of free resources for a new task in this processor example is the presence of at least 16 free RONs in CBD 1 and at least two free register lines in KSPK 2. If the necessary resources are not available, 8 of the earliest (old) context is forced out of CBD 1 and KSPK 2 in random access memory 3.
При наличии необходимых свободных ресурсов производят резервирование 9 текущего контекста в КБР 1 и КСПК 2, включающее в себя смещение 10 в КБР 1 текущего окна РОНов путем увеличения значения УВ-КБР на значение ЧСР-КБР из текущего ССП. Значение ЧСР-КБР при этом унаследовано от предыдущего контекста или, при необходимости, заново установлено программно.If the necessary free resources are available, 9 current contexts are backed up in CBD 1 and KSPK 2, which includes an offset of 10 in KBR 1 of the current RON window by increasing the value of HC-CBD by the value of CSR-KBR from the current SSP. In this case, the value of the CSR-CBD is inherited from the previous context or, if necessary, is reinstalled programmatically.
Затем осуществляется сохранение 11 в КСПК 2 значений регистров ССП и CK, относящихся к текущей задаче, по адресу, содержащемуся в УВ-КСПК 2. Данные значения записываются в один регистр и представляют собой одну строку в КСПК 2.Then, the 11 values of the SSP and CK registers related to the current task are stored in KSPK 2 at the address contained in the UV-KSPK 2. These values are written in one register and represent one line in KSPK 2.
В следующую строку КСПК 2 записывают 12 значения ДПРК для новой запускаемой задачи и УКК-П для текущей задачи, являющейся резервируемой. Причем значение ДПРК считывают из строки таблицы ДПРК в памяти по УТ-ДПРК, а УКК-П вычисляют как сумму элементов памяти для размещения РОНов, CK, ССП и ДПРК. В случае наличия вызванных из задачи процедур, сумма элементов памяти дополнительно включает элементы памяти для 7 000124In the next line of KSPK 2 write 12 values of DPRK for the new launched task and UKK-P for the current task, which is reserved. Moreover, the value of the DPRK is read from the row of the DPRK table in memory by UT-DPRK, and the UCC-P is calculated as the sum of memory elements for placing RONs, CK, MSS and DPRK. If there are procedures called from the task, the sum of memory elements additionally includes memory elements for 7 000124
19 размещения РОНов, CK и ССП всех процедур.19 placement of RONs, CK and BSC of all procedures.
После успешного резервирования 9 текущего контекста осуществляется инициализация 13 регистров ССП и CK для запускаемой задачи.After successfully backing up 9 current contexts, 13 registers of MTP and CK are initialized for the task to be started.
Вытеснение 8 самого раннего контекста из КБР 1 и КСПК 2 в оперативную память 3 поясняется фиг.З, и включает в себя чтение 14 из РО-КСПК значения текущего регистра КСПК.The crowding out 8 of the earliest context from the CBD 1 and the BSCC 2 into the RAM 3 is illustrated in FIG. 3, and includes reading 14 from the RO-BSCC values of the current register of the BSCC.
Так как ССП содержит поле ПЗЗ, то всегда можно определить 15, относится данный контекст к задаче или к процедуре.Since the MTS contains the field of the PPZ, it is always possible to determine 15, this context refers to the task or procedure.
Если данный контекст относится к задаче, то число последующих циклов чтения устанавливается 16 равным полному числу РОНов задачи - 16. В случае контекста процедуры число последующих циклов чтения устанавливается 17 равным значению ЧСР-КБР из ССП. После этого выполняется 18 требуемое число циклов чтения значений из РО-КБР и их запись в РО-П. Регистр РО-П является регистром косвенной адресации и отображает элемент памяти с адресом, содержащемся в УСА-П. Причем, перед чтением из РО-П содержимое УСА-П увеличивается на единичное значение, что ведет к смещению указателя на следующий элемент памяти .If this context refers to the task, then the number of subsequent reading cycles is set to 16 equal to the total number of RONs of the task - 16. In the case of the context of the procedure, the number of subsequent reading cycles is set to 17 equal to the value of the CSR-CBD from the BSC. After that, the required number of 18 cycles of reading values from the RO-CBD and their writing to the RO-P are performed. Register RO-P is a register of indirect addressing and displays a memory element with the address contained in USA-P. Moreover, before reading from RO-P, the contents of USA-P are increased by a single value, which leads to a shift of the pointer to the next memory element.
Таким образом, в оперативную память 3 перенесены сохраняемые РОНы одного контекста .Thus, the stored RONs of the same context are transferred to the RAM 3.
Затем осуществляется запись 19 в РО-П значений CK и ССП. Если данный контекст является 20 контекстом процедуры, то его вытеснение в оперативную память 3 завершено 21.Then, the value of CK and BSC is recorded in PO-P 19. If this context is the 20th context of the procedure, then its extrusion into RAM 3 is completed 21.
Если данный контекст является 20 контекстом задачи, то осуществляется последовательное чтение 22 из РО-КСПК пары значений УКК-П и ДПРК, запись 23 в РО-П значения ДПРК, запись 24 в УСА-П значения ДПРК и запись 25 в РО-П значения УКК-П. Таким образом, вытеснение контекста задачи в оперативную память 3 завершено 21. Причем контексты всех процедур, вызванных данной задачей последовательно размещены внутри контекста этой задачи .If this context is the 20 context of the task, then a sequential reading of 22 from the RO-KSPK pair of UKK-P and DPRK values is made, writing 23 in the RO-P values of the DPRK, writing 24 in the USA-P values of the DPRK and writing 25 in the RO-P values UKK-P. Thus, the extrusion of the task context into RAM 3 is completed 21. Moreover, the contexts of all procedures caused by this task are sequentially placed inside the context of this task.
Возможны ситуации, когда необходимо перенести все сохраненные контексты из КБР 1 и КСПК 2 в память 3. Например для того, чтобы просмотреть или изменить какой- либо контекст, в частности значение ССП. Для этого система команд процессора должна включать в себя команду переноса контекстов задач и процедур в память 3, в результате декодирования и выполнения которой все контексты, за исключением текущего, должны быть перенесены из регистров процессора в память 3.There may be situations when it is necessary to transfer all saved contexts from CBD 1 and KSPK 2 to memory 3. For example, in order to view or change some context, in particular, the value of the SSP. For this, the processor command system must include a command for transferring the contexts of tasks and procedures to memory 3, as a result of decoding and execution of which all contexts, with the exception of the current one, must be transferred from the processor registers to memory 3.
При завершении текущей задачи автоматически осуществляется восстановление к тому контексту, из которого была вызвана текущая задача.When the current task is completed, it is automatically restored to the context from which the current task was called.
При завершении задачи УВ-КСПК уменьшается на единичное значение, одновременно с этим декрементируется и УВ-КБР.Upon completion of the task, the HC-CBFR decreases by a single value, and at the same time, the HC-CBD decreases.
Значения полученных указателей сравниваются со значениями УД-КБР и УД-КСПК, на основании чего определяется наличие требуемых данных в КБР 1 и КСПК 2. Если требуемых для восстановления данных в них нет, то автоматически включается механизм их восстановления из памяти 3. При этом значение РО-П уже отражает содержание УСА-П, указывающее на место в памяти 3, из которого следует производить восстановление .The values of the resulting pointers are compared with the values of UD-KBR and UD-KSPK, on the basis of which the availability of the required data in KBR 1 and KSPK 2 is determined. If there is no data required for restoration in them, the mechanism for their recovery from memory 3 is automatically turned on. Moreover, the value of PO-P already reflects USA-P content, indicating a place in memory 3 from which recovery should be made.
Если данный элемент контекста является УКК-П, то осуществляют переход по адресу содержащемуся в нем, а затем последовательно считывают в КСПК 2 значения ДПРК, ССП, CK. Значения 16 РОНов переносят в KCB 1. После этого заносят в КСПК 2 значение УКК-П предыдущего контекста, расположенное в последнем элементе контекста в памяти 3.If this context element is UKK-P, then go to the address contained in it, and then sequentially read in KSPK 2 values DPRK, SSP, CK. The values of 16 RONs are transferred to KCB 1. After that, the value of UKK-P of the previous context located in the last context element in memory 3 is entered in KSPK 2.
Если текущий элемент контекста является ССП, то в КСПК 2 переносят значения ССП, CK, а в KCB 1 переносят РОНы, число которых узнают из поля ЧСР-КБР считанного ССП.If the current context element is SSP, then SSP, CK are transferred to KSPK 2, and RONs are transferred to KCB 1, the number of which is recognized from the CSR-KBR field of the read SSP.
Организация контекстов в КБР 1, КСПК 2 и памяти 3 поясняется примером, представленным на фиг.l, на которой выделен контекст одной задачи.The organization of contexts in CBD 1, KSPK 2, and memory 3 is illustrated by the example shown in FIG. 1, in which the context of one task is highlighted.
РОНы 26 КБР 1 и данные 27 КСПК 2 представляют собой контекст одной задачи.RONs 26 CBD 1 and data 27 KSPK 2 represent the context of one task.
В показанной на фиг.l ситуации контекст задачи "В" включает два контекста, один из которых относится непосредственно к данной задаче - контекст "ВО", а второй относится к вызванной из нее процедуре "Bl". Связь контекстов в памяти 3 организуется за счет того, что в последний элемент 28 предыдущего контекста "А" записывают значение ДПPK(B) определяющее расположение первого элемента контекста "В" . Записывают по данному адресу памяти значение УКК-П (А) , указывающее на расположение элемента 28 в памяти. Причем для считывания значений ДПPK(B) и УКК-П (А) из КСПК 2 требуется одна операция чтения, т.к. эти величины расположены в одном регистре КСПК 2.In the situation shown in FIG. 1, the context of the task "B" includes two contexts, one of which relates directly to this task - the context "IN", and the second refers to the procedure called "Bl" from it. Communication contexts in memory 3 is organized due to the fact that in the last element 28 of the previous context "A" write the value DPPK (B) that determines the location of the first context element "B". The value UKK-P (A) is recorded at this memory address, indicating the location of element 28 in memory. Moreover, to read the values DPPK (B) and UKK-P (A) from KSPK 2 requires one read operation, because these values are located in one register KSPK 2.
Вслед за УКК-П (А) записывают в память значения 29 РОНов, CK и ССП для всех контекстов, входящих в контекст данной задачи. Затем значение УКК-П (В) помещают в самый первый элемент 30 контекста задачи "В".Following UKK-P (A), the values of 29 RONs, CK, and BSC are recorded in memory for all contexts included in the context of this task. Then the value UKK-P (B) is placed in the very first element 30 of the context of the task "B".
Последовательность запуска механизма переключения контекста поясняет фиг .4.The startup sequence of the context switching mechanism is illustrated in Fig. 4.
После включения 31 питания процессора необходимо подать 32 на него внешний сигнал сброса (RESET) , посредством которого производится начальная установка 33 регистров процессора. При этом устанавливается наивысший приоритет в регистре ССП и начальное значение CK.After turning on 31 processor power, it is necessary to apply 32 to it an external reset signal (RESET), through which the initial setup of 33 processor registers is performed. In this case, the highest priority is set in the SSP register and the initial value of CK.
После снятия сигнала RESET процессор начинает выполнять программу с указанного адреса. При этом таблица векторов прерываний и таблица ДПРК еще не определены. В данном режиме процессор не может отвечать на прерывания и переключаться с задачи на задачу, но при этом он может 7 000124After removing the RESET signal, the processor starts to execute the program from the specified address. At the same time, the table of interrupt vectors and the DPRK table have not yet been determined. In this mode, the processor cannot respond to interrupts and switch from task to task, but at the same time it can 7 000124
23 вызывать процедуры с максимальной глубиной вложенности до восьми .23 call procedures with a maximum nesting depth of up to eight.
Сначала выполняется 34 программа начальной установки процессора, по завершении которой выполняется 35 команда начальной установки механизма сохранения/восстановления контекста задач при вытеснении контекстов в память и осуществляется запуск 36 первичной задачи.First, a 34 initial processor installation program is executed, after which a 35 command is executed for the initial installation of the mechanism for saving / restoring the context of tasks when the contexts are pushed into memory, and 36 primary tasks are launched.
Программа начальной установки процессора формирует 37 таблицу ДПРК, формирует 38 УТ-ДПРК. Затем формируется 39 таблица векторов прерываний и формируется 40 указатель на таблицу векторов прерываний.The initial setup program of the processor generates 37 DPRK tables, forms 38 UT-DPRK. Then, a 39 interrupt vector table is generated and a 40 pointer to an interrupt vector table is generated.
По завершении указанных действий становится возможным выполнить команду начальной установки 35 механизма сохранения/восстановления контекста задач при вытеснении контекстов в память (RESTART) , приводящую к считыванию из таблицы ДПРК первого значения и его размещению 41 в КСПК. Затем из таблицы векторов прерываний выбираются 42 значения ССП и CK, соответствующие задаче рестарта. После этого контекст начальной загрузки забывается.Upon completion of these steps, it becomes possible to execute the initial installation command 35 of the mechanism for saving / restoring the context of tasks when the contexts are pushed into memory (RESTART), which leads to the reading of the first value from the DPRK table and its placement 41 in the KSPK. Then, from the table of interrupt vectors, 42 SSP and CK values corresponding to the restart task are selected. After that, the bootstrap context is forgotten.
Команда RESTART выполняется как особое прерывание без сохранения текущего контекста.The RESTART command is executed as a special interrupt without saving the current context.
Для приведения механизма сохранения/восстановления контекстов в памяти в исходное состояние, в регистр УТ-ДПРК следует записать адрес нулевого дескриптора таблицы ДПРК. Затем записывают нулевые значения в регистры УВ-КБР, 24To bring the mechanism of saving / restoring contexts in memory to their initial state, the address of the zero descriptor of the DPRK table should be written in the UT-DPRK register. Then write zero values in the registers UV-CBD, 24
УД-КБР, УВ-КСПК и УД-КСПК. Записывают в КСПК 2 пару значений ДПРК, после чего увеличивают значение УВ-КСПК на единичное значение и присваивают регистру УКК-П значение ДПРК.UD-KBR, UV-KSPK and UD-KSPK. A pair of DPRK values is recorded in KSPK 2, after which the value of the UV-KSPK is increased by a single value and the value of the DPRK is assigned to the UCC-P register.
Примером осуществления заявленного изобретения является микропроцессор для встраиваемых приложений "Орхидея" . На фиг .5 представлена упрощенная структурная схема этого процессора.An example implementation of the claimed invention is a microprocessor for embedded applications "Orchid". In Fig. 5 presents a simplified structural diagram of this processor.
Микропроцессор "Орхидея" является процессором с сокращенным набором команд (RISC) и характеризуется полностью автоматической поддержкой механизма переключения задач и процедур, причем все необходимые для этого действия выполняются на аппаратном уровне, за исключением формирования таблицы ДПРК.Microprocessor "Orchid" is a processor with a reduced set of instructions (RISC) and is characterized by fully automatic support for the mechanism of switching tasks and procedures, and all the necessary steps for this are performed at the hardware level, except for the formation of the DPRK table.
"Орхидея" содержит КБР 1, АЛУ 43, ДК 44 и БИ 45, CK 46 и БФАВИ 47, а также БОП 48, характерные для ряда RISC процессоров ."Orchid" contains KBR 1, ALU 43, DK 44 and BI 45, CK 46 and BFAVI 47, as well as BOP 48, which are typical for a number of RISC processors.
Существенным отличием "Орхидеи" от обычных RISC процессоров является механизм переключения контекста, существенным элементом которого являются блоки КСПК 2 и СУПК 49 (фиг.5) .A significant difference between "Orchids" and conventional RISC processors is a context switching mechanism, an essential element of which are blocks KSPK 2 and CUPK 49 (figure 5).
При этом вход-выход данных АЛУ 43 и первый вход-выход данных БОП 48 соединены с входом-выходом данных КБР 1.In this case, the input-output data ALU 43 and the first input-output data BOP 48 are connected to the input-output data CBD 1.
ДК 44 соединен своим входом данных с выходом данных ОЗУ-И 50 через БИ 45 посредством шины данных. Выходы управления ДК 44 соединены с входами управления АЛУ 43, БОП 48, CK 46 и первым входом управления КБР 1. ДК 44 также соединен с СУПК 49 через вход-выход управления.DK 44 is connected by its data input to the data output of the RAM-I 50 through the BI 45 through the data bus. Outputs control DC 44 are connected to the control inputs of ALU 43, BOP 48, CK 46 and the first control input of CBD 1. DC 44 is also connected to the control system 49 through the input-output control.
Вход-выход данных CK 46 соединен с входом-выходом данных КСПК 2, а выход данных связан со входом данных ОЗУ-И 50 через БФАВИ 47 и адресную шину.The input-output data CK 46 is connected to the input-output data KSPK 2, and the data output is connected to the data input RAM-50 through BFAVI 47 and the address bus.
Первый выход данных КБР 1 и выход данных КСПК 2 соединены с СУПК 49. Первый и второй выходы управления СУПК 49 соединены, соответственно, с входом управления КСПК 2 и вторым входом управления КБР 1.The first output of the CBD 1 data and the output of the KSPK 2 data are connected to the control system 49. The first and second control outputs of the control system 49 are connected, respectively, to the control input of the KSPK 2 and the second control input of the KBR 1.
Выход данных СУПК 49 соединен с входом данных БОП 48.The output of the control system 49 is connected to the data input of the BOP 48.
Второй вход-выход данных БОП 48 соединен с входом-выходом данных ОЗУ-Д 51 посредством шины данных, а вход данных ОЗУ-Д 51 соединен с выходом данных БОП 48 посредством адресной шины.The second input-output data BOP 48 is connected to the input-output data OZU-D 51 via the data bus, and the data input RAM-D 51 is connected to the data output BOP 48 via the address bus.
СУПК 49 представляет собой абстрактное обобщение аппаратных средств, необходимых для управления переключением контекста. Данные аппаратные средства, по своему существу, являются средствами работы с системными регистрами посредством операций чтения и записи в соответствии с алгоритмом переключения контекста, реализованным на основе конечного автомата. Аппаратная реализация СУПК может иметь различные варианты и не представляет сложности относительно существующих технологий. Сохранение и восстановление контекстов в/из памяти осуществляется следующим образом.CMSC 49 is an abstract generalization of the hardware needed to control context switching. These hardware, in essence, are means of working with system registers through read and write operations in accordance with a context switching algorithm implemented on the basis of a state machine. The hardware implementation of the control system can have various options and is not difficult with respect to existing technologies. Saving and restoring contexts to / from memory is as follows.
По признаку переполнения ресурсов хотя бы в КБР 1 или КСПК 2 генерируется сигнал запуска СУПК 49, в процессе работы которого осуществляется перенос данных из КБР 1 и КСПК 2 в ОЗУ-Д 51 через БОП 48, формирующего адрес, данные и сигналы записи в ОЗУ-Д 51.Based on the sign of overflow of resources, at least in KBR 1 or KSPK 2, a start-up signal is generated for СУПК 49, during the operation of which data is transferred from KBR 1 and KSPK 2 to RAM-D 51 through BOP 48, which generates the address, data and write signals to RAM- D 51
По признаку отсутствия ресурсов в КБР 1 или КСПК 2 производится генерирование сигнала запуска СУПК 49, осуществляющего перенос данных из ОЗУ-Д 51 в КБР 1 и КСПК 2 через БОП 48. При этом БОП 48 формирует адрес, данные и сигналы чтения из ОЗУ-Д 51.On the basis of the lack of resources in KBR 1 or KSPK 2, a start-up signal is generated for CPSK 49, which transfers data from RAM-D 51 to KBR 1 and KSPK 2 through BOP 48. In this case, BOP 48 generates an address, data and read signals from RAM-D 51.
Причем при осуществлении операции записи в регистр ССП из ОЗУ-И 50 выбирается код инструкции, который в дальнейшем дешифрируется в ДК 44 с целью получения сигналов для управления логической схемой записи регистра ССП, а при выполнении команды переноса контекстов задач и процедур в ОЗУ-Д 51, из ОЗУ-И 50 выбирается код инструкции, дешифрируемый в дальнейшем в ДК 44 с целью получения логического сигнала запуска СУПК 49.Moreover, during the operation of writing to the SSP register from RAM-I 50, an instruction code is selected, which is subsequently decoded in DC 44 in order to obtain signals for controlling the logic of the SSB register writing, and when the command for transferring task and procedure contexts to RAM-D 51 is executed , from the RAM-I 50, an instruction code is selected, which is further decrypted in DC 44 in order to obtain a logical start signal for the control system 49.
Реализация "Орхидеи" характерна тем, что значение бита поля ПССП всегда равно единице, а соответствующий бит в УКК-П всегда имеет нулевое значение. Значение бита поля ПЗЗ при запуске задачи равно единице .The implementation of "Orchid" is characterized by the fact that the value of the bit of the PSSS field is always equal to one, and the corresponding bit in UKK-P always has a zero value. The value of the bit of the PPZ field when starting the task is equal to one.
Кроме того, поля ПРВО, ПП и ЧСР-КБР в ССП "Орхидеи" занимают по четыре бита начиная от начала ССП, поле ИП занимает последующие пять битов, а поле ПССП занимает самый последний, тридцать второй бит. Причем установка битов поля ЧСР-КБР осуществляется командой с машинным кодом 11100100 в своих старших разрядах, и содержащей поле из четырех бит в первых младших разрядах для величины задаваемой командой записи в ССП значения числа сохраняемых РОНов в КБР 1.In addition, the fields of PRVO, PP and CSR-KBR in the SSP "Orchids" occupy four bits starting from the beginning of the MSS, the IP field occupies the next five bits, and the MSSP field occupies the last, thirty-second bit. Moreover, setting the bits of the CSR-KBR field is carried out by a command with machine code 11100100 in its high order bits, and containing a field of four bits in the first low order bits for the value of the number of stored RONs in KBR 1 set by the write command in the SSP.
Команда переноса всех сохраненных контекстов в память для "Орхидеи" имеет код 11101100 в старших разрядах, а команда записи подаваемая процессору имеет код 11101111 или 11011101 или 01110000 в своих разрядах с 25 по 32. The command to transfer all saved contexts to the memory for "Orchid" has the code 11101100 in high order, and the write command issued to the processor has the code 11101111 or 11011101 or 01110000 in its bits 25 to 32.

Claims

Формула изобретения . Claim .
1. Способ переключения контекста задач и процедур в процессоре, содержащем кольцевой буфер регистров общего назначения, регистр слова состояния процессора, счетчик команд, кольцевой стек переключения контекста, выполненный с возможностью хранения значений регистра слова состояния процессора и счетчика команд контекста, данных характеризующих размещение в оперативной памяти контекстов задач и аппаратное средство, предназначенное для управления переключением контекста, и содержащий последовательное резервирование контекстов в кольцевом буфере регистров общего назначения и кольцевом стеке переключения контекста с последующим восстановлением, или с восстановлением контекстов в обратной последовательности, при переполнении кольцевого буфера регистров общего назначения и кольцевого стека переключения контекста производят вытеснение самого раннего контекста в память, путем чтения из регистра обращения к кольцевому стеку переключения контекста значения текущего регистра кольцевого стека переключения контекста, причем повторяют такое вытеснение до освобождения требуемых запускаемой задачей или процедурой ресурсов в кольцевом буфере регистров общего назначения и/или кольцевого стека переключения контекста, а при завершении задачи или процедуры производят восстановление контекстов из памяти в обратной последовательности в освободившиеся ресурсы кольцевого буфера регистров общего назначения и кольцевого стека переключения контекста, а при отсутствии необходимых ресурсов в кольцевом буфере регистров общего назначения и кольцевом стеке переключения контекста, при размещении контекстов задач и процедур в оперативной памяти в первый элемент контекста задачи записывают указатель на конец контекста в памяти для предыдущего контекста в последний элемент контекста задачи записывают дескриптор начала и размера области памяти для размещения контекста следующей задачи, причем контексты всех процедур задачи последовательно размещают внутри контекста данной задачи, при формировании слова состояния процессора, в регистр слова состояния процессора записывают значения битов полей признаков результата выполненной операции, приоритета процесса, числа сохраняемых регистров общего назначения кольцевого буфера регистров общего назначения контекста данной задачи или процедуры, идентификатора процесса, признака запуска задачи и признака определяющего данное слово как слово состояния процессора при переключении контекста, при переносе контекстов задач и процедур в оперативную память осуществляют подачу команды процессору, причем в результате декодирования и выполнения данной команды процессором все контексты, за исключением текущего, последовательно переносят из процессора в память, причем для каждого контекста переносят значения слова состояния процессора, счетчика команд, дескриптора начала и размера области памяти для размещения контекста и указателя на конец контекста в памяти, при начальной установке параметров переключения контекста задач и процедур в процессоре, процессору подают команды записи новых значений в служебные регистры переключения контекста, декодируемые и исполняемые процессором, причем служебные регистры включают в свое число регистр указателя на строку таблицы дескрипторов начала и размера областей памяти для размещения контекстов .1. A method for switching the context of tasks and procedures in a processor containing a general-purpose circular buffer buffer, a processor status word register, an instruction counter, a context switching ring stack, configured to store processor status word register values and a context command counter that characterize the placement in the operational task context memory and hardware designed to control context switching and containing sequential reservation of contexts in the ring When the general buffer of general registers and the ring stack of context switching are overwritten, the earliest context is erased by reading from the register the call to the ring stack context switch the values of the current register of the ring stack context switch, and repeat such crowding until release the resources required by the task or procedure in the ring buffer of general registers and / or the ring context switch stack, and upon completion of the task or procedure, contexts are restored from memory in the reverse order to the freed resources of the ring buffer of general registers and the ring context switch stack, and when lack of necessary resources in the ring buffer of general purpose registers and the ring stack of context switching, when placing contexts back h and procedures in main memory in the first element of the context of the task write a pointer to the end of the context in memory for the previous context in the last element of the context of the task write a descriptor of the beginning and size of the memory area to place the context of the next task, and the contexts of all procedures of the task are sequentially placed inside the context of this task , when forming the processor status word, in the word register processor states record the values of the bits of the feature fields of the result of the operation, the process priority, the number of general purpose registers saved, the ring buffer of general purpose registers of the context of the given task or procedure, the process identifier, the sign of the task launch and the sign defining this word as the processor state word when switching the context, transferring the contexts of tasks and procedures into the RAM memory gives a command to the processor, and as a result of decoding, you When this command is completed by the processor, all contexts, with the exception of the current one, are sequentially transferred from the processor to memory, and for each context, the values of the processor status word, command counter, start descriptor and size of the memory area are transferred to place the context and a pointer to the end of the context in memory, at the initial setting the parameters for switching the context of tasks and procedures in the processor, the processor is instructed to write new values to the service registers of context switching, decoded and executed processor, moreover, service registers include a register pointer to a row in the table of descriptors of the beginning and size of memory areas for placing contexts.
2. Способ по п.l, отличающийся тем, что в памяти контексты всех процедур задачи последовательно размещают внутри контекста этой задачи.2. The method according to p. 1, characterized in that in memory the contexts of all the procedures of the task are sequentially placed inside the context of this task.
3. Способ по п.l, отличающийся тем, что данные, характеризующие размещение в памяти контекстов задач представлены значениями дескриптора начала и размера области памяти для размещения контекста и указателя на конец контекста в памяти, связанных, соответственно, со значением указателя конца контекста в памяти для предыдущего контекста и значением дескриптора начала и размера области памяти для размещения контекста следующего контекста,.3. The method according to claim 1, characterized in that the data characterizing the placement of task contexts in the memory is represented by the values of the start descriptor and the size of the memory area to place the context and the pointer to the end of the context in the memory associated with, respectively, the value of the context end pointer in the memory for the previous context and the descriptor value of the beginning and size of the memory area to place the context of the next context.
4. Способ по п.З, отличающийся тем, что кольцевой стек переключения контекста выполнен с возможностью размещения в одном регистре стека значений регистра слова состояния процессора и счетчика команд одного контекста или значений указателя на конец контекста в памяти и дескриптора начала и размера области памяти для размещения контекста, одно из которых относится к первому контексту, а другое ко второму контексту, являющихся соседними.4. The method according to p. 3, characterized in that the annular context switching stack is configured to place in one register of the stack the values of the register of the processor status word and the counter of commands of one context or values a pointer to the end of the context in memory and a handle to the beginning and size of the memory area to place the context, one of which relates to the first context, and the other to the second context, which are adjacent.
5. Способ п.З, отличающийся тем, что, регистр слова состояния процессора содержит поле числа сохраняемых регистров общего назначения кольцевого буфера регистров общего назначения контекста данной задачи или процедуры числа сохраняемых регистров общего назначения кольцевого буфера регистров общего назначения и поле признака запуска задачи для вытеснения контекста, последовательно записывают в память регистров общего назначения, счетчика команд и регистра слова состояния процессора вытесняемого контекста, причем в случае истинности признака запуска задачи записывают все регистры общего назначения задачи, в противном случае записывают число регистров общего назначения заданное в число сохраняемых регистров общего назначения кольцевого буфера регистров общего назначения контекста данной задачи или процедуры, непосредственно после значения регистра слова состояния процессора записывают значение дескриптора начала и размера области памяти для размещения контекста для размещения следующего контекста, а значение указателя на конец контекста в оперативной памяти вытесняемого контекста в памяти записывают по адресу начала области памяти для размещения следующего контекста.5. The method of claim 3, wherein the processor status word register contains a field for the number of saved general purpose registers of the ring buffer of general purpose registers of the context of a given task or a procedure for the number of stored registers of general purpose ring buffer of the general registers of general purpose registers and a flag for launching a task for crowding out context, sequentially recorded in the memory of general registers, a command counter and a register of the processor status word of the displaced context, and in the case of truth n In terms of the task launch, all general purpose registers of the task are written; otherwise, the number of general registers specified in the number of general purpose registers of the ring buffer of general purpose registers of the context of the given task or procedure is recorded; immediately after the value of the register of the processor status word, the value of the start descriptor and the size of the memory to place the context to place the next context, and the value of the pointer to the end of the context in RAM in The crowded out context is stored in memory at the start address of the memory area to accommodate the next context.
6. Способ по п.5, отличающийся тем, что процессор содержит регистры дескриптора начала и размера области памяти для размещения контекста следующего контекста, указатель контекста в оперативной памяти и указателя на адрес памяти для записи/считывания следующего элемента контекста, при переключении контекста задачи в кольцевой стек обеспечения переключения контекста заносят значения указателя на конец контекста в памяти и дескриптора начала и размера области памяти для размещения контекста следующего контекста из указанных регистров, причем значение дескриптора начала и размера области памяти для размещения контекста следующего контекста получают из таблицы, содержащей все заранее определенные значения дескриптора начала и размера области памяти для размещения контекста следующего контекста, начальное значение регистра указателя конца контекста в памяти приравнивают к значению регистра дескриптора начала и размера области памяти для размещения контекста следующего контекста дескриптора начала и размера области памяти для размещения контекста следующего контекста, при вытеснении контекста увеличивают значение регистра указателя конца контекста в памяти на величину размера сохраняемых в памяти элементов контекста, а запись осуществляет регистр обращения к памяти, выполненный с возможностью отображения элемента памяти с адресом, содержащемся в регистре указателе на адрес оперативной памяти для записи/считывания следующего элемента контекста, а после записи в регистр обращения к памяти значение указателя на адрес оперативной памяти для записи/считывания следующего элемента контекста увеличивают на единичное значение .6. The method according to claim 5, characterized in that the processor contains the registers of the start descriptor and the size of the memory area to place the context of the next context, a context pointer in the main memory and a pointer to a memory address for writing / reading the next context element, when switching the task context to the ring stack for providing context switching is loaded with the values of a pointer to the end of the context in memory and a descriptor of the beginning and size of the memory area to place the context of the next context from the indicated registers, p When in use, the start value descriptor and the memory area size to accommodate the context of the next context is obtained from a table containing all predetermined values the start descriptor and the size of the memory area to place the context of the next context, the initial value of the end context pointer register in the memory is equal to the value of the start descriptor register and the size of the memory area to place the context of the next context of the start descriptor and the size of the memory area to place the next context context, when the context is extruded increase the value of the register of the end of context pointer in memory by the size of the context elements stored in the memory, and recording creates a memory access register, configured to display a memory element with the address contained in the register, a pointer to the address of the main memory for writing / reading the next context element, and after writing to the memory access register, the value of the pointer to the main memory address for writing / reading the next the context element is incremented by a single value.
7. Способ по п. б, отличающийся тем, что слово состояния процессора и указатель на конец контекста в оперативной памяти содержат поле признака слово состояния процессора или указатель на конец контекста в оперативной памяти соответственно, причем, при восстановлении контекстов из памяти, считывают из памяти элемент контекста с адресом из указателя на адрес оперативной памяти для записи/считывания следующего элемента контекста посредством регистра обращения к памяти, если данный элемент характеризуется признаком слово состояния процессора, то считываемый контекст является контекстом вложенной в задачу процедуры, для восстановления которой последовательно считывают значения слова состояния процессора и счетчика команд в кольцевом стеке обеспечения переключения контекста, а регистры общего назначения, численно соответствующие значению числу сохраняемых регистров общего назначения кольцевого буфера регистров общего назначения из слова состояния процессора, в кольцевой буфер регистров общего назначения, в случае, если первоначально прочитанный из памяти элемент характеризуется признаком указателя на конец контекста в оперативной памяти, то считываемый контекст является контекстом задачи, при этом осуществляют переход по адресу из прочитанного указателя на конец контекста в оперативной памяти, после чего последовательно считывают значения слова состояния процессора, счетчика команд в кольцевом стеке переключения контекста, а все регистры общего назначения данного контекста в кольцевой буфер регистров общего назначения .7. The method according to claim b, characterized in that the processor status word and the pointer to the end of the context in the RAM contain the attribute field the processor status word or the pointer to the end of the context in the RAM, respectively, and when recovering contexts from memory, read from memory a context element with an address from a pointer to a RAM address for writing / reading the next context element by means of a memory access register, if this element is characterized by the sign of a status word process ora, then the context being read is the context of the procedure embedded in the task, to restore which the values of the processor status word and command counter are sequentially read in the ring stack to ensure context switching, and the general registers numerically correspond to the number of general registers of the general buffer of the general register registers from processor status words in the general-purpose ring buffer of the general-purpose registers, in case the element ha was originally read from memory is characterized by a sign of a pointer to the end of the context in RAM, then the context being read is the context of the task, while they go to the address from the read pointer to the end of the context in RAM, and then sequentially read the values of the processor status word, the instruction counter in the ring stack of context switching, and all general-purpose registers of this context into the ring buffer of general-purpose registers.
8. Способ по п.l, отличающийся тем, что значение указателя конца контекста в оперативной памяти считывают из поля указателя конца контекста регистра кольцевого стека переключения контекста, а значение дескриптора памяти размещения контекста считывают из поля дескриптора памяти размещения контекста этого же регистра.8. The method according to claim 1, wherein the value of the context end pointer in the random access memory is read from the context end pointer field of the context switch ring stack register, and the context allocation memory descriptor value is read from the context placement memory descriptor field of the same register.
9. Способ по п.l, отличающийся тем, что в случае, когда из задачи не были вызваны процедуры, значение указателя конца контекста в оперативной памяти вычисляют как сумму элементов памяти для размещения значений регистров общего назначения, значения счетчика команд, значения слова состояния процессора данной задачи и значения дескриптора памяти размещения контекста следующего контекста, а в случае наличия вызванных из задачи процедур, сумма адресов элементов памяти дополнительно включает адреса элементов памяти для размещения значений регистров общего назначения, значений счетчика команд, значений слова состояния процессора всех процедур.9. The method according to p. 1, characterized in that in the case when no procedures were called from the task, the value of the context end pointer in the main memory is calculated as the sum of memory elements for placing the values of general registers, values of the instruction counter, values of the processor status word the given task and the values of the memory descriptor of the context location of the next context, and in the case of the procedures called from the task, the sum of the addresses of the memory elements additionally includes the addresses of the memory elements for the placement of values Istria general purpose of the program counter values, the status word processor of all procedures.
10. Способ по п.l, отличающийся тем, что указатель конца контекста содержит поле признака, определяющего содержимое данного регистра как указателя конца контекста, причем поле признака указатель конца контекста в оперативной памяти имеет нулевое значение, не подлежит изменению и расположено в тридцать втором от начала регистра бите, являющемся последним.10. The method according to p. 1, characterized in that the context end indicator contains a sign field defining the contents of this register as a context end indicator, wherein the sign field of the context end indicator in RAM is zero, cannot be changed and is located in the thirty-second from Begin register is the last bit.
11. Способ по п.l, отличающийся тем, что для каждой области памяти, предназначенной для размещения в ней контекста задачи, заранее формируют значение дескриптора начала и размера области памяти для размещения контекста, а при запуске задачи записывают соответствующее ей значение дескриптора памяти размещения контекста в кольцевом стеке обеспечения переключения контекста .11. The method according to p. 1, characterized in that for each memory area, designed to accommodate the context of the task, pre-form the value of the descriptor of the beginning and size of the memory area to place the context, and when the task starts the corresponding value of the context placement memory descriptor in the ring stack for providing context switching.
12. Способ по любому из п. п.8-11, отличающийся тем, что каждый контекст занимает непрерывную область памяти.12. The method according to any one of p. 8-11, characterized in that each context occupies a continuous memory area.
13. Способ по п.l, отличающийся тем, что значение бита поля признака слово состояния процессора всегда задают отличным от значения бита имеющего такую же позицию в указателе на конец контекста в памяти.13. The method according to p. 1, characterized in that the value of the bit of the attribute field, the processor status word is always set different from the value of the bit having the same position in the pointer to the end of the context in memory.
14. Способ по п.l, отличающийся тем, что бит поля признака слово состояния процессора всегда задают равным единице.14. The method according to claim 1, characterized in that the bit of the attribute field is always set to one.
15. Способ по п.l, отличающийся тем, что при запуске задачи значение бита поля признак запуска задачи задают равным единице.15. The method according to claim 1, characterized in that when the task is started, the value of the bit of the field is set to the start sign of the task equal to one.
16. Способ по п.l, отличающийся тем, что значения битов поля числа сохраняемых регистров общего назначения кольцевого буфера регистров общего назначения соответствующего контекста непосредственно устанавливают командой процессора, имеющей код 11100100 в своих старших разрядах, и поле из четырех бит в первых младших разрядах для величины задаваемой командой записи в слово состояния процессора значения числа сохраняемых регистров общего назначения.16. The method according to p. 1, characterized in that the values of the bits of the field of the number of stored general purpose registers of the circular buffer of general registers of the corresponding context are directly set by the processor team having the code 11100100 in their high order bits, and a field of four bits in the first low order bits for the values set by the command to write to the processor status word the value of the number of general purpose registers to be saved.
17. Способ по любому из п. п.13-16, отличающийся тем, что полям признаков результата выполненной операции, полю приоритета процесса и полю числа сохраняемых регистров общего назначения кольцевого буфера регистров общего назначения соответствующего контекста выделяют последовательно по четыре бита начиная от начала слова состояния процессора, полю идентификатора процессора выделяют последующие пять битов, а полю признака слова состояния процессора выделяют тридцать второй бит, являющийся последним.17. The method according to any one of paragraphs.13-16, characterized in that the attribute fields of the result of the operation, the process priority field and the field of the number of saved general purpose registers of the circular buffer of general registers of the corresponding context are allocated four bits in sequence starting from the beginning of the word the processor state, the next five bits are allocated to the processor identifier field, and the thirty-second bit, which is the last, is allocated to the attribute field of the processor status word.
18. Способ по п.l, отличающийся тем, что команда подаваемая процессору имеет код 11101100 в своих старших разрядах. 18. The method according to p. 1, characterized in that the command issued to the processor has a code 11101100 in its upper digits.
19. Способ по п.l, отличающийся тем, что служебные регистры включают в свое число рабочие регистры кольцевого стека переключения контекста, а записываемые новые значения представляют собой дескрипторы начала и размера областей памяти для размещения контекстов .19. The method according to p. 1, characterized in that the service registers include the working registers of the ring stack context switch, and the recorded new values are descriptors of the beginning and size of memory areas for placing contexts.
20. Способ по п.l, отличающийся тем, что служебные регистры включают в себя регистр указателя начала свободного пространства в кольцевом стеке переключения контекстов.20. The method according to p. 1, characterized in that the service registers include a register of a pointer to the beginning of free space in the ring context switching stack.
21. Способ по любому из п. п.19-20, отличающийся тем, что команда записи подаваемая процессору имеет код 11101111 или 11011101 или 01110000 в своих разрядах с 25 по 32. 21. The method according to any one of paragraphs.19-20, characterized in that the write command issued to the processor has a code 11101111 or 11011101 or 01110000 in its bits 25 to 32.
PCT/RU2007/000124 2006-04-18 2007-03-15 Method for switching context of tasks and procedures in a processor WO2007120075A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
RU2006112635 2006-04-18
RU2006112635/09A RU2320002C2 (en) 2006-04-18 2006-04-18 Method for switching context of tasks and procedures in a processor

Publications (1)

Publication Number Publication Date
WO2007120075A1 true WO2007120075A1 (en) 2007-10-25

Family

ID=38609763

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/RU2007/000124 WO2007120075A1 (en) 2006-04-18 2007-03-15 Method for switching context of tasks and procedures in a processor

Country Status (2)

Country Link
RU (1) RU2320002C2 (en)
WO (1) WO2007120075A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103049325A (en) * 2013-01-09 2013-04-17 浙江大学 Method for implementing CSA (context save area) node manager on basis of TC1767 platform

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9195768B2 (en) * 2011-08-26 2015-11-24 Amazon Technologies, Inc. Remote browsing session management

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6108744A (en) * 1998-04-16 2000-08-22 Sun Microsystems, Inc. Software interrupt mechanism
WO2003007105A2 (en) * 2000-11-24 2003-01-23 Catharon Productions, Inc. Computer multi-tasking via virtual threading
RU2239228C2 (en) * 2001-07-05 2004-10-27 Всероссийский научно-исследовательский институт автоматики Method for distributing time of central processor between tasks in automatized system for controlling technological processes

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6108744A (en) * 1998-04-16 2000-08-22 Sun Microsystems, Inc. Software interrupt mechanism
WO2003007105A2 (en) * 2000-11-24 2003-01-23 Catharon Productions, Inc. Computer multi-tasking via virtual threading
RU2239228C2 (en) * 2001-07-05 2004-10-27 Всероссийский научно-исследовательский институт автоматики Method for distributing time of central processor between tasks in automatized system for controlling technological processes

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103049325A (en) * 2013-01-09 2013-04-17 浙江大学 Method for implementing CSA (context save area) node manager on basis of TC1767 platform

Also Published As

Publication number Publication date
RU2006112635A (en) 2007-11-20
RU2320002C2 (en) 2008-03-20

Similar Documents

Publication Publication Date Title
US6470436B1 (en) Eliminating memory fragmentation and garbage collection from the process of managing dynamically allocated memory
US8266365B2 (en) Ruggedized memory device
US7010555B2 (en) System and method for compacting a computer system heap
US6668336B2 (en) Ruggedized block device driver
US6785808B2 (en) System and method for altering an operating system start-up sequence prior to operating system loading
JPH07175698A (en) File system
JP5422652B2 (en) Avoiding self-eviction due to dynamic memory allocation in flash memory storage
US4454580A (en) Program call method and call instruction execution apparatus
US5175830A (en) Method for executing overlays in an expanded memory data processing system
CN112905365A (en) Data processing method, device, equipment and medium
WO2007120075A1 (en) Method for switching context of tasks and procedures in a processor
JPH0695955A (en) Flash file system
JP3450071B2 (en) PC card
US5450587A (en) Expanded memory addressing scheme
US6886159B2 (en) Computer system, virtual machine, runtime representation of object, storage media and program transmission apparatus
CN112148203B (en) Memory management method, device, electronic equipment and storage medium
US8756193B2 (en) System and method for persisting object pointers
JP2867965B2 (en) Data processing device and data processing method
JP2004206369A (en) Access method and access program to common resource
KR100654477B1 (en) Object oriented processing with dedicated pointer memories
CN112395083B (en) Resource file release method and device and computer readable storage medium
JPS6032220B2 (en) information processing equipment
US20020124164A1 (en) Method for starting computer system
US10817288B2 (en) Combined instruction for addition and checking of terminals
JPH0756633B2 (en) Task switching method

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 07747855

Country of ref document: EP

Kind code of ref document: A1

DPE2 Request for preliminary examination filed before expiration of 19th month from priority date (pct application filed from 20040101)
NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 07747855

Country of ref document: EP

Kind code of ref document: A1