⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 osunixxf.c

📁 acpi tools for linux include acpiexec and acpixtract
💻 C
📖 第 1 页 / 共 2 页
字号:
 * * RETURN:      Status * * DESCRIPTION: Delete an OS semaphore * *****************************************************************************/ACPI_STATUSAcpiOsDeleteSemaphore (    ACPI_HANDLE         Handle){    if (!Handle)    {        return AE_BAD_PARAMETER;    }    return AE_OK;}/****************************************************************************** * * FUNCTION:    AcpiOsWaitSemaphore * * PARAMETERS:  Handle              - Handle returned by AcpiOsCreateSemaphore *              Units               - How many units to wait for *              Timeout             - How long to wait * * RETURN:      Status * * DESCRIPTION: Wait for units * *****************************************************************************/ACPI_STATUSAcpiOsWaitSemaphore (    ACPI_HANDLE         Handle,    UINT32              Units,    UINT16              Timeout){    return AE_OK;}/****************************************************************************** * * FUNCTION:    AcpiOsSignalSemaphore * * PARAMETERS:  Handle              - Handle returned by AcpiOsCreateSemaphore *              Units               - Number of units to send * * RETURN:      Status * * DESCRIPTION: Send units * *****************************************************************************/ACPI_STATUSAcpiOsSignalSemaphore (    ACPI_HANDLE         Handle,    UINT32              Units){    return AE_OK;}ACPI_STATUSAcpiOsCreateLock (    ACPI_SPINLOCK           *OutHandle){    return (AcpiOsCreateSemaphore (1, 1, OutHandle));}voidAcpiOsDeleteLock (    ACPI_SPINLOCK           Handle){    AcpiOsDeleteSemaphore (Handle);}ACPI_CPU_FLAGSAcpiOsAcquireLock (    ACPI_HANDLE             Handle){    AcpiOsWaitSemaphore (Handle, 1, 0xFFFF);    return (0);}voidAcpiOsReleaseLock (    ACPI_SPINLOCK           Handle,    ACPI_CPU_FLAGS          Flags){    AcpiOsSignalSemaphore (Handle, 1);}/****************************************************************************** * * FUNCTION:    AcpiOsInstallInterruptHandler * * PARAMETERS:  InterruptNumber     Level handler should respond to. *              Isr                 Address of the ACPI interrupt handler *              ExceptPtr           Where status is returned * * RETURN:      Handle to the newly installed handler. * * DESCRIPTION: Install an interrupt handler.  Used to install the ACPI *              OS-independent handler. * *****************************************************************************/UINT32AcpiOsInstallInterruptHandler (    UINT32                  InterruptNumber,    ACPI_OSD_HANDLER        ServiceRoutine,    void                    *Context){    return AE_OK;}/****************************************************************************** * * FUNCTION:    AcpiOsRemoveInterruptHandler * * PARAMETERS:  Handle              Returned when handler was installed * * RETURN:      Status * * DESCRIPTION: Uninstalls an interrupt handler. * *****************************************************************************/ACPI_STATUSAcpiOsRemoveInterruptHandler (    UINT32                  InterruptNumber,    ACPI_OSD_HANDLER        ServiceRoutine){    return AE_OK;}/****************************************************************************** * * FUNCTION:    AcpiOsExecute * * PARAMETERS:  Type            - Type of execution *              Function        - Address of the function to execute *              Context         - Passed as a parameter to the function * * RETURN:      Status. * * DESCRIPTION: Execute a new thread * *****************************************************************************/ACPI_STATUSAcpiOsExecute (    ACPI_EXECUTE_TYPE       Type,    ACPI_OSD_EXEC_CALLBACK  Function,    void                    *Context){//    _beginthread (Function, (unsigned) 0, Context);    return 0;}/****************************************************************************** * * FUNCTION:    AcpiOsBreakpoint * * PARAMETERS:  Msg                 Message to print * * RETURN:      Status * * DESCRIPTION: Print a message and break to the debugger. * *****************************************************************************/ACPI_STATUSAcpiOsBreakpoint (    char                    *Msg){    if (Msg)    {        AcpiOsPrintf ("AcpiOsBreakpoint: %s ****\n", Msg);    }    else    {        AcpiOsPrintf ("At AcpiOsBreakpoint ****\n");    }    return AE_OK;}/****************************************************************************** * * FUNCTION:    AcpiOsStall * * PARAMETERS:  microseconds        To sleep * * RETURN:      Blocks until sleep is completed. * * DESCRIPTION: Sleep at microsecond granularity * *****************************************************************************/voidAcpiOsStall (    UINT32                  microseconds){    if (microseconds)    {        usleep (microseconds);    }    return;}/****************************************************************************** * * FUNCTION:    AcpiOsSleep * * PARAMETERS:  milliseconds        To sleep * * RETURN:      Blocks until sleep is completed. * * DESCRIPTION: Sleep at millisecond granularity * *****************************************************************************/voidAcpiOsSleep (    ACPI_INTEGER            milliseconds){    sleep (milliseconds / 1000);    /* Sleep for whole seconds */    /*     * Arg to usleep() must be less than 1,000,000 (1 second)     */    usleep ((milliseconds % 1000) * 1000);      /* Sleep for remaining usecs */    return;}/****************************************************************************** * * FUNCTION:    AcpiOsGetTimer * * PARAMETERS:  None * * RETURN:      Current time in 100 nanosecond units * * DESCRIPTION: Get the current system time * *****************************************************************************/UINT64AcpiOsGetTimer (void){    struct timeval  time;    gettimeofday(&time, NULL);    /* Seconds * 10^7 = 100ns(10^-7), Microseconds(10^-6) * 10^1 = 100ns */    return (((UINT64) time.tv_sec * 10000000) + ((UINT64) time.tv_usec * 10));}/****************************************************************************** * * FUNCTION:    AcpiOsValidateInterface * * PARAMETERS:  Interface           - Requested interface to be validated * * RETURN:      AE_OK if interface is supported, AE_SUPPORT otherwise * * DESCRIPTION: Match an interface string to the interfaces supported by the *              host. Strings originate from an AML call to the _OSI method. * *****************************************************************************/ACPI_STATUSAcpiOsValidateInterface (    char                    *Interface){    return (AE_SUPPORT);}/****************************************************************************** * * FUNCTION:    AcpiOsValidateAddress * * PARAMETERS:  SpaceId             - ACPI space ID *              Address             - Physical address *              Length              - Address length * * RETURN:      AE_OK if Address/Length is valid for the SpaceId. Otherwise, *              should return AE_AML_ILLEGAL_ADDRESS. * * DESCRIPTION: Validate a system address via the host OS. Used to validate *              the addresses accessed by AML operation regions. * *****************************************************************************/ACPI_STATUSAcpiOsValidateAddress (    UINT8                   SpaceId,    ACPI_PHYSICAL_ADDRESS   Address,    ACPI_SIZE               Length){    return (AE_OK);}/****************************************************************************** * * FUNCTION:    AcpiOsReadPciConfiguration * * PARAMETERS:  PciId               Seg/Bus/Dev *              Register            Device Register *              Value               Buffer where value is placed *              Width               Number of bits * * RETURN:      Status * * DESCRIPTION: Read data from PCI configuration space * *****************************************************************************/ACPI_STATUSAcpiOsReadPciConfiguration (    ACPI_PCI_ID             *PciId,    UINT32                  Register,    void                    *Value,    UINT32                  Width){    return (AE_OK);}/****************************************************************************** * * FUNCTION:    AcpiOsWritePciConfiguration * * PARAMETERS:  PciId               Seg/Bus/Dev *              Register            Device Register *              Value               Value to be written *              Width               Number of bits * * RETURN:      Status. * * DESCRIPTION: Write data to PCI configuration space * *****************************************************************************/ACPI_STATUSAcpiOsWritePciConfiguration (    ACPI_PCI_ID             *PciId,    UINT32                  Register,    ACPI_INTEGER            Value,    UINT32                  Width){    return (AE_OK);}/* TEMPORARY STUB FUNCTION */voidAcpiOsDerivePciId(    ACPI_HANDLE             rhandle,    ACPI_HANDLE             chandle,    ACPI_PCI_ID             **PciId){}/****************************************************************************** * * FUNCTION:    AcpiOsReadPort * * PARAMETERS:  Address             Address of I/O port/register to read *              Value               Where value is placed *              Width               Number of bits * * RETURN:      Value read from port * * DESCRIPTION: Read data from an I/O port or register * *****************************************************************************/ACPI_STATUSAcpiOsReadPort (    ACPI_IO_ADDRESS         Address,    UINT32                  *Value,    UINT32                  Width){    switch (Width)    {    case 8:        *Value = 0xFF;        break;    case 16:        *Value = 0xFFFF;        break;    case 32:        *Value = 0xFFFFFFFF;        break;    }    return (AE_OK);}/****************************************************************************** * * FUNCTION:    AcpiOsWritePort * * PARAMETERS:  Address             Address of I/O port/register to write *              Value               Value to write *              Width               Number of bits * * RETURN:      None * * DESCRIPTION: Write data to an I/O port or register * *****************************************************************************/ACPI_STATUSAcpiOsWritePort (    ACPI_IO_ADDRESS         Address,    UINT32                  Value,    UINT32                  Width){    return (AE_OK);}/****************************************************************************** * * FUNCTION:    AcpiOsReadMemory * * PARAMETERS:  Address             Physical Memory Address to read *              Value               Where value is placed *              Width               Number of bits * * RETURN:      Value read from physical memory address * * DESCRIPTION: Read data from a physical memory address * *****************************************************************************/ACPI_STATUSAcpiOsReadMemory (    ACPI_PHYSICAL_ADDRESS   Address,    UINT32                  *Value,    UINT32                  Width){    switch (Width)    {    case 8:    case 16:    case 32:        *Value = 0;        break;    default:        return (AE_BAD_PARAMETER);        break;    }    return (AE_OK);}/****************************************************************************** * * FUNCTION:    AcpiOsWriteMemory * * PARAMETERS:  Address             Physical Memory Address to write *              Value               Value to write *              Width               Number of bits * * RETURN:      None * * DESCRIPTION: Write data to a physical memory address * *****************************************************************************/ACPI_STATUSAcpiOsWriteMemory (    ACPI_PHYSICAL_ADDRESS   Address,    UINT32                  Value,    UINT32                  Width){    return (AE_OK);}ACPI_THREAD_IDAcpiOsGetThreadId(void){    return getpid();}/****************************************************************************** * * FUNCTION:    AcpiOsSignal * * PARAMETERS:  Function            ACPI CA signal function code *              Info                Pointer to function-dependent structure * * RETURN:      Status * * DESCRIPTION: Miscellaneous functions * *****************************************************************************/ACPI_STATUSAcpiOsSignal (    UINT32                  Function,    void                    *Info){    switch (Function)    {    case ACPI_SIGNAL_FATAL:        break;    case ACPI_SIGNAL_BREAKPOINT:        if (Info)        {            AcpiOsPrintf ("AcpiOsBreakpoint: %s ****\n", Info);        }        else        {            AcpiOsPrintf ("At AcpiOsBreakpoint ****\n");        }        break;    }    return (AE_OK);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -