-
Notifications
You must be signed in to change notification settings - Fork 637
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[block] Provide abstraction to allow system to be quiesced
When performing a SAN boot via INT 13, there is no way for the operating system to indicate that it has finished using the INT 13 SAN device. We therefore have no opportunity to clean up state before the loaded operating system's native drivers take over. This can cause problems when booting Windows, which tends not to be forgiving of unexpected system state. Windows will typically write a flag to the SAN device as the last action before transferring control to the native drivers. We can use this as a heuristic to bring the system to a quiescent state (without performing a full shutdown); this provides us an opportunity to temporarily clean up state that could otherwise prevent a successful Windows boot. Signed-off-by: Michael Brown <mcb30@ipxe.org>
- Loading branch information
Showing
3 changed files
with
99 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* Copyright (C) 2017 Michael Brown <mbrown@fensystems.co.uk>. | ||
* | ||
* 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 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., 51 Franklin Street, Fifth Floor, Boston, MA | ||
* 02110-1301, USA. | ||
* | ||
* You can also choose to distribute this program under the terms of | ||
* the Unmodified Binary Distribution Licence (as given in the file | ||
* COPYING.UBDL), provided that you have satisfied its requirements. | ||
*/ | ||
|
||
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); | ||
|
||
/** | ||
* @file | ||
* | ||
* Quiesce system | ||
* | ||
*/ | ||
|
||
#include <ipxe/quiesce.h> | ||
|
||
/** Quiesce system */ | ||
void quiesce ( void ) { | ||
struct quiescer *quiescer; | ||
|
||
/* Call all quiescers */ | ||
for_each_table_entry ( quiescer, QUIESCERS ) { | ||
quiescer->quiesce(); | ||
} | ||
} | ||
|
||
/** Unquiesce system */ | ||
void unquiesce ( void ) { | ||
struct quiescer *quiescer; | ||
|
||
/* Call all quiescers */ | ||
for_each_table_entry ( quiescer, QUIESCERS ) { | ||
quiescer->unquiesce(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#ifndef _IPXE_QUIESCE_H | ||
#define _IPXE_QUIESCE_H | ||
|
||
/** @file | ||
* | ||
* Quiesce system | ||
* | ||
*/ | ||
|
||
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); | ||
|
||
#include <ipxe/tables.h> | ||
|
||
/** A quiescer */ | ||
struct quiescer { | ||
/** Quiesce system */ | ||
void ( * quiesce ) ( void ); | ||
/** Unquiesce system */ | ||
void ( * unquiesce ) ( void ); | ||
}; | ||
|
||
/** Quiescer table */ | ||
#define QUIESCERS __table ( struct quiescer, "quiescers" ) | ||
|
||
/** Declare a quiescer */ | ||
#define __quiescer __table_entry ( QUIESCERS, 01 ) | ||
|
||
extern void quiesce ( void ); | ||
extern void unquiesce ( void ); | ||
|
||
#endif /* _IPXE_QUIESCE_H */ |