diff options
author | Bill Richardson <wfrichar@google.com> | 2021-05-20 13:55:40 -0500 |
---|---|---|
committer | Bill Richardson <wfrichar@google.com> | 2021-05-24 23:15:40 +0000 |
commit | e2d28b1e1ef99731700e11012d4a96452ebaf0be (patch) | |
tree | c7f98e2e6bad54da592adafc069d256e999a3854 | |
parent | b798c457bcff18bc273f7d09cbfdbe7223b583f1 (diff) | |
download | generic-e2d28b1e1ef99731700e11012d4a96452ebaf0be.tar.gz |
Define NUGGET_PARAM_STORAGE_ functions
This allows storage of a single variable-sized data blob by
Nugget OS, for whatever purpose the AP may require. Nugget OS
makes no use of it.
Bug: 173056823
Test: manual
Change-Id: Iecbaf9a89fa782ddc67e5d3f23d0cd117ea2458a
Signed-off-by: Bill Richardson <wfrichar@google.com>
Reviewed-on: https://nugget-os-review.googlesource.com/c/host/generic/+/43626
Reviewed-by: Randall Spangler <rspangler@google.com>
Presubmit-Verified: TreeHugger Robot <android-build-prod@system.gserviceaccount.com>
-rw-r--r-- | nugget/include/app_nugget.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/nugget/include/app_nugget.h b/nugget/include/app_nugget.h index 525e774..94c9b6b 100644 --- a/nugget/include/app_nugget.h +++ b/nugget/include/app_nugget.h @@ -370,6 +370,48 @@ enum nugget_sjtag_avb_boot_lock_result { * @errors APP_ERROR_BOGUS_ARGS */ +/* + * Persistent storage of arbitrary data, up to + * (FS_MAX_FILE_SIZE - sizeof(struct nugget_app_data)) bytes. + */ +struct nugget_app_storage { + uint32_t flags; /* TBD, use zero for now */ + uint8_t data[0]; /* Zero or more bytes */ +} __packed; + +#define NUGGET_PARAM_STORAGE_WRITE 0x0014 +/* + * Write arbitrary data. + * + * The current storage is erased, then new data (if any) is saved. + * + * .flags meaning is not yet defined; for now it must be 0x00000000 + * Possible usage could restrict reading to the bootloader, + * erase data after N reads or reboots, etc. + * + * @param args struct nugget_app_storage + zero or more bytes + * @param arg_len To write: > sizeof(struct nugget_app_storage) + * To erase: <= sizeof(struct nugget_app_storage) + * @param reply <none> + * @param reply_len 0 + * + * @errors APP_ERROR_BOGUS_ARGS + */ +#define NUGGET_PARAM_STORAGE_READ 0x0015 +/* + * Read arbitrary data. + * + * On success, struct nugget_app_storage is returned, followed by zero + * or more bytes of .data + * + * @param args <none> + * @param arg_len 0 + * @param reply struct nugget_app_storage + zero or more bytes + * @param reply_len <varies> + * + * @errors APP_ERROR_BOGUS_ARGS + */ + /****************************************************************************/ /* Test related commands */ |