Object-oriented resource lock and entry register
First Claim
1. Apparatus for use in a computer system having a plurality of system resources, a plurality of devices, a resource conflict resolution mechanism for generating a conflict-free resource assignment and a plurality of device drivers, the apparatus operating during operation of a program running on the computer system and preventing race conditions caused by the plurality of device drivers attempting to simultaneously access the same system resources under control of the program, and comprising:
- (a) a resource lock object having a method operable during the operation of the program for retrieving a conflict free resource assignment for an I/O function of one of the devices generated by the conflict resolution mechanism (b) means operating during the operation of the program and controlled by one of the plurality of device drivers for attempting to acquire the resource lock;
(c) means operable when the resource lock is acquired for obtaining the conflict-free resource assignment so that the one device driver can use the assigned resources during the operation of the program; and
(d) means for generating an exception if a predetermined period of time expires before the one device driver acquires the resource lock.
2 Assignments
0 Petitions
Accused Products
Abstract
System resources are automatically assigned by a single resource conflict resolver to all functions on expansion buses in a computer system. Such system resources include, but are not limited to, memory ranges, input-output (I/O) register ranges, interrupt request lines and direct memory access (DMA) channels. Generally, the assignment is exclusive, however, in some cases, the assignment may be shared so that one or more resources will be shared between different functions. In order to prevent contention between two functions for the same resource, classes are provided which classes can be instantiated to construct resource lock objects. The resource lock objects provide an access control mechanism to synchronize access to the resources among the devices that use and, possibly, share the resources. The lock object contains methods which retrieve the resource assignments for an I/O function and acquire a lock on the resources. The lock object can be used by device drivers to first retrieve the resource assignments from the hardware configuration database and then acquire access to the resources assigned to an I/O function. The acquired access can be either exclusive or shared.
73 Citations
24 Claims
-
1. Apparatus for use in a computer system having a plurality of system resources, a plurality of devices, a resource conflict resolution mechanism for generating a conflict-free resource assignment and a plurality of device drivers, the apparatus operating during operation of a program running on the computer system and preventing race conditions caused by the plurality of device drivers attempting to simultaneously access the same system resources under control of the program, and comprising:
-
(a) a resource lock object having a method operable during the operation of the program for retrieving a conflict free resource assignment for an I/O function of one of the devices generated by the conflict resolution mechanism (b) means operating during the operation of the program and controlled by one of the plurality of device drivers for attempting to acquire the resource lock;
(c) means operable when the resource lock is acquired for obtaining the conflict-free resource assignment so that the one device driver can use the assigned resources during the operation of the program; and
(d) means for generating an exception if a predetermined period of time expires before the one device driver acquires the resource lock. - View Dependent Claims (2, 3, 4)
-
-
5. A method for use in a computer system having a plurality of system resources, a plurality of devices, a resource conflict resolution mechanism for generating a conflict-free resource assignment and a plurality of device drivers, the method operable during operation of a program running on the computer system and preventing race conditions caused by the plurality of device drivers attempting to simultaneously access the same system resources under control of the program, and comprising the steps of:
-
(a) creating a resource lock object having a method operable during the operation of the program for retrieving a conflict free resource assignment for an I/O function of one of the devices generated by the conflict resolution mechanism;
(b) during the operation of the program, using one of the plurality of device drivers to attempt to acquire the resource lock;
(c) when the resource lock is acquired, obtaining the conflict-free resource assignment so that the one device driver can use the assigned resources during the operation of the program; and
(d) generating an exception if a predetermined period of time expires before the one device driver acquires the resource lock. - View Dependent Claims (6, 7, 8)
(a1) storing the resource lock in the memory with the conflict free resource assignment.
-
-
7. A method according to claim 5 wherein step (d) comprises the step of:
(d1) identifying another holder of the resource lock.
-
8. A method according to claim 5 wherein step (b) comprises the step of:
(b1) specifying whether the resource lock is exclusive or shared.
-
9. A computer program product for use in a computer system having a plurality of system resources, a plurality of devices, a resource conflict resolution mechanism for generating a conflict-free resource assignment and a plurality of device drivers, the computer program product operable during operation of a program running on the computer system and preventing race conditions caused by the plurality of device drivers attempting to simultaneously access the same system resources, and comprising a computer usable medium having computer readable program code thereon, including:
-
(a) program code for creating a resource lock object having a method operable during the operation of the program for retrieving a conflict free resource assignment for an I/O function of one of the devices generated by the conflict resolution mechanism;
(b) program code operable during the operation of the program for using one of the plurality of device drivers to attempt to acquire the resource lock;
(c) program code operable when the resource lock is acquired, for obtaining the conflict-free resource assignment so that the one device driver can use the assigned resources during the operation of the program; and
(d) program code for generating an exception if a predetermined period of time expires before the one device driver acquires the resource lock. - View Dependent Claims (10, 11, 12)
-
-
13. In a computer system having a plurality of system resources, a plurality of devices, a plurality of device drivers and a resource conflict resolver object having methods for generating conflict-free resource assignments, an apparatus operating during operation of a program running on the computer system and for preventing race conditions caused by a plurality of device drivers attempting to access the same system resource, the apparatus comprising:
-
(a) a recognizer object for identifying one of the plurality of system resources assigned to an I/O function of one device of the plurality of devices;
(b) a resource lock object having a method operable during the operation of the program for retrieving a conflict free resource assignment for the I/O function of the one device generated by the conflict resolver object;
(c) means for determining whether the I/O function requires exclusive or shared access to the resource assignment;
(d) means in the resource lock object executable by one of the plurality of device drivers for acquiring a lock for the one system resource assigned to the I/O function of the one device during the operation of the program; and
(e) means for generating an exception if a predetermined period of time expires before the one device driver acquires the lock. - View Dependent Claims (14, 15, 16)
-
-
17. In a computer system having a plurality of system resources, a plurality of devices, a plurality of device drivers and a resource conflict resolver object having methods for generating conflict-free resource assignments, a method operating during operation of a program running on the computer system and for preventing race conditions caused by a plurality of device drivers attempting to access the same system resource, the method comprising the steps of:
-
(a) constructing a recognizer object for identifying one of the plurality of system resources assigned to an I/O function of one device of the plurality of devices;
(b) constructing a resource lock object having a method for retrieving a conflict free resource assignment for the I/O function of the one device generated by the conflict resolver object;
(c) determining whether the I/O function requires exclusive or shared access to the resource assignment;
(d) using one of the device drivers during the operation of the program to acquire a lock for the one system resource assigned to the I/O function of the one device; and
(e) generating an exception if a predetermined period of time expires before the one device driver acquires the lock. - View Dependent Claims (18, 19, 20)
(e1) identifying a holder of the lock to the one device driver.
-
-
19. A method according to claim 17 wherein step (d) comprises the step of:
(d1) invoking a first method of the resource lock object.
-
20. A method according to claim 17 wherein each device driver includes an interrupt handler reference and the method further comprises the step of:
(f) registering the interrupt handler reference of each device driver with the resource lock entry object such that system resources assigned to the corresponding I/O functions are automatically freed when the device no longer requires the system resource.
-
21. In a computer system having a plurality of system resources, a plurality of devices, a plurality of device drivers and a resource conflict resolver object having methods for generating conflict-free resource assignments, a computer program product operating during operation of a program running on the computer system and for preventing race conditions caused by a plurality of device drivers attempting to access the same system resource, the computer program product comprising a computer usable medium having computer readable program code thereon, including:
-
(a) program code for constructing a recognizer object for identifying one of the plurality of system resources assigned to an I/O function of one device of the plurality of devices;
(b) program code for constructing a resource lock object having a method for retrieving a conflict free resource assignment for the I/O function of the one device generated by the conflict resolver object;
(c) program code for determining whether the I/O function requires exclusive or shared access to the resource assignment;
(d) program code for using one of the device drivers during the operation of the program to acquire a lock for the one system resource assigned to the I/O function of the one device; and
(e) program code for generating an exception if a predetermined period of time expires before the one device driver acquires the lock. - View Dependent Claims (22, 23, 24)
-
Specification