资源简介
《深入理解linux内核》第三版的源代码,linux 2.6.11版本,适合在阅读的时候查看。
代码片段和文件信息
/*
* acpi_ac.c - ACPI AC Adapter Driver ($Revision: 27 $)
*
* Copyright (C) 2001 2002 Andy Grover
* Copyright (C) 2001 2002 Paul Diefenbaugh
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not write to the Free Software Foundation Inc.
* 59 Temple Place Suite 330 Boston MA 02111-1307 USA.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
#include
#include
#include
#include
#include
#include
#include
#include
#define ACPI_AC_COMPONENT 0x00020000
#define ACPI_AC_CLASS “ac_adapter“
#define ACPI_AC_HID “ACPI0003“
#define ACPI_AC_DRIVER_NAME “ACPI AC Adapter Driver“
#define ACPI_AC_DEVICE_NAME “AC Adapter“
#define ACPI_AC_FILE_STATE “state“
#define ACPI_AC_NOTIFY_STATUS 0x80
#define ACPI_AC_STATUS_OFFLINE 0x00
#define ACPI_AC_STATUS_ONLINE 0x01
#define ACPI_AC_STATUS_UNKNOWN 0xFF
#define _COMPONENT ACPI_AC_COMPONENT
ACPI_MODULE_NAME (“acpi_ac“)
MODULE_AUTHOR(“Paul Diefenbaugh“);
MODULE_DEscriptION(ACPI_AC_DRIVER_NAME);
MODULE_LICENSE(“GPL“);
int acpi_ac_add (struct acpi_device *device);
int acpi_ac_remove (struct acpi_device *device int type);
static int acpi_ac_open_fs(struct inode *inode struct file *file);
static struct acpi_driver acpi_ac_driver = {
.name = ACPI_AC_DRIVER_NAME
.class = ACPI_AC_CLASS
.ids = ACPI_AC_HID
.ops = {
.add = acpi_ac_add
.remove = acpi_ac_remove
}
};
struct acpi_ac {
acpi_handle handle;
unsigned long state;
};
static struct file_operations acpi_ac_fops = {
.open = acpi_ac_open_fs
.read = seq_read
.llseek = seq_lseek
.release = single_release
};
/* --------------------------------------------------------------------------
AC Adapter Management
-------------------------------------------------------------------------- */
static int
acpi_ac_get_state (
struct acpi_ac *ac)
{
acpi_status status = AE_OK;
ACPI_FUNCTION_TRACE(“acpi_ac_get_state“);
if (!ac)
return_VALUE(-EINVAL);
status = acpi_evaluate_integer(ac->handle “_PSR“ NULL &ac->state);
if (ACPI_FAILURE(status)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR
“Error reading AC Adap
- 上一篇:自己动手写网络爬虫pdf+源代码
- 下一篇:SMS10.0软件
相关资源
- 剖析Linux系统下基于NUMA构建的服务
- linux SPI设备注册和驱动小结
- 周立功PCI CAN卡LINUX驱动ubuntu16.04内核
- 实现Windows与Linux两系统间自由切换
- 在双引导Linux系统上实现OS自动切换
- 如何删除Linux系统后找回Windows的启动
- Linux命令详解,循序渐进Linux
- Linux系统文件命令精通指南(下)
- Linux系统命令及Shell脚本实践指南
- RK3308 LINUX开发者指南(1).pdf
- S3C4510 开发板中uCLinux系统开发
- 嵌入式操作系统的解析
- Linux点阵字库和字库生成器.rar
- Linux-UNIX系统编程手册上、下册中文版
- 基于ARM的电子相册源码含动态库可运
- rubygems-2.6.11.tgz
- PSFTP.EXE 工具
- 如何实现Linux与windows文件互传
- Linux内核函数Start_kernel()的功能
- 一只老鸟的嵌入式ARM学习心得
- cximage的linux版本源码
- Existence of Solutions to Volterra Integral Eq
- yaf-2.1.17.tgz
- IBM eServer xSeries 445 EXP400在Linux下的双
- 如何在本地无光驱软驱时通过PXE远程
- Linux操作系统下配置无密码的RSH访问
- 如何利用mdadm在Linux中配置RAID
- db2 v9.5 linux 许可证
- linux telnet服务安装包
- SUSE Linux Enterprise——助力曙光高
评论
共有 条评论