summaryrefslogtreecommitdiff
path: root/FreeRTOS/Test/CBMC/proofs/Queue/QueueGenericReset
diff options
context:
space:
mode:
Diffstat (limited to 'FreeRTOS/Test/CBMC/proofs/Queue/QueueGenericReset')
-rw-r--r--FreeRTOS/Test/CBMC/proofs/Queue/QueueGenericReset/Makefile.json53
-rw-r--r--FreeRTOS/Test/CBMC/proofs/Queue/QueueGenericReset/QueueGenericReset_harness.c45
-rw-r--r--FreeRTOS/Test/CBMC/proofs/Queue/QueueGenericReset/README.md12
3 files changed, 110 insertions, 0 deletions
diff --git a/FreeRTOS/Test/CBMC/proofs/Queue/QueueGenericReset/Makefile.json b/FreeRTOS/Test/CBMC/proofs/Queue/QueueGenericReset/Makefile.json
new file mode 100644
index 000000000..1759310d8
--- /dev/null
+++ b/FreeRTOS/Test/CBMC/proofs/Queue/QueueGenericReset/Makefile.json
@@ -0,0 +1,53 @@
+#
+# FreeRTOS memory safety proofs with CBMC.
+# Copyright (C) 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+#
+# Permission is hereby granted, free of charge, to any person
+# obtaining a copy of this software and associated documentation
+# files (the "Software"), to deal in the Software without
+# restriction, including without limitation the rights to use, copy,
+# modify, merge, publish, distribute, sublicense, and/or sell copies
+# of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+#
+# http://aws.amazon.com/freertos
+# http://www.FreeRTOS.org
+#
+
+{
+ "ENTRY": "QueueGenericReset",
+ "CBMCFLAGS": [
+ "--unwind 1",
+ "--signed-overflow-check",
+ "--pointer-overflow-check",
+ "--unsigned-overflow-check"
+ ],
+ "OBJS": [
+ "$(ENTRY)_harness.goto",
+ "$(FREERTOS)/Source/queue.goto",
+ "$(FREERTOS)/Source/list.goto"
+ ],
+ "DEF": [
+ "configUSE_TRACE_FACILITY=0",
+ "configGENERATE_RUN_TIME_STATS=0"
+ ],
+ "INC": [
+ "."
+ ],
+ "GENERATE_HEADER":[
+ "queue_datastructure.h"
+ ]
+}
+
diff --git a/FreeRTOS/Test/CBMC/proofs/Queue/QueueGenericReset/QueueGenericReset_harness.c b/FreeRTOS/Test/CBMC/proofs/Queue/QueueGenericReset/QueueGenericReset_harness.c
new file mode 100644
index 000000000..fbe4883a0
--- /dev/null
+++ b/FreeRTOS/Test/CBMC/proofs/Queue/QueueGenericReset/QueueGenericReset_harness.c
@@ -0,0 +1,45 @@
+/*
+ * FreeRTOS memory safety proofs with CBMC.
+ * Copyright (C) 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use, copy,
+ * modify, merge, publish, distribute, sublicense, and/or sell copies
+ * of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ * http://aws.amazon.com/freertos
+ * http://www.FreeRTOS.org
+ */
+
+#include "FreeRTOS.h"
+#include "queue.h"
+#include "queue_init.h"
+
+#include "cbmc.h"
+
+struct QueueDefinition;
+
+void harness() {
+ BaseType_t xNewQueue;
+
+ QueueHandle_t xQueue = xUnconstrainedQueue();
+ if(xQueue != NULL)
+ {
+ xQueueGenericReset(xQueue, xNewQueue);
+ }
+}
diff --git a/FreeRTOS/Test/CBMC/proofs/Queue/QueueGenericReset/README.md b/FreeRTOS/Test/CBMC/proofs/Queue/QueueGenericReset/README.md
new file mode 100644
index 000000000..7645344aa
--- /dev/null
+++ b/FreeRTOS/Test/CBMC/proofs/Queue/QueueGenericReset/README.md
@@ -0,0 +1,12 @@
+Assuming that the QueueHandel_t is not null and the assumptions made
+for QueueGenericCreate hold, this harness proves the memory safety of QueueGenericReset.
+
+This proof is a work-in-progress. Proof assumptions are described in
+the harness. The proof also assumes the following functions are
+memory safe and have no side effects relevant to the memory safety of
+this function:
+
+* vPortEnterCritical
+* vPortExitCritical
+* vPortGenerateSimulatedInterrupt
+* xTaskRemoveFromEventList