Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PowerPC specific include in vxworks timebase #349

Open
skliper opened this issue Jun 9, 2022 · 2 comments
Open

PowerPC specific include in vxworks timebase #349

skliper opened this issue Jun 9, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@skliper
Copy link
Contributor

skliper commented Jun 9, 2022

Is your feature request related to a problem? Please describe.
There's a PowerPC specific include in the timbase_vxworks here:

#include <arch/ppc/vxPpcLib.h>

It would be good to make this module vxworks generic if possible.

Describe the solution you'd like
I'm not sure what's needed from that include, but if it is necessary it would be nice to abstract it out or ifdef it in only for PPC.

Describe alternatives you've considered
Nothing particular in mind, but any method to make that module generic vxworks would work.

Additional context
None

Requester Info
Jacob Hageman - NASA/GSFC

Ping @superolmo

@skliper skliper added the enhancement New feature or request label Jun 9, 2022
@jphickey
Copy link
Contributor

The problem is that the register used by this module is in fact PPC-specific - it is reading the timebase register directly in the powerPC CPU. Although there is a VxWorks-defined call to read it, its not really abstracted at all. (This is why it has to deal with the strange semantics of the register).

Suggestion is to rename this module to something like "vxworks_ppc_timebase" to better indicate that its use is limited to the VxWorks + PPC combination. A generic timebase could then be implemented separately for other CPUs.

@superolmo
Copy link

@jphickey For the LEON4 target I am working on, I defined my own vxTimeBaseGet function and added the following to cfe_psp_timebase_vxworks.c to make it work.

#if defined(LEONCOMPAT_VERSION)
extern void vxTimeBaseGet(uint32 *Tbu, uint32 *Tbl);
#endif

PSP could call a generic CFE_PSP_VXTimeBaseGet function that is implemented by the target specific implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants