Changeset View
Changeset View
Standalone View
Standalone View
stand/common/bootstrap.h
Show All 27 Lines | |||||
#ifndef _BOOTSTRAP_H_ | #ifndef _BOOTSTRAP_H_ | ||||
#define _BOOTSTRAP_H_ | #define _BOOTSTRAP_H_ | ||||
#include <sys/types.h> | #include <sys/types.h> | ||||
#include <sys/queue.h> | #include <sys/queue.h> | ||||
#include <sys/linker_set.h> | #include <sys/linker_set.h> | ||||
#ifdef SECURE_BOOT | |||||
#include <bearssl.h> | |||||
#endif | |||||
/* Commands and return values; nonzero return sets command_errmsg != NULL */ | /* Commands and return values; nonzero return sets command_errmsg != NULL */ | ||||
typedef int (bootblk_cmd_t)(int argc, char *argv[]); | typedef int (bootblk_cmd_t)(int argc, char *argv[]); | ||||
#define COMMAND_ERRBUFSZ (256) | #define COMMAND_ERRBUFSZ (256) | ||||
extern const char *command_errmsg; | extern const char *command_errmsg; | ||||
extern char command_errbuf[COMMAND_ERRBUFSZ]; | extern char command_errbuf[COMMAND_ERRBUFSZ]; | ||||
#define CMD_OK 0 | #define CMD_OK 0 | ||||
#define CMD_WARN 1 | #define CMD_WARN 1 | ||||
#define CMD_ERROR 2 | #define CMD_ERROR 2 | ||||
▲ Show 20 Lines • Show All 283 Lines • ▼ Show 20 Lines | #else | ||||
void (*arch_loadseg)(void *eh, void *ph, uint64_t delta); | void (*arch_loadseg)(void *eh, void *ph, uint64_t delta); | ||||
#endif | #endif | ||||
/* Probe ZFS pool(s), if needed. */ | /* Probe ZFS pool(s), if needed. */ | ||||
void (*arch_zfs_probe)(void); | void (*arch_zfs_probe)(void); | ||||
/* For kexec-type loaders, get ksegment structure */ | /* For kexec-type loaders, get ksegment structure */ | ||||
void (*arch_kexec_kseg_get)(int *nseg, void **kseg); | void (*arch_kexec_kseg_get)(int *nseg, void **kseg); | ||||
#ifdef SECURE_BOOT | |||||
/* | |||||
* Check if we should verify anything. | |||||
* 0 - Secure boot disabled, | |||||
* 1 - enabled | |||||
*/ | |||||
int (*secure_boot_enabled)(void); | |||||
/* Return an array of x509 CAs */ | |||||
br_x509_certificate* (*secure_boot_get_CAs)(size_t *count); | |||||
br_x509_certificate* (*secure_boot_get_forbidden_CAs)(size_t *count); | |||||
/* Check if the DER encoded TBS part of X509 certificate is forbidden */ | |||||
int (*secure_boot_cert_forbidden)(const char*, size_t); | |||||
#endif | |||||
}; | }; | ||||
extern struct arch_switch archsw; | extern struct arch_switch archsw; | ||||
/* This must be provided by the MD code, but should it be in the archsw? */ | /* This must be provided by the MD code, but should it be in the archsw? */ | ||||
void delay(int delay); | void delay(int delay); | ||||
void dev_cleanup(void); | void dev_cleanup(void); | ||||
time_t time(time_t *tloc); | time_t time(time_t *tloc); | ||||
#ifndef CTASSERT | #ifndef CTASSERT | ||||
#define CTASSERT(x) _Static_assert(x, "compile-time assertion failed") | #define CTASSERT(x) _Static_assert(x, "compile-time assertion failed") | ||||
#endif | #endif | ||||
#endif /* !_BOOTSTRAP_H_ */ | #endif /* !_BOOTSTRAP_H_ */ |