ppc: Introduce LOAD_REG_IMMEDIATE() macro for ppc64

When loading the fw_cfg address with just lis, addi sequence,
we get the high address bits as 0xffffffff on ppc64.

Use the full double word immediate load sequence on ppc64.

v2:
* Rename from load() to LOAD_REG_IMMEDIATE() to match Linux.
  Suggested by Alex.
* Move to ppc/asmdefs.h for future use elsewhere.

Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Acked-by: Alexander Graf <agraf@suse.de>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@944 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
Andreas Färber
2010-11-02 22:13:24 +00:00
committed by Andreas Färber
parent cb897515cc
commit 814bcd10cd
2 changed files with 24 additions and 22 deletions

View File

@@ -75,6 +75,19 @@
/* MISC */
/************************************************************************/
#ifdef __powerpc64__
#define LOAD_REG_IMMEDIATE(D, x) \
lis (D), (x)@highest ; \
ori (D), (D), (x)@higher ; \
sldi (D), (D), 32 ; \
oris (D), (D), (x)@h ; \
ori (D), (D), (x)@l
#else
#define LOAD_REG_IMMEDIATE(D, x) \
lis (D), HA(x) ; \
addi (D), (D), LO(x)
#endif
#ifndef __darwin__
#define GLOBL( name ) .globl name ; name
#define EXTERN( name ) name