]> git.ipfire.org Git - people/ms/u-boot.git/commit - common/board_r.c
x86: board_r: Set the global data pointer after relocation
authorSimon Glass <sjg@chromium.org>
Mon, 16 Jan 2017 14:03:51 +0000 (07:03 -0700)
committerBin Meng <bmeng.cn@gmail.com>
Mon, 6 Feb 2017 03:38:46 +0000 (11:38 +0800)
commitfb92308b983d54f6275ae0ced0e6930dfcc5bdec
tree36fc2ee04566c78fe4c36b04d0632f560b63ecc3
parent4acff4524783d860d873e131057602e43b8294f9
x86: board_r: Set the global data pointer after relocation

Since 'gd' is just a normal variable on 64-bit x86, it is relocated by the
time we get to board_init_r(). The old 'gd' variable is passed in as
parameter to board_init_r(), presumably for this situation.

Assign it on 64-bit x86 so that gd points to the correct data.

Options to improve this:
- Make gd a fixed register and remove the board_init_r() parameter
- Make all archs use this board_init_r() parameter

The second has a TODO in the code. The first has a TODO in a future commit
('x86: Support global_data on x86_64')

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
common/board_r.c