acpippm.c (19397407) | acpippm.c (db2bae30) |
---|---|
1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE --- 10 unchanged lines hidden (view full) --- 19 * CDDL HEADER END 20 */ 21 22/* 23 * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 24 * Use is subject to license terms. 25 */ 26 | 1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE --- 10 unchanged lines hidden (view full) --- 19 * CDDL HEADER END 20 */ 21 22/* 23 * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 24 * Use is subject to license terms. 25 */ 26 |
27 | |
28#include <sys/types.h> 29#include <sys/conf.h> 30#include <sys/open.h> 31#include <sys/modctl.h> 32#include <sys/promif.h> 33#include <sys/stat.h> 34#include <sys/ddi_impldefs.h> 35#include <sys/ddi.h> --- 9 unchanged lines hidden (view full) --- 45 * acpippm deals with those bits of ppm functionality that 46 * must be mediated by ACPI 47 * 48 * The routines in this driver is referenced by Platform 49 * Power Management driver of X86 workstation systems. 50 * acpippm driver is loaded because it is listed as a platform driver 51 * It is initially configured as a pseudo driver. 52 */ | 27#include <sys/types.h> 28#include <sys/conf.h> 29#include <sys/open.h> 30#include <sys/modctl.h> 31#include <sys/promif.h> 32#include <sys/stat.h> 33#include <sys/ddi_impldefs.h> 34#include <sys/ddi.h> --- 9 unchanged lines hidden (view full) --- 44 * acpippm deals with those bits of ppm functionality that 45 * must be mediated by ACPI 46 * 47 * The routines in this driver is referenced by Platform 48 * Power Management driver of X86 workstation systems. 49 * acpippm driver is loaded because it is listed as a platform driver 50 * It is initially configured as a pseudo driver. 51 */ |
53extern void pc_tod_set_rtc_offsets(FADT_DESCRIPTOR *); | 52extern void pc_tod_set_rtc_offsets(ACPI_TABLE_FADT *); |
54 55/* 56 * Configuration Function prototypes and data structures 57 */ 58static int appm_attach(dev_info_t *, ddi_attach_cmd_t); 59static int appm_detach(dev_info_t *, ddi_detach_cmd_t); 60static int appm_getinfo(dev_info_t *, ddi_info_cmd_t, void *, void **); 61static int appm_open(dev_t *dev_p, int flag, int otyp, cred_t *cred_p); --- 130 unchanged lines hidden (view full) --- 192 * Driver attach(9e) entry point 193 */ 194static int 195appm_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) 196{ 197 char *str = "appm_attach"; 198 int instance; 199 appm_unit *unitp; | 53 54/* 55 * Configuration Function prototypes and data structures 56 */ 57static int appm_attach(dev_info_t *, ddi_attach_cmd_t); 58static int appm_detach(dev_info_t *, ddi_detach_cmd_t); 59static int appm_getinfo(dev_info_t *, ddi_info_cmd_t, void *, void **); 60static int appm_open(dev_t *dev_p, int flag, int otyp, cred_t *cred_p); --- 130 unchanged lines hidden (view full) --- 191 * Driver attach(9e) entry point 192 */ 193static int 194appm_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) 195{ 196 char *str = "appm_attach"; 197 int instance; 198 appm_unit *unitp; |
200 FADT_DESCRIPTOR *fadt = NULL; | 199 ACPI_TABLE_FADT *fadt = NULL; |
201 int rv = DDI_SUCCESS; 202 203 switch (cmd) { 204 case DDI_ATTACH: 205 break; 206 case DDI_RESUME: 207 return (DDI_SUCCESS); 208 default: --- 41 unchanged lines hidden (view full) --- 250 /* 251 * create minor node for kernel_ioctl calls 252 */ 253 rv = ddi_create_minor_node(dip, "acpi-ppm", S_IFCHR, instance, 0, 0); 254 if (rv != DDI_SUCCESS) 255 goto doerrs; 256 257 /* Get the FADT */ | 200 int rv = DDI_SUCCESS; 201 202 switch (cmd) { 203 case DDI_ATTACH: 204 break; 205 case DDI_RESUME: 206 return (DDI_SUCCESS); 207 default: --- 41 unchanged lines hidden (view full) --- 249 /* 250 * create minor node for kernel_ioctl calls 251 */ 252 rv = ddi_create_minor_node(dip, "acpi-ppm", S_IFCHR, instance, 0, 0); 253 if (rv != DDI_SUCCESS) 254 goto doerrs; 255 256 /* Get the FADT */ |
258 if (AcpiGetFirmwareTable(FADT_SIG, 1, ACPI_LOGICAL_ADDRESSING, | 257 if (AcpiGetTable(ACPI_SIG_FADT, 1, |
259 (ACPI_TABLE_HEADER **)&fadt) != AE_OK) 260 return (rv); 261 262 /* Init the RTC offsets */ 263 if (fadt != NULL) 264 pc_tod_set_rtc_offsets(fadt); 265 266 return (rv); --- 188 unchanged lines hidden --- | 258 (ACPI_TABLE_HEADER **)&fadt) != AE_OK) 259 return (rv); 260 261 /* Init the RTC offsets */ 262 if (fadt != NULL) 263 pc_tod_set_rtc_offsets(fadt); 264 265 return (rv); --- 188 unchanged lines hidden --- |