WO2009001030A1 - Interrupt handling - Google Patents
Interrupt handling Download PDFInfo
- Publication number
- WO2009001030A1 WO2009001030A1 PCT/GB2008/002044 GB2008002044W WO2009001030A1 WO 2009001030 A1 WO2009001030 A1 WO 2009001030A1 GB 2008002044 W GB2008002044 W GB 2008002044W WO 2009001030 A1 WO2009001030 A1 WO 2009001030A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- interrupt
- function
- interact
- controllers
- event
- Prior art date
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4812—Task transfer initiation or dispatching by interrupt, e.g. masked
Definitions
- interrupt controller 10 provides an output to interrupt controller 11.
- Interrupt controller 12 receives inputs from interrupt controllers 11 and 13 and provides an interrupt output to the microprocessor 14.
- the interrupt controllers may be at multiple depths (as in the case of controllers 12, 11 and 10), and there may be multiple controllers at the same depth (as in the case of controllers 11 and 13).
- operations will need to be performed to configure the interrupt controller. Examples of these operations include:
- a method for servicing interrupts in a computing device having multiple interrupt controllers for receiving interrupt events, a processor and a memory storing instructions for execution by the processor to cause the processor to interact with interrupt events, the instructions being such as to implement an interface including: a first function that can be invoked by software running on the device for interacting with interrupts on two or more of the interrupt controllers; and a second function that can interact with interrupt events on a specific one of the interrupt controllers; the method comprising: invoking the first function for interacting with an interrupt event on the specific one of the interrupt controllers; and subsequently invoking the second function so as to cause it to interact with that event.
- the interface may be such as to maintain a record of interrupts available in the device and an indication of the interrupts for which of it should invoke the second function to interact with events thereon.
- the record of interrupts may be in the form of a linked list that links each interrupt to a respective implementation mechanism, the implementation mechanisms including the invocation of the second function.
- the record of interrupts may be in the form of an array that links groups of one or more interrupts to a respective implementation mechanisms, the implementation mechanisms including the invocation of the second function.
- Each interrupt may be identified by an interrupt identifier.
- the interface may then be arranged to allocate the interrupt identifiers such that for each of the interrupts the bits in a common set of bit positions indicate the implementation mechanism to be invoked for that interrupt.
- the first function may be a component of an application programming interface (API).
- API application programming interface
- Figure 4 illustrates deriving an MlnterruptControllerBase object from a given interrupt ID.
- the operating system provides an extendable API which is accessible to applications. That API is designed so that specific interface implementations for any added interrupt controllers can be plugged in to it. Application code can then use the single operating system API to access interrupts regardless of which interrupt controller the relevant interrupt input is connected to. This enables developers to use a common API for controlling interrupts on any interrupt controller.
- the specific interface implementations provide implementations of some or all of the functionality offered by the operating system API, such as bind, unbind, enable, disable, etc. These implementations are configured to be appropriate to the respective interrupt controller that the interface implementation is to interact with. Each of these implementations is registered with the operating system API.
- the operating system API maintains a list of the implementations of the API for each interrupt controller and acts as a wrapper around them.
- Each interrupt controller can be allocated a range of interrupt IDs that are unique to that controller.
- the interrupt ID passed to it can uniquely identify the interrupt controller that it applies to.
- the operating system can use the interrupt ID to find the implementation for that interrupt controller and pass the request on to it.
- the API effectively implements a function that can be called by an application or other software to handle an interrupt or otherwise with an interrupt event (whether one that has occurred or one that may occur in the future). That effective function can call other subsidiary effective functions in order to handle the interrupt. As will be described below, those functions could then call each other to echo chaining of interrupt controllers in hardware.
- API 30 is configured so as to serve as a standard API for use by all code, whether in applications 27 or in the operating system 25, that needs to control interrupts.
- An object 31 derived from an abstract base class provided by API 30, will be implemented for each interrupt controller 28 in the system. That abstract base class defines an API that can be implemented for each interrupt controller in order for it to operate with API 30. This type of hierarchy is in accordance with normal object-oriented conventions.
- API 30 will be referred to as Tlnterrupt.
- the abstract base class provided by API 30 will be referred to as MlnterruptControllerBase.
- the concrete implementations 31 of that class will each be referred to as MlnterruptControllerBase objects.
- An MlnterruptControllerBase object is declared for every interrupt controller in the device that is to work with API 30. In figure 3 the MlnterruptControllerBase objects are shown as being external to the operating system but they could be part of the operating system.
- the Tlnterrupt API maintains a list of the registered MlnterruptControllerBase objects. There are several ways to do this; each is a trade-off between performance, memory usage and convenience to the developer. Some examples of ways in which the list can be maintained are:
- MlnterruptControllerBase object will indicate the number of interrupt IDs that it requires, and the Tlnterrupt implementation will assign a range of free IDs to that MlnterruptControllerBase object. This method will work even if the interrupt IDs are not known at compile time.
- Tlnterrupt could be configured to use a linked list structure to manage the allocation of interrupt IDs.
- Tlnterrupt could be configured to use a linked list structure to manage the allocation of interrupt IDs.
- MlnterruptControllerBase objects are never removed from the list (which would happen in a system whose hardware cannot be removed at runtime) then the free IDs can be allocated from a simple one-way-counter. Otherwise, the Tlnterrupt object can maintain a pool of free interrupt IDs - for example by putting linked-list objects back onto a free list when an MlnterruptControllerBase object is deleted.
- an MlnterruptControllerBase object is not allowed to handle more than 128 interrupt inputs.
- New MlnterruptControllerBase objects will always be allocated a range of 128 interrupt IDs. If one such object only provides 8 interrupt inputs the remaining 120 IDs will be unused.
- Interrupt IDs can be allocated statically. When interrupt IDs are allocated statically, all that is necessary is to create a linked-list item with the correct base interrupt ID and range. When the linked-list uses fixed-size ranges, the requested set of static IDs can be rounded down to the base of an available range, if they are not assumed to be already defined on range multiples. Static allocation will fail if there is a conflict between two requests for static ranges. This can either be assumed not to happen, or it can be tested for by checking the list for overlapping ranges and rejecting any request that conflicts. When using statically allocated interrupt IDs with a fixed-slot array, the requested interrupt ID range can define which slot in the array the MlnterruptControllerBase object will go into. If the base of the requested static ID range is not assumed to be a multiple of the range size, then it is first rounded down to the base of an available range.
- MlnterruptControllerBase objects are kept in an array. This array may be fixed- size or variable size. Items in the array will be referred to as slots. Each slot covers a fixed-size range of interrupt IDs. The range of IDs allocated to a MlnterruptControllerBase object is defined by which slot it occupies in the array. This mechanism allows for efficient lookup of the MlnterruptControllerBase object from the interrupt ID.
- the interrupt ID can be defined such that M bits are used to index the array entry and N bits are used to select the interrupt input within that MlnterruptControllerBase object.
- the MlnterruptControllerBase object can be found from any given interrupt ID by simply using the M bits as the array index. This process is illustrated in figure 4.
- FIG. 4 illustrates an MlnterruptControllerBase object 40 that occupies slot [2] of the array 41.
- the fact that the object occupies slot [2] means that the upper bits of the words that represent that object's interrupt IDs are binary 2.
- the individual interrupts within that range are represented by the remaining bits of the word.
- the lower example illustrates the mapping of an interrupt ID 42 on to an MlnterruptControllerBase object 43.
- the first M bits of the interrupt ID point to a slot in the array 41.
- the content of that slot represent the appropriate MlnterruptControllerBase object.
- the remaining bits of the interrupt ID represent the specific interrupt within that range that is being processed.
- This method has the advantage that the process of identifying an MlnterruptControllerBase object from the interrupt ID is simple because the object is specified by a number that is the array index shifted left by a number of bits.
- All that is necessary is to search the array for an empty slot, defined by an illegal pointer value. That value is conventionally NULL but any illegal value is suitable. Although searching the list may occupy time, adding interrupt controllers is generally not a time-critical operation so the array search is acceptable.
- a parameter passed with the function call specifies the ID of the interrupt that the call is to operate on.
- the call to enable interrupt 136 could for example be: enable ( 136 )
- Tlnterrupt API identifies which one of the MlnterruptControllerBase objects is responsible for handling the specified interrupt ID. Tlnterrupt then calls that object, specifying the interrupt ID or at least the necessary bits of it, in order to have that object carry out the desired operation. If no object is found matching the interrupt ID the Tlnterrupt API can either return an error, or treat this as a fatal exception. It is convenient for the functions in the MlnterruptControllerBase objects to directly correspond to equivalent functions in the Tlnterrupt API. This allows that when a particular function of Tlnterrupt is called, it can simply call the corresponding function in the appropriate MlnterruptControllerBase object.
- Tlnterrupt As described above, the Tlnterrupt class defines the static API through which all code manipulates interrupts.
- MInterruptControllerBase This class defines the API through which Tlnterrupt dispatches requests to the handlers for a particular interrupt controller. In practice, each interrupt controller will have an implementation of this API derived from MInterruptControllerBase.
- MlnterruptControllerBase* entry iLinkedListHead
- the EnableO function identifies which interrupt controller to call and then dispatches the call to the appropriate MInterruptControllerBase implementation.
- MInterruptControllerBase* obj Find ⁇ bject( id ) ; if( obj )
- the Register() function adds entries corresponding to implementations of MInterruptControllerBase to the appropriate data structure when a new MInterruptControllerBase object is registered.
- the function can be implemented in various ways depending on how the data structure is defined.
- Register() adds dynamic interrupt controller entries to a fixed-range linked list.
- Register() adds static interrupt controller entries to a fixed-slot array.
- a fourth example of the Register() function adds dynamic interrupt controller entries to a fixed-slot array.
- the MlnterruptControllerBase object can be implemented as a definition of a jump table.
- a jump table could, for example, be implemented in C in the following manner:
- each version of MlnterruptControllerBase will provide a memory area conforming to this structure, filled in with pointers to the functions of the corresponding interrupt controller. This memory area will be passed to the Tlnterrupt API when registering the implementation.
- This simplest way of dispatching interrupts in a system that has multiple interrupt controllers is for the interrupt dispatch functions for each interrupt controller to chain in exactly the same way as the hardware chains. There is no need for any lookup of which interrupt controller implements a particular interrupt during the dispatch phase. Thus, if the interrupt controllers are chained at a hardware level, the MlnterruptControllerBase objects can be chained in the same topology.
- TInterrupt (C0NTR0LLER_A_INT2_ID, ControllerBDispatch );
- ControllerBDispatch() processes pending interrupts on interrupt controller B.
- static interrupt IDs are used, they can be defined in a header file and compiled into code as a constant. This is not possible with dynamic IDs. For those the actual ID can be looked up at runtime using a mechanism for translating from a description of the desired interrupt to its ID.
- One example of such a mechanism is to use a database of available hardware on the system, constructed dynamically as hardware is identified and interrupt IDs are assigned. This might for example identify devices by a type and number. Such a table might look like this:
- Drivers can search the table for the peripheral and interrupt source they handle to find an interrupt ID.
- the same device drivers can be present on each device, irrespective of its hardware capabilities. Those drivers that correspond to non-existent hardware will be able to configure themselves as normal, even though that hardware is not present, and will then just lie dormant since they will never be woken by an interrupt.
- the present mechanism of interrupt handling can be implemented on a wide range of devices. Examples include desktop and laptop computers, personal digital assistants (PDAs), mobile telephones, smartphones, digital cameras and digital music players and converged devices incorporating the functionality of one or more of the classes of device already mentioned, as well as on many other industrial and domestic electronic appliances.
- the device is preferably portable.
- the device preferably has a self-contained power source such as a battery or a fuel cell that can power the device when it is operating to exchange data.
- interrupt controllers accept a similar set of commands for interacting with interrupts; including, for example, bind, unbind, enable and disable.
- MlnterruptControllerBase could include a generic function that can be extended as needed to allow it to interact with such controllers. If a controller uses non-standard functions to implement standard actions such as bind then the mapping from (e.g.) bind to that non-standard function can be done in the appropriate MlnterruptControllerBase object. That makes the mapping transparent to the application programmer.
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Microcomputers (AREA)
- Bus Control (AREA)
- Debugging And Monitoring (AREA)
Abstract
Description
Claims
Priority Applications (3)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN200880021903A CN101711384A (en) | 2007-06-27 | 2008-06-16 | Interrupt handling |
EP08762371A EP2206039A1 (en) | 2007-06-27 | 2008-06-16 | Interrupt handling |
JP2010514093A JP2010531508A (en) | 2007-06-27 | 2008-06-16 | Interrupt handling |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
GB0712493.6 | 2007-06-27 | ||
GB0712493A GB2450516A (en) | 2007-06-27 | 2007-06-27 | Servicing interrupts in a device having multiple interrupt controllers |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2009001030A1 true WO2009001030A1 (en) | 2008-12-31 |
Family
ID=38420825
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/GB2008/002044 WO2009001030A1 (en) | 2007-06-27 | 2008-06-16 | Interrupt handling |
Country Status (5)
Country | Link |
---|---|
EP (1) | EP2206039A1 (en) |
JP (1) | JP2010531508A (en) |
CN (1) | CN101711384A (en) |
GB (1) | GB2450516A (en) |
WO (1) | WO2009001030A1 (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102314399A (en) * | 2011-07-07 | 2012-01-11 | 曙光信息产业股份有限公司 | Method for realizing interruption distribution for Loongson blade equipment |
KR101936565B1 (en) * | 2016-11-14 | 2019-01-09 | 엘에스산전 주식회사 | Method for controlling interrupt in inverter |
CN108874515B (en) * | 2017-05-15 | 2021-02-26 | 成都鼎桥通信技术有限公司 | Push-to-talk PTT (push-to-talk) establishing method and system |
TWI687868B (en) * | 2018-02-12 | 2020-03-11 | 緯創資通股份有限公司 | Computer system and handling method thereof for interrupt event |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US4275458A (en) * | 1979-12-14 | 1981-06-23 | Gte Automatic Electric Laboratories Incorporated | Interrupt expander circuit |
US5369770A (en) * | 1992-11-02 | 1994-11-29 | Microsoft Corporation | Standardized protected-mode interrupt manager |
US5619705A (en) * | 1993-12-16 | 1997-04-08 | Intel Corporation | System and method for cascading multiple programmable interrupt controllers utilizing separate bus for broadcasting interrupt request data packet in a multi-processor system |
US20040024938A1 (en) * | 2002-08-02 | 2004-02-05 | Bian Qiyong B. | Flexible interrupt handling methods for optical networking apparatuses with multiple multi-protocol optical networking modules |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP3003968B2 (en) * | 1991-05-01 | 2000-01-31 | インターナショナル・ビジネス・マシーンズ・コーポレイション | Interrupt processing program selection device and processing method |
US5568644A (en) * | 1995-05-05 | 1996-10-22 | Apple Computer, Inc. | Method and apparatus using a tree structure for the dispatching of interrupts |
US6618779B1 (en) * | 2000-05-30 | 2003-09-09 | Intel Corporation | Method and apparatus for chaining interrupt service routines |
GB2396445B (en) * | 2002-12-19 | 2005-12-21 | Advanced Risc Mach Ltd | An interrupt controller and interrupt controlling method for prioritizing interrupt requests generated by a plurality of interrupt sources |
WO2006090329A1 (en) * | 2005-02-28 | 2006-08-31 | Koninklijke Philips Electronics N.V. | Data processing system with interrupt controller and interrupt controlling method |
-
2007
- 2007-06-27 GB GB0712493A patent/GB2450516A/en not_active Withdrawn
-
2008
- 2008-06-16 JP JP2010514093A patent/JP2010531508A/en not_active Withdrawn
- 2008-06-16 CN CN200880021903A patent/CN101711384A/en active Pending
- 2008-06-16 EP EP08762371A patent/EP2206039A1/en not_active Withdrawn
- 2008-06-16 WO PCT/GB2008/002044 patent/WO2009001030A1/en active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US4275458A (en) * | 1979-12-14 | 1981-06-23 | Gte Automatic Electric Laboratories Incorporated | Interrupt expander circuit |
US5369770A (en) * | 1992-11-02 | 1994-11-29 | Microsoft Corporation | Standardized protected-mode interrupt manager |
US5619705A (en) * | 1993-12-16 | 1997-04-08 | Intel Corporation | System and method for cascading multiple programmable interrupt controllers utilizing separate bus for broadcasting interrupt request data packet in a multi-processor system |
US20040024938A1 (en) * | 2002-08-02 | 2004-02-05 | Bian Qiyong B. | Flexible interrupt handling methods for optical networking apparatuses with multiple multi-protocol optical networking modules |
Also Published As
Publication number | Publication date |
---|---|
EP2206039A1 (en) | 2010-07-14 |
JP2010531508A (en) | 2010-09-24 |
CN101711384A (en) | 2010-05-19 |
GB0712493D0 (en) | 2007-08-08 |
GB2450516A (en) | 2008-12-31 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11175896B2 (en) | Handling value types | |
US9904527B1 (en) | Optimizing API implementer programs using fine-grained code analysis | |
US5129086A (en) | System and method for intercommunicating between applications and a database manager | |
KR100518584B1 (en) | Shared library system and method for constructing the system | |
US6711605B2 (en) | Multi OS configuration method and computer system | |
US9069656B2 (en) | Obfuscating function resources while reducing stack consumption | |
EP2380078B1 (en) | Shared value resolution with multiple runtime containers | |
US9063805B2 (en) | Method and system for enabling access to functionality provided by resources outside of an operating system environment | |
WO2023124968A1 (en) | Method for calling android dynamic library hal interface by software operating system, device and medium | |
EP2206039A1 (en) | Interrupt handling | |
US7822723B2 (en) | Method, system, program and data structure for controlling access to sensitive functions | |
JP5307228B2 (en) | Sharing multiple operating system subprocesses across multiple tasks | |
US8402479B2 (en) | Device control call allocation for embedded system design | |
US10055367B2 (en) | Integrated-circuit radio | |
US11074200B2 (en) | Use-after-free exploit prevention architecture | |
US20200379792A1 (en) | Processor microcode with embedded jump table | |
CN102063303B (en) | Method for supporting kdata page of WinCE/WM by Linux kernel | |
Yang et al. | A RISC-V On-chip Operating System Based on Rust | |
CN114969753A (en) | Implementation method and system of loadable system module for dynamically determining running state |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
WWE | Wipo information: entry into national phase |
Ref document number: 200880021903.0 Country of ref document: CN |
|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 08762371 Country of ref document: EP Kind code of ref document: A1 |
|
WWE | Wipo information: entry into national phase |
Ref document number: 7567/CHENP/2009 Country of ref document: IN Ref document number: 2010514093 Country of ref document: JP |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
WWE | Wipo information: entry into national phase |
Ref document number: 2008762371 Country of ref document: EP |