[go: up one dir, main page]

RU2320002C2 - 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
RU2320002C2
RU2320002C2 RU2006112635/09A RU2006112635A RU2320002C2 RU 2320002 C2 RU2320002 C2 RU 2320002C2 RU 2006112635/09 A RU2006112635/09 A RU 2006112635/09A RU 2006112635 A RU2006112635 A RU 2006112635A RU 2320002 C2 RU2320002 C2 RU 2320002C2
Authority
RU
Russia
Prior art keywords
context
memory
task
register
processor
Prior art date
Application number
RU2006112635/09A
Other languages
Russian (ru)
Other versions
RU2006112635A (en
Inventor
Сергей Саввич Коваленко (RU)
Сергей Саввич Коваленко
Сергей Андреевич Хромов (RU)
Сергей Андреевич Хромов
Юрий Петрович Крылатых (RU)
Юрий Петрович Крылатых
Николай Петрович Васильев (RU)
Николай Петрович Васильев
Андрей Владимирович Винокуров (RU)
Андрей Владимирович Винокуров
Original Assignee
Общество с ограниченной ответственностью "Юникор микросистемы"
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 Общество с ограниченной ответственностью "Юникор микросистемы" filed Critical Общество с ограниченной ответственностью "Юникор микросистемы"
Priority to RU2006112635/09A priority Critical patent/RU2320002C2/en
Priority to PCT/RU2007/000124 priority patent/WO2007120075A1/en
Publication of RU2006112635A publication Critical patent/RU2006112635A/en
Application granted granted Critical
Publication of RU2320002C2 publication Critical patent/RU2320002C2/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/461Saving or restoring of program or task context

Landscapes

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

Abstract

FIELD: computer engineering, namely processors meant for operation in multitask mode and containing hardware for automatically switching context of tasks and procedures.
SUBSTANCE: in accordance to the method, for each new task or procedure free resources are allocated in circular buffer of general purpose registers for data being processed, and in circular stack for switching contexts for data which characterize predetermined location for contexts in external memory. When circular buffer of general purpose registers or circular context switching stack are overflowed, saved contexts at hardware level are fully automatically displaced into memory, without using software means. The data from circular context switching stack make it possible to organize contexts displaced into memory in form of connected list, and to restore saved contexts when necessary.
EFFECT: increased speed when switching context of tasks and procedures with lesser amount of used hardware resources.
21 cl, 5 dwg

Description

Изобретение относится к вычислительной технике, а именно к процессорам для обработки данных, предназначенным для работы в многозадачном режиме, и может быть использовано, в частности, во встраиваемых приложениях.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. the 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.

Отличие между задачей и процедурой заключается в том, что задача запускается прерыванием (trap), а процедура вызывается из задачи (call), возможно с передачей параметров и, по существу, представляет собой подпрограмму или функцию, по завершении которой возможен возврат результатов в породившую данную процедуру задачу. Для операционной системы это подпроцесс процесса задачи.The difference between the task and the procedure is that the task is started by an interrupt (trap), 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 originating 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 - an arithmetic-logical device that is part of the processor;

БИ - буфер инструкций;BI - instruction buffer;

БОП - блок обращения к памяти для чтения/записи данных (load/store unit);BOP - memory access unit for reading / writing data (load / store unit);

БФАВИ - блок формирования адреса выбираемой инструкции (instruction fetch unit);BFAVI - block forming the address of the selected instruction (instruction fetch unit);

ДК - дешифратор команд;DK - command decoder;

ДПРК - дескриптор начала и размера области памяти для размещения контекста (дескриптор памяти размещения контекста);DPRK - descriptor of the beginning and size of the memory area for context allocation (context location memory descriptor);

ИП - идентификатор процесса (PID - process identifier);IP - process identifier (PID - process identifier);

КБР - кольцевой буфер РОНов;KBR - ring buffer RONs;

КСПК - кольцевой стек обеспечения переключения контекста (кольцевой стек переключения контекста);KSPK - ring stack providing context switching (ring stack context switching);

ОЗУ-Д - оперативное запоминающее устройство для хранения данных;OZU-D - random access memory for data storage;

ОЗУ-И - оперативное запоминающее устройство для хранения инструкций;RAM-I - random access memory for storing instructions;

ПЗЗ - признак запуска задачи;ПЗЗ - sign of the task launch;

ПП - приоритет процесса;PP - process priority;

ПРВО - признаки результата выполненной операции;PRVO - signs of the result of the operation;

ПССП - признак ССП;PSSP - a sign of MTP;

РО-КБР - регистр обращения к КБР;RO-CBD - register of appeal to the CBD;

РО-КСПК - регистр обращения к КСПК;RO-KSPK - the register of the appeal to KSPK;

РО-П - регистр обращения к памяти;RO-P - memory access register;

РОНы - регистры общего назначения;RONs - general purpose registers;

СК - счетчик команд;SK - team counter;

ССП - слово состояния процессора (PSW - processor status word);SSP - processor status word (PSW - processor status word);

СУПК - структура управления механизмом переключения контекста и выбором режимов работы КБР и КСПК (структура управления переключением контекста);СУПК - the control structure of the context switching mechanism and the choice of CBD and KSPK operating modes (context switching control structure);

УВ-КБР - указатель начала текущего окна в КБР (указатель верхушки КБР);UV-KBR - a pointer to the beginning of the current window in the CBD (a 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 - 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);

ЧСР-КБР - число сохраняемых РОНов КБР соответствующего контекста.CSR-CBD - the number of stored CBR RONs of the relevant context.

Одна из первых реализаций поддержки переключения контекста, получившая широкое распространение, относится к RISC процессорам с архитектурой SPARC V8 (The SPARC Architecture Manual. Version 8. SPARC International Inc; 1992, 303 p.). Одной из особенностей SPARC V8 является большой регистровый файл со свойствами циклического буфера и технологией регистрового окна. Однако при этом управление механизмом переключения контекста должно быть реализовано программными средствами, что обуславливает относительно невысокую скорость переключения контекста по сравнению с возможной аппаратной реализацией данного механизма и, следовательно, ведет к ограниченной производительности процессоров данной архитектуры.One of the first implementations of context switching support, which was widely used, relates to RISC processors with the SPARC V8 architecture (The SPARC Architecture Manual. Version 8. SPARC International Inc; 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.

Задача повышения скорости переключения контекста частично решена в процессорах архитектуры TriCore (TriCore™ 1. 32-Bit Unified Processor Core. Volume 1:V1.3 Core Architecture. User's Manual, V1.3.6. Infineon Technologies AG, 2005, 209 p.), реализующих переключение контекста аппаратными средствами. Однако все сохраненные контексты размещаются в модуле памяти, время доступа к которой существенно превышает время доступа к внутренним регистрам процессора.The task of increasing the context switching speed was partially solved in TriCore architecture processors (TriCore ™ 1. 32-Bit Unified Processor Core. Volume 1: V1.3 Core Architecture. User's Manual, V1.3.6. Infineon Technologies AG, 2005, 209 p.), 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.

Существенное повышение скорости переключения контекста достигнуто благодаря использованию в процессоре двух регистровых файлов для промежуточного хранения контекстов с последующим их переносом в модуль памяти (патент US 6553487 B1, 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 US 6553487 B1, 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.

Наиболее близким аналогом заявленного изобретения является способ переключения контекста в процессоре (патент US 6115777 A, 05.09.2000), заключающийся в оперативном хранении контекстов в большом кольцевом регистровом стеке и переносе контекстов в память при его переполнении. При этом каждый регистр кольцевого стека помимо области хранения данных содержит дополнительный информационный бит, указывающий на действительность хранимых данных. Указанная реализация способа переключения контекста использует дополнительный регистр для временного хранения указанных информационных битов. Кроме того, для управления механизмом сохранения и восстановления контекстов, использованы регистры указателей на области хранения контекстов во внешней памяти. Данный способ также способен обеспечить высокую скорость переключения контекста.The closest analogue of the claimed invention is a method for switching context in the processor (patent US 6115777 A, 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.

Технический результат при этом заключается в увеличении скорости переключения контекста задач и процедур при уменьшенном количестве использованных аппаратных ресурсов.The technical result in this case is to increase the speed of switching the context of tasks and procedures with a reduced amount of used hardware resources.

Данный технический результат обеспечивается способом переключения контекста задач и процедур в процессоре, способом размещения контекстов задач и процедур в оперативной памяти, способом формирования ССП, способом переноса контекстов задач и процедур в оперативную память и способом начальной установки параметров переключения контекста задач и процедур в процессоре.This technical result is provided by a method of switching the context of tasks and procedures in the processor, a method of placing contexts of tasks and procedures in RAM, a method of generating SSPs, a method of transferring contexts of tasks and procedures to RAM, and a method of initially setting parameters to switch the context of tasks and procedures in the processor.

Технический результат достигается за счет того, что согласно способу переключения контекста задач и процедур в процессоре, процессор содержит КБР, регистр ССП, СК и КСПК. Причем КСПК выполнен с возможностью хранения значений ССП и СК контекста, и данных, характеризующих размещение в оперативной памяти контекстов задач. Процессор содержит также аппаратное средство для управления переключением контекста (СУПК). При этом способ включает в себя последовательное резервирование контекстов в КБР и КСПК с последующим восстановлением, при необходимости, контекстов в обратной последовательности. При переполнении КБР или КСПК производят вытеснение самого раннего контекста в память. При необходимости повторяют такое вытеснение до освобождения требуемых запускаемой задачей или процедурой ресурсов в КБР и/или КСПК. При завершении задачи или процедуры производят восстановление контекстов из памяти в обратной последовательности в освободившиеся ресурсы КБР и КСПК при отсутствии необходимых ресурсов в КБР и/или КСПК.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 a CBD, a register of SSP, SK and KSPK. Moreover, KSPK is made with the possibility of storing the values of the SSP and SK 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 the CBD and KSPK with the subsequent restoration, if necessary, of the contexts in the reverse order. When an overflow of CBD or KSPK, the earliest context is forced out into memory. If necessary, such repression is repeated until the resources required by the task or procedure to be launched in the CBD and / or the KSPK are released. Upon completion of a task or procedure, contexts are restored from memory in the reverse order to the freed resources of the CBD and the KSPK in the absence of the necessary resources in the KBR and / or the KSPK.

Согласно способу размещения контекстов задач и процедур в оперативной памяти в ячейки памяти ОЗУ-Д, выделенные для первого элемента контекста задачи записывают УКК-П для предыдущего контекста, а в последний элемент контекста задачи таким же образом записывают ДПРК следующей задачи. Причем контексты всех процедур задачи последовательно и непрерывно размещают внутри контекста данной задачи.According to the method of placing the contexts of tasks and procedures in RAM into 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, the DPRK of the next task is written in the same way. Moreover, the contexts of all procedures of the task are sequentially and continuously placed inside the context of this task.

Согласно способу формирования ССП в регистр ССП записывают значения битов полей ПРВО, ПП, ЧСР-КБР, ИП, ПЗЗ и ПССП.According to the method for generating the MSS, the values of the bits of the PRVO, PP, ChSR-KBR, IP, PZZ and MSSP fields are recorded in the MSS register.

Согласно способу переноса контекстов задач и процедур в оперативную память, процессору подают команду, характеризующуюся тем, что в результате декодирования и выполнения данной команды процессором все контексты, за исключением текущего, последовательно переносят из процессора в память. Причем для каждого контекста переносят значения ССП, СК, ДПРК и УКК-П.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 SSP, SK, 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 context switching service 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.

При этом КСПК может быть выполнен с возможностью размещения в одном регистре стека значений ССП и СК одного контекста или значений УКК-П и ДПРК, одно из которых относится к первому контексту, а другое ко второму контексту, являющимися соседними.In this case, the QPSC can be configured to place in the same register of the stack the values of the SSP and the SK of one context or the values of UKK-P and DPRK, one of which refers to the first context, and the other to the second context, which are adjacent.

Кроме того, для вытеснения контекста в память, последовательно записывают в память значения РОНов, СК и ССП вытесняемого контекста. Количество РОНов, значения которых будут сохранены в КБР при вытеснении контекста, определяется исходя из значений полей ЧСР-КБР и ПЗЗ ССП. Причем, в случае истинности, ПЗЗ записывают значения всех РОНов задачи, в противном случае записывают значения РОНов, число которых задано в ЧСР-КБР. Непосредственно после значения ССП записывают значение ДПРК для размещения следующего контекста, а значение УКК-П вытесняемого контекста в памяти записывают по адресу начала области памяти для размещения следующего контекста.In addition, to oust the context into memory, the values of RONs, SC, and BSC of the ousted context are sequentially written into the memory. The number of RONs whose values will be stored in the CBD upon displacing the context is determined based on the values of the fields CSR-KBR and MSS of the MSS. Moreover, in the case of truth, the RPS record the values of all RONs of the task, otherwise write down the values of RONs, the number of which is specified in the Czechoslovak-KBR. Immediately after the SSP value, the DPRK value is recorded to place the next context, and the value of the UCC-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 pushed out, 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.

Для обеспечения возможности восстановления контекстов из памяти в ССП и УКК-П изначально включают поле признака ССП или УКК-П соответственно. Причем при восстановлении контекстов из памяти считывают из памяти элемент контекста с адресом из УСА-П посредством РО-П. Если данный элемент обладает признаком ССП, то считываемый контекст является контекстом вложенной в задачу процедуры, для восстановления которой последовательно считывают значения ССП и СК в КСПК, а РОНы, численно соответствующие значению ЧСР-КБР из ССП, в КБР. В случае, если первоначально прочитанный из памяти элемент обладает признаком УКК-П, то считываемый контекст является контекстом задачи. При этом осуществляют переход по адресу из прочитанного УКК-П, указывающий на конец ранее сохраненного в памяти контекста, после чего последовательно считывают значения ССП и СК в КСПК, а все РОНы данного контекста в КБР.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 reconstructing contexts from memory, a context element with an address from USA-P is read from memory by means of PO-P. If this element has the sign of SSP, then the context being read is the context of the procedure embedded in the task, to restore which the values of SSP and SK in the KSPK are sequentially read, 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 SK in the KSPK are sequentially read, and all RONs of this context in the KBR.

Способ размещения контекстов задач и процедур в оперативной памяти в своих частных случаях характеризуется тем, что значение УКК-П считывают из поля УКК-П регистра КСПК, а значение ДПРК считывают из поля ДПРК этого же регистра. Или, в случае, когда из задачи не были вызваны процедуры, значение УКК-П вычисляют как сумму элементов памяти для размещения значений РОНов, значения СК, значения ССП данной задачи и значения ДПРК следующего контекста. В случае наличия вызванных из задачи процедур, сумма адресов элементов памяти дополнительно включает адреса элементов памяти для размещения значений РОНов, значений СК и значений ССП всех процедур данной задачи.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, the SC value, the SSP value of the given 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 for the placement of RON values, SC 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 to be different from the value of the bit 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 to 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.

Сущность изобретения поясняют следующие схемы:The invention is illustrated by the following schemes:

фиг.1: принципиальная схема переключения контекста;figure 1: schematic diagram of the context switch;

фиг.2: схема общего алгоритма переключения контекста;2: a diagram of a general context switching algorithm;

фиг.3: схема алгоритма вытеснения контекста в оперативную память;figure 3: diagram of the algorithm for displacing the context in RAM;

фиг.4: схема последовательности запуска механизма переключения контекста;4: sequence diagram of the start of the context switching mechanism;

фиг.5: упрощенная структурная схема микропроцессора "Орхидея".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.

Процессор содержит архитектурные регистры СК, ССП, ДПРК, УКК-П, УТ-ДПРК и УСА-П, а также показанные на фиг.1 КБР 1 и КСПК 2.The processor contains the architectural registers SK, SSP, DPRK, UKK-P, UT-DPRK and USA-P, and also shown in figure 1 KBR 1 and KSPK 2.

ССП характеризует задачу или процедуру, а СК характеризует стадию их выполнения.BSC characterizes the task or procedure, and SC 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 the 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 представляет собой стек регистров для хранения величин ССП, СК, ДПРК и УКК-П, соответствующих РОНам из КБР 1. В каждый регистр КСПК 2 может быть записана пара значений {ССП, СК} или пара значений {УКК-П, ДПРК}. Причем УКК-П должно относиться к первому из двух соседних контекстов, а значение ДПРК ко второму контексту, следующему непосредственно за первым. Благодаря этому КСПК 2 реализует функции стека возвратов (return stack) и стека обращений к памяти.KSPK 2 is a stack of registers for storing the values of SSP, SK, DPRK and UKK-P, corresponding to RONs from KBR 1. In each register of KSPK 2, a pair of values {SSP, SK} or a pair of values {UKK-P, DPRK} can be written . 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 (return stack) 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 the element CBD 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.

После получения 6 (фиг.2) сигнала прерывания производится проверка 7 наличия свободных ресурсов в КБР 1 и КСПК 2. Необходимым условием доступности свободных ресурсов для новой задачи в данном примере процессора является наличие не менее 16 свободных РОНов в КБР 1 и не менее двух свободных строк-регистров в КСПК 2. В случае, если необходимые ресурсы недоступны, производится вытеснение 8 самого раннего (старого) контекста из КБР 1 и КСПК 2 в оперативную память 3.After receiving 6 (FIG. 2) interrupt signal, a check is made of 7 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 KBR 1 and at least two free register strings in KSPK 2. If the necessary resources are unavailable, the 8 earliest (oldest) context is forced out of KBR 1 and KSPK 2 into RAM 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 значений регистров ССП и СК, относящихся к текущей задаче, по адресу, содержащемуся в УВ-КСПК 2. Данные значения записываются в один регистр и представляют собой одну строку в КСПК 2.Then, the 11 values of the SSP and SK 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 значения ДПРК для новой запускаемой задачи и УКК-П для текущей задачи, являющейся резервируемой. Причем значение ДПРК считывают из строки таблицы ДПРК в памяти по УТ-ДПРК, а УКК-П вычисляют как сумму элементов памяти для размещения РОНов, СК, ССП и ДПРК. В случае наличия вызванных из задачи процедур, сумма элементов памяти дополнительно включает элементы памяти для размещения РОНов, СК и ССП всех процедур.In 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 the memory elements for placing RONs, SC, SSP and DPRK. In the case of the presence of procedures called up from the task, the sum of memory elements additionally includes memory elements for placing RONs, SCs and BSCs of all procedures.

После успешного резервирования 9 текущего контекста осуществляется инициализация 13 регистров ССП и СК для запускаемой задачи.After successfully backing up 9 current contexts, 13 registers of SSP and SK are initialized for the task to be started.

Вытеснение 8 самого раннего контекста из КБР 1 и КСПК 2 в оперативную память 3 поясняется фиг.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 the 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 в РО-П значений СК и ССП.Then, a record of 19 in the RO-P of the values of SC and BSC is carried out.

Если данный контекст является 20 контекстом процедуры, то его вытеснение в оперативную память 3 завершено 21.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 displacement of the context of the task 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 any 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 obtained 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 activated. RO-P already reflects the content of USA-P, indicating a place in memory 3 from which recovery should be made.

Если данный элемент контекста является УКК-П, то осуществляют переход по адресу, содержащемуся в нем, а затем последовательно считывают в КСПК 2 значения ДПРК, ССП, СК. Значения 16 РОНов переносят в КСВ 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, SK. The values of 16 RONs are transferred to SWR 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 переносят значения ССП, СК, а в КСВ 1 переносят РОНы, число которых узнают из поля ЧСР-КБР считанного ССП.If the current context element is SSP, then SSP, SK are transferred to KSPK 2, and RONs are transferred to SWR 1, the number of which is recognized from the CSR-KBR field of the read SSP.

Организация контекстов в КБР 1, КСПК 2 и памяти 3 поясняется примером, представленным на фиг.1, на которой выделен контекст одной задачи.The organization of contexts in CBD 1, KSPK 2 and memory 3 is illustrated by the example shown in figure 1, which highlighted the context of one task.

РОНы 26 КБР 1 и данные 27 КСПК 2 представляют собой контекст одной задачи.RONs 26 CBD 1 and data 27 KSPK 2 represent the context of one task.

В показанной на фиг.1 ситуации контекст задачи "В" включает два контекста, один из которых относится непосредственно к данной задаче - контекст "В0", а второй относится к вызванной из нее процедуре "В1".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 “B0”, and the second refers to the procedure “B1” called from it.

Связь контекстов в памяти 3 организуется за счет того, что в последний элемент 28 предыдущего контекста "А" записывают значение ДПРК(В), определяющее расположение первого элемента контекста "В". Записывают по данному адресу памяти значение УКК-П(А), указывающее на расположение элемента 28 в памяти. Причем для считывания значений ДПРК(В) и УКК-П(А) из КСПК 2 требуется одна операция чтения, т.к. эти величины расположены в одном регистре КСПК 2.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 of DPRK (B), which determines the location of the first element of the context "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 of DPRK (B) and UKK-P (A) from KSPK 2 requires one read operation, because these values are located in one register KSPK 2.

Вслед за УКК-П(А) записывают в память значения 29 РОНов, СК и ССП для всех контекстов, входящих в контекст данной задачи. Затем значение УКК-П(В) помещают в самый первый элемент 30 контекста задачи "В".Following UKK-P (A), the values of 29 RONs, SC, 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.Figure 4 illustrates the startup sequence of the context switching mechanism.

После включения 31 питания процессора необходимо подать 32 на него внешний сигнал сброса (RESET), посредством которого производится начальная установка 33 регистров процессора. При этом устанавливается наивысший приоритет в регистре ССП и начальное значение СК.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 SK.

После снятия сигнала RESET процессор начинает выполнять программу с указанного адреса. При этом таблица векторов прерываний и таблица ДПРК еще не определены. В данном режиме процессор не может отвечать на прерывания и переключаться с задачи на задачу, но при этом он может вызывать процедуры с максимальной глубиной вложенности до восьми.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 interruptions and switch from task to task, but at the same time it can 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 значения ССП и СК, соответствующие задаче рестарта. После этого контекст начальной загрузки забывается.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 SC 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.

Для приведения механизма сохранения/восстановления контекстов в памяти в исходное состояние в регистр УТ-ДПРК следует записать адрес нулевого дескриптора таблицы ДПРК. Затем записывают нулевые значения в регистры УВ-КБР, УД-КБР, УВ-КСПК и УД-КСПК. Записывают в КСПК 2 пару значений ДПРК, после чего увеличивают значение УВ-КСПК на единичное значение и присваивают регистру УКК-П значение ДПРК.To 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, zero values are recorded in the registers UV-KBR, 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". Figure 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, СК 46 и БФАВИ 47, а также БОП 48, характерные для ряда RISC процессоров."Orchid" contains KBR 1, ALU 43, DK 44 and BI 45, SK 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, СК 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. The control outputs of the DC 44 are connected to the control inputs of the ALU 43, BOP 48, SK 46 and the first control input of the CBD 1. The DC 44 is also connected to the control system 49 through the control input-output.

Вход-выход данных СК 46 соединен с входом-выходом данных КСПК 2, а выход данных связан со входом данных ОЗУ-И 50 через БФАВИ 47 и адресную шину.The input / output of data SK 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 KBR 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 at the start of the task is equal to one.

Кроме того, поля ПРВО, ПП и ЧСР-КБР в ССП "Орхидеи" занимают по четыре бита начиная от начала ССП, поле ИП занимает последующие пять битов, а поле ПССП занимает самый последний, тридцать второй бит. Причем установка битов поля ЧСР-КБР осуществляется командой с машинным кодом 11100100 в своих старших разрядах, и содержащей поле из четырех бит в первых младших разрядах для величины задаваемой командой записи в ССП значения числа сохраняемых РОНов в КБР 1.In addition, the PRVO, PP, and CSR-KBR fields in the Orchid SSP occupy four bits each, starting from the beginning of the SSP, the IP field occupies the next five bits, and the PRSS 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 the upper digits, and the write command issued to the processor has the code 11101111 or 11011101 or 01110000 in its digits 25 through 32.

Claims (21)

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, data characterizing the placement of random access memory of task contexts, and hardware designed to control context switching, and containing sequential reservation of contexts in a ring When the general buffer of the general purpose registers and in the ring stack are context switches with subsequent restoration, or with the restoration of contexts in the reverse order, when the ring buffer of general registers and the ring stack of context switches overflow the earliest context into memory by reading the ring access from the register the context switching stack, the values of the current register of the context switching ring stack, and such extrusion is repeated until released the resources required by the task or procedure to be run in the ring buffer of general purpose registers and / or the ring context switch stack, and when the task or procedure is completed, 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 in the absence of the necessary resources in the ring buffer of general purpose registers and the ring stack of context switching, when placing contexts tasks and procedures in RAM, a pointer to the end of the context in memory for the previous context is written to the first element of the task context; a descriptor of the beginning and size of the memory area is written to the last element of the task context to place the context of the next task, and the contexts of all task procedures are sequentially placed inside the context of this task , when forming the processor status word in the register of the processor status word, write the values of the bits of the attribute field fields of the result of the operation performed, when process priority, the number of general purpose registers to be saved, the circular buffer register 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 the given word as the processor status word when switching the context, when transferring the contexts of tasks and procedures to the main memory, instructions to the processor, and as a result of decoding and execution of this instruction by the processor, all contexts, except for the current one, are sequentially transferred It is transferred from the processor to the memory, and for each context, the values of the processor status word are transferred to the processor status word register, instruction counter, start descriptor and size of the memory area to place the context and the pointer to the end of the context in the memory, at the initial setting of parameters for switching the context 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, and the service registers include reg Istr of a pointer to a row in the table of descriptors of the beginning and size of memory areas for placing contexts. 2. Способ по п.1, отличающийся тем, что в памяти контексты всех процедур задачи последовательно размещают внутри контекста этой задачи.2. The method according to claim 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. Способ по п.1, отличающийся тем, что данные, характеризующие размещение в памяти контекстов задач представлены значениями дескриптора начала и размера области памяти для размещения контекста и указателя на конец контекста в памяти, связанных соответственно со значением указателя конца контекста в памяти для предыдущего контекста и значением дескриптора начала и размера области памяти для размещения контекста следующего контекста.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 memory for the previous context and the descriptor value of the beginning and size of the memory area to accommodate the context of the next context. 4. Способ по п.3, отличающийся тем, что кольцевой стек переключения контекста выполнен с возможностью размещения в одном регистре стека значений регистра слова состояния процессора и счетчика команд одного контекста или значений указателя на конец контекста в памяти и дескриптора начала и размера области памяти для размещения контекста, одно из которых относится к первому контексту, а другое ко второму контексту, являющихся соседними.4. The method according to claim 3, characterized in that the ring 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 instruction counter of one context or the values of the pointer to the end of the context in memory and a descriptor of the beginning and size of the memory area for placement of the context, one of which refers to the first context, and the other to the second context, which are adjacent. 5. Способ п.3, отличающийся тем, что регистр слова состояния процессора содержит поле числа сохраняемых регистров общего назначения кольцевого буфера регистров общего назначения контекста данной задачи или процедуры числа сохраняемых регистров общего назначения кольцевого буфера регистров общего назначения и поле признака запуска задачи для вытеснения контекста, последовательно записывают в память регистров общего назначения, счетчика команд и регистра слова состояния процессора вытесняемого контекста, причем в случае истинности признака запуска задачи записывают все регистры общего назначения задачи, в противном случае записывают число регистров общего назначения заданное в число сохраняемых регистров общего назначения кольцевого буфера регистров общего назначения контекста данной задачи или процедуры, непосредственно после значения регистра слова состояния процессора записывают значение дескриптора начала и размера области памяти для размещения контекста для размещения следующего контекста, а значение указателя на конец контекста в оперативной памяти вытесняемого контекста в памяти записывают по адресу начала области памяти для размещения следующего контекста.5. The method according to claim 3, characterized in that the processor status word register contains a field for the number of saved general purpose registers of the circular buffer of general purpose registers of the context of a given task or a procedure for the number of saved general purpose registers of the circular buffer of general registers of the general purpose register and a sign for launching a task for crowding out the context are sequentially written to the memory of general purpose registers, a command counter and a register of the processor status word of the extruded context, and in the case of truth, from the start of the task, 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 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 descriptor of the beginning and size of the region is written memory to place the context to place the next context, and the value of the pointer to the end of the context in RAM you the crowded context in memory is recorded 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 entered the value of the pointer to the end of the context in the memory and the descriptor of the beginning and size of the memory area to place the context of the next context from the specified registers, p whereby the value of the start descriptor and the size of the memory area for placing the context of the next context are obtained from the table containing all the predetermined values of the start descriptor and the size of the memory area to place the context of the next context, the initial value of the register pointer of the end of the context in memory is equal to the value of the register of the start and size descriptor memory areas for placing the context of the next context, when crowding out the context, increase the value of the register of the end of the context pointer in pa it is equal to the size of the context elements stored in the memory, and the recording is performed by the memory access register, which is capable of displaying the memory element with the address contained in the register of the pointer to the RAM address for writing / reading the next context element, and after writing to the access register memory value of the pointer to the address of the RAM for writing / reading the next context element is increased by a single value. 7. Способ по п.6, отличающийся тем, что слово состояния процессора и указатель на конец контекста в оперативной памяти содержат поле признака слово состояния процессора или указатель на конец контекста в оперативной памяти соответственно, причем при восстановлении контекстов из памяти, считывают из памяти элемент контекста с адресом из указателя на адрес оперативной памяти для записи/считывания следующего элемента контекста посредством регистра обращения к памяти, если данный элемент характеризуется признаком слово состояния процессора, то считываемый контекст является контекстом вложенной в задачу процедуры, для восстановления которой последовательно считывают значения слова состояния процессора и счетчика команд в кольцевом стеке обеспечения переключения контекста, а регистры общего назначения, численно соответствующие значению числа сохраняемых регистров общего назначения кольцевого буфера регистров общего назначения из слова состояния процессора, в кольцевой буфер регистров общего назначения, в случае, если первоначально прочитанный из памяти элемент характеризуется признаком указателя на конец контекста в оперативной памяти, то считываемый контекст является контекстом задачи, при этом осуществляют переход по адресу из прочитанного указателя на конец контекста в оперативной памяти, после чего последовательно считывают значения слова состояния процессора, счетчика команд в кольцевом стеке переключения контекста, а все регистры общего назначения данного контекста в кольцевой буфер регистров общего назначения.7. The method according to claim 6, 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 restoring contexts from memory, an element is read from memory context with the address from the pointer to the address of random access memory for writing / reading the next context element through the memory access register, if this element is characterized by the sign of the processor status word a, 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 the command counter are sequentially read in the ring stack to ensure context switching, and general registers, numerically corresponding to the value of the number of general registers stored in the ring buffer of general registers from processor status words in the general-purpose ring buffer of the general-purpose registers if the element is cited by a sign of a pointer to the end of the context in RAM, then the context being read is the task context, and the address from the read pointer to the end of the context in RAM is navigated, after which the values of the processor status word, command counter in the ring context switching stack are read, and all general purpose registers of this context are in the circular buffer of general purpose registers. 8. Способ по п.1, отличающийся тем, что значение указателя конца контекста в оперативной памяти считывают из поля указателя конца контекста регистра кольцевого стека переключения контекста, а значение дескриптора памяти для размещения контекста считывают из поля дескриптора размещения контекста этого же регистра.8. The method according to claim 1, characterized in that the value of the context end pointer in the main memory is read from the context end pointer field of the context switch ring stack register, and the context descriptor value of the memory handle is read from the context placement descriptor field of the same register. 9. Способ по п.1, отличающийся тем, что в случае, когда из задачи не были вызваны процедуры, значение указателя конца контекста в оперативной памяти вычисляют как сумму элементов памяти для размещения значении регистров общего назначения, значения счетчика команд, значения слова состояния процессора данной задачи и значения дескриптора памяти размещения контекста следующего контекста, а в случае наличия вызванных из задачи процедур, сумма адресов элементов памяти дополнительно включает адреса элементов памяти для размещения значений регистров общего назначения, значений счетчика команд, значений слова состояния процессора всех процедур.9. The method according to claim 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 value of general registers, the values of the command counter, the values of the processor status word the given task and the value 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 placing Istria general purpose of the program counter values, the status word processor of all procedures. 10. Способ по п.1, отличающийся тем, что указатель конца контекста содержит поле признака, определяющего содержимое данного регистра как указатель конца контекста, причем поле признака указатель конца контекста в оперативной памяти имеет нулевое значение, не подлежит изменению и расположено в тридцать втором от начала регистра бите, являющемся последним.10. The method according to claim 1, characterized in that the context end indicator contains a sign field defining the contents of a given register as a context end pointer, wherein the sign field of the context end pointer in RAM is zero, cannot be changed, and is located in the thirty-second from Begin register is the last bit. 11. Способ по п.1, отличающийся тем, что для каждой области памяти, предназначенной для размещения в ней контекста задачи, заранее формируют значение дескриптора начала и размера области памяти для размещения контекста следующего контекста, а при запуске задачи записывают соответствующее ей значение дескриптора памяти размещения контекста в кольцевом стеке обеспечения переключения контекста.11. The method according to claim 1, characterized in that for each memory area intended for placement of the task context in it, the value of the start descriptor and the size of the memory area are formed in advance to place the context of the next context, and when the task is started, the corresponding value of the memory descriptor is written placing context on the ring stack to provide context switching. 12. Способ по любому из пп.8-11, отличающийся тем, что каждый контекст занимает непрерывную область памяти.12. The method according to any one of claims 8 to 11, characterized in that each context occupies a continuous memory area. 13. Способ по п.1, отличающийся тем, что значение бита поля признака слово состояния процессора всегда задают отличным от значения бита имеющего такую же позицию в указателе на конец контекста в памяти.13. The method according to claim 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. Способ по п.1, отличающийся тем, что бит поля признака слово состояния процессора всегда задают равным единице.14. The method according to claim 1, characterized in that the bit of the attribute field the processor status word is always set equal to one. 15. Способ по п.1, отличающийся тем, что при запуске задачи значение бита поля признака запуска задачи задают равным единице.15. The method according to claim 1, characterized in that when the task is started, the value of the bit field of the sign of the task launch is set to unity. 16. Способ по п.1, отличающийся тем, что значения битов поля числа сохраняемых регистров общего назначения кольцевого буфера регистров общего назначения соответствующего контекста непосредственно устанавливают командой процессора, имеющей код 11100100 в своих старших разрядах, и поле из четырех бит в первых младших разрядах для величины задаваемой командой записи в регистр слова состояния процессора значения числа сохраняемых регистров общего назначения.16. The method according to claim 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 write command in the register of the processor status word the value of the number of saved general purpose registers. 17. Способ по любому из пп.13-16, отличающийся тем, что полям признаков результата выполненной операции, полю приоритета процесса и полю числа сохраняемых регистров общего назначения кольцевого буфера регистров общего назначения соответствующего контекста выделяют последовательно по четыре бита начиная от начала слова состояния процессора, полю идентификатора процессора выделяют последующие пять битов, а полю признака слова состояния процессора выделяют тридцать второй бит, являющийся последним.17. The method according to any 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 processor status word , 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. Способ по п.1, отличающийся тем, что команда, подаваемая процессору, имеет код 11101100 в своих старших разрядах.18. The method according to claim 1, characterized in that the command issued to the processor has a code 11101100 in its upper digits. 19. Способ по п.1, отличающийся тем, что служебные регистры включают в свое число рабочие регистры кольцевого стека переключения контекста, а записываемые новые значения представляют собой дескрипторы начала и размера областей памяти для размещения контекстов.19. The method according to claim 1, characterized in that the service registers include in their number 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. Способ по п.1, отличающийся тем, что служебные регистры включают в себя регистр указателя начала свободного пространства в кольцевом стеке переключения контекстов.20. The method according to claim 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 and 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.
RU2006112635/09A 2006-04-18 2006-04-18 Method for switching context of tasks and procedures in a processor RU2320002C2 (en)

Priority Applications (2)

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

Applications Claiming Priority (1)

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

Publications (2)

Publication Number Publication Date
RU2006112635A RU2006112635A (en) 2007-11-20
RU2320002C2 true RU2320002C2 (en) 2008-03-20

Family

ID=38609763

Family Applications (1)

Application Number Title Priority Date Filing Date
RU2006112635/09A RU2320002C2 (en) 2006-04-18 2006-04-18 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
RU2589306C2 (en) * 2011-08-26 2016-07-10 Амазон Текнолоджис, Инк. Remote viewing session control

Families Citing this family (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

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US610744A (en) * 1898-09-13 Valve-seat
US6092144A (en) * 1993-06-30 2000-07-18 Microsoft Corporation Method and system for interrupt-responsive execution of communications protocols
WO2003007105A3 (en) * 2000-11-24 2003-09-12 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
RU2003113302A (en) * 2000-11-13 2004-11-10 Коммиссариат А Л'Энержи Атомик METHOD OF PROTECTION WITH DETERMINED EXECUTION IN REAL TIME OF MULTI-TASK APPLICATIONS OF MANAGEMENT AND CONTROL TYPE WITH RESTRICTION OF ERRORS
RU2263949C2 (en) * 2000-10-05 2005-11-10 Арм Лимитед Translated commands with possible rerun

Family Cites Families (2)

* 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
FR2816730B1 (en) * 2000-11-13 2004-10-15 Commissariat Energie Atomique SECURITY METHOD FOR DETERMINING REAL-TIME EXECUTION OF MULTITASTIC APPLICATIONS OF CONTROL-CONTROL TYPE WITH ERROR CONTAINMENT

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US610744A (en) * 1898-09-13 Valve-seat
US6092144A (en) * 1993-06-30 2000-07-18 Microsoft Corporation Method and system for interrupt-responsive execution of communications protocols
RU2263949C2 (en) * 2000-10-05 2005-11-10 Арм Лимитед Translated commands with possible rerun
RU2003113302A (en) * 2000-11-13 2004-11-10 Коммиссариат А Л'Энержи Атомик METHOD OF PROTECTION WITH DETERMINED EXECUTION IN REAL TIME OF MULTI-TASK APPLICATIONS OF MANAGEMENT AND CONTROL TYPE WITH RESTRICTION OF ERRORS
WO2003007105A3 (en) * 2000-11-24 2003-09-12 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
RU2589306C2 (en) * 2011-08-26 2016-07-10 Амазон Текнолоджис, Инк. Remote viewing session control

Also Published As

Publication number Publication date
RU2006112635A (en) 2007-11-20
WO2007120075A1 (en) 2007-10-25

Similar Documents

Publication Publication Date Title
TWI323847B (en) Data processing system having multiple register contexts and method therefor
US6314513B1 (en) Method and apparatus for transferring data between a register stack and a memory resource
US7010555B2 (en) System and method for compacting a computer system heap
US7840773B1 (en) Providing memory management within a system management mode
JP2014504768A (en) Method, computer program product, and apparatus for progressively unloading classes using a region-based garbage collector
US6115777A (en) LOADRS instruction and asynchronous context switch
KR20130012126A (en) Apparatus and method for handling exception events
US4454580A (en) Program call method and call instruction execution apparatus
JP2011529225A (en) Avoiding self-eviction due to dynamic memory allocation in flash memory storage
JPS604493B2 (en) Microprogrammed data processing system
US20070055841A1 (en) Memory allocation in a computer system
US5175830A (en) Method for executing overlays in an expanded memory data processing system
US6065114A (en) Cover instruction and asynchronous backing store switch
RU2320002C2 (en) Method for switching context of tasks and procedures in a processor
JPH05257808A (en) Microprocessor and its operation conversion method
US7934073B2 (en) Method for performing jump and translation state change at the same time
US5450587A (en) Expanded memory addressing scheme
CN116541314A (en) Address mapping method, device and storage medium based on system page table
US8756193B2 (en) System and method for persisting object pointers
JP2004206369A (en) Access method and access program to common resource
KR100654477B1 (en) How Processors Work
JPS6032220B2 (en) information processing equipment
RU2294010C1 (en) Digital data processing method
KR100336717B1 (en) Address space management method of multi-threads for real-time systems
US10817288B2 (en) Combined instruction for addition and checking of terminals

Legal Events

Date Code Title Description
MM4A The patent is invalid due to non-payment of fees

Effective date: 20110419