Andrew Jeffery | 4fe996c | 2018-02-27 12:16:48 +1030 | [diff] [blame] | 1 | /* SPDX-License-Identifier: Apache-2.0 */ |
| 2 | /* Copyright (C) 2018 IBM Corp. */ |
Deepak Kodihalli | b6a446f | 2017-04-29 13:01:49 -0500 | [diff] [blame] | 3 | #pragma once |
| 4 | |
Ratan Gupta | 8441a39 | 2017-05-05 21:42:53 +0530 | [diff] [blame] | 5 | #include <limits.h> |
Deepak Kodihalli | b6a446f | 2017-04-29 13:01:49 -0500 | [diff] [blame] | 6 | |
| 7 | struct mbox_context; |
| 8 | struct vpnor_partition_table; |
| 9 | |
Ratan Gupta | 8441a39 | 2017-05-05 21:42:53 +0530 | [diff] [blame] | 10 | struct vpnor_partition_paths |
| 11 | { |
| 12 | char ro_loc[PATH_MAX]; |
Ratan Gupta | c0ef987 | 2017-06-06 14:31:37 +0530 | [diff] [blame] | 13 | char rw_loc[PATH_MAX]; |
| 14 | char prsv_loc[PATH_MAX]; |
Adriana Kobylak | c71dfd7 | 2017-07-22 11:10:43 -0500 | [diff] [blame] | 15 | char patch_loc[PATH_MAX]; |
Ratan Gupta | 8441a39 | 2017-05-05 21:42:53 +0530 | [diff] [blame] | 16 | }; |
| 17 | |
Evan Lojewski | f1e547c | 2019-03-14 14:34:33 +1030 | [diff] [blame] | 18 | struct vpnor_data { |
| 19 | struct vpnor_partition_table *vpnor; |
| 20 | struct vpnor_partition_paths paths; |
| 21 | }; |
| 22 | |
Deepak Kodihalli | b6a446f | 2017-04-29 13:01:49 -0500 | [diff] [blame] | 23 | #ifdef __cplusplus |
| 24 | extern "C" { |
| 25 | #endif |
| 26 | |
Evan Lojewski | f1e547c | 2019-03-14 14:34:33 +1030 | [diff] [blame] | 27 | /** @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 Jeffery | 5320f6e | 2019-03-15 12:40:41 +1030 | [diff] [blame] | 33 | #ifdef VIRTUAL_PNOR_ENABLED |
Evan Lojewski | f1e547c | 2019-03-14 14:34:33 +1030 | [diff] [blame] | 34 | void vpnor_default_paths(struct vpnor_partition_paths *paths); |
Andrew Jeffery | 5320f6e | 2019-03-15 12:40:41 +1030 | [diff] [blame] | 35 | #else |
| 36 | static inline void vpnor_default_paths(struct vpnor_partition_paths *paths) |
| 37 | { |
| 38 | memset(paths, 0, sizeof(*paths)); |
| 39 | } |
| 40 | #endif |
Evan Lojewski | f1e547c | 2019-03-14 14:34:33 +1030 | [diff] [blame] | 41 | |
Deepak Kodihalli | b6a446f | 2017-04-29 13:01:49 -0500 | [diff] [blame] | 42 | #ifdef __cplusplus |
| 43 | } |
| 44 | #endif |