Device(UAR1) { Method(_HID, 0) { Return(EISAID("PNP0501")) } //PnP Device ID Name(_UID, 1) // Generic ID for COMA Name (_DDN, "COM1") // _DDN: DOS Device Name //***************************************************** // Method _STA: Return Status //***************************************************** Method(_STA,0,NotSerialized) { // Return Status of the UART // Enter Configuration Mode ENFG() // Select the UART (Logical Device #1) Store(0x01,LDN) // // First, read the Activate register. // If this register is TRUE, then that means // that the device is Present & Active. // If (ACTR) { // Leave Configuration Mode EXFG() // Return result -- // Device is Present & Active // did *NOT* fail self-test // SHOULD be shown to user Return(0x0F) } // // OK, so the device isn't Active, so check // and see if it's at least Present. // Else { // // If the I/O Address is non-zero, then the device // is Present. Test for zero by OR'ing together // the high and low bytes of the address. // If (LOr(IOAH,IOAL)) { // Leave Configuration Mode EXFG() // // Return result -- // Device is Present, but not Active // did *NOT* fail self-test // SHOULD be shown to user // Return(0x0D) }Else { // Leave Configuration Mode EXFG() // Return result -- Device not even Present Return(0x00) } } } // end of Method _STA //***************************************************** // Method _DIS: Disable the device //***************************************************** Method(_DIS,0,NotSerialized) { // Disable Method // Enter Configuration Mode ENFG() // Set Logical Device #1 to select the UART Store(0x01,LDN) // Set the Activate Register to zero to disable device Store(0x00,ACTR) // Leave Configuration Mode EXFG() } //***************************************************** // Method _CRS: Return Current Resource Settings //***************************************************** Method(_CRS,0,NotSerialized) { Name(BUF0,ResourceTemplate() { IO(Decode16,0x3F8,0x3F8,0x08,0x08) IRQNoFlags(){4} }) // // Create some ByteFields in the Buffer in order to // permit saving values into the data portions of // each of the descriptors above. // CreateByteField (BUF0, 0x02, IOLO) // IO Port Low CreateByteField (BUF0, 0x03, IOHI) // IO Port Hi CreateByteField (BUF0, 0x04, IORL) // IO Port Low CreateByteField (BUF0, 0x05, IORH) // IO Port High CreateWordField (BUF0, 0x09, IRQL) // IRQ // Enter Configuration Mode ENFG() // Select the UART (Logical Device 1) Store(0x01,LDN) // // Get the IO setting from the chip, and copy it // to both the min & max for the IO descriptor. // // Low Bytes: Store(IOAL, IOLO) // min. Store(IOAL, IORL) // max. // High Bytes: Store(IOAH, IOHI) // min. Store(IOAH, IORH) // max. // // Get the IRQ setting from the chip, and shift // it into the Descriptor byte. // Store(0x01,Local0) ShiftLeft(Local0,INTR,IRQL) // Leave Configuration Mode EXFG() Return(BUF0) // return the result } // end _CRS Method //***************************************************** // Method _PRS: Return Possible Resource Settings //***************************************************** Method(_PRS,0) { // Possible Resource Name(BUF0,ResourceTemplate() { // Good configuration for Legacy O/S and sub-optional for ACPI O/S StartDependentFn(0,2) { IO(Decode16,0x3F8,0x3F8,0x01,0x08) IRQNoFlags() {4} } // Good configuration for Legacy O/S and sub-optional for ACPI O/S StartDependentFn(0,2) { IO(Decode16,0x3F8,0x3F8,0x01,0x08) IRQNoFlags() {3} } // Good configuration for Legacy O/S and sub-optional for ACPI O/S StartDependentFn(0,2) { IO(Decode16,0x3F8,0x3F8,0x01,0x08) IRQNoFlags() {5} } // Good configuration for Legacy O/S and sub-optional for ACPI O/S StartDependentFn(0,2) { IO(Decode16,0x3F8,0x3F8,0x01,0x08) IRQNoFlags() {7} } // Good configuration for Legacy O/S and sub-optional for ACPI O/S StartDependentFn(0,2) { IO(Decode16,0x3E8,0x3E8,0x01,0x08) IRQNoFlags() {4} } // Good configuration for Legacy O/S and sub-optional for ACPI O/S StartDependentFn(0,2) { IO(Decode16,0x3E8,0x3E8,0x01,0x08) IRQNoFlags() {3} } // Good configuration for Legacy O/S and sub-optional for ACPI O/S StartDependentFn(0,2) { IO(Decode16,0x3E8,0x3E8,0x01,0x08) IRQNoFlags() {5} } // Good configuration for Legacy O/S and sub-optional for ACPI O/S StartDependentFn(0,2) { IO(Decode16,0x3E8,0x3E8,0x01,0x08) IRQNoFlags() {7} } // Good configuration for Legacy O/S and sub-optional for ACPI O/S StartDependentFn(0,2) { IO(Decode16,0x2F8,0x2F8,0x01,0x08) IRQNoFlags() {4} } // Good configuration for Legacy O/S and sub-optional for ACPI O/S StartDependentFn(0,2) { IO(Decode16,0x2F8,0x2F8,0x01,0x08) IRQNoFlags() {3} } // Good configuration for Legacy O/S and sub-optional for ACPI O/S StartDependentFn(0,2) { IO(Decode16,0x2F8,0x2F8,0x01,0x08) IRQNoFlags() {5} } // Good configuration for Legacy O/S and sub-optional for ACPI O/S StartDependentFn(0,2) { IO(Decode16,0x2F8,0x2F8,0x01,0x08) IRQNoFlags() {7} } // Good configuration for Legacy O/S and sub-optional for ACPI O/S StartDependentFn(0,2) { IO(Decode16,0x2E8,0x2E8,0x01,0x08) IRQNoFlags() {4} } // Good configuration for Legacy O/S and sub-optional for ACPI O/S StartDependentFn(0,2) { IO(Decode16,0x2E8,0x2E8,0x01,0x08) IRQNoFlags() {3} } // Good configuration for Legacy O/S and sub-optional for ACPI O/S StartDependentFn(0,2) { IO(Decode16,0x2E8,0x2E8,0x01,0x08) IRQNoFlags() {5} } // Good configuration for Legacy O/S and sub-optional for ACPI O/S StartDependentFn(0,2) { IO(Decode16,0x2E8,0x2E8,0x01,0x08) IRQNoFlags() {7} } // Good configuration for ACPI and sub-optional Legacy O/S EndDependentFn() }) Return(BUF0) // Return Buf0 } // End _PRS //***************************************************** // Method _SRS: Set Resource Setting //***************************************************** Method(_SRS,1,NotSerialized) { // Set Resource Settings // ARG0 is PnP Resource String to set // // Define offsets into descriptor to match value // returned by descriptors in _PRS method // CreateByteField (Arg0, 0x02, IOLO) // IO Port Low CreateByteField (Arg0, 0x03, IOHI) // IO Port Hi CreateWordField (Arg0, 0x09, IRQL) // IRQ // Enter Configuration Mode ENFG() // Set Logical Device #1 to select UART Store(0x01, LDN) // Set the IO Base Address Store(IOLO, IOAL) Store(IOHI, IOAH) FindSetRightBit(IRQL,INTR)// Set IRQ If (LNotEqual(IRQL,Zero)) {Decrement(INTR)} // Activate the Device Store(0x01,ACTR) // Leave Configuration Mode EXFG() } // end _SRS Method } // end of Device UAR1