vboot: align workbuf to VB2_WORKBUF_ALIGN
Also standardize on position and spacing of __attribute__. BUG=b:124141368 TEST=make clean && make runtests BRANCH=none Change-Id: Ic61d6193c2413824837a51af98eb2dcd9ea4ab85 Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1902843 Commit-Queue: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
This commit is contained in:
parent
c48a593b26
commit
92ea19ae09
|
@ -81,10 +81,10 @@ struct vb2_public_key;
|
|||
__GNUC__ >= 7
|
||||
#define VBOOT_FALLTHROUGH [[gnu::fallthrough]]
|
||||
#elif defined(__GNUC__) && __GNUC__ >= 7 // gcc 7
|
||||
#define VBOOT_FALLTHROUGH __attribute__ ((fallthrough))
|
||||
#define VBOOT_FALLTHROUGH __attribute__((fallthrough))
|
||||
#elif defined(__clang__)
|
||||
#if __has_attribute(fallthrough)
|
||||
#define VBOOT_FALLTHROUGH __attribute__ ((fallthrough))
|
||||
#define VBOOT_FALLTHROUGH __attribute__((fallthrough))
|
||||
#else // clang versions that do not support fallthrough.
|
||||
#define VBOOT_FALLTHROUGH
|
||||
#endif
|
||||
|
|
|
@ -61,7 +61,7 @@
|
|||
* int foo(void)
|
||||
* {
|
||||
* struct vb2_workbuf wb;
|
||||
* uint8_t buf[NUM] __attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
|
||||
* uint8_t buf[NUM] __attribute__((aligned(VB2_WORKBUF_ALIGN)));
|
||||
* wb.buf = buf;
|
||||
* wb.size = sizeof(buf);
|
||||
*/
|
||||
|
|
|
@ -40,7 +40,8 @@ struct show_option_s show_option = {
|
|||
};
|
||||
|
||||
/* Shared work buffer */
|
||||
static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE];
|
||||
static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE]
|
||||
__attribute__((aligned(VB2_WORKBUF_ALIGN)));
|
||||
static struct vb2_workbuf wb;
|
||||
|
||||
void show_pubkey(const struct vb2_packed_key *pubkey, const char *sp)
|
||||
|
|
|
@ -188,7 +188,8 @@ vblock_cleanup:
|
|||
static int do_verify(const char *infile, const char *signpubkey,
|
||||
const char *fv_file, const char *kernelkey_file)
|
||||
{
|
||||
uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE];
|
||||
uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE]
|
||||
__attribute__((aligned(VB2_WORKBUF_ALIGN)));
|
||||
struct vb2_workbuf wb;
|
||||
vb2_workbuf_init(&wb, workbuf, sizeof(workbuf));
|
||||
|
||||
|
|
|
@ -178,7 +178,8 @@ static int Unpack(const char *infile, const char *datapubkey,
|
|||
/* If the signing public key is provided, then verify the block
|
||||
* signature, since vb2_read_keyblock() only verified the hash. */
|
||||
if (signpubkey) {
|
||||
static uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE];
|
||||
static uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE]
|
||||
__attribute__((aligned(VB2_WORKBUF_ALIGN)));
|
||||
static struct vb2_workbuf wb;
|
||||
|
||||
if (block->keyblock_signature.sig_size == 0) {
|
||||
|
|
|
@ -245,7 +245,8 @@ static int fmap_sign_fw_main(const char *name, uint8_t *buf, uint32_t len,
|
|||
static int fmap_sign_fw_preamble(const char *name, uint8_t *buf, uint32_t len,
|
||||
void *data)
|
||||
{
|
||||
static uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE];
|
||||
static uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE]
|
||||
__attribute__((aligned(VB2_WORKBUF_ALIGN)));
|
||||
static struct vb2_workbuf wb;
|
||||
vb2_workbuf_init(&wb, workbuf, sizeof(workbuf));
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ int ft_show_rwsig(const char *name, uint8_t *buf, uint32_t len, void *nuthin)
|
|||
const struct vb21_packed_key *pkey = show_option.pkey;
|
||||
struct vb2_public_key key;
|
||||
uint8_t workbuf[VB2_VERIFY_DATA_WORKBUF_BYTES]
|
||||
__attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
|
||||
__attribute__((aligned(VB2_WORKBUF_ALIGN)));
|
||||
struct vb2_workbuf wb;
|
||||
uint32_t data_size, sig_size = SIGNATURE_RSVD_SIZE;
|
||||
uint32_t total_data_size = 0;
|
||||
|
|
|
@ -372,7 +372,7 @@ static vb2_error_t try_our_own(enum vb2_signature_algorithm sig_alg,
|
|||
struct vb2_public_key pubkey;
|
||||
struct vb21_signature *sig;
|
||||
uint8_t buf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE]
|
||||
__attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
|
||||
__attribute__((aligned(VB2_WORKBUF_ALIGN)));
|
||||
struct vb2_workbuf wb = {
|
||||
.buf = buf,
|
||||
.size = sizeof(buf),
|
||||
|
|
|
@ -35,7 +35,7 @@ struct linux_kernel_e820entry {
|
|||
uint64_t start_addr;
|
||||
uint64_t segment_size;
|
||||
uint32_t segment_type;
|
||||
} __attribute__ ((packed));
|
||||
} __attribute__((packed));
|
||||
|
||||
/* Simplified version of the x86 kernel zeropage table */
|
||||
struct linux_kernel_params {
|
||||
|
@ -62,6 +62,6 @@ struct linux_kernel_params {
|
|||
uint8_t pad6[0x2d0 - 0x236];
|
||||
struct linux_kernel_e820entry
|
||||
e820_entries[E820_ENTRY_MAX]; /* 2d0-cd0 */
|
||||
} __attribute__ ((packed));
|
||||
} __attribute__((packed));
|
||||
|
||||
#endif /* VBOOT_REFERENCE_KERNEL_BLOB_H_ */
|
||||
|
|
|
@ -1259,7 +1259,8 @@ static struct vb2_keyblock *dupe_keyblock(const struct vb2_keyblock *block)
|
|||
static int verify_keyblock(const struct vb2_keyblock *block,
|
||||
const struct vb2_packed_key *sign_key) {
|
||||
int r;
|
||||
uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE];
|
||||
uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE]
|
||||
__attribute__((aligned(VB2_WORKBUF_ALIGN)));
|
||||
struct vb2_workbuf wb;
|
||||
struct vb2_public_key key;
|
||||
struct vb2_keyblock *new_block;
|
||||
|
|
|
@ -508,7 +508,8 @@ int VerifyKernelBlob(uint8_t *kernel_blob,
|
|||
uint32_t vmlinuz_header_size = 0;
|
||||
uint64_t vmlinuz_header_address = 0;
|
||||
|
||||
uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE];
|
||||
uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE]
|
||||
__attribute__((aligned(VB2_WORKBUF_ALIGN)));
|
||||
struct vb2_workbuf wb;
|
||||
vb2_workbuf_init(&wb, workbuf, sizeof(workbuf));
|
||||
|
||||
|
@ -740,7 +741,8 @@ uint8_t *CreateKernelBlob(uint8_t *vmlinuz_buf, uint32_t vmlinuz_size,
|
|||
|
||||
enum futil_file_type ft_recognize_vblock1(uint8_t *buf, uint32_t len)
|
||||
{
|
||||
uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE];
|
||||
uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE]
|
||||
__attribute__((aligned(VB2_WORKBUF_ALIGN)));
|
||||
struct vb2_workbuf wb;
|
||||
vb2_workbuf_init(&wb, workbuf, sizeof(workbuf));
|
||||
|
||||
|
|
|
@ -144,7 +144,8 @@ struct vb2_keyblock *vb2_create_keyblock_external(
|
|||
|
||||
struct vb2_keyblock *vb2_read_keyblock(const char *filename)
|
||||
{
|
||||
uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE];
|
||||
uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE]
|
||||
__attribute__((aligned(VB2_WORKBUF_ALIGN)));
|
||||
struct vb2_workbuf wb;
|
||||
vb2_workbuf_init(&wb, workbuf, sizeof(workbuf));
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
/* Common context for tests */
|
||||
static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE]
|
||||
__attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
|
||||
__attribute__((aligned(VB2_WORKBUF_ALIGN)));
|
||||
static struct vb2_context *ctx;
|
||||
static struct vb2_shared_data *sd;
|
||||
static struct vb2_fw_preamble *fwpre;
|
||||
|
|
|
@ -83,7 +83,7 @@ static void test_verify_data(const struct vb2_packed_key *key1,
|
|||
const struct vb2_signature *sig)
|
||||
{
|
||||
uint8_t workbuf[VB2_VERIFY_DATA_WORKBUF_BYTES]
|
||||
__attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
|
||||
__attribute__((aligned(VB2_WORKBUF_ALIGN)));
|
||||
struct vb2_workbuf wb;
|
||||
|
||||
struct vb2_public_key pubk, pubk_orig;
|
||||
|
|
|
@ -141,7 +141,7 @@ static void test_verify_keyblock(const struct vb2_public_key *public_key,
|
|||
const struct vb2_packed_key *data_key)
|
||||
{
|
||||
uint8_t workbuf[VB2_KEYBLOCK_VERIFY_WORKBUF_BYTES]
|
||||
__attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
|
||||
__attribute__((aligned(VB2_WORKBUF_ALIGN)));
|
||||
struct vb2_workbuf wb;
|
||||
struct vb2_keyblock *hdr;
|
||||
struct vb2_keyblock *h;
|
||||
|
@ -206,7 +206,7 @@ static void test_verify_fw_preamble(struct vb2_packed_key *public_key,
|
|||
struct vb2_fw_preamble *h;
|
||||
struct vb2_public_key rsa;
|
||||
uint8_t workbuf[VB2_VERIFY_FIRMWARE_PREAMBLE_WORKBUF_BYTES]
|
||||
__attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
|
||||
__attribute__((aligned(VB2_WORKBUF_ALIGN)));
|
||||
struct vb2_workbuf wb;
|
||||
uint32_t hsize;
|
||||
|
||||
|
@ -348,7 +348,7 @@ static void test_verify_kernel_preamble(
|
|||
struct vb2_public_key rsa;
|
||||
// TODO: how many workbuf bytes?
|
||||
uint8_t workbuf[VB2_VERIFY_FIRMWARE_PREAMBLE_WORKBUF_BYTES]
|
||||
__attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
|
||||
__attribute__((aligned(VB2_WORKBUF_ALIGN)));
|
||||
struct vb2_workbuf wb;
|
||||
uint32_t hsize;
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
/* Common context for tests */
|
||||
static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE]
|
||||
__attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
|
||||
__attribute__((aligned(VB2_WORKBUF_ALIGN)));
|
||||
static struct vb2_workbuf wb;
|
||||
static struct vb2_context *ctx;
|
||||
static struct vb2_shared_data *sd;
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
/* Common context for tests */
|
||||
static uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE]
|
||||
__attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
|
||||
__attribute__((aligned(VB2_WORKBUF_ALIGN)));
|
||||
static struct vb2_context *ctx;
|
||||
static struct vb2_shared_data *sd;
|
||||
static struct vb2_gbb_header gbb;
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
static void test_signatures(const struct vb2_public_key *key)
|
||||
{
|
||||
uint8_t workbuf[VB2_VERIFY_DIGEST_WORKBUF_BYTES]
|
||||
__attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
|
||||
__attribute__((aligned(VB2_WORKBUF_ALIGN)));
|
||||
uint8_t sig[RSA1024NUMBYTES];
|
||||
struct vb2_workbuf wb;
|
||||
int unexpected_success;
|
||||
|
@ -54,7 +54,7 @@ static void test_signatures(const struct vb2_public_key *key)
|
|||
*/
|
||||
static void test_verify_digest(struct vb2_public_key *key) {
|
||||
uint8_t workbuf[VB2_VERIFY_DIGEST_WORKBUF_BYTES]
|
||||
__attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
|
||||
__attribute__((aligned(VB2_WORKBUF_ALIGN)));
|
||||
uint8_t sig[RSA1024NUMBYTES];
|
||||
struct vb2_workbuf wb;
|
||||
enum vb2_signature_algorithm orig_key_alg = key->sig_alg;
|
||||
|
|
|
@ -145,7 +145,7 @@ static void print_help(const char *progname)
|
|||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
uint8_t workbuf[16384] __attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
|
||||
uint8_t workbuf[16384] __attribute__((aligned(VB2_WORKBUF_ALIGN)));
|
||||
struct vb2_context *ctx;
|
||||
struct vb2_shared_data *sd;
|
||||
vb2_error_t rv;
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
/* Common context for tests */
|
||||
static uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE]
|
||||
__attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
|
||||
__attribute__((aligned(VB2_WORKBUF_ALIGN)));
|
||||
static struct vb2_context *ctx;
|
||||
static struct vb2_shared_data *sd;
|
||||
|
||||
|
|
|
@ -170,7 +170,7 @@ static void test_verify_data(const struct vb2_public_key *pubk_orig,
|
|||
const struct vb21_signature *sig)
|
||||
{
|
||||
uint8_t workbuf[VB2_VERIFY_DATA_WORKBUF_BYTES]
|
||||
__attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
|
||||
__attribute__((aligned(VB2_WORKBUF_ALIGN)));
|
||||
struct vb2_workbuf wb;
|
||||
|
||||
struct vb2_public_key pubk;
|
||||
|
|
|
@ -220,7 +220,7 @@ static void test_verify_hash(void)
|
|||
const struct vb2_private_key *prik;
|
||||
struct vb2_public_key pubk;
|
||||
uint8_t workbuf[VB2_VERIFY_DATA_WORKBUF_BYTES]
|
||||
__attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
|
||||
__attribute__((aligned(VB2_WORKBUF_ALIGN)));
|
||||
struct vb2_workbuf wb;
|
||||
|
||||
vb2_workbuf_init(&wb, workbuf, sizeof(workbuf));
|
||||
|
@ -260,7 +260,7 @@ static void test_verify_keyblock(void)
|
|||
uint8_t *buf, *buf2;
|
||||
|
||||
uint8_t workbuf[VB2_KEYBLOCK_VERIFY_WORKBUF_BYTES]
|
||||
__attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
|
||||
__attribute__((aligned(VB2_WORKBUF_ALIGN)));
|
||||
struct vb2_workbuf wb;
|
||||
|
||||
TEST_SUCC(vb2_public_key_hash(&pubk, VB2_HASH_SHA256),
|
||||
|
@ -387,7 +387,7 @@ static void test_verify_fw_preamble(void)
|
|||
uint8_t *buf, *buf2;
|
||||
|
||||
uint8_t workbuf[VB2_VERIFY_FIRMWARE_PREAMBLE_WORKBUF_BYTES]
|
||||
__attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
|
||||
__attribute__((aligned(VB2_WORKBUF_ALIGN)));
|
||||
struct vb2_workbuf wb;
|
||||
|
||||
/*
|
||||
|
|
|
@ -37,7 +37,7 @@ static void preamble_tests(const char *keys_dir)
|
|||
int i;
|
||||
|
||||
uint8_t workbuf[VB2_VERIFY_FIRMWARE_PREAMBLE_WORKBUF_BYTES]
|
||||
__attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
|
||||
__attribute__((aligned(VB2_WORKBUF_ALIGN)));
|
||||
struct vb2_workbuf wb;
|
||||
|
||||
vb2_workbuf_init(&wb, workbuf, sizeof(workbuf));
|
||||
|
|
|
@ -29,7 +29,7 @@ static void keyblock_tests(const char *keys_dir)
|
|||
const char test_desc[] = "Test keyblock";
|
||||
|
||||
uint8_t workbuf[VB2_KEYBLOCK_VERIFY_WORKBUF_BYTES]
|
||||
__attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
|
||||
__attribute__((aligned(VB2_WORKBUF_ALIGN)));
|
||||
struct vb2_workbuf wb;
|
||||
|
||||
vb2_workbuf_init(&wb, workbuf, sizeof(workbuf));
|
||||
|
|
|
@ -47,7 +47,7 @@ static void sig_tests(const struct alg_combo *combo,
|
|||
uint32_t size;
|
||||
|
||||
uint8_t workbuf[VB2_VERIFY_DATA_WORKBUF_BYTES]
|
||||
__attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
|
||||
__attribute__((aligned(VB2_WORKBUF_ALIGN)));
|
||||
struct vb2_workbuf wb;
|
||||
|
||||
uint8_t *buf;
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
/* Common context for tests */
|
||||
static uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE]
|
||||
__attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
|
||||
__attribute__((aligned(VB2_WORKBUF_ALIGN)));
|
||||
static struct vb2_context *ctx;
|
||||
static struct vb2_shared_data *sd;
|
||||
static struct vb2_gbb_header gbb;
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
/* Common context for tests */
|
||||
|
||||
static uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE]
|
||||
__attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
|
||||
__attribute__((aligned(VB2_WORKBUF_ALIGN)));
|
||||
static struct vb2_context *ctx;
|
||||
static struct vb2_shared_data *sd;
|
||||
static struct vb2_gbb_header gbb;
|
||||
|
|
|
@ -148,7 +148,7 @@ static void test_align(void)
|
|||
*/
|
||||
static void test_workbuf(void)
|
||||
{
|
||||
uint64_t buf[8] __attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
|
||||
uint64_t buf[8] __attribute__((aligned(VB2_WORKBUF_ALIGN)));
|
||||
uint8_t *p0 = (uint8_t *)buf, *ptr;
|
||||
struct vb2_workbuf wb;
|
||||
|
||||
|
|
|
@ -48,7 +48,8 @@ static int mock_ec_rw_hash_size;
|
|||
static uint8_t want_ec_hash[32];
|
||||
static uint8_t update_hash;
|
||||
static int want_ec_hash_size;
|
||||
static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE];
|
||||
static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE]
|
||||
__attribute__((aligned(VB2_WORKBUF_ALIGN)));
|
||||
static struct vb2_context *ctx;
|
||||
static struct vb2_shared_data *sd;
|
||||
static struct vb2_gbb_header gbb;
|
||||
|
|
|
@ -15,7 +15,8 @@ static struct vb2_gbb_header *gbb = (struct vb2_gbb_header *)gbb_data;
|
|||
static struct vb2_packed_key *rootkey;
|
||||
static struct vb2_context *ctx;
|
||||
static struct vb2_workbuf wb;
|
||||
static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE];
|
||||
static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE]
|
||||
__attribute__((aligned(VB2_WORKBUF_ALIGN)));
|
||||
|
||||
static void set_gbb_hwid(const char *hwid, size_t size)
|
||||
{
|
||||
|
|
|
@ -11,8 +11,8 @@
|
|||
#include "vboot_test.h"
|
||||
|
||||
static struct vb2_context *ctx;
|
||||
__attribute__((aligned(VB2_WORKBUF_ALIGN)))
|
||||
static uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE];
|
||||
static uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE]
|
||||
__attribute__((aligned(VB2_WORKBUF_ALIGN)));
|
||||
static struct {
|
||||
struct vb2_gbb_header h;
|
||||
uint8_t rootkey[4096];
|
||||
|
|
|
@ -15,9 +15,9 @@
|
|||
|
||||
/* Common context for tests */
|
||||
static uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE]
|
||||
__attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
|
||||
__attribute__((aligned(VB2_WORKBUF_ALIGN)));
|
||||
static uint8_t workbuf2[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE]
|
||||
__attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
|
||||
__attribute__((aligned(VB2_WORKBUF_ALIGN)));
|
||||
static struct vb2_context *ctx;
|
||||
static struct vb2_shared_data *sd;
|
||||
static struct vb2_gbb_header gbb;
|
||||
|
|
|
@ -82,7 +82,7 @@ static void nv_storage_test(uint32_t ctxflags)
|
|||
struct nv_field *vnf;
|
||||
uint8_t goodcrc;
|
||||
uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE]
|
||||
__attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
|
||||
__attribute__((aligned(VB2_WORKBUF_ALIGN)));
|
||||
struct vb2_context *ctx;
|
||||
|
||||
TEST_SUCC(vb2api_init(workbuf, sizeof(workbuf), &ctx),
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
#include "vboot_test.h"
|
||||
|
||||
static struct vb2_context *ctx;
|
||||
__attribute__((aligned(VB2_WORKBUF_ALIGN)))
|
||||
static uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE];
|
||||
static uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE]
|
||||
__attribute__((aligned(VB2_WORKBUF_ALIGN)));
|
||||
|
||||
static const uint8_t *mock_preamble;
|
||||
static size_t mock_preamble_size;
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
#include "vboot_common.h"
|
||||
|
||||
static uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE]
|
||||
__attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
|
||||
__attribute__((aligned(VB2_WORKBUF_ALIGN)));
|
||||
static struct vb2_context *ctx;
|
||||
static struct vb2_shared_data *sd;
|
||||
static struct vb2_secdata_firmware *sec;
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
#include "test_common.h"
|
||||
|
||||
static uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE]
|
||||
__attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
|
||||
__attribute__((aligned(VB2_WORKBUF_ALIGN)));
|
||||
static struct vb2_context *ctx;
|
||||
static struct vb2_gbb_header gbb;
|
||||
static struct vb2_shared_data *sd;
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
#include "vboot_common.h"
|
||||
|
||||
static uint8_t workbuf[VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE]
|
||||
__attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
|
||||
__attribute__((aligned(VB2_WORKBUF_ALIGN)));
|
||||
static struct vb2_context *ctx;
|
||||
static struct vb2_shared_data *sd;
|
||||
static struct vb2_secdata_kernel *sec;
|
||||
|
|
|
@ -92,7 +92,8 @@ test_case_t test[] = {
|
|||
};
|
||||
|
||||
/* Mock data */
|
||||
static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE];
|
||||
static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE]
|
||||
__attribute__((aligned(VB2_WORKBUF_ALIGN)));
|
||||
static struct vb2_context *ctx;
|
||||
static struct vb2_shared_data *sd;
|
||||
static struct vb2_gbb_header gbb;
|
||||
|
|
|
@ -25,7 +25,8 @@
|
|||
static uint8_t shared_data[VB_SHARED_DATA_MIN_SIZE];
|
||||
static VbSharedDataHeader *shared = (VbSharedDataHeader *)shared_data;
|
||||
static LoadKernelParams lkp;
|
||||
static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE];
|
||||
static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE]
|
||||
__attribute__((aligned(VB2_WORKBUF_ALIGN)));
|
||||
static struct vb2_context *ctx;
|
||||
static struct vb2_shared_data *sd;
|
||||
static struct vb2_gbb_header gbb;
|
||||
|
|
|
@ -24,7 +24,8 @@
|
|||
#include "vboot_struct.h"
|
||||
|
||||
/* Mock data */
|
||||
static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE];
|
||||
static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE]
|
||||
__attribute__((aligned(VB2_WORKBUF_ALIGN)));
|
||||
static struct vb2_context *ctx;
|
||||
static struct vb2_context ctx_nvram_backend;
|
||||
static struct vb2_shared_data *sd;
|
||||
|
|
|
@ -302,7 +302,8 @@ static const char *got_find_disk;
|
|||
static const char *got_load_disk;
|
||||
static uint32_t got_return_val;
|
||||
static uint32_t got_external_mismatch;
|
||||
static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE];
|
||||
static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE]
|
||||
__attribute__((aligned(VB2_WORKBUF_ALIGN)));
|
||||
static struct vb2_context *ctx;
|
||||
|
||||
/**
|
||||
|
|
|
@ -27,7 +27,8 @@
|
|||
static uint8_t shared_data[VB_SHARED_DATA_MIN_SIZE];
|
||||
static VbSharedDataHeader *shared = (VbSharedDataHeader *)shared_data;
|
||||
static LoadKernelParams lkp;
|
||||
static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE];
|
||||
static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE]
|
||||
__attribute__((aligned(VB2_WORKBUF_ALIGN)));
|
||||
static struct vb2_context *ctx;
|
||||
static struct vb2_shared_data *sd;
|
||||
static struct vb2_gbb_header gbb;
|
||||
|
|
|
@ -27,7 +27,8 @@ static VbSharedDataHeader *shared = (VbSharedDataHeader *)shared_data;
|
|||
static char debug_info[4096];
|
||||
static struct vb2_context *ctx;
|
||||
static struct vb2_shared_data *sd;
|
||||
static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE];
|
||||
static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE]
|
||||
__attribute__((aligned(VB2_WORKBUF_ALIGN)));
|
||||
static uint32_t mock_localization_count;
|
||||
static uint32_t mock_altfw_mask;
|
||||
|
||||
|
|
|
@ -70,7 +70,8 @@ static GptHeader *mock_gpt_primary =
|
|||
static GptHeader *mock_gpt_secondary =
|
||||
(GptHeader*)&mock_disk[MOCK_SECTOR_SIZE * (MOCK_SECTOR_COUNT - 1)];
|
||||
static uint8_t mock_digest[VB2_SHA256_DIGEST_SIZE] = {12, 34, 56, 78};
|
||||
static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE];
|
||||
static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE]
|
||||
__attribute__((aligned(VB2_WORKBUF_ALIGN)));
|
||||
static struct vb2_context *ctx;
|
||||
static struct vb2_packed_key mock_key;
|
||||
|
||||
|
|
|
@ -19,7 +19,8 @@
|
|||
#include "vboot_api.h"
|
||||
#include "vboot_kernel.h"
|
||||
|
||||
static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE];
|
||||
static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE]
|
||||
__attribute__((aligned(VB2_WORKBUF_ALIGN)));
|
||||
static struct vb2_context *ctx;
|
||||
static struct vb2_shared_data *sd;
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
int main(int argc, char* argv[])
|
||||
{
|
||||
uint8_t workbuf[VB2_VERIFY_DIGEST_WORKBUF_BYTES]
|
||||
__attribute__ ((aligned (VB2_WORKBUF_ALIGN)));
|
||||
__attribute__((aligned(VB2_WORKBUF_ALIGN)));
|
||||
struct vb2_workbuf wb;
|
||||
vb2_workbuf_init(&wb, workbuf, sizeof(workbuf));
|
||||
|
||||
|
|
Loading…
Reference in New Issue