blob: 010223842fd50b9fd5168119aa230d4bc9fd0d38 [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>
Deepak Kodihallib6a446f2017-04-29 13:01:49 -05006
7struct mbox_context;
8struct vpnor_partition_table;
9
Ratan Gupta8441a392017-05-05 21:42:53 +053010struct vpnor_partition_paths
11{
12 char ro_loc[PATH_MAX];
Ratan Guptac0ef9872017-06-06 14:31:37 +053013 char rw_loc[PATH_MAX];
14 char prsv_loc[PATH_MAX];
Adriana Kobylakc71dfd72017-07-22 11:10:43 -050015 char patch_loc[PATH_MAX];
Ratan Gupta8441a392017-05-05 21:42:53 +053016};
17
Evan Lojewskif1e547c2019-03-14 14:34:33 +103018struct vpnor_data {
19 struct vpnor_partition_table *vpnor;
20 struct vpnor_partition_paths paths;
21};
22
Deepak Kodihallib6a446f2017-04-29 13:01:49 -050023#ifdef __cplusplus
24extern "C" {
25#endif
26
Evan Lojewskif1e547c2019-03-14 14:34:33 +103027/** @brief Populate the path object with the default partition paths
28 *
29 * @param[in/out] paths - A paths object in which to store the defaults
30 *
31 * Returns 0 if the call succeeds, else a negative error code.
32 */
Andrew Jeffery5320f6e2019-03-15 12:40:41 +103033#ifdef VIRTUAL_PNOR_ENABLED
Evan Lojewskif1e547c2019-03-14 14:34:33 +103034void vpnor_default_paths(struct vpnor_partition_paths *paths);
Andrew Jeffery5320f6e2019-03-15 12:40:41 +103035#else
36static inline void vpnor_default_paths(struct vpnor_partition_paths *paths)
37{
38 memset(paths, 0, sizeof(*paths));
39}
40#endif
Evan Lojewskif1e547c2019-03-14 14:34:33 +103041
Deepak Kodihallib6a446f2017-04-29 13:01:49 -050042#ifdef __cplusplus
43}
44#endif