Abstract:
An advanced configuration and power interface operating system transparent method to control the wake-to-sleep and sleep-to-wake transitions includes: detecting a sleep enable command; temporarily blocking completion of the sleep enable command; generating an interrupt; configuring an input-output device; and completing the sleep enable command. The sleep enable command can be a write command to an advanced configuration and power interface sleep enable data storage unit. The generated interrupt can be a system management interrupt that invokes a basic input-output device configuration program.

Description:
BACKGROUND 
     The invention relates to controlling the sleep-to-wake and wake-to-sleep state transitions in an advanced configuration and power interface (ACPI) computer system. 
     Known power management techniques such as advanced power management (APM) are implemented by basic input-output system (BIOS) instructions stored in read-only memory. When a power management or configuration event occurred (e.g., a request to transition from an &#34;on&#34; state to a &#34;sleep&#34; state), the BIOS received notice of the event via an operating system transparent interrupt known as a system management interrupt (SMI). Upon event occurrence, the BIOS communicates the event to the operating system which, after notifying all operating system level device drivers, generated a SMI, returning control to the BIOS. It was the responsibility of the BIOS to manipulate the necessary software state information and to control the necessary hardware to perform the requested action. On wake-up, the BIOS again received notice via a SMI and performed any state restoration actions needed before returning control to the operating system. 
     Under the newer ACPI, when a power management or configuration event occurs the operating system is notified via an operating system visible interrupt known as a system control interrupt (SCI). It is the operating system itself that directs all system and device power state transitions. 
     The ACPI specification includes tables, BIOS, and hardware registers. ACPI tables are used to describe system information (e.g., supported power states, power sources, clock sources), features (e.g., available hardware devices), and methods for controlling those features (e.g., ACPI control methods). ACPI BIOS is that part of the computer system firmware that implements the ACPI specified interfaces for sleep, wake, some restart operations, and provides permanent storage of ACPI table information. ACPI registers are used to store and pass event information between the hardware/firmware and an ACPI driver--an operating system level program that directs/coordinates all transitions between working and sleeping states. 
     The ACPI specification defines a global working state (G0) as that state in which a host processor dispatches and executes user mode (application) threads. In this state, devices (peripherals) may dynamically have their power state changed. The ACPI specification defines a global sleeping state (G1) as that state in which no user mode threads are executed by the host processor. As shown in Table 1, the ACPI specification also defines five types of sleeping states (S1 through S5). 
     
                       TABLE 1______________________________________ACPI Sleep StatesType     Description______________________________________S1       Low wake-up latency state. No system context is    lost and hardware maintains all system context.S2       Similar to S1 except that the operating system is    not responsible for maintaining processor or cache    context.S3       Processor and cache context are lost. Hardware    maintains memory and some processor configuration    context.S4       It is assumed that hardware has powered off all    devices, although platform context is maintained.S5       Soft off state. Similar to S4 except that no    context is saved and no device is enabled to wake    the system. A complete boot operation is required    to exit the S5 state.______________________________________ 
    
     As shown in FIG. 1, ACPI registers 100 include fixed 102 and general purpose 104 registers. Fixed registers 102 are used to implement ACPI required event handing, e.g., transitions to and from the working and sleeping states. General purpose registers 104 are used to process events generated by value-added hardware, e.g., original equipment manufacturer (OEM) supplied components. 
     Transitions between the global working state G0 and any one of the supported sleeping states (S1-S5) are controlled by two fields in ACPI fixed register space 102: sleep type (SLP --  TYP 106) and sleep enable (SLP --  EN 108). To transition from the working state to one of the sleep states the ACPI driver stores the desired sleep state identifier (i.e., S1-S5) into field SLP --  TYP 106. When the ACPI driver later asserts field SLP --  EN 108, the computer system transitions into the specified sleep state. 
     While in any of the sleeping states (G1), wake status flag (WAK --  STS 110) provides the ACPI driver with a way to detect a wake-up event. Any enabled wake-up event/device may set WAK --  STS flag 110. When WAK --  STS flag 110 is set, a SCI is generated which allows the ACPI driver to sequence computer system hardware back to the working state. 
     Under the ACPI specification, the only opportunity a device manufacturer (e.g., OEM) has to set the configuration of a device prior to entering a sleep state is through the ACPI prepare to sleep ( --  PTS) control method. Under ACPI however, the  --  PTS routine is not guaranteed to be called at a specific point in the wake-to-sleep operation (e.g., after operating system level drivers have been commanded to sleep), or even that a state transition will occur (an ACPI operating system may cancel a pending wake-to-sleep state transition). For these reasons configuring a device so that it may be controlled, accessed, used, or activated remotely (i.e., remotely managed) through the  --  PTS control method is difficult. 
     SUMMARY 
     In one aspect, the invention provides a method to configure a device that is transparent to an advanced configuration and power interface (ACPI) operating system. The method includes detecting an ACPI sleep enable command, temporarily blocking completion of the sleep enable command, generating an interrupt, configuring the device, and completing the sleep enable command. The sleep enable command can be a write command to an ACPI sleep enable data storage unit. The generated interrupt can be a system management interrupt that invokes a basic input-output device configuration program. 
     In another aspect, the invention provides a computer system having a bus, a host processor coupled to the bus, an input-output device coupled to the bus, advanced configuration and power interface sleep enable data storage coupled to the bus, a detector coupled to the bus and adapted to detect and postpone a command to write to the sleep enable data storage, a configuration circuit coupled to the detector and adapted to configure the input-output device when the write command is detected and a sleep circuit coupled to the configuration circuit and adapted to complete the postponed command after the input-output device has been configured. The bus can be a proprietary or special purpose bus, a peripheral component interface (PCI) bus, an industry standard architecture (ISA) bus, an extended industry standard architecture (EISA) bus, or a combination of one or more of these busses. The input-output device can be a network interface card, a modem, a printer interface card, and the like. The computer system may include a bus-to-bus bridge circuit, and the bridge circuit can incorporate the sleep enable data storage, detector, configuration, and sleep circuits. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 shows advanced configuration and power interface register space. 
     FIG. 2 shows a computer system. 
     FIG. 3 shows a working to sleep state transition method. 
     FIG. 4 shows a sleeping to wake state transition method. 
     FIG. 5 shows a bridge circuit. 
    
    
     DETAILED DESCRIPTION 
     Referring to FIG. 2, an advanced configuration and power interface (ACPI) computer system 200 providing basic input-output system (BIOS) control of working-sleeping state transitions includes host processor (CPU) 202 and random access memory (RAM) 204 coupled to system bus 206. Illustrative host processors 202 include the PENTIUM, PENTIUM PRO, PENTIUM-II, and 80X86 families of processors from Intel Corporation. 
     Bridge circuit 208 couples system bus 206 to secondary bus 210. Bridge circuit 208 will be described in more detail below. Components coupled to secondary bus 210 include: read only memory (ROM) 212; non-volatile RAM (NVRAM) 214; ACPI registers 216 (see FIG. 1); input-output (I/O) control circuit 218; video controller 220 and associated display 222; disk controller 224 and associated disks (one shown) 226; and one or more expansion slots 228. Expansion slots 228 can, for example, be used to include a network interface card (NIC), modem, or printer control card. Input-output control circuit 218 can provide an interface for user keyboard 230, pointer device 232, and serial 234 and parallel 236 ports. 
     Generally, if a device such as a NIC or modem is placed into a state capable of responding to a remote wake-up signal, it cannot then respond to routine commands issued to it by host processor 202 (i.e., it is hung) should an ACPI operating system cancel the putative wake-to-sleep transition. FIG. 3 shows a wake-to-sleep process that can configure a device immediately prior to, and when it is certain that, computer system 200 will enter a sleep state. The wake-to-sleep process of FIG. 3 is transparent to an ACPI operating system. 
     When transitioning from the global working state to any supported sleep state the ACPI driver performs its normal sequence of actions as specified in the &#34;Advanced Configuration and Power Interface Specification, section 9: Waking and Sleeping,&#34; dated Dec. 22, 1996 (step 300). Step 300 includes writing (storing) the desired sleep state identifier into field SLP --  TYP 106 of ACPI registers 216. However, when the ACPI driver later attempts to initiate the specified sleep mode by asserting field SLP --  EN 108, this data/command is intercepted (step 302) and an operating system transparent system management interrupt (SMI) is generated (step 304). The SMI causes program code to execute which configures the target device for remote manageability (step 306). Upon completing device configuration the SLP --  EN field 108 is asserted at step 308 (the operation previously intercepted, step 302) which causes computer system 200 to enter the specified sleep state (step 310). 
     Referring to FIG. 4, transition from a sleep state to the global working state is initiated when the WAK --  STS flag 110 is set (step 400). WAK --  STS flag 110 may be set by any event/device so enabled by the operating system such as a keyboard or a peripheral device like a modem. Setting of the WAK --  STS flag 110 triggers generation of a SMI (step 402) which, in turn, causes program code to execute that configures the target device for normal working state operations (step 404). Upon completing device configuration, the ACPI operating system is notified of the change in WAK --  STS flag 110 state via a SCI (step 406). Following SCI generation, the ACPI driver performs its normal wake-up sequence (step 408). 
     Implementing the methods of FIGS. 3 and 4 requires a means to: (1) detect and intercept when the ACPI driver attempts to assert the SLP --  EN field; (2) generate and respond to a SMI; and (3) generate a wake-up SCI. In addition, program code (typically BIOS instructions) must be written to perform the desired configuration actions (steps 306 and 404). Program code will vary from device to device, e.g., a NIC versus a modem. An independent hardware component can be designed to perform these tasks, or bridge circuit 208 may be modified to perform the same tasks. If an independent hardware component is used, it should be located in the path between system bus 206 and ACPI registers 216. 
     Referring to FIG. 5, in one embodiment of computer system 200 ACPI registers 216 and wake/sleep transition circuitry 500 are located within bridge circuit 208. Sleep detect circuit 502 determines when ACPI register 216&#39;s SLP --  EN field is being asserted. Interrupt circuit 504 generates SMI and SCI interrupt signals as indicated in FIGS. 3 and 4. Write circuit 506 asserts the SLP --  EN field to complete a wake-to-sleep transition. Control fields 508 are used by the sleep detect 502, interrupt 504, and write 506 circuits. As shown in Table 2, four control fields can be used to control the operation of wake/sleep transitions. The same, or functionally equivalent, fields can be used if a separate device is provided to implement the invention. 
     
                       TABLE 2______________________________________Wake/Sleep Transition Control FieldsField       Description______________________________________SLP.sub.-- SMI.sub.-- EN       When set, transition from working to any       sleep state sets SLP.sub.-- SMI.sub.-- STS and causes       generation of a SMI.SLP.sub.-- SMI.sub.-- STS       Set by transition from the working state to       any sleep state when SLP.sub.-- SMI.sub.-- EN is set.       Cleared when a wake-up signal is received,       e.g., when the WAK.sub.-- STS flag indicates a       wake-up event.WAK.sub.-- SMI.sub.-- EN       When set, transition from any sleep state       to the working state sets WAK.sub.-- SMI.sub.-- STS and       causes generation of a SMI.WAK.sub.-- SMI.sub.-- STS       Set by transition from a sleeping state to       the working state when WAK.sub.-- SMI.sub.-- EN is set.       Cleared when a wake-up signal is received,       e.g., when the WAK.sub.-- STS flag indicates a       wake-up event.______________________________________ 
    
     One benefit of the state transition methods illustrated in FIGS. 3 and 4 is that any device whose configuration requires computer system 200 to enter a sleep state can be accommodated. Another benefit is that the remote manageability configuration actions (steps 306 and 404) are transparent to the ACPI operating system. 
     The foregoing description is illustrative only and is not to be considered limiting. Various changes in the materials, components, circuit elements, as well as in the details of the illustrated operational methods are possible without departing from the scope of the claims. For example, system bus 206 and secondary bus 210 can be proprietary or special purpose buses, peripheral component interface (PCI) buses, industry standard architecture (ISA) buses, extended industry standard architecture (EISA) buses, or combinations of one or more of these busses. A bridge circuit modified in accordance with the invention can be implemented in discrete logic on a printed circuit card or incorporated within a specially designed application specific integrated circuit (ASIC). Similarly, a hardware component independent of bridge circuit 208 can be implemented as a collection of discrete logic units or incorporated into an ASIC. Steps of the invention may be performed by a computer processor executing instructions organized into a program module or a custom designed state machine. Storage devices suitable for tangibly embodying computer program instructions include all forms of non-volatile memory including, but not limited to: semiconductor memory devices such as EPROM, EEPROM, and flash devices; magnetic disks (fixed, floppy, and removable); other magnetic media such as tape; and optical media such as CD-ROM disks.