[修改] 增加freeRTOS
1. 版本FreeRTOSv202212.01,命名为kernel;
This commit is contained in:
@ -0,0 +1,48 @@
|
||||
# The proof depends on one parameter:
|
||||
# BUFFER_SIZE is the size of the buffer being parsed
|
||||
# The buffer size must be bounded because we must bound the number of
|
||||
# iterations loops iterating over the buffer.
|
||||
|
||||
{
|
||||
"ENTRY": "ProcessDHCPReplies",
|
||||
|
||||
################################################################
|
||||
# Buffer header: sizeof(DHCPMessage_t) = 241
|
||||
# Buffer header: sizeof(DHCPMessage_IPv4_t) = 240
|
||||
"BUFFER_HEADER": 240,
|
||||
|
||||
################################################################
|
||||
# Buffer size
|
||||
# Reasonable sizes are BUFFER_SIZE > BUFFER_HEADER
|
||||
# Sizes smaller than this causes CBMC to fail in simplify_byte_extract
|
||||
"BUFFER_SIZE": 252,
|
||||
|
||||
################################################################
|
||||
# Buffer payload
|
||||
"BUFFER_PAYLOAD": "__eval 1 if {BUFFER_SIZE} <= {BUFFER_HEADER} else {BUFFER_SIZE} - {BUFFER_HEADER} + 1",
|
||||
|
||||
################################################################
|
||||
|
||||
"CBMCFLAGS": [
|
||||
# "--nondet-static",
|
||||
"--unwind 1",
|
||||
"--unwindset memcmp.0:7,prvProcessDHCPReplies.0:{BUFFER_PAYLOAD}"
|
||||
],
|
||||
|
||||
"OBJS":
|
||||
[
|
||||
"$(ENTRY)_harness.goto",
|
||||
"$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/cbmc.goto",
|
||||
"$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/freertos_api.goto",
|
||||
"$(FREERTOS_PLUS_TCP)/source/FreeRTOS_DHCP.goto",
|
||||
"$(FREERTOS_PLUS_TCP)/source/portable/BufferManagement/BufferAllocation_2.goto",
|
||||
"$(FREERTOS_PLUS_TCP)/test/FreeRTOS-Kernel/event_groups.goto",
|
||||
"$(FREERTOS_PLUS_TCP)/test/FreeRTOS-Kernel/list.goto"
|
||||
],
|
||||
|
||||
"DEF":
|
||||
[
|
||||
"CBMC_DHCPMESSAGE_HEADER_SIZE={BUFFER_HEADER}",
|
||||
"CBMC_FREERTOS_RECVFROM_BUFFER_BOUND={BUFFER_SIZE}"
|
||||
]
|
||||
}
|
||||
@ -0,0 +1,37 @@
|
||||
/* Standard includes. */
|
||||
#include <stdint.h>
|
||||
|
||||
/* FreeRTOS includes. */
|
||||
#include "FreeRTOS.h"
|
||||
#include "task.h"
|
||||
#include "semphr.h"
|
||||
|
||||
/* FreeRTOS+TCP includes. */
|
||||
#include "FreeRTOS_IP.h"
|
||||
#include "FreeRTOS_Sockets.h"
|
||||
#include "FreeRTOS_IP_Private.h"
|
||||
#include "FreeRTOS_UDP_IP.h"
|
||||
#include "FreeRTOS_DHCP.h"
|
||||
#include "FreeRTOS_ARP.h"
|
||||
|
||||
|
||||
/****************************************************************
|
||||
* Signature of function under test
|
||||
****************************************************************/
|
||||
|
||||
BaseType_t prvProcessDHCPReplies( BaseType_t xExpectedMessageType );
|
||||
|
||||
/****************************************************************
|
||||
* The proof for FreeRTOS_gethostbyname.
|
||||
****************************************************************/
|
||||
|
||||
void harness()
|
||||
{
|
||||
/* Omitting model of an unconstrained xDHCPData because xDHCPData is */
|
||||
/* the source of uninitialized data only on line 647 to set a */
|
||||
/* transaction id is an outgoing message */
|
||||
|
||||
BaseType_t xExpectedMessageType;
|
||||
|
||||
prvProcessDHCPReplies( xExpectedMessageType );
|
||||
}
|
||||
Reference in New Issue
Block a user