blob: 949e5c1fd4b26209711d1eaf0dfcda05f455ea19 [file] [log] [blame]
Andrew Jeffery4fe996c2018-02-27 12:16:48 +10301/* SPDX-License-Identifier: Apache-2.0 */
2/* Copyright (C) 2018 IBM Corp. */
Deepak Kodihallib6a446f2017-04-29 13:01:49 -05003#pragma once
4
Ratan Gupta8441a392017-05-05 21:42:53 +05305#include <limits.h>
Patrick Williams68a24c92023-07-25 12:02:16 -05006#include <string.h>
Deepak Kodihallib6a446f2017-04-29 13:01:49 -05007
8struct mbox_context;
9struct vpnor_partition_table;
10
Ratan Gupta8441a392017-05-05 21:42:53 +053011struct vpnor_partition_paths
12{
13 char ro_loc[PATH_MAX];
Ratan Guptac0ef9872017-06-06 14:31:37 +053014 char rw_loc[PATH_MAX];
15 char prsv_loc[PATH_MAX];
Adriana Kobylakc71dfd72017-07-22 11:10:43 -050016 char patch_loc[PATH_MAX];
Ratan Gupta8441a392017-05-05 21:42:53 +053017};
18
Evan Lojewskif1e547c2019-03-14 14:34:33 +103019struct vpnor_data {
20 struct vpnor_partition_table *vpnor;
21 struct vpnor_partition_paths paths;
22};
23
Deepak Kodihallib6a446f2017-04-29 13:01:49 -050024#ifdef __cplusplus
25extern "C" {
26#endif
27
Evan Lojewskif1e547c2019-03-14 14:34:33 +103028/** @brief Populate the path object with the default partition paths
29 *
30 * @param[in/out] paths - A paths object in which to store the defaults
31 *
32 * Returns 0 if the call succeeds, else a negative error code.
33 */
Andrew Jeffery5320f6e2019-03-15 12:40:41 +103034#ifdef VIRTUAL_PNOR_ENABLED
Evan Lojewskif1e547c2019-03-14 14:34:33 +103035void vpnor_default_paths(struct vpnor_partition_paths *paths);
Andrew Jeffery5320f6e2019-03-15 12:40:41 +103036#else
37static inline void vpnor_default_paths(struct vpnor_partition_paths *paths)
38{
39 memset(paths, 0, sizeof(*paths));
40}
41#endif
Evan Lojewskif1e547c2019-03-14 14:34:33 +103042
Deepak Kodihallib6a446f2017-04-29 13:01:49 -050043#ifdef __cplusplus
44}
45#endif