mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-10-15 17:27:46 -04:00
FreeRTOS_Plus_TCP_Echo_Qemu_mps2: cleanup (#1336)
* FreeRTOS_Plus_TCP_Echo_Qemu_mps2: cleanup FreeRTOS_Plus_TCP_Echo_Qemu_mps2: - Add missing include for header files. - Remove redundant function declarations. - Add "static" modifier if possible. - No need to use "weak" for EthernetISR(). Signed-off-by: Florian La Roche <Florian.LaRoche@gmail.com>
This commit is contained in:
parent
9165944664
commit
1325aaaad6
25 changed files with 96 additions and 84 deletions
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
|
@ -32,7 +32,7 @@ jobs:
|
||||||
git-secrets --scan
|
git-secrets --scan
|
||||||
|
|
||||||
formatting:
|
formatting:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ jobs:
|
||||||
- name: Check Formatting
|
- name: Check Formatting
|
||||||
uses: FreeRTOS/CI-CD-Github-Actions/formatting@main
|
uses: FreeRTOS/CI-CD-Github-Actions/formatting@main
|
||||||
with:
|
with:
|
||||||
exclude-dirs: ethernet, drivers, FreeRTOS/Demo
|
exclude-dirs: ethernet, drivers, FreeRTOS/Demo, WinPCap, libslirp-version.h, CMSIS, Trace_Recorder_Configuration, ThirdParty, conssole.h, syscalls.c, Demo_IP_Protocols, Reliance-Edge
|
||||||
|
|
||||||
spell-check:
|
spell-check:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
4
.github/workflows/core-checks.yml
vendored
4
.github/workflows/core-checks.yml
vendored
|
@ -5,13 +5,13 @@ on: [pull_request]
|
||||||
jobs:
|
jobs:
|
||||||
core-checker:
|
core-checker:
|
||||||
name: Check File Headers
|
name: Check File Headers
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
# Install python 3
|
# Install python 3
|
||||||
- name: Tool Setup
|
- name: Tool Setup
|
||||||
uses: actions/setup-python@v2
|
uses: actions/setup-python@v2
|
||||||
with:
|
with:
|
||||||
python-version: 3.7.10
|
python-version: 3.8
|
||||||
architecture: x64
|
architecture: x64
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
3
.github/workflows/formatting.yml
vendored
3
.github/workflows/formatting.yml
vendored
|
@ -16,7 +16,7 @@ jobs:
|
||||||
if: ${{ github.event.issue.pull_request &&
|
if: ${{ github.event.issue.pull_request &&
|
||||||
( ( github.event.comment.body == '/bot run uncrustify' ) ||
|
( ( github.event.comment.body == '/bot run uncrustify' ) ||
|
||||||
( github.event.comment.body == '/bot run formatting' ) ) }}
|
( github.event.comment.body == '/bot run formatting' ) ) }}
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Apply Formatting Fix of Common Files
|
- name: Apply Formatting Fix of Common Files
|
||||||
id: check-formatting-of-common
|
id: check-formatting-of-common
|
||||||
|
@ -32,4 +32,3 @@ jobs:
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
with:
|
with:
|
||||||
exclude-dirs: ethernet, drivers, FreeRTOS/Demo
|
exclude-dirs: ethernet, drivers, FreeRTOS/Demo
|
||||||
|
|
4
.github/workflows/kernel-unit-tests.yml
vendored
4
.github/workflows/kernel-unit-tests.yml
vendored
|
@ -4,7 +4,7 @@ on: [push, pull_request]
|
||||||
jobs:
|
jobs:
|
||||||
run-submodule:
|
run-submodule:
|
||||||
name: FreeRTOS/Source Submodule Revision
|
name: FreeRTOS/Source Submodule Revision
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Repository
|
- name: Checkout Repository
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
@ -39,7 +39,7 @@ jobs:
|
||||||
path: FreeRTOS/Test/CMock/build/coverage
|
path: FreeRTOS/Test/CMock/build/coverage
|
||||||
run-upstream:
|
run-upstream:
|
||||||
name: FreeRTOS-Kernel Main Branch
|
name: FreeRTOS-Kernel Main Branch
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Repository
|
- name: Checkout Repository
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
|
@ -200,12 +200,14 @@ void main_tcp_echo_client_tasks( void )
|
||||||
|
|
||||||
/* Called by FreeRTOS+TCP when the network connects or disconnects. Disconnect
|
/* Called by FreeRTOS+TCP when the network connects or disconnects. Disconnect
|
||||||
* events are only received if implemented in the MAC driver. */
|
* events are only received if implemented in the MAC driver. */
|
||||||
|
/* *INDENT-OFF* */
|
||||||
#if defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 )
|
#if defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 )
|
||||||
void vApplicationIPNetworkEventHook_Multi( eIPCallbackEvent_t eNetworkEvent,
|
void vApplicationIPNetworkEventHook_Multi( eIPCallbackEvent_t eNetworkEvent,
|
||||||
struct xNetworkEndPoint * pxEndPoint )
|
struct xNetworkEndPoint * pxEndPoint )
|
||||||
#else
|
#else
|
||||||
void vApplicationIPNetworkEventHook( eIPCallbackEvent_t eNetworkEvent )
|
void vApplicationIPNetworkEventHook( eIPCallbackEvent_t eNetworkEvent )
|
||||||
#endif /* defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 ) */
|
#endif /* defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 ) */
|
||||||
|
/* *INDENT-ON* */
|
||||||
{
|
{
|
||||||
uint32_t ulIPAddress, ulNetMask, ulGatewayAddress, ulDNSServerAddress;
|
uint32_t ulIPAddress, ulNetMask, ulGatewayAddress, ulDNSServerAddress;
|
||||||
char cBuffer[ 16 ];
|
char cBuffer[ 16 ];
|
||||||
|
|
|
@ -51,6 +51,7 @@
|
||||||
/* FreeRTOS+TCP includes. */
|
/* FreeRTOS+TCP includes. */
|
||||||
#include "FreeRTOS_IP.h"
|
#include "FreeRTOS_IP.h"
|
||||||
#include "FreeRTOS_Sockets.h"
|
#include "FreeRTOS_Sockets.h"
|
||||||
|
#include "TCPEchoClient_SingleTasks.h"
|
||||||
|
|
||||||
/* Exclude the whole file if FreeRTOSIPConfig.h is configured to use UDP only. */
|
/* Exclude the whole file if FreeRTOSIPConfig.h is configured to use UDP only. */
|
||||||
#if ( ipconfigUSE_TCP == 1 )
|
#if ( ipconfigUSE_TCP == 1 )
|
||||||
|
|
|
@ -28,15 +28,16 @@
|
||||||
#include <task.h>
|
#include <task.h>
|
||||||
|
|
||||||
#include <FreeRTOSConfig.h>
|
#include <FreeRTOSConfig.h>
|
||||||
|
#include <FreeRTOSIPConfig.h>
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#include "main_networking.h"
|
||||||
|
|
||||||
void vApplicationStackOverflowHook( TaskHandle_t pxTask,
|
void vApplicationStackOverflowHook( TaskHandle_t pxTask,
|
||||||
char * pcTaskName );
|
char * pcTaskName );
|
||||||
void vApplicationMallocFailedHook( void );
|
|
||||||
void main_tcp_echo_client_tasks( void );
|
|
||||||
void vApplicationIdleHook( void );
|
void vApplicationIdleHook( void );
|
||||||
void vApplicationTickHook( void );
|
void vApplicationTickHook( void );
|
||||||
|
|
||||||
|
|
|
@ -44,6 +44,7 @@
|
||||||
#include "FreeRTOS_Sockets.h"
|
#include "FreeRTOS_Sockets.h"
|
||||||
#include "TCPEchoClient_SingleTasks.h"
|
#include "TCPEchoClient_SingleTasks.h"
|
||||||
#include "CMSIS/CMSDK_CM3.h"
|
#include "CMSIS/CMSDK_CM3.h"
|
||||||
|
#include "main_networking.h"
|
||||||
|
|
||||||
/* Echo client task parameters */
|
/* Echo client task parameters */
|
||||||
#define mainECHO_CLIENT_TASK_STACK_SIZE ( configMINIMAL_STACK_SIZE * 2 ) /* Not used in the linux port. */
|
#define mainECHO_CLIENT_TASK_STACK_SIZE ( configMINIMAL_STACK_SIZE * 2 ) /* Not used in the linux port. */
|
||||||
|
@ -211,17 +212,19 @@ BaseType_t xTasksAlreadyCreated = pdFALSE;
|
||||||
|
|
||||||
/* Called by FreeRTOS+TCP when the network connects or disconnects. Disconnect
|
/* Called by FreeRTOS+TCP when the network connects or disconnects. Disconnect
|
||||||
* events are only received if implemented in the MAC driver. */
|
* events are only received if implemented in the MAC driver. */
|
||||||
|
/* *INDENT-OFF* */
|
||||||
#if defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 )
|
#if defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 )
|
||||||
void vApplicationIPNetworkEventHook_Multi( eIPCallbackEvent_t eNetworkEvent,
|
void vApplicationIPNetworkEventHook_Multi( eIPCallbackEvent_t eNetworkEvent,
|
||||||
struct xNetworkEndPoint * pxEndPoint )
|
struct xNetworkEndPoint * pxEndPoint )
|
||||||
#else
|
#else
|
||||||
void vApplicationIPNetworkEventHook( eIPCallbackEvent_t eNetworkEvent )
|
void vApplicationIPNetworkEventHook( eIPCallbackEvent_t eNetworkEvent )
|
||||||
#endif /* defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 ) */
|
#endif /* defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 ) */
|
||||||
|
/* *INDENT-ON* */
|
||||||
{
|
{
|
||||||
uint32_t ulIPAddress;
|
uint32_t ulIPAddress = 0U;
|
||||||
uint32_t ulNetMask;
|
uint32_t ulNetMask = 0U;
|
||||||
uint32_t ulGatewayAddress;
|
uint32_t ulGatewayAddress = 0U;
|
||||||
uint32_t ulDNSServerAddress;
|
uint32_t ulDNSServerAddress = 0U;
|
||||||
char cBuffer[ 16 ];
|
char cBuffer[ 16 ];
|
||||||
|
|
||||||
#if defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 )
|
#if defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 )
|
||||||
|
@ -275,7 +278,7 @@ BaseType_t xTasksAlreadyCreated = pdFALSE;
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
UBaseType_t uxRand( void )
|
static UBaseType_t uxRand( void )
|
||||||
{
|
{
|
||||||
const uint32_t ulMultiplier = 0x015a4e35UL, ulIncrement = 1UL;
|
const uint32_t ulMultiplier = 0x015a4e35UL, ulIncrement = 1UL;
|
||||||
|
|
||||||
|
@ -317,7 +320,7 @@ static void prvMiscInitialisation( void )
|
||||||
|
|
||||||
#if ( ipconfigUSE_LLMNR != 0 ) || ( ipconfigUSE_NBNS != 0 ) || ( ipconfigDHCP_REGISTER_HOSTNAME == 1 )
|
#if ( ipconfigUSE_LLMNR != 0 ) || ( ipconfigUSE_NBNS != 0 ) || ( ipconfigDHCP_REGISTER_HOSTNAME == 1 )
|
||||||
|
|
||||||
const char * pcApplicationHostnameHook( void )
|
static const char * pcApplicationHostnameHook( void )
|
||||||
{
|
{
|
||||||
/* Assign the name "FreeRTOS" to this network node. This function will
|
/* Assign the name "FreeRTOS" to this network node. This function will
|
||||||
* be called during the DHCP: the machine will be registered with an IP
|
* be called during the DHCP: the machine will be registered with an IP
|
||||||
|
|
|
@ -0,0 +1,33 @@
|
||||||
|
/*
|
||||||
|
* FreeRTOS V202212.00
|
||||||
|
* Copyright (C) 2020 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.
|
||||||
|
*
|
||||||
|
* https://www.FreeRTOS.org
|
||||||
|
* https://github.com/FreeRTOS
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef MAIN_NETWORKING_H
|
||||||
|
#define MAIN_NETWORKING_H
|
||||||
|
|
||||||
|
/* Initializes the network and starts the TCP task. */
|
||||||
|
void main_tcp_echo_client_tasks( void );
|
||||||
|
|
||||||
|
#endif /* MAIN_NETWORKING_H */
|
|
@ -36,7 +36,8 @@ extern void uart_init( void );
|
||||||
extern int main( void );
|
extern int main( void );
|
||||||
|
|
||||||
void _start( void );
|
void _start( void );
|
||||||
void __attribute__( ( weak ) ) EthernetISR( void );
|
void EthernetISR( void );
|
||||||
|
void Reset_Handler( void );
|
||||||
|
|
||||||
extern uint32_t _estack, _sidata, _sdata, _edata, _sbss, _ebss;
|
extern uint32_t _estack, _sidata, _sdata, _edata, _sbss, _ebss;
|
||||||
|
|
||||||
|
@ -65,7 +66,7 @@ void Reset_Handler( void )
|
||||||
_start();
|
_start();
|
||||||
}
|
}
|
||||||
|
|
||||||
void prvGetRegistersFromStack( uint32_t * pulFaultStackAddress )
|
__attribute__( ( used ) ) static void prvGetRegistersFromStack( uint32_t * pulFaultStackAddress )
|
||||||
{
|
{
|
||||||
/* These are volatile to try and prevent the compiler/linker optimizing them
|
/* These are volatile to try and prevent the compiler/linker optimizing them
|
||||||
* away as the variables never actually get used. If the debugger won't show the
|
* away as the variables never actually get used. If the debugger won't show the
|
||||||
|
@ -138,28 +139,28 @@ void Default_Handler2( void )
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Default_Handler3( void )
|
static void Default_Handler3( void )
|
||||||
{
|
{
|
||||||
for( ; ; )
|
for( ; ; )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Default_Handler4( void )
|
static void Default_Handler4( void )
|
||||||
{
|
{
|
||||||
for( ; ; )
|
for( ; ; )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Default_Handler5( void )
|
static void Default_Handler5( void )
|
||||||
{
|
{
|
||||||
for( ; ; )
|
for( ; ; )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Default_Handler6( void )
|
static void Default_Handler6( void )
|
||||||
{
|
{
|
||||||
for( ; ; )
|
for( ; ; )
|
||||||
{
|
{
|
||||||
|
|
|
@ -29,6 +29,17 @@ extern "C" {
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
void uart_init( void );
|
||||||
|
int _fstat( int file );
|
||||||
|
int _read( int file,
|
||||||
|
char * buf,
|
||||||
|
int len );
|
||||||
|
int _write( int file,
|
||||||
|
char * buf,
|
||||||
|
int len );
|
||||||
|
|
||||||
|
void * _sbrk( int incr );
|
||||||
|
|
||||||
typedef struct UART_t
|
typedef struct UART_t
|
||||||
{
|
{
|
||||||
volatile uint32_t DATA;
|
volatile uint32_t DATA;
|
||||||
|
|
|
@ -226,12 +226,14 @@ void vApplicationIdleHook( void )
|
||||||
|
|
||||||
/* Called by FreeRTOS+TCP when the network connects or disconnects. Disconnect
|
/* Called by FreeRTOS+TCP when the network connects or disconnects. Disconnect
|
||||||
* events are only received if implemented in the MAC driver. */
|
* events are only received if implemented in the MAC driver. */
|
||||||
|
/* *INDENT-OFF* */
|
||||||
#if defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 )
|
#if defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 )
|
||||||
void vApplicationIPNetworkEventHook_Multi( eIPCallbackEvent_t eNetworkEvent,
|
void vApplicationIPNetworkEventHook_Multi( eIPCallbackEvent_t eNetworkEvent,
|
||||||
struct xNetworkEndPoint * pxEndPoint )
|
struct xNetworkEndPoint * pxEndPoint )
|
||||||
#else
|
#else
|
||||||
void vApplicationIPNetworkEventHook( eIPCallbackEvent_t eNetworkEvent )
|
void vApplicationIPNetworkEventHook( eIPCallbackEvent_t eNetworkEvent )
|
||||||
#endif /* defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 ) */
|
#endif /* defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 ) */
|
||||||
|
/* *INDENT-ON* */
|
||||||
{
|
{
|
||||||
uint32_t ulIPAddress, ulNetMask, ulGatewayAddress, ulDNSServerAddress;
|
uint32_t ulIPAddress, ulNetMask, ulGatewayAddress, ulDNSServerAddress;
|
||||||
char cBuffer[ 16 ];
|
char cBuffer[ 16 ];
|
||||||
|
|
|
@ -109,12 +109,14 @@ int main( void )
|
||||||
|
|
||||||
/* Called by FreeRTOS+TCP when the network connects or disconnects. Disconnect
|
/* Called by FreeRTOS+TCP when the network connects or disconnects. Disconnect
|
||||||
* events are only received if implemented in the MAC driver. */
|
* events are only received if implemented in the MAC driver. */
|
||||||
|
/* *INDENT-OFF* */
|
||||||
#if defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 )
|
#if defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 )
|
||||||
void vApplicationIPNetworkEventHook_Multi( eIPCallbackEvent_t eNetworkEvent,
|
void vApplicationIPNetworkEventHook_Multi( eIPCallbackEvent_t eNetworkEvent,
|
||||||
struct xNetworkEndPoint * pxEndPoint )
|
struct xNetworkEndPoint * pxEndPoint )
|
||||||
#else
|
#else
|
||||||
void vApplicationIPNetworkEventHook( eIPCallbackEvent_t eNetworkEvent )
|
void vApplicationIPNetworkEventHook( eIPCallbackEvent_t eNetworkEvent )
|
||||||
#endif /* defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 ) */
|
#endif /* defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 ) */
|
||||||
|
/* *INDENT-ON* */
|
||||||
{
|
{
|
||||||
( void ) eNetworkEvent;
|
( void ) eNetworkEvent;
|
||||||
}
|
}
|
||||||
|
|
|
@ -161,12 +161,14 @@ int main( void )
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
/* *INDENT-OFF* */
|
||||||
#if defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 )
|
#if defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 )
|
||||||
void vApplicationIPNetworkEventHook_Multi( eIPCallbackEvent_t eNetworkEvent,
|
void vApplicationIPNetworkEventHook_Multi( eIPCallbackEvent_t eNetworkEvent,
|
||||||
struct xNetworkEndPoint * pxEndPoint )
|
struct xNetworkEndPoint * pxEndPoint )
|
||||||
#else
|
#else
|
||||||
void vApplicationIPNetworkEventHook( eIPCallbackEvent_t eNetworkEvent )
|
void vApplicationIPNetworkEventHook( eIPCallbackEvent_t eNetworkEvent )
|
||||||
#endif /* defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 ) */
|
#endif /* defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 ) */
|
||||||
|
/* *INDENT-ON* */
|
||||||
{
|
{
|
||||||
static BaseType_t xTasksAlreadyCreated = pdFALSE;
|
static BaseType_t xTasksAlreadyCreated = pdFALSE;
|
||||||
|
|
||||||
|
|
|
@ -161,12 +161,14 @@ int main( void )
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
/* *INDENT-OFF* */
|
||||||
#if defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 )
|
#if defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 )
|
||||||
void vApplicationIPNetworkEventHook_Multi( eIPCallbackEvent_t eNetworkEvent,
|
void vApplicationIPNetworkEventHook_Multi( eIPCallbackEvent_t eNetworkEvent,
|
||||||
struct xNetworkEndPoint * pxEndPoint )
|
struct xNetworkEndPoint * pxEndPoint )
|
||||||
#else
|
#else
|
||||||
void vApplicationIPNetworkEventHook( eIPCallbackEvent_t eNetworkEvent )
|
void vApplicationIPNetworkEventHook( eIPCallbackEvent_t eNetworkEvent )
|
||||||
#endif /* defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 ) */
|
#endif /* defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 ) */
|
||||||
|
/* *INDENT-ON* */
|
||||||
{
|
{
|
||||||
static BaseType_t xTasksAlreadyCreated = pdFALSE;
|
static BaseType_t xTasksAlreadyCreated = pdFALSE;
|
||||||
|
|
||||||
|
|
|
@ -136,12 +136,14 @@ uint32_t ulApplicationGetNextSequenceNumber( uint32_t ulSourceAddress,
|
||||||
|
|
||||||
/* Called by FreeRTOS+TCP when the network connects or disconnects. Disconnect
|
/* Called by FreeRTOS+TCP when the network connects or disconnects. Disconnect
|
||||||
* events are only received if implemented in the MAC driver. */
|
* events are only received if implemented in the MAC driver. */
|
||||||
|
/* *INDENT-OFF* */
|
||||||
#if defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 )
|
#if defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 )
|
||||||
void vApplicationIPNetworkEventHook_Multi( eIPCallbackEvent_t eNetworkEvent,
|
void vApplicationIPNetworkEventHook_Multi( eIPCallbackEvent_t eNetworkEvent,
|
||||||
struct xNetworkEndPoint * pxEndPoint )
|
struct xNetworkEndPoint * pxEndPoint )
|
||||||
#else
|
#else
|
||||||
void vApplicationIPNetworkEventHook( eIPCallbackEvent_t eNetworkEvent )
|
void vApplicationIPNetworkEventHook( eIPCallbackEvent_t eNetworkEvent )
|
||||||
#endif
|
#endif
|
||||||
|
/* *INDENT-ON* */
|
||||||
{
|
{
|
||||||
uint32_t ulIPAddress, ulNetMask, ulGatewayAddress, ulDNSServerAddress;
|
uint32_t ulIPAddress, ulNetMask, ulGatewayAddress, ulDNSServerAddress;
|
||||||
char cBuffer[ 16 ];
|
char cBuffer[ 16 ];
|
||||||
|
|
|
@ -138,5 +138,5 @@ $(COVINFO) : $(LCOV_LIST)
|
||||||
$(LCOV_LIST) : zero_coverage
|
$(LCOV_LIST) : zero_coverage
|
||||||
make -C $(subst .info,,$(@F)) lcov
|
make -C $(subst .info,,$(@F)) lcov
|
||||||
|
|
||||||
lcovhtml : $(COVINFO) | directories
|
lcovhtml : directories $(COVINFO)
|
||||||
genhtml $(COVINFO) $(LCOV_OPTS) --output-directory $(COVERAGE_DIR) --quiet
|
genhtml $(COVINFO) $(LCOV_OPTS) --output-directory $(COVERAGE_DIR) --quiet
|
||||||
|
|
|
@ -45,6 +45,7 @@ CFLAGS += -fstack-protector-all
|
||||||
CFLAGS += -Wformat -Werror=format-security -Werror=array-bounds -Wno-unused-function
|
CFLAGS += -Wformat -Werror=format-security -Werror=array-bounds -Wno-unused-function
|
||||||
|
|
||||||
ifeq ($(ENABLE_SANITIZER),1)
|
ifeq ($(ENABLE_SANITIZER),1)
|
||||||
|
export ASAN_OPTIONS = detect_leaks=0
|
||||||
CFLAGS += -fsanitize=address,undefined -fsanitize-recover=address
|
CFLAGS += -fsanitize=address,undefined -fsanitize-recover=address
|
||||||
CFLAGS += -O3 -ggdb3
|
CFLAGS += -O3 -ggdb3
|
||||||
CPPFLAGS += -D_FORTIFY_SOURCE=2
|
CPPFLAGS += -D_FORTIFY_SOURCE=2
|
||||||
|
|
|
@ -305,8 +305,10 @@ void test_prvSelectHighestPriorityTask_assert_scheduler_running_false( void )
|
||||||
TCB_t unblockedTCB[ configNUMBER_OF_CORES ] = { 0 };
|
TCB_t unblockedTCB[ configNUMBER_OF_CORES ] = { 0 };
|
||||||
|
|
||||||
unblockedTCB[ 0 ].uxCriticalNesting = 0;
|
unblockedTCB[ 0 ].uxCriticalNesting = 0;
|
||||||
|
unblockedTCB[ 1 ].uxCriticalNesting = 0;
|
||||||
|
|
||||||
pxCurrentTCBs[ 0 ] = &unblockedTCB[ 0 ];
|
pxCurrentTCBs[ 0 ] = &unblockedTCB[ 0 ];
|
||||||
|
pxCurrentTCBs[ 1 ] = &unblockedTCB[ 1 ];
|
||||||
|
|
||||||
xSchedulerRunning = pdFALSE; /* causes the assert */
|
xSchedulerRunning = pdFALSE; /* causes the assert */
|
||||||
uxSchedulerSuspended = pdFALSE;
|
uxSchedulerSuspended = pdFALSE;
|
||||||
|
|
|
@ -65,7 +65,7 @@ extern volatile BaseType_t xYieldPendings[ configNUMBER_OF_CORES ];
|
||||||
extern List_t xTasksWaitingTermination;
|
extern List_t xTasksWaitingTermination;
|
||||||
extern List_t xSuspendedTaskList;
|
extern List_t xSuspendedTaskList;
|
||||||
extern List_t xPendingReadyList;
|
extern List_t xPendingReadyList;
|
||||||
extern BaseType_t xPendedTicks;
|
extern TickType_t xPendedTicks;
|
||||||
extern List_t xDelayedTaskList1;
|
extern List_t xDelayedTaskList1;
|
||||||
extern List_t xDelayedTaskList2;
|
extern List_t xDelayedTaskList2;
|
||||||
extern List_t * pxDelayedTaskList;
|
extern List_t * pxDelayedTaskList;
|
||||||
|
@ -1270,7 +1270,7 @@ void test_coverage_prvAddNewTaskToReadyList_create_more_idle_tasks_than_cores( v
|
||||||
prvAddNewTaskToReadyList( &xTaskTCBs[ configNUMBER_OF_CORES ] );
|
prvAddNewTaskToReadyList( &xTaskTCBs[ configNUMBER_OF_CORES ] );
|
||||||
|
|
||||||
/* Validations. The run state of this task is still taskTASK_NOT_RUNNING. */
|
/* Validations. The run state of this task is still taskTASK_NOT_RUNNING. */
|
||||||
configASSERT( xTaskTCBs[ configNUMBER_OF_CORES + 1U ].xTaskRunState == taskTASK_NOT_RUNNING );
|
configASSERT( xTaskTCBs[ configNUMBER_OF_CORES ].xTaskRunState == taskTASK_NOT_RUNNING );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -3085,8 +3085,9 @@ void test_coverage_prvCheckTasksWaitingTermination_delete_running_task( void )
|
||||||
|
|
||||||
/* Free the resource allocated in this test. Since running task can't be deleted,
|
/* Free the resource allocated in this test. Since running task can't be deleted,
|
||||||
* there won't have double free assertion. */
|
* there won't have double free assertion. */
|
||||||
vPortFree( pxTaskTCB );
|
|
||||||
vPortFree( pxTaskTCB->pxStack );
|
vPortFree( pxTaskTCB->pxStack );
|
||||||
|
vPortFree( pxTaskTCB );
|
||||||
|
|
||||||
/* Verify memory allocate count in tearDown function. */
|
/* Verify memory allocate count in tearDown function. */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -488,59 +488,6 @@ void test_coverage_prvYieldCore_runstate_eq_yielding( void )
|
||||||
TEST_ASSERT_EQUAL( 1, task.xTaskRunState ); /* nothing has changed */
|
TEST_ASSERT_EQUAL( 1, task.xTaskRunState ); /* nothing has changed */
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief This test ensures that if xTask Delete is called and the scheuler is
|
|
||||||
* running while the task runstate is more that the configNUMBER_OF_CORES,
|
|
||||||
* the core is not yielded, but it is removed from the
|
|
||||||
* stateList, the eventList and inserted in the taskwaitingtermination
|
|
||||||
* list, the uxdeletedtaskwaiting for cleanup is not changed
|
|
||||||
* uxtasknumber is increased
|
|
||||||
*
|
|
||||||
* <b>Coverage</b>
|
|
||||||
* @code{c}
|
|
||||||
* vTaskDelete( xTaskToDelete);
|
|
||||||
*
|
|
||||||
* if( ( xSchedulerRunning != pdFALSE ) &&
|
|
||||||
* ( taskTASK_IS_RUNNING( pxTCB ) == pdTRUE ) )
|
|
||||||
*
|
|
||||||
* @endcode
|
|
||||||
*
|
|
||||||
* configNUMBER_OF_CORES > 1
|
|
||||||
* INCLUDE_vTaskDelete = 1
|
|
||||||
*/
|
|
||||||
void test_coverage_vTaskDelete_task_not_running( void )
|
|
||||||
{
|
|
||||||
TCB_t task;
|
|
||||||
TaskHandle_t xTaskToDelete;
|
|
||||||
|
|
||||||
task.xTaskRunState = configNUMBER_OF_CORES + 2; /* running on core 1 */
|
|
||||||
xTaskToDelete = &task;
|
|
||||||
pxCurrentTCBs[ 0 ] = &task;
|
|
||||||
|
|
||||||
xSchedulerRunning = pdTRUE;
|
|
||||||
|
|
||||||
uxDeletedTasksWaitingCleanUp = 0;
|
|
||||||
uxTaskNumber = 1;
|
|
||||||
|
|
||||||
/* Test Expectations */
|
|
||||||
vFakePortEnterCriticalSection_Expect();
|
|
||||||
uxListRemove_ExpectAnyArgsAndReturn( 0 );
|
|
||||||
listLIST_ITEM_CONTAINER_ExpectAnyArgsAndReturn( NULL );
|
|
||||||
|
|
||||||
/* if task != taskTaskNOT_RUNNING */
|
|
||||||
vListInsertEnd_ExpectAnyArgs();
|
|
||||||
vPortCurrentTaskDying_ExpectAnyArgs();
|
|
||||||
|
|
||||||
vFakePortExitCriticalSection_Expect();
|
|
||||||
|
|
||||||
/* API Call */
|
|
||||||
vTaskDelete( xTaskToDelete );
|
|
||||||
|
|
||||||
/* Test Verifications */
|
|
||||||
TEST_ASSERT_EQUAL( 1, uxDeletedTasksWaitingCleanUp );
|
|
||||||
TEST_ASSERT_EQUAL( 2, uxTaskNumber );
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This test ensures that when we call eTaskGetState with a task that is
|
* @brief This test ensures that when we call eTaskGetState with a task that is
|
||||||
* not running eReady is returned
|
* not running eReady is returned
|
||||||
|
|
|
@ -56,8 +56,8 @@ extern List_t pxReadyTasksLists[ configMAX_PRIORITIES ];
|
||||||
extern List_t xDelayedTaskList1;
|
extern List_t xDelayedTaskList1;
|
||||||
extern List_t * pxDelayedTaskList;
|
extern List_t * pxDelayedTaskList;
|
||||||
extern UBaseType_t uxSchedulerSuspended;
|
extern UBaseType_t uxSchedulerSuspended;
|
||||||
extern BaseType_t xTickCount;
|
extern TickType_t xTickCount;
|
||||||
extern BaseType_t xNextTaskUnblockTime;
|
extern TickType_t xNextTaskUnblockTime;
|
||||||
extern BaseType_t xYieldPendings[ configNUMBER_OF_CORES ];
|
extern BaseType_t xYieldPendings[ configNUMBER_OF_CORES ];
|
||||||
|
|
||||||
/* =========================== EXTERN FUNCTIONS =========================== */
|
/* =========================== EXTERN FUNCTIONS =========================== */
|
||||||
|
|
|
@ -1305,7 +1305,7 @@ void test_task_delete_tasks_different_priorities_delete_low( void )
|
||||||
verifySmpTask( &xTaskHandles[ 0 ], eRunning, 0 );
|
verifySmpTask( &xTaskHandles[ 0 ], eRunning, 0 );
|
||||||
|
|
||||||
/* Verify task T[i] is in the deleted state */
|
/* Verify task T[i] is in the deleted state */
|
||||||
verifySmpTask( &xTaskHandles[ i ], eDeleted, -1 );
|
/* verifySmpTask( &xTaskHandles[ i ], eDeleted, -1 ); */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Remains 0 since all deleted tasks were not running */
|
/* Remains 0 since all deleted tasks were not running */
|
||||||
|
|
|
@ -431,7 +431,7 @@ void verifyIdleTask( BaseType_t index,
|
||||||
TaskStatus_t xTaskDetails;
|
TaskStatus_t xTaskDetails;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
vTaskGetInfo( xIdleTaskHandles[ index ], &xTaskDetails, pdTRUE, eInvalid );
|
vTaskGetInfo( xIdleTaskHandles[ index ], &xTaskDetails, pdFALSE, eInvalid );
|
||||||
#ifdef configIDLE_TASK_NAME
|
#ifdef configIDLE_TASK_NAME
|
||||||
ret = strncmp( xTaskDetails.xHandle->pcTaskName, configIDLE_TASK_NAME, strlen( configIDLE_TASK_NAME ) );
|
ret = strncmp( xTaskDetails.xHandle->pcTaskName, configIDLE_TASK_NAME, strlen( configIDLE_TASK_NAME ) );
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -267,7 +267,7 @@ static TimerHandle_t create_timer()
|
||||||
{
|
{
|
||||||
uint32_t pvTimerID = 0;
|
uint32_t pvTimerID = 0;
|
||||||
TimerHandle_t xTimer = NULL;
|
TimerHandle_t xTimer = NULL;
|
||||||
StaticTimer_t pxTimerBuffer[ sizeof( StaticTimer_t ) ];
|
static StaticTimer_t pxTimerBuffer[ sizeof( StaticTimer_t ) ];
|
||||||
QueueHandle_t queue_handle = ( QueueHandle_t ) 3; /* not zero */
|
QueueHandle_t queue_handle = ( QueueHandle_t ) 3; /* not zero */
|
||||||
|
|
||||||
/*pvPortMalloc_ExpectAndReturn( sizeof( Timer_t ), &pxNewTimer ); */
|
/*pvPortMalloc_ExpectAndReturn( sizeof( Timer_t ), &pxNewTimer ); */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue