Skip to content

Commit 50dc9d5

Browse files
committed
Fix nasa#375, Progress on pc-rtems generic target support
1 parent 591f5af commit 50dc9d5

File tree

7 files changed

+116
-0
lines changed

7 files changed

+116
-0
lines changed

fsw/pc-rtems/src/cfe_psp_start.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,27 @@ struct rtems_bsdnet_config rtems_bsdnet_config = {
9999
/*
100100
* Network configuration
101101
*/
102+
/* TODO move to a separate file */
103+
#include <rtems.h>
104+
#include <bsp.h>
105+
106+
#include "bsp_rtems_cfg.h"
107+
108+
#include <drvmgr/drvmgr.h>
109+
110+
/* Configure Driver manager */
111+
#if defined(RTEMS_DRVMGR_STARTUP) && defined(LEON3) /* if --drvmgr was given to configure */
112+
/* Add Timer and UART Driver for this example */
113+
#ifdef CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
114+
#define CONFIGURE_DRIVER_AMBAPP_GAISLER_GPTIMER
115+
#endif
116+
#ifdef CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
117+
#define CONFIGURE_DRIVER_AMBAPP_GAISLER_APBUART
118+
#endif
119+
#endif
120+
#define CONFIGURE_DRIVER_AMBAPP_GAISLER_GRETH /* TODO make dependent on OSAL NETWORK config */
121+
122+
#include <drvmgr/drvmgr_confdefs.h>
102123

103124
/* Set default IP and MAC if not defined */
104125
#ifndef CONFIG_ETH_IP

unit-test-coverage/ut-stubs/inc/PCS_bsdnet.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,7 @@ extern int PCS_rtems_fxp_attach(struct PCS_rtems_bsdnet_ifconfig *cfg, i
2727
extern void PCS_rtems_bsdnet_do_dhcp_failsafe(void);
2828
extern int PCS_rtems_bsdnet_initialize_network(void);
2929
extern const char *PCS_rtems_status_text(PCS_rtems_status_code sc);
30+
extern void PCS_rtems_bsdnet_show_inet_routes(void);
31+
extern void PCS_rtems_bsdnet_show_if_stats(void);
3032

3133
#endif
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/************************************************************************
2+
* NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes”
3+
*
4+
* Copyright (c) 2020 United States Government as represented by the
5+
* Administrator of the National Aeronautics and Space Administration.
6+
* All Rights Reserved.
7+
*
8+
* Licensed under the Apache License, Version 2.0 (the "License"); you may
9+
* not use this file except in compliance with the License. You may obtain
10+
* a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
************************************************************************/
18+
19+
/* PSP coverage stub replacement for drvmgr.h */
20+
#ifndef OVERRIDE_DRVMGR_H
21+
#define OVERRIDE_DRVMGR_H
22+
23+
#endif
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/************************************************************************
2+
* NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes”
3+
*
4+
* Copyright (c) 2020 United States Government as represented by the
5+
* Administrator of the National Aeronautics and Space Administration.
6+
* All Rights Reserved.
7+
*
8+
* Licensed under the Apache License, Version 2.0 (the "License"); you may
9+
* not use this file except in compliance with the License. You may obtain
10+
* a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
************************************************************************/
18+
19+
/* PSP coverage stub replacement for drvmgr_confdefs.h */
20+
#ifndef OVERRIDE_DRVMGR_CONFDEFS_H
21+
#define OVERRIDE_DRVMGR_CONFDEFS_H
22+
23+
#endif
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/************************************************************************
2+
* NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes”
3+
*
4+
* Copyright (c) 2020 United States Government as represented by the
5+
* Administrator of the National Aeronautics and Space Administration.
6+
* All Rights Reserved.
7+
*
8+
* Licensed under the Apache License, Version 2.0 (the "License"); you may
9+
* not use this file except in compliance with the License. You may obtain
10+
* a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
************************************************************************/
18+
19+
/* PSP coverage stub replacement for confdefs.h */
20+
#ifndef OVERRIDE_CONFDEFS_H
21+
#define OVERRIDE_CONFDEFS_H
22+
23+
#endif

unit-test-coverage/ut-stubs/override_inc/rtems/rtems_bsdnet.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,7 @@
2626
#define rtems_bsdnet_do_dhcp_failsafe PCS_rtems_bsdnet_do_dhcp_failsafe
2727
#define rtems_bsdnet_initialize_network PCS_rtems_bsdnet_initialize_network
2828
#define rtems_fxp_attach PCS_rtems_fxp_attach
29+
#define rtems_bsdnet_show_inet_routes PCS_rtems_bsdnet_show_inet_routes
30+
#define rtems_bsdnet_show_if_stats PCS_rtems_bsdnet_show_if_stats
2931

3032
#endif

unit-test-coverage/ut-stubs/src/PCS_bsdnet_stubs.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,28 @@ int PCS_rtems_bsdnet_initialize_network(void)
5252
return UT_GenStub_GetReturnValue(PCS_rtems_bsdnet_initialize_network, int);
5353
}
5454

55+
/*
56+
* ----------------------------------------------------
57+
* Generated stub function for PCS_rtems_bsdnet_show_if_stats()
58+
* ----------------------------------------------------
59+
*/
60+
void PCS_rtems_bsdnet_show_if_stats(void)
61+
{
62+
63+
UT_GenStub_Execute(PCS_rtems_bsdnet_show_if_stats, Basic, NULL);
64+
}
65+
66+
/*
67+
* ----------------------------------------------------
68+
* Generated stub function for PCS_rtems_bsdnet_show_inet_routes()
69+
* ----------------------------------------------------
70+
*/
71+
void PCS_rtems_bsdnet_show_inet_routes(void)
72+
{
73+
74+
UT_GenStub_Execute(PCS_rtems_bsdnet_show_inet_routes, Basic, NULL);
75+
}
76+
5577
/*
5678
* ----------------------------------------------------
5779
* Generated stub function for PCS_rtems_fxp_attach()

0 commit comments

Comments
 (0)