亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? power.cxx

?? eCos/RedBoot for勤研ARM AnywhereII(4510) 含全部源代碼
?? CXX
?? 第 1 頁 / 共 2 頁
字號:
//==========================================================================
//
//      power.cxx
//
//      Main implementation of power management support.
//
//==========================================================================
//####ECOSGPLCOPYRIGHTBEGIN####
// -------------------------------------------
// This file is part of eCos, the Embedded Configurable Operating System.
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
//
// eCos 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 or (at your option) any later version.
//
// eCos 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 eCos; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
//
// As a special exception, if other files instantiate templates or use macros
// or inline functions from this file, or you compile this file and link it
// with other works to produce a work based on this file, this file does not
// by itself cause the resulting work to be covered by the GNU General Public
// License. However the source code for this file must still be made available
// in accordance with section (3) of the GNU General Public License.
//
// This exception does not invalidate any other reasons why a work based on
// this file might be covered by the GNU General Public License.
//
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
// at http://sources.redhat.com/ecos/ecos-license/
// -------------------------------------------
//####ECOSGPLCOPYRIGHTEND####
//==========================================================================
//#####DESCRIPTIONBEGIN####
//
// Author(s):    bartv
// Contributors: bartv
// Date:         2001-06-18
//
//####DESCRIPTIONEND####
//
//==========================================================================

// Provide the external (non-inline) definitions of the inline functions
// in power.h so there's something available in C code when the compiler
// chooses not to inline
#define POWER_INLINE extern "C"

#include <pkgconf/power.h>
#include <cyg/power/power.h>
#include <cyg/infra/cyg_type.h>
#include <cyg/infra/cyg_ass.h>
#include <cyg/hal/hal_tables.h>

// ----------------------------------------------------------------------------
// Statics. Most of these are only relevant when a separate power
// management thread is being used. Some of these are exported, e.g.
// to allow the use of inline functions.

// The current power mode for the system as a whole.
PowerMode       __power_mode            = PowerMode_Active;

// The mode that the system should be running at.
PowerMode       __power_desired_mode    = PowerMode_Active;

// The policy callback function, if any.
__power_policy_callback_t __power_policy_callback = 0;

// This flag is used to abort a mode change. It allows a controller to
// call power_set_mode() while the mode is already being changed.
static volatile cyg_bool abort_mode_change = false;

#ifdef CYGPKG_POWER_THREAD
static unsigned char    power_thread_stack[CYGNUM_POWER_THREAD_STACKSIZE];
static cyg_thread       power_thread;
// The power management thread's handle is exported to support
// operations like changing the thread's priority.
cyg_handle_t     power_thread_handle;

// This semaphore is used to wake up the power management thread when there
// is work to be done.
static cyg_sem_t        power_thread_action;

#else
static cyg_bool         power_doing_it      = false;
static cyg_uint32       power_todo_count    = 0;
#endif

// ----------------------------------------------------------------------------
// Synchronisation.
//
// There are two exported functions to worry about: power_set_mode()
// and power_set_controller_mode(). There are also two main scenarios:
// CYGPKG_POWER_THREAD enabled and CYGPKG_POWER_THREAD_DISABLED.
//
// If CYGPKG_POWER_THREAD is enabled then any external code may at any
// time invoke the exported functions. These are asynchronous calls.
// In addition when the power management thread invokes a power
// controller that controller may also call the exported functions,
// synchronously. In either scenario the calls can return before the
// operation has completed, hence the policy callback functionality.
//
// If CYGPKG_POWER_THREAD is disabled then there may be only one
// external call to the exported functions, and the operation must
// complete before that call returns. If there are multiple concurrent
// external calls then the behaviour of the system is undefined.
// Really. It is still possible for power controllers to call the
// exported functions synchronously, which complicates things
// somewhat.
//
// The CYGPKG_POWER_THREAD case is the easier to handle. The power
// management thread simply loops forever, waiting on a semaphore
// until there is some work to be done and then checking internal
// state to figure out what that work should be. Some care has to be
// taken that the internal state gets updated and read atomically,
// which can be achieved by cyg_scheduler_lock() and unlock() calls in
// strategic places. Obviously it is undesirable to keep these locks
// longer than is absolutely necessary since that would impact
// dispatch latency, and in particular power controllers must not be
// invoked with the scheduler locked because there are no specific
// restrictions on what a controller may or may not do.
//
// The call graph is something like:
//    power_thread_fn()     - the thread entry point, loops waiting on the semaphore
//    power_doit()          - do the real work. This can be either a global mode
//                            change or one or more individual controller mode changes.
//                            Either operation involves iterating through the controllers.
//    power_change_controller_mode() - manipulate an individual controller.
//
// There is one little complication. If during a power_doit()
// set_mode() loop there is a call to power_set_mode() then the
// current loop should be aborted. This is especially important when
// switching to off mode and a controller has decided to cancel this
// via another call to set_mode().
//
// If no separate thread is used then there will only ever be one
// external call. That will result in an invocation of
// power_nothread_doit(), which in turn calls power_doit() and
// power_change_controller_mode() as in the threaded case. A flag is
// used so that it is possible to distinguish between external and
// synchronous calls, and a counter ensures that synchronous calls are
// processed correctly. Recursion is avoided so that stack usage
// remains deterministic.
//    power_set_mode()/power_set_controller_mode()
//    power_nothread_doit()
//    power_doit()
//    power_change_controller_mode();
//
// The main fields in the power controller data structures to worry
// about are "mode", "desired_mode", and "change_this". "mode" is only
// manipulated by the power controller itself, and since all power
// controller accesses are serialized no problems arise.
// "desired_mode" and "change_this" are updated by power_set_mode()
// and power_set_controller_mode(), and read by power_doit(). If a separate
// thread is in use then the scheduler lock protects access to thse fields.
// Without a separate thread concurrency is not an issue. Obviously there
// are other fields and variables, but most of these will only be set during
// system start-up and the rest do not require any special attention.

