Documentation/power/notifers.txt

Chinese translated version of Documentation/power/notifers.txt


If you have any comment or update to the content, please contact the
original document maintainer directly.  However, if you have a problem
communicating in English you can also ask the Chinese maintainer for
help.  Contact the Chinese maintainer if this translation is outdated
or if there is a problem with the translation.


Chinese maintainer: keyingjing <342311642@qq.com>
---------------------------------------------------------------------
Documentation/power/notifers.txt 的中文翻译


如果想评论或更新本文的内容,请直接联系原文档的维护者。如果你使用英文
交流有困难的话,也可以向中文版维护者求助。如果本翻译更新不及时或者翻
译存在问题,请联系中文版维护者。


中文版维护者: 柯莹璟  <342311642@qq.com>
中文版翻译者: 柯莹璟  <342311642@qq.com>
中文版校译者: 柯莹璟  <342311642@qq.com>




Suspend notifiers
          (C) 2007-2011 Rafael J. Wysocki <rjw@sisk.pl>, GPL
There are some operations that subsystems or drivers may want to carry out before 
hibernation/suspend or after restore/resume, but they require the system to be fully 
functional, so the drivers' and subsystems' .suspend() and .resume()or even .
prepare() and .complete() callbacks are not suitable for this purpose.
For example, device drivers may want to upload firmware to their devices after
resume/restore, but they cannot do it by calling request_firmware() from their
.resume() or .complete() routines (user land processes are frozen at these
points).  The solution may be to load the firmware into memory before processes
are frozen and upload it from there in the .resume() routine.
A suspend/hibernation notifier may be used for this purpose.


暂停通知
(C) 2007-2011 Rafael J. Wysocki <rjw@sisk.pl>, GPL
有些操作子系统或驱动器可能再进行休眠/挂起前或者还原/恢复后要求系统更功能齐全,因此
驱动器和子系统的.suspend()函数和.resume()函数,甚至.prepare()函数和.complete()函数
回调不适用于此目的。
例如,设备驱动器可能在还原/恢复后上传固件到设备,但是他们无法做到仅从.resume()和 
.complete()例程中通过调用函数request_firmware()(此处的用户区域被冻结)。在.resume()
例程中,该解决方案可能在进程被冻结前把固件负载到内存中并上传。
挂起/休眠通知器可能被用于此目的。

The subsystems or drivers having such needs can register suspend notifiers that
will be called upon the following events by the PM core:
有下列事件需求的子系统或驱动程序将被PM核心要求注册暂停通知器:
  
  PM_HIBERNATION_PREPARE  The system is going to hibernate, tasks will be frozen
                          immediately. This is different from PM_SUSPEND_PREPARE
                          below because here we do additional work between notifiers
                          and drivers freezing.

  PM_HIBERNATION_PREPARE  系统准备休眠时,任务将立即被冻结。与下文PM_SUSPEND_PREPARE
                          不同的是因为此处我们在通知器和冻结驱动程序之间做了额外工作。
  
  PM_POST_HIBERNATION     The system memory state has been restored from a
                          hibernation image or an error occurred during
                          hibernation.  Device drivers' restore callbacks have
                          been executed and tasks have been thawed.

  PM_POST_HIBERNATION     系统内存状态已经从休眠图像或休眠过程里发生的错误中
                          得到恢复。设备驱动程序恢复回调任务已经解冻并执行。

  
  PM_RESTORE_PREPARE      The system is going to restore a hibernation image.
                         If all goes well, the restored kernel will issue a
                          PM_POST_HIBERNATION notification.
 
  PM_RESTORE_PREPARE 系统将恢复休眠图像。如果一切顺利,恢复的内核会发出  
PM_POST_HIBERNA通知。
 
  PM_POST_RESTORE         An error occurred during restore from hibernation.
                          Device drivers' restore callbacks have been executed
                          and tasks have been thawed.
 
  PM_POST_RESTORE  在恢复休眠时发生错误。设备驱动程序恢复回调任务已经
                          解冻并执行。  
  
  PM_SUSPEND_PREPARE      The system is preparing for suspend.
  
  PM_SUSPEND_PREPARE      该系统准备挂起。
  
  PM_POST_SUSPEND         The system has just resumed or an error occurred during
                          suspend.  Device drivers' resume callbacks have been
                          executed and tasks have been thawed.
 
  PM_POST_SUSPEND  系统刚刚恢复或休眠期间发生错误。设备驱动程序恢复回调
                          任务已经解冻并执行。  
  
   It is generally assumed that whatever the notifiers do for
  PM_HIBERNATION_PREPARE, should be undone for PM_POST_HIBERNATION. Analogously,
  operations performed for PM_SUSPEND_PREPARE should be reversed for
  PM_POST_SUSPEND. Additionally, all of the notifiers are called for
  PM_POST_HIBERNATION if one of them fails for PM_HIBERNATION_PREPARE, and
  all of the notifiers are called for PM_POST_SUSPEND if one of them fails for
  PM_SUSPEND_PREPARE.
  
       人们普遍认为,无论通知器为PM_HIBERNATION_PREPARE做什么,都应撤销
