]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/glsdk-u-boot.git/commit
x86: Use fs for global data
authorGraeme Russ <graeme.russ@gmail.com>
Sat, 31 Dec 2011 11:58:15 +0000 (22:58 +1100)
committerGraeme Russ <graeme.russ@gmail.com>
Wed, 4 Jan 2012 11:17:24 +0000 (22:17 +1100)
commit9e6c572ff03cda84c88663b23c7157d8b1f275ac
treea2c42fef142e1d179d47b20c35d3c331a279359a
parent240ab5aa2161df500e8950c2a4f392e84324f78a
x86: Use fs for global data

Use the base address of the 'F' segment as a pointer to the global data
structure. By adding the linear address (i.e. the 'D' segment address) as
the first word of the global data structure, the address of the global data
relative to the 'D' segment can be found simply, for example, by:

fs movl 0, %eax

This makes the gd 'pointer' writable prior to relocation (by reloading the
Global Desctriptor Table) which brings x86 into line with all other arches

NOTE: Writing to the gd 'pointer' is expensive (but we only do it
twice) but using it to access global data members (read and write) is
still fairly cheap

--
Changes for v2:
 - Rebased against changes made to patch #3
 - Removed extra indent
 - Tweaked commit message
arch/x86/cpu/cpu.c
arch/x86/cpu/start.S
arch/x86/include/asm/global_data.h
arch/x86/include/asm/processor.h
arch/x86/include/asm/u-boot-x86.h
arch/x86/lib/board.c