blob: 51b7354a73e244b0e2c88d3791a0116d5ef4cfbe [file] [log] [blame]
Julian Hall51a3fb32022-11-07 16:25:56 +00001/*
2 * Copyright (c) 2022, Arm Limited. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 *
6 */
7
8#ifndef FWU_RAW_INSTALLER_H
9#define FWU_RAW_INSTALLER_H
10
11#include <stdbool.h>
12#include <stddef.h>
13#include <stdint.h>
Gyorgy Szing3c446242023-03-31 01:53:15 +020014
15#include "common/uuid/uuid.h"
16#include "media/volume/volume.h"
17#include "service/fwu/installer/installer.h"
Julian Hall51a3fb32022-11-07 16:25:56 +000018
19#ifdef __cplusplus
20extern "C" {
21#endif
22
23/**
24 * \brief raw_installer structure definition
25 *
26 * A raw_installer is an installer that takes the raw input image and writes
27 * it directly to the target storage volume with no intermediate processing.
28 * The raw_installer can be used for say installing a complete firmware image
29 * into a single volume. Because the raw_installer has no knowledge of the
30 * format of images that it installs, the assigned location_uuid is used
31 * by the enumerate method to advertise a single updatable image that
32 * corresponds to the entire raw contents of the associated target
33 * volume. Other sub-volume installers may advertise additional updatable
34 * images that reside within the same target volume.
35 */
36struct raw_installer {
37 struct installer base_installer;
38 struct volume *target_volume;
39 unsigned int commit_count;
40 size_t bytes_written;
41 bool is_open;
42};
43
44/**
45 * \brief Initialize a raw_installer
46 *
47 * \param[in] subject The subject raw_installer
48 * \param[in] location_uuid The associated location UUID
49 * \param[in] location_id Identifies where to install qualifying images
50 */
Gyorgy Szing3c446242023-03-31 01:53:15 +020051void raw_installer_init(struct raw_installer *subject, const struct uuid_octets *location_uuid,
52 uint32_t location_id);
Julian Hall51a3fb32022-11-07 16:25:56 +000053
54/**
55 * \brief De-initialize a raw_installer
56 *
57 * \param[in] subject The subject raw_installer
58 */
59void raw_installer_deinit(struct raw_installer *subject);
60
61#ifdef __cplusplus
62}
63#endif
64
65#endif /* FWU_RAW_INSTALLER_H */