summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarren Krahn <dkrahn@google.com>2016-03-03 14:10:06 -0800
committerDarren Krahn <dkrahn@google.com>2016-03-08 15:43:41 -0800
commitdeda0447304af079c32d767a15f7dd86dc455c13 (patch)
tree5b549694a23329b5cb7fd0dfc12e3b4333159cb6
parent5f735636de456c2a5fdf0bb9728778607662bd53 (diff)
downloadlibhardware-deda0447304af079c32d767a15f7dd86dc455c13.tar.gz
nvram: Add a get_max_space_size_in_bytes method.
This is useful for the Access-Controlled NVRAM HAL because implementations may be able to achieve atomic writes if they are able to limit the maximum space size. This method allows the module to report that it is imposing such a limit. BUG=27480753 Change-Id: Ia70f459d7d5fca894e52310ddb2cdcbb51bd8364
-rw-r--r--include/hardware/nvram.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/include/hardware/nvram.h b/include/hardware/nvram.h
index 0af5073c..859ea471 100644
--- a/include/hardware/nvram.h
+++ b/include/hardware/nvram.h
@@ -31,7 +31,7 @@ __BEGIN_DECLS
/* The version of this module. */
#define NVRAM_MODULE_API_VERSION_0_1 HARDWARE_MODULE_API_VERSION(0, 1)
-#define NVRAM_DEVICE_API_VERSION_0_1 HARDWARE_DEVICE_API_VERSION(0, 1)
+#define NVRAM_DEVICE_API_VERSION_1_1 HARDWARE_DEVICE_API_VERSION(1, 1)
struct nvram_module {
/**
@@ -77,6 +77,17 @@ struct nvram_device {
const struct nvram_device* device, uint64_t* available_size);
/**
+ * Outputs the maximum number of bytes that can be allocated for a single
+ * space. This will always be at least 32. If an implementation does not
+ * limit the maximum size it may provide the total size.
+ *
+ * device - The nvram_device instance.
+ * max_space_size - Receives the output. Cannot be NULL.
+ */
+ nvram_result_t (*get_max_space_size_in_bytes)(
+ const struct nvram_device* device, uint64_t* max_space_size);
+
+ /**
* Outputs the maximum total number of spaces that may be allocated.
* This will always be at least 8. Outputs NV_UNLIMITED_SPACES if any
* number of spaces are supported (limited only to available NVRAM