On Wed, 24 Apr 2013 01:57:52 -0700, ghosh.subhasish wrote:
> Hi,
>
> I need to understand how to run a function on a core other than the
> current.
>
> For example, my main() function could be on core-0, but I want to run a
> function on core-1.
>
> There are APIs in Linux like sched_setaffinity();
>
> The platform that I am using does not have any OS or scheduler.
>
You are in for a treat. It's easy in Linux because there's a lot if
infrastructure already present; you have to accomplish equivalent
preparation yourself. Essentially, different cores are separate CPUs that
simply look at the same memory; they all execute some code (possibly even
same code, e.g. if they were all in idle loop or idle wait). If you want
another CPU to execute some routine you have prepared for it, you just
have to tell the dispatcher running on that CPU to jump to the memory
area where you placed your code.