Skip to content

Commit

Permalink
Fix nasa#375, Progress on pc-rtems generic target support
Browse files Browse the repository at this point in the history
  • Loading branch information
skliper committed Feb 26, 2024
1 parent 3e04956 commit fd39b8a
Show file tree
Hide file tree
Showing 7 changed files with 105 additions and 1 deletion.
21 changes: 21 additions & 0 deletions fsw/pc-rtems/src/cfe_psp_start.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,27 @@ struct rtems_bsdnet_config rtems_bsdnet_config = {
/*
* Network configuration
*/
/* TODO move to a separate file */
#include <rtems.h>
#include <bsp.h>

#include "bsp_rtems_cfg.h"

#include <drvmgr/drvmgr.h>

/* Configure Driver manager */
#if defined(RTEMS_DRVMGR_STARTUP) && defined(LEON3) /* if --drvmgr was given to configure */
/* Add Timer and UART Driver for this example */
#ifdef CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
#define CONFIGURE_DRIVER_AMBAPP_GAISLER_GPTIMER
#endif
#ifdef CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_DRIVER_AMBAPP_GAISLER_APBUART
#endif
#endif
#define CONFIGURE_DRIVER_AMBAPP_GAISLER_GRETH /* TODO make dependent on OSAL NETWORK config */

#include <drvmgr/drvmgr_confdefs.h>

/* Set default IP and MAC if not defined */
#ifndef CONFIG_ETH_IP
Expand Down
2 changes: 2 additions & 0 deletions unit-test-coverage/ut-stubs/inc/PCS_bsdnet.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,7 @@ extern int PCS_rtems_fxp_attach(struct PCS_rtems_bsdnet_ifconfig *, int)
extern void PCS_rtems_bsdnet_do_dhcp_failsafe(void);
extern int PCS_rtems_bsdnet_initialize_network(void);
extern const char *PCS_rtems_status_text(PCS_rtems_status_code);
extern void PCS_rtems_bsdnet_show_inet_routes(void);
extern void PCS_rtems_bsdnet_show_if_stats(void);

#endif
23 changes: 23 additions & 0 deletions unit-test-coverage/ut-stubs/override_inc/drvmgr/drvmgr.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/************************************************************************
* NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes”
*
* Copyright (c) 2020 United States Government as represented by the
* Administrator of the National Aeronautics and Space Administration.
* All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
************************************************************************/

/* PSP coverage stub replacement for drvmgr.h */
#ifndef OVERRIDE_DRVMGR_H
#define OVERRIDE_DRVMGR_H

#endif
23 changes: 23 additions & 0 deletions unit-test-coverage/ut-stubs/override_inc/drvmgr/drvmgr_confdefs.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/************************************************************************
* NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes”
*
* Copyright (c) 2020 United States Government as represented by the
* Administrator of the National Aeronautics and Space Administration.
* All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
************************************************************************/

/* PSP coverage stub replacement for drvmgr_confdefs.h */
#ifndef OVERRIDE_DRVMGR_CONFDEFS_H
#define OVERRIDE_DRVMGR_CONFDEFS_H

#endif
23 changes: 23 additions & 0 deletions unit-test-coverage/ut-stubs/override_inc/rtems/confdefs.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/************************************************************************
* NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes”
*
* Copyright (c) 2020 United States Government as represented by the
* Administrator of the National Aeronautics and Space Administration.
* All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
************************************************************************/

/* PSP coverage stub replacement for confdefs.h */
#ifndef OVERRIDE_CONFDEFS_H
#define OVERRIDE_CONFDEFS_H

#endif
2 changes: 2 additions & 0 deletions unit-test-coverage/ut-stubs/override_inc/rtems/rtems_bsdnet.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,7 @@
#define rtems_bsdnet_do_dhcp_failsafe PCS_rtems_bsdnet_do_dhcp_failsafe
#define rtems_bsdnet_initialize_network PCS_rtems_bsdnet_initialize_network
#define rtems_fxp_attach PCS_rtems_fxp_attach
#define rtems_bsdnet_show_inet_routes PCS_rtems_bsdnet_show_inet_routes
#define rtems_bsdnet_show_if_stats PCS_rtems_bsdnet_show_if_stats

#endif
12 changes: 11 additions & 1 deletion unit-test-coverage/ut-stubs/src/rtems-bsdnet-stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,14 @@ int PCS_rtems_bsdnet_initialize_network(void)
int PCS_rtems_fxp_attach(struct PCS_rtems_bsdnet_ifconfig *config, int attaching)
{
return UT_DEFAULT_IMPL(PCS_rtems_fxp_attach);
}
}

void PCS_rtems_bsdnet_show_inet_routes(void)
{
UT_DEFAULT_IMPL(PCS_rtems_bsdnet_show_inet_routes);
}

void PCS_rtems_bsdnet_show_if_stats(void)
{
UT_DEFAULT_IMPL(PCS_rtems_bsdnet_show_if_stats);
}

0 comments on commit fd39b8a

Please sign in to comment.