]> git.baikalelectronics.ru Git - uboot.git/commit
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)
commitd1d4f16f2d07a2d149be7790d0babb63096c69ac
tree36fc2ee04566c78fe4c36b04d0632f560b63ecc3
parent8da3d0a33c4f4bf393f26c5c8601af29f81ceee3
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