remove the last set_fs() in common code, and remove it for x86 and powerpc v3

Linus Torvalds torvalds at linux-foundation.org
Sat Sep 5 04:42:42 AEST 2020


On Fri, Sep 4, 2020 at 10:58 AM Alexey Dobriyan <adobriyan at gmail.com> wrote:
>
> set_fs() is older than some kernel hackers!
>
>         $ cd linux-0.11/
>         $ find . -type f -name '*.h' | xargs grep -e set_fs -w -n -A3

Oh, it's older than that. It was there (as set_fs) in 0.10, and may
even predate that. But sadly, I don't have tar-balls for 0.02 and
0.03, so can't check.

The actual use of %fs as the user space segment is already there in
0.01, but there was no 'set_fs()'. That was a simpler and more direct
time, and "get_fs()" looked like this back then:

  #define _fs() ({ \
  register unsigned short __res; \
  __asm__("mov %%fs,%%ax":"=a" (__res):); \
  __res;})

and all the setting was basically part of the kernel entry asm and. Lovely.

                 Linus


More information about the Linuxppc-dev mailing list