From: Graeme Russ <graeme.russ@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 13/58] x86: Set up the global data pointer in C instead of asm
Date: Sat, 15 Dec 2012 09:36:44 +1100 [thread overview]
Message-ID: <50CBA9FC.2010900@gmail.com> (raw)
In-Reply-To: <1355467767-29575-14-git-send-email-sjg@chromium.org>
Hi Simon,
On 14/12/12 17:48, Simon Glass wrote:
> We currently assume that the global data pointer is at the start of
> struct global_data. We want to remove this restriction, and it is
> easiest to do this in C.
>
> Remove the asm code and add equivalent code in C.
>
> This idea was proposed by Graeme Russ here:
> http://patchwork.ozlabs.org/patch/199741/
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
> Changes in v2:
> - Add new patch to move gd pointer by C to asm on x86
>
> arch/x86/cpu/cpu.c | 4 +++-
> arch/x86/cpu/start.S | 6 ------
> 2 files changed, 3 insertions(+), 7 deletions(-)
>
> diff --git a/arch/x86/cpu/cpu.c b/arch/x86/cpu/cpu.c
> index 315e87a..6a23974 100644
> --- a/arch/x86/cpu/cpu.c
> +++ b/arch/x86/cpu/cpu.c
> @@ -100,7 +100,9 @@ void setup_gdt(gd_t *id, u64 *gdt_addr)
> gdt_addr[X86_GDT_ENTRY_32BIT_DS] = GDT_ENTRY(0xc093, 0, 0xfffff);
>
> /* FS: data, read/write, 4 GB, base (Global Data Pointer) */
> - gdt_addr[X86_GDT_ENTRY_32BIT_FS] = GDT_ENTRY(0xc093, (ulong)id, 0xfffff);
> + id->arch.gd_addr = id;
> + gdt_addr[X86_GDT_ENTRY_32BIT_FS] = GDT_ENTRY(0xc093,
> + (ulong)&id->arch.gd_addr, 0xfffff);
This patch needs to come before #12 as:
- gdt_addr[X86_GDT_ENTRY_32BIT_FS] = GDT_ENTRY(0xc093, (ulong)id, 0xfffff);
+ id->gd_addr = id;
+ gdt_addr[X86_GDT_ENTRY_32BIT_FS] = GDT_ENTRY(0xc093,
+ (ulong)&id->gd_addr, 0xfffff);
Then you can move gd_addr into arch-specific global data
Regards,
Graeme
next prev parent reply other threads:[~2012-12-14 22:36 UTC|newest]
Thread overview: 74+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-14 6:48 [U-Boot] [PATCH v2 0/58] Move arch-specific global data into its own structure Simon Glass
2012-12-14 6:48 ` [U-Boot] [PATCH v2 01/58] Add architecture-specific global data Simon Glass
2012-12-14 6:48 ` [U-Boot] [PATCH v2 02/58] at91: Move at91 global data into arch_global_data Simon Glass
2012-12-14 6:48 ` [U-Boot] [PATCH v2 03/58] arm: Move timer_rate_hz " Simon Glass
2012-12-14 6:48 ` [U-Boot] [PATCH v2 04/58] arm: Move tbu to arch_global_data Simon Glass
2012-12-14 6:48 ` [U-Boot] [PATCH v2 05/58] arm: Move tbl " Simon Glass
2012-12-14 6:48 ` [U-Boot] [PATCH v2 06/58] arm: Move lastinc " Simon Glass
2012-12-14 6:48 ` [U-Boot] [PATCH v2 07/58] arm: Move timer_reset_value " Simon Glass
2012-12-14 6:48 ` [U-Boot] [PATCH v2 08/58] ixp: Move timestamp " Simon Glass
2012-12-14 13:31 ` Marek Vasut
2012-12-17 20:31 ` Simon Glass
2012-12-14 6:48 ` [U-Boot] [PATCH v2 09/58] nds32: Drop tlb_addr from global data Simon Glass
2012-12-14 6:48 ` [U-Boot] [PATCH v2 10/58] arm: Move tlb_addr to arch_global_data Simon Glass
2013-02-01 20:23 ` Tom Rini
2013-02-01 20:58 ` Simon Glass
2012-12-14 6:48 ` [U-Boot] [PATCH v2 11/58] x86: Remove gdt_addr from arch_global_data Simon Glass
2012-12-14 6:48 ` [U-Boot] [PATCH v2 12/58] x86: Move gd_addr into arch_global_data Simon Glass
2012-12-14 22:32 ` Graeme Russ
2012-12-14 22:44 ` Simon Glass
2012-12-14 6:48 ` [U-Boot] [PATCH v2 13/58] x86: Set up the global data pointer in C instead of asm Simon Glass
2012-12-14 22:36 ` Graeme Russ [this message]
2012-12-14 6:48 ` [U-Boot] [PATCH v2 14/58] x86: Remove reset_status, relocoff from global_data Simon Glass
2012-12-14 6:48 ` [U-Boot] [PATCH v2 15/58] ppc: Move brg_clk to arch_global_data Simon Glass
2012-12-14 6:48 ` [U-Boot] [PATCH v2 16/58] ppc: Remove extra pci_clk fields from global_data Simon Glass
2012-12-14 6:48 ` [U-Boot] [PATCH v2 17/58] ppc: Move clock fields to arch_global_data Simon Glass
2012-12-14 6:48 ` [U-Boot] [PATCH v2 18/58] ppc: Move mpc83xx " Simon Glass
2012-12-14 6:48 ` [U-Boot] [PATCH v2 19/58] ppc: Move lbc_clk and cpu " Simon Glass
2012-12-14 6:48 ` [U-Boot] [PATCH v2 20/58] ppc: m68k: Move i2c1_clk, i2c2_clk " Simon Glass
2012-12-14 6:48 ` [U-Boot] [PATCH v2 21/58] ppc: Move CONFIG_QE " Simon Glass
2012-12-14 6:48 ` [U-Boot] [PATCH v2 22/58] ppc: Move used_laws " Simon Glass
2012-12-14 6:48 ` [U-Boot] [PATCH v2 23/58] ppc: Move used_tlb_cams " Simon Glass
2012-12-14 6:48 ` [U-Boot] [PATCH v2 24/58] ppc: Move mpc5xxx clocks " Simon Glass
2012-12-14 6:48 ` [U-Boot] [PATCH v2 25/58] ppc: Move mpc512x " Simon Glass
2012-12-14 6:48 ` [U-Boot] [PATCH v2 26/58] ppc: Move mpc8220 " Simon Glass
2012-12-14 6:48 ` [U-Boot] [PATCH v2 27/58] ppc: Move reset_status " Simon Glass
2012-12-14 6:48 ` [U-Boot] [PATCH v2 28/58] ppc: Move arbiter fields " Simon Glass
2012-12-14 6:48 ` [U-Boot] [PATCH v2 29/58] ppc: Move dp_alloc_base, dp_alloc_top " Simon Glass
2012-12-14 6:48 ` [U-Boot] [PATCH v2 30/58] arm: Move uart_clk " Simon Glass
2012-12-14 6:49 ` [U-Boot] [PATCH v2 31/58] ppc: Move mirror_hack " Simon Glass
2012-12-14 6:49 ` [U-Boot] [PATCH v2 32/58] ppc: Remove console_addr from global data Simon Glass
2012-12-14 6:49 ` [U-Boot] [PATCH v2 33/58] ppc: Move fpga_state to arch_global_data Simon Glass
2012-12-14 6:49 ` [U-Boot] [PATCH v2 34/58] ppc: Move wdt_last " Simon Glass
2012-12-14 6:49 ` [U-Boot] [PATCH v2 35/58] ppc: Move kbd_status " Simon Glass
2012-12-14 6:49 ` [U-Boot] [PATCH v2 36/58] ppc: arm: Move sdhc_clk into arch_global_data Simon Glass
2012-12-14 6:49 ` [U-Boot] [PATCH v2 37/58] sparc: Drop kbd_status and reset_status from global_data Simon Glass
2012-12-14 6:49 ` [U-Boot] [PATCH v2 38/58] m68k: Move CONFIG_EXTRA_CLOCK to arch_global_data Simon Glass
2012-12-14 6:49 ` [U-Boot] [PATCH v2 39/58] mips: Move per_clk and dev_clk " Simon Glass
2012-12-14 6:49 ` [U-Boot] [PATCH v2 40/58] avr32: Move stack_end " Simon Glass
2012-12-14 6:49 ` [U-Boot] [PATCH v2 41/58] avr32: Move cpu_hz " Simon Glass
2012-12-14 6:49 ` [U-Boot] [PATCH v2 42/58] sandbox: Move ram_buf " Simon Glass
2012-12-14 6:49 ` [U-Boot] [PATCH v2 43/58] Add generic global_data Simon Glass
2012-12-14 6:49 ` [U-Boot] [PATCH v2 44/58] Only use fb_base if we have a display Simon Glass
2012-12-14 6:49 ` [U-Boot] [PATCH v2 45/58] arm: Use generic global_data Simon Glass
2012-12-14 6:49 ` [U-Boot] [PATCH v2 46/58] avr32: " Simon Glass
2013-02-14 10:29 ` Andreas Bießmann
2013-02-14 14:25 ` Simon Glass
2013-02-14 16:11 ` Andreas Bießmann
2013-02-14 16:15 ` Tom Rini
2013-02-28 1:22 ` Simon Glass
2012-12-14 6:49 ` [U-Boot] [PATCH v2 47/58] blackfin: " Simon Glass
2012-12-14 6:49 ` [U-Boot] [PATCH v2 48/58] m68k: " Simon Glass
2012-12-14 6:49 ` [U-Boot] [PATCH v2 49/58] microblaze: " Simon Glass
2012-12-14 10:45 ` Michal Simek
2012-12-14 16:41 ` Simon Glass
2012-12-14 6:49 ` [U-Boot] [PATCH v2 50/58] mips: " Simon Glass
2012-12-14 6:49 ` [U-Boot] [PATCH v2 51/58] nds32: " Simon Glass
2012-12-14 6:49 ` [U-Boot] [PATCH v2 52/58] nios2: " Simon Glass
2012-12-14 6:49 ` [U-Boot] [PATCH v2 53/58] openrisc: " Simon Glass
2012-12-14 6:49 ` [U-Boot] [PATCH v2 54/58] powerpc: " Simon Glass
2012-12-14 6:49 ` [U-Boot] [PATCH v2 55/58] sandbox: " Simon Glass
2012-12-14 6:49 ` [U-Boot] [PATCH v2 56/58] sh: " Simon Glass
2012-12-14 6:49 ` [U-Boot] [PATCH v2 57/58] sparc: " Simon Glass
2012-12-14 6:49 ` [U-Boot] [PATCH v2 58/58] x86: " Simon Glass
2013-02-04 16:36 ` [U-Boot] [PATCH v2 0/58] Move arch-specific global data into its own structure Tom Rini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=50CBA9FC.2010900@gmail.com \
--to=graeme.russ@gmail.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.