// ----------------------------------------------------------------------------
// Do the real work.
//
// power_change_controller_mode() acts on a single controller. It is invoked only
// from power_doit(), either for a global mode change or for an individual mode change.
// It should be invoked with the scheduler unlocked - power_doit() is responsible for
// synchronizing with the external calls.
static inline void
power_change_controller_mode(PowerController* controller, PowerMode desired_mode, cyg_bool change_this)
{
    // The policy callback will want to know the previous power mode.
    PowerMode old_mode = controller->mode;

    // Invoke the mode change operation. Note that
    // controller->change_this and controller->desired_mode may have
    // been updated by now, but at some point they did have values
    // which required a mode change.
    (*controller->change_mode)(controller, desired_mode, change_this ? PowerModeChange_Controller : PowerModeChange_Global);

    // Report the results to higher-level code. It is unlikely that

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品资源网| 欧美美女网站色| 欧美日韩一区二区三区在线| 久久精品一区二区三区av| 亚洲欧洲制服丝袜| 国产河南妇女毛片精品久久久| 欧美男男青年gay1069videost| 国产精品毛片久久久久久久 | 久久久久久久久97黄色工厂| 亚洲福利视频导航| 97se亚洲国产综合自在线观| 久久众筹精品私拍模特| 天堂影院一区二区| 欧美日韩一区在线| 一区二区日韩av| 色综合天天视频在线观看 | 国产福利一区在线| 日韩欧美一区二区免费| 五月婷婷久久丁香| 欧美日韩视频在线一区二区 | 成人免费在线播放视频| 国产成人精品免费| 精品毛片乱码1区2区3区| 日韩av成人高清| 欧美情侣在线播放| 午夜电影一区二区三区| 欧美顶级少妇做爰| 国产精品天美传媒| 中文字幕在线播放不卡一区| 国产最新精品精品你懂的| 欧美一区二区三区在线观看| 午夜激情久久久| 911精品国产一区二区在线| 亚欧色一区w666天堂| 欧美色精品在线视频| 亚洲成人免费观看| 在线综合视频播放| 久久99精品国产麻豆婷婷洗澡| 日韩一区二区免费高清| 麻豆91免费观看| 久久精品人人做人人爽人人| 国产美女一区二区三区| 久久嫩草精品久久久久| 国产成人自拍高清视频在线免费播放| 欧美激情综合在线| 色哟哟一区二区在线观看| 亚洲自拍另类综合| 日韩一级欧美一级| 日韩成人dvd| 日韩专区一卡二卡| 欧美一区二区视频在线观看| 麻豆成人av在线| 久久久久成人黄色影片| 99久久婷婷国产综合精品| 亚洲欧美国产毛片在线| 欧美日韩电影在线播放| 精品一区二区三区视频在线观看| 久久蜜桃av一区精品变态类天堂| 成人av网站免费观看| 亚洲人精品午夜| 欧美一区二区视频观看视频| 国内精品国产成人国产三级粉色| 国产精品欧美极品| 欧美日韩精品福利| 国产一区二区0| 亚洲精品一二三| 精品久久久三级丝袜| 99精品久久只有精品| 日韩黄色小视频| 国产精品久久久久天堂| 精品视频1区2区3区| 国产一二精品视频| 午夜精品免费在线观看| 国产精品午夜在线| 3d动漫精品啪啪一区二区竹菊| 丁香网亚洲国际| 三级精品在线观看| 亚洲视频一区在线观看| 2023国产一二三区日本精品2022| 色婷婷综合久色| 国产丶欧美丶日本不卡视频| 午夜精品一区二区三区电影天堂 | 99久久久精品| 精品一二线国产| 亚洲午夜免费电影| 国产精品久久久久精k8| 精品久久久网站| 91精品婷婷国产综合久久竹菊| 99久久国产综合精品色伊| 国产一区在线观看麻豆| 日日欢夜夜爽一区| 亚洲一本大道在线| 亚洲人成人一区二区在线观看| 久久久久国产精品麻豆ai换脸| 777午夜精品免费视频| 91免费看视频| 成人激情黄色小说| 国产一区二区不卡在线| 九九精品一区二区| 日韩精品久久理论片| 亚洲一区二区三区四区在线免费观看| 国产精品国产三级国产aⅴ原创| 久久久久久免费毛片精品| 日韩女优电影在线观看| 欧美一区二区三区视频| 欧美男生操女生| 欧美精品高清视频| 欧美日本一区二区| 欧美视频中文一区二区三区在线观看 | 99国产精品久久久久| 国产凹凸在线观看一区二区| 国产精品99久久久久久久女警| 激情成人综合网| 黑人巨大精品欧美黑白配亚洲| 久久er99热精品一区二区| 毛片av一区二区| 韩国v欧美v日本v亚洲v| 国产精品综合一区二区| 国产一区 二区 三区一级| 国产大陆a不卡| 99久久国产综合色|国产精品| 99久久综合99久久综合网站| av不卡一区二区三区| 91精品1区2区| 欧美日韩一区久久| 欧美一级高清片| 久久久国际精品| 亚洲欧洲成人自拍| 亚洲精品日日夜夜| 午夜日韩在线观看| 精品一区二区在线观看| 国产成人日日夜夜| 99精品国产视频| 欧美久久一二区| 久久久噜噜噜久久人人看 | 国产欧美精品在线观看| 亚洲欧洲精品一区二区三区| 亚洲一区二区三区精品在线| 日韩精品亚洲专区| 国产成人欧美日韩在线电影| 色综合久久精品| 欧美一区二区三区视频| 国产精品丝袜黑色高跟| 亚洲免费观看高清完整版在线 | 亚洲曰韩产成在线| 三级精品在线观看| 国产suv精品一区二区三区| 在线日韩av片| 精品国产伦一区二区三区观看体验| 久久久久亚洲蜜桃| 亚洲国产欧美另类丝袜| 久久福利资源站| 在线观看三级视频欧美| 欧美v日韩v国产v| 亚洲女子a中天字幕| 激情欧美日韩一区二区| 色狠狠桃花综合| 久久久久久久网| 亚洲成a人v欧美综合天堂下载 | 国产欧美日韩不卡免费| 午夜亚洲国产au精品一区二区| 国产91色综合久久免费分享| 欧美日韩在线观看一区二区| 中文av字幕一区| 免费av网站大全久久| 色综合天天狠狠| 国产女同性恋一区二区| 日韩高清国产一区在线| 成人丝袜18视频在线观看| 日韩女优制服丝袜电影| 午夜日韩在线观看| www.在线成人| 久久精品一区二区三区av| 美女视频黄频大全不卡视频在线播放 | 亚洲精品精品亚洲| 国产精品一二三四| 日韩免费观看高清完整版| 亚洲国产一区二区视频| 91小视频免费看| 日本一区二区电影| 国产一区二区三区久久久| 51午夜精品国产| 五月天亚洲精品| 欧美性感一区二区三区| 亚洲精品中文在线影院| aa级大片欧美| 亚洲图片激情小说| av在线播放一区二区三区| 国产欧美视频在线观看| 国产乱理伦片在线观看夜一区| 欧美电视剧免费全集观看| 日本麻豆一区二区三区视频| 337p亚洲精品色噜噜噜| 日韩av不卡在线观看| 日韩一区二区三区四区| 美女尤物国产一区| 精品国产91洋老外米糕| 国产又粗又猛又爽又黄91精品| 26uuuu精品一区二区| 国产不卡在线视频|