Software APIs
boot_svc_next_boot_bl0_slot.c
1// Copyright lowRISC contributors (OpenTitan project).
2// Licensed under the Apache License, Version 2.0, see LICENSE for details.
3// SPDX-License-Identifier: Apache-2.0
4
5#include "sw/device/silicon_creator/lib/boot_svc/boot_svc_next_boot_bl0_slot.h"
6
7#include "sw/device/silicon_creator/lib/error.h"
8
9void boot_svc_next_boot_bl0_slot_req_init(
10 uint32_t primary_slot, uint32_t next_slot,
11 boot_svc_next_boot_bl0_slot_req_t *msg) {
12 msg->next_bl0_slot = next_slot;
13 msg->primary_bl0_slot = primary_slot;
14 boot_svc_header_finalize(kBootSvcNextBl0SlotReqType,
15 sizeof(boot_svc_next_boot_bl0_slot_req_t),
16 &msg->header);
17}
18
19void boot_svc_next_boot_bl0_slot_res_init(
20 rom_error_t status, uint32_t primary_slot,
21 boot_svc_next_boot_bl0_slot_res_t *msg) {
22 msg->status = status;
23 msg->primary_bl0_slot = primary_slot;
24 boot_svc_header_finalize(kBootSvcNextBl0SlotResType,
25 sizeof(boot_svc_next_boot_bl0_slot_res_t),
26 &msg->header);
27}