Re: get_current is __pure__, maybe __const__ even

William Lee Irwin III
2004-09-16T04:00:00Z

On Wed, 2004-09-15 at 22:36, William Lee Irwin III wrote:
>> Not over a call to schedule(). In the midst of schedule().

On Wed, Sep 15, 2004 at 11:49:38PM -0400, Albert Cahalan wrote:
> OK, let's look.
> First, there's fork/vfork/clone. At no point does
> "current" change. A process comes into existance
> with a ready-made current.
> Second, there's sched.c with context_switch().
> That does everything via switch_to, like so:
> /* Here we just switch the register state and the stack. */
> switch_to(prev, next, prev);
> No problem. Now I only need to show that switch_to()
> is safe. Unfortunately, it's arch-specific code.
> I'll look at a few examples...

gcc has to compile more than Linux. There has to be a rule for how this
works, not "gee, Linux will still work and get faster if we change this".

-- wli