get_/set_fs()

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

 



Hello!

> Hello,
> Can you explain this code segment?
>
> oldfs = get_fs(); set_fs(KERNEL_DS);
> err = file.f_op->read(&file, buf, *count, &file.f_pos);
> set_fs(oldfs);
>
> What is the functionality of get_fs() and set_fs().

I think, it saves and restores the FS register to a variable.
[in ix86 systems] FS is an extra segment register. KERNEL_DS is the
KERNEL data segment, with IOPL 0, so you can access it only in kernelspace.

				    Axt Attila
				    [http://axt.load.hu]



-
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