source: branches/branch-1-0/include/helpers/acpih.h@ 325

Last change on this file since 325 was 325, checked in by pr, 19 years ago

Add ACPI shutdown support

  • Property svn:eol-style set to CRLF
  • Property svn:keywords set to Author Date Id Revision
File size: 3.6 KB
Line 
1
2/*
3 *@@sourcefile acpih.h:
4 * header file for acpih.c.
5 *
6 * Note: Version numbering in this file relates to XWorkplace version
7 * numbering.
8 *
9 *@@include #include <os2.h>
10 *@@include #include "helpers\acpih.h"
11 */
12
13/* Copyright (C) 2006 Paul Ratcliffe.
14 * This file is part of the "XWorkplace helpers" source package.
15 * This is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published
17 * by the Free Software Foundation, in version 2 as it comes in the
18 * "COPYING" file of the XWorkplace main distribution.
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 */
24
25#if __cplusplus
26extern "C" {
27#endif
28
29#ifndef ACPIH_HEADER_INCLUDED
30 #define ACPIH_HEADER_INCLUDED
31
32 /*
33 * Power state values
34 */
35
36 #define ACPI_STATE_UNKNOWN (UCHAR) 0xFF
37
38 #define ACPI_STATE_S0 (UCHAR) 0
39 #define ACPI_STATE_S1 (UCHAR) 1
40 #define ACPI_STATE_S2 (UCHAR) 2
41 #define ACPI_STATE_S3 (UCHAR) 3
42 #define ACPI_STATE_S4 (UCHAR) 4
43 #define ACPI_STATE_S5 (UCHAR) 5
44 #define ACPI_S_STATES_MAX ACPI_STATE_S5
45 #define ACPI_S_STATE_COUNT 6
46
47 #pragma pack(1)
48
49 typedef struct _VersionAcpi_
50 {
51 ULONG Major;
52 ULONG Minor;
53 } ACPI_VERSION;
54
55 typedef struct _AcpiApiHandle_
56 {
57 HFILE AcpiDrv; // Handle to ACPICA driver
58 ACPI_VERSION PSD; // Version PSD
59 ACPI_VERSION Driver; // Version ACPICA driver
60 ACPI_VERSION DLL; // Version acpi32.dll
61 ULONG StartAddrPSD; // Start address PSD (for testcase)
62 ULONG AddrCommApp; // Address DosCommApp from PSD (which not write IBM)
63 ULONG StartAddrDriver; // Start address ACPICA (for testcase)
64 ULONG AddrFindPSD; // Address function for find PSD (find CommApp)
65 ULONG IRQNumber; // Number use IRQ
66 void *Internal; // For internal DLL use
67 } ACPI_API_HANDLE, *PACPI_API_HANDLE;
68
69 /* ******************************************************************
70 *
71 * ACPI helper APIs
72 *
73 ********************************************************************/
74
75 #pragma pack()
76
77 APIRET APIENTRY AcpiStartApi(ACPI_API_HANDLE *);
78 typedef APIRET APIENTRY ACPISTARTAPI(ACPI_API_HANDLE *);
79 typedef ACPISTARTAPI *PACPISTARTAPI;
80
81 APIRET APIENTRY AcpiEndApi(ACPI_API_HANDLE *);
82 typedef APIRET APIENTRY ACPIENDAPI(ACPI_API_HANDLE *);
83 typedef ACPIENDAPI *PACPIENDAPI;
84
85 APIRET APIENTRY AcpiGoToSleep(ACPI_API_HANDLE *, UCHAR);
86 typedef APIRET APIENTRY ACPIGOTOSLEEP(ACPI_API_HANDLE *, UCHAR);
87 typedef ACPIGOTOSLEEP *PACPIGOTOSLEEP;
88
89 APIRET APIENTRY acpihOpen(ACPI_API_HANDLE *phACPI);
90
91 VOID APIENTRY acpihClose(ACPI_API_HANDLE *phACPI);
92
93 APIRET APIENTRY acpihGoToSleep(ACPI_API_HANDLE *phACPI, UCHAR ucState);
94
95 #define ORD_ACPISTARTAPI 16
96 #define ORD_ACPIENDAPI 17
97 #define ORD_ACPIGOTOSLEEP 19
98
99#endif
100
101#if __cplusplus
102}
103#endif
104
Note: See TracBrowser for help on using the repository browser.