PM_POST_HIBERNATION。类似地,执行PM_SUSPEND_PREPARE操作应扭转为PM_POST_SUSPEND。
此外,如果PM_HIBERNATION_PREPARE其中之一出现故障,所有的通知器被PM_POST_HIBERNATION
调用,如果PM_SUSPEND_PREPARE其中之一出现故障,所有的通知器被PM_POST_SUSPEND调用。


  The hibernation and suspend notifiers are called with pm_mutex held.  They are
  defined in the usual way, but their last argument is meaningless (it is always
  NULL).  To register and/or unregister a suspend notifier use the functions
  register_pm_notifier() and unregister_pm_notifier(), respectively, defined in
  include/linux/suspend.h .  If you don't need to unregister the notifier, you can
  also use the pm_notifier() macro defined in include/linux/suspend.h .
   
      休眠和挂起通知器同pm_mutex一起被挂起调用。他们以通常方式定义,但是他们的最后
一个参数是没有意义的(它通常为空)。要注册和/或注销休眠通知器需分别使用定义在/linux/suspend.h
中的函数register_pm_notifier()和unregister_pm_notifier()。如果你不需要注销通知器,
你也可以使用在/linux/suspend.h 中宏定义的pm_notifier()函数。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
将QT += core QT -= gui CONFIG += c++11 TARGET = UavRectifyLoadLIb CONFIG += console CONFIG -= app_bundle TEMPLATE = app SOURCES += main.cpp # The following define makes your compiler emit warnings if you use # any feature of Qt which as been marked deprecated (the exact warnings # depend on your compiler). Please consult the documentation of the # deprecated API in order to know how to port your code away from it. DEFINES += QT_DEPRECATED_WARNINGS win32{ CONFIG(debug, debug|release){ DESTDIR = $$PWD/../../../../RasterManager/bin/Debug } else{ DESTDIR = $$PWD/../../../../RasterManager/bin/release } INCLUDEPATH += $$PWD/../../../include/gdal1101 DEPENDPATH += $$PWD/../../../include/gdal1101 } else{ CONFIG(debug, debug|release){ DESTDIR = $$PWD/../../../product/release32 } else{ DESTDIR = $$PWD/../../../product/release32 } } # You can also make your code fail to compile if you use deprecated APIs. # In order to do so, uncomment the following line. # You can also select to disable deprecated APIs only up to a certain version of Qt. #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 unix:!macx: LIBS += -L$$PWD/../../../product/release32/ -lUAVAutoRectifyMt -lUAVAutoRectify -lUAVAutoRectifyFi INCLUDEPATH += $$PWD/../include DEPENDPATH += $$PWD/../include unix:!macx: LIBS += -L$$PWD/../../../lib/opencvf249/ -lopencv_core unix:!macx: LIBS += -L$$PWD/../../../lib/opencvf249/ -lopencv_highgui unix:!macx: LIBS += -L$$PWD/../../../lib/opencvf249/ -lopencv_imgproc INCLUDEPATH += $$PWD/../../../lib/opencvf249 DEPENDPATH += $$PWD/../../../lib/opencvf249 unix:!macx: LIBS += -L$$PWD/../../../../../../../usr/local/lib/ -lopencv_core #unix:!macx: LIBS += -L$$PWD/../../../../../../../usr/local/lib/ -lopencv_highgui unix:!macx: LIBS += -L$$PWD/../../../../../../../usr/local/lib/ -lopencv_imgproc unix:!macx: LIBS += -L$$PWD/../../../../../../../usr/local/lib/ -lopencv_features2d unix:!macx: LIBS += -L$$PWD/../../../../../../../usr/local/lib/ -lopencv_imgcodecs INCLUDEPATH += $$PWD/../../../../../../../usr/local/include DEPENDPATH += $$PWD/../../../../../../../usr/local/include unix:!macx: LIBS += -L$$PWD/../../../product/release32/ -lDEMDriver unix:!macx: LIBS += -L$$PWD/../../../product/release32/ -lProjection unix:!macx: LIBS += -L$$PWD/../../../product/release32/ -lIImage_gC QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO QMAKE_LFLAGS_RELEASE = $$QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO 转为cmake格式
06-11
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值