xinu-os / xinu

Repository for Xinu source code
http://xinu-os.org/
Other
432 stars 128 forks source link

Clkinit.c #20

Open LdB-ECM opened 6 years ago

LdB-ECM commented 6 years ago

I am trying to merge some stuff back to your master but that file (clkinit.c) causes problems it's being treated as if it's a system as in it is in the system directory.

The commenting about the #ifdef _XINU_PLATFORMX86 already makes the problem quite clear the file needs to be one of two choices 1.) Implementation made platform specific .. clkinit.c moves to each platform 2.) Place a callback function pointer in the header which start NULL

void (*clkinit_callback) (void) = NULL;

To do option 1 you can simply copy the existing clkinit.c into each platform and add to that platform makerules. You can then remove the file from the system directory. I would simply override the clkinit.c locally on the pi platform. The #ifdef could then also be removed from the x86 platform and throw out the #else code for that platform.

If we do option 2. All that needs to happen is the call back function pointer is expected to be set in platforminit.c as in "clkinit_callback = myplatform_clockInit". The x86 platform and I can then both set that callback function and the ClkInit.c code simple needs to say

if (clkinit_callback != NULL) clkinit_calback();

I don't mind which way it is done but obviously as the maintainer that is up to you