Mechanism for using common code to handle hardware interrupts in multiple processor modes
AssigneeMicrosoft Corporation
InventorsRichard A. Pletcher, Ralph A. Lipe
Life of this patent
Estimating the term…
Abstract
An interrupt handler may be run in multiple processor modes on a data processing system having a processor for executing instructions and a memory for storing information. The sharing of interrupt handler code across multiple processor modes minimizes the switching between processor modes during the handling of interrupts. The mode in which the interrupt handler executes is dictated by the current processor mode. The indicator of the current processor mode directs the interrupt handler to use information that is appropriate for the current processor mode.
Claims18
In a data processing system having a processor for executing instructions and operating at different privilege levels, a storage for storing information and an interrupt handler for handling a type of interrupt, a method of handling interrupts comprising the steps of:
- a) storing an indicator of a current privilege level of executing instructions in the storage;
- b) storing information to be used by the interrupt handler when run in a first privilege level in the storage and storing information to be used by the interrupt handler when run in a second privilege level in the storage;
- c) receiving an interrupt of the type handled by the interrupt handler;
- d) in response to receiving the interrupt, determining the current privilege level by examining the indicator in storage;
- e) running the interrupt handler using the stored information for the first privilege level in response to determining that the current privilege level is the first privilege level to avoid switching privilege levels;
- and
- f) running the interrupt handler using the stored information for the second privilege level in response to determining that the current privilege level is the second privilege level to avoid switching privilege levels.
In a data processing system that has a processor that runs in processor modes of real mode or protected mode and a storage for storing an interrupt handler for handling interrupts, a method comprising the computer-implemented steps of:
- running the processor in the protected mode;
- providing a data block along with the interrupt handler in the storage, said data blocks holding an offset value;
- receiving an interrupt while the processor is running in the protected mode;
- providing a data pointer to the data block for use by the interrupt handler;
- with the interrupt handler, using the data pointer to locate the data block and examining the offset value in the data block;
- and
- using data at an offset specified by the offset value to run the interrupt handler in the protected mode without switching to the real mode.
In a data processing system having a processor that runs programs at different privilege levels and a storage for storing an interrupt handler for handling interrupts, a method comprising the computer-implemented steps of:
- running a program on the processor at a first of the privilege levels;
- providing a data block along with the interrupt handler in the storage, said data block holding an offset value;
- receiving an interrupt while the program is run on the processor at a first of the privilege levels;
- providing a data pointer to the data block for use by the interrupt handler;
- with the interrupt handler, using the data pointer to locate the data block and examining the offset value in the data block;
- and
- using data at an offset specified by the offset value to run the interrupt handler at the first of the privilege levels.
In a data processing system having a processor for executing instructions and operating in different processor modes, a storage for storing information and an interrupt handler for handling a type of interrupt, a computer-readable storage medium holding instructions for performing a method of handling interrupts comprising the steps of:
- a) storing an indicator of a current processor mode in the storage;
- b) storing information to be used by the interrupt handler when run in a first processor mode in the storage and storing information to be used by the interrupt handler when run in a second processor mode in the storage;
- c) receiving an interrupt of the type handled by the interrupt handler responds;
- d) in response to receiving the interrupt, determining what the current processor mode is by examining the indicator in storage;
- e) running the interrupt handler using the stored information for the first processor privilege level in response to determining that the current processor mode is the first mode to avoid switching processor modes;
- and
- f) running the interrupt handler using the stored information for the second processor mode in response to determining that the current processor mode is the second processor mode to avoid switching processor modes.
In a data processing system having a processor for executing instructions and operating at different privilege levels, a storage for storing information and an interrupt handler for handling a type of interrupt, a computer-readable storage medium holding instructions for performing a method of handling interrupts comprising the steps of:
- a) storing an indicator of a current privilege level of executing instructions in the storage;
- b) storing information to be used by the interrupt handler when run in a first privilege level in the storage and storing information to be used by the interrupt handler when run in a second privilege level in the storage;
- c) receiving an interrupt of the type handled by the interrupt handler;
- d) in response to receiving the interrupt, determining the current privilege level by examining the indicator in storage;
- e) running the interrupt handler using the stored information for the first privilege level in response to determining that the current privilege level is the first privilege level to avoid switching privilege levels;
- and
- f) running the interrupt handier using the stored information for the second privilege level in response to determining that the current privilege level is the second privilege level to avoid switching privilege levels.
In a data processing system that has a processor that runs in processor modes of real mode or protected mode and a storage for storing an interrupt handler for handling interrupts, a computer-readable storage medium holding instructions for performing a method comprising the steps of:
- running the processor in the protected mode;
- providing a data block along with the interrupt handler in the storage, said data blocks holding an offset value;
- receiving an interrupt while the processor is running in the protected mode;
- providing a data pointer to the data block for use by the interrupt handler;
- with the interrupt handler, using the data pointer to locate the data block and examining the offset value in the data block;
- and
- using data at an offset specified by the offset value to run the interrupt handler in the protected mode without switching to the real mode.
In a data processing system having a processor that runs programs at different privilege levels and a storage for storing an interrupt handler for handling interrupts, a computer-readable storage medium holding instructions for performing a method comprising the steps of:
- running a program on the processor at a first of the privilege levels;
- providing a data block along with the interrupt handler in the storage, said data block holding an offset value;
- receiving an interrupt while the program is run on the processor at a first of the privilege levels;
- providing a data pointer to the data block for use by the interrupt handler;
- with the interrupt handler, using the data pointer to locate the data block and examining the offset value in the data block;
- and
- using data at an offset specified by the offset value to run the interrupt handler at the first of the privilege levels.
Dependencies are inferred from the claim text.