[block] Add dummy SAN device

Add a dummy SAN device which allows the "sanhook" command to be tested
even when no SAN booting capability is present on the platform.  This
allows substantial portions of the SAN boot code to be run in Linux
under Valgrind.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2017-03-26 15:42:52 +03:00
parent 6bc4a8ac91
commit c212597336
4 changed files with 135 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
#ifndef _IPXE_DUMMY_SANBOOT_H
#define _IPXE_DUMMY_SANBOOT_H
/** @file
*
* Dummy SAN device
*
*/
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#ifdef SANBOOT_DUMMY
#define SANBOOT_PREFIX_dummy
#else
#define SANBOOT_PREFIX_dummy __dummy_
#endif
#endif /* _IPXE_DUMMY_SANBOOT_H */

View File

@@ -73,6 +73,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#define ERRFILE_pixbuf ( ERRFILE_CORE | 0x00210000 )
#define ERRFILE_efi_block ( ERRFILE_CORE | 0x00220000 )
#define ERRFILE_sanboot ( ERRFILE_CORE | 0x00230000 )
#define ERRFILE_dummy_sanboot ( ERRFILE_CORE | 0x00240000 )
#define ERRFILE_eisa ( ERRFILE_DRIVER | 0x00000000 )
#define ERRFILE_isa ( ERRFILE_DRIVER | 0x00010000 )

View File

@@ -90,6 +90,7 @@ struct san_device {
/* Include all architecture-independent sanboot API headers */
#include <ipxe/null_sanboot.h>
#include <ipxe/dummy_sanboot.h>
#include <ipxe/efi/efi_block.h>
/* Include all architecture-dependent sanboot API headers */