summaryrefslogtreecommitdiff
path: root/README
diff options
context:
space:
mode:
authorhailfinger <hailfinger@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2010-02-14 01:20:28 +0000
committerhailfinger <hailfinger@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2010-02-14 01:20:28 +0000
commitd46cd05af98241fa3ac5234e3d73db0712a69e32 (patch)
treecec0b7507929eb51b11d3359be45eb3aad5179e3 /README
parent66cd7f54a6b4188a0a0bffe08914a92ee4932823 (diff)
downloadflashrom-d46cd05af98241fa3ac5234e3d73db0712a69e32.tar.gz
Some programmers want to run certain functions during programmer
shutdown, but the function choice depends on the code path taken during programmer init. Rather than rebuilding the whole init logic in the shutdown function, it is now possible to register functions for execution on programmer shutdown. The behaviour is similar to atexit(), but the registered functions will be run on programmer shutdown instead of on exit and the functions will be called with a void * argument that is specified on registration. Registered functions must have the prototype void function(void *); and will be executed in reverse registration order directly before calling the programmer-specific shutdown() function. It is recommended to have shutdown() only disable programmer/hardware access and leave all code path sensitive shutdown to functions registered with register_shutdown(). The most prominent use case is resetting the EC after flashing on laptops. Note: There are quite a few code paths in flashrom which proceed to terminate flashrom without any programmer shutdown. Those code paths will not get the benefit of register_shutdown() and they should be changed wherever possible. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de> git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@904 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'README')
0 files changed, 0 insertions, 0 deletions