IP Library Granted Patent US 6,981,165
Granted Patent B2
US 6,981,165 · App. 10/233,731 · Granted Dec 27, 2005

Method and apparatus for handling an interrupt from a real-time clock to increment a program clock

View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 6,981,165
App. No.
10/233,731
Granted
Dec 27, 2005
Kind
B2
Abstract

A method and apparatus for handling an interrupt from a real-time clock to increment a program clock in a computer system while compensating for missed interrupts due to contention on a system bus from a DMA controller or the like. In accordance with the invention, a count is stored representing a cumulative interval of time that has elapsed without a corresponding incrementing of the program clock. In response to an interrupt from the real-time clock, the processor transfers control to an interrupt handling routine, which determines the interval of time that has elapsed since the previous real-time clock interrupt and increments the cumulative interval of time by the actual interval of time that has elapsed since the previous real-time clock interrupt. If the cumulative interval of time is greater than an expected interval of time between real-time clock interrupts, the interrupt handling routine iteratively increments the program clock and decrements the cumulative interval of time to reflect incrementing of the program clock until the cumulative interval of time is less than the expected interval of time between real-time clock interrupts.

Claims (37)

1. In a computer system having a processor and a program running on the processor, the program having a program clock that is incremented by the processor in response to an interrupt received from a real-time clock, a method of incrementing the program clock, comprising the steps of:

(a) storing a count representing a cumulative interval of time that has elapsed without a corresponding incrementing of the program clock; and

(b) in response to an interrupt from the real-time clock:

(1) incrementing the cumulative interval of time by an actual interval of time that has elapsed since a previous real-time clock interrupt; and

(2) if the cumulative interval of time is greater than an expected interval of time between real-time clock interrupts, incrementing the program clock and decrementing the cumulative interval of time to reflect incrementing of the program clock.

2. The method of claim 1 in which the steps of incrementing the program clock and decrementing the cumulative interval of time are performed iteratively until the cumulative interval of time is less than the expected interval of time between real-time clock interrupts.

3. The method of claim 1 in which the steps of incrementing the program clock and decrementing the cumulative interval of time are performed unconditionally on a first iteration and are performed conditionally on one or more additional iterations until the cumulative interval of time is less than the expected interval of time between real-time clock interrupts.

4. The method of claim 1 in which the processor transfers control to an interrupt handling routine for performing steps (b)(1) and (b)(2) in response to the interrupt from the real-time clock.

5. The method of claim 1 in which step (b)(1) includes the step of determining the interval of time that has elapsed since the previous real-time clock interrupt.

6. The method of claim 5 in which the step of determining the interval of time that has elapsed since the previous real-time clock interrupt comprises the steps of:

obtaining a current timer value from a timer having a resolution greater than that of the real-time clock; and

comparing the current timer value with a timer value obtained from the timer on the previous real-time clock interrupt.

7. The method of claim 1 in which the program clock is further adjusted upon being incremented a predetermined number of times.

8. In a computer system having a processor and a program running on the processor, the program having a program clock that is incremented by the processor in response to an interrupt received from a real-time clock, apparatus for handling an interrupt from the real-time clock to increment the program clock, comprising:

(a) means for determining an actual interval of time that has elapsed since a previous real-time clock interrupt;

(b) means for incrementing by said actual interval of time a cumulative interval of time that has elapsed since a previous real-time clock interrupt without a corresponding incrementing of the program clock; and

(c) means for incrementing the program clock and decrementing the cumulative interval of time to reflect incrementing of the program clock if the cumulative interval of time is greater than an expected interval of time between real-time clock interrupts.

9. The apparatus of claim 8 in which the means for incrementing the program clock and decrementing the cumulative interval of time operates iteratively until the cumulative interval of time is less than the expected interval of time between real-time clock interrupts.

10. The apparatus of claim 8 in which the means for incrementing the program clock and decrementing the cumulative interval of time operates unconditionally on a first iteration and operates conditionally on one or more additional iterations until the cumulative interval of time is less than the expected interval of time between real-time clock interrupts.

11. The apparatus of claim 8 in which means (a)–(c) are part of an interrupt handling routine responsive to the interrupt from the real-time clock.

12. The apparatus of claim 8 in which the means for determining the interval of time that has elapsed since the previous real-time clock interrupt comprises:

means for obtaining a current timer value from a timer having a resolution greater than that of the real-time clock; and

means for comparing the current timer value with a timer value obtained from the timer on the previous real-time clock interrupt.

13. The apparatus of claim 8 in which the program clock is further adjusted upon being incremented a predetermined number of times.

14. A program storage device readable by a machine, tangibly embodying a program of instructions executable by the machine to perform method steps for incrementing a program clock in a computer system having a processor and a program running on the processor, the program having a program clock that is incremented by the processor in response to an interrupt received from the real-time clock, the method steps comprising:

(a) storing a count representing a cumulative interval of time that has elapsed without a corresponding incrementing of the program clock; and

(b) in response to an interrupt from the real-time clock:

(1) incrementing the cumulative interval of time by an actual interval of time that has elapsed since a previous real-time clock interrupt; and

(2) incrementing the program clock and decrementing the cumulative interval of time to reflect incrementing of the program clock if the cumulative interval of time is greater than an expected interval of time between real-time clock interrupts.

15. The program storage device of claim 14 in which the steps of incrementing the program clock and decrementing the cumulative interval of time are performed iteratively until the cumulative interval of time is less than the expected interval of time between real-time clock interrupts.

16. The program storage device of claim 14 in which the steps of incrementing the program clock and decrementing the cumulative interval of time are performed unconditionally on a first iteration and are performed conditionally on one or more additional iterations until the cumulative interval of time is less than the expected interval of time between real-time clock interrupts.

17. The program storage device of claim 14 in which the processor transfers control to an interrupt handling routine for performing steps (b)(1) and (b)(2) in response to the interrupt from the real-time clock.

18. The program storage device of claim 14 in which step (b)(1) includes the step of determining the interval of time that has elapsed since the previous real-time clock interrupt.

19. The program storage device of claim 14 in which the step of determining the interval of time that has elapsed since the previous real-time clock interrupt comprises the steps of:

obtaining a current timer value from a timer having a resolution greater than that of the real-time clock; and

comparing the current timer value with a timer value obtained from the timer on the previous real-time clock interrupt.

20. The program storage device of claim 14 in which the program clock is further adjusted upon being incremented a predetermined number of times.

Assignments (2)
CONVEYOR IS ASSIGNING UNDIVIDED 50% INTEREST Recorded Jan 29, 2018
From: INTERNATIONAL BUSINESS MACHINES CORPORATION
To: SERVICENOW, INC.; INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 045183/0349 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 3, 2002
From: MARIK, MARK D.
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 013264/0172 →