Re: Question about software task-switching

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Donald A. Dade" wrote:
> 
> Hello,
> 
> I understand that Linux 2.4 has one TSS per CPU now, and that task
> switching is done in software. From looking at the relevant pieces of
> code, though, I cannot discern exactly where the state of all the
> registers is saved/loaded. I see a subset being being saved and loaded
> in switch_to(). What is it about x86 that allows this to work?

I don't think it's about x86 precisely. switch_to() only
needs to be concerned with registers the kernel might
change, not ones user-space code might change, because
-all- the user-space registers are saved to the user
stack when an interrupt occurs. So for example the
kernel segment registers don't need to be saved, since
they're always the same when in kernel mode. (I haven't
looked at the 2.4 task-switch code very thoroughly, so
I may be somewhat off-base here.)

Cheers,

-- Joe
# "You know how many remote castles there are along the
#  gorges? You can't MOVE for remote castles!" - Lu Tze re. Uberwald
# (Obsolete) Linux MM docs:
http://home.earthlink.net/~jknapka/linux-mm/vmoutline.html
-
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
IRC Channel:   irc.openprojects.net / #kernelnewbies
Web Page:      http://www.kernelnewbies.org/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux