mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-28 15:41:40 +00:00
Blackfin: change global data register from P5 to P3
Since the Blackfin ABI favors higher scratch registers by default, use the last scratch register (P3) for global data rather than the first (P5). This allows the compiler's register allocator to use higher number scratch P registers, which in turn better matches the Blackfin instruction set, which reduces the size of U-Boot by more than 1024 bytes... Signed-off-by: Robin Getz <robin.getz@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
This commit is contained in:
parent
574b70df03
commit
c4db335c2e
5 changed files with 7 additions and 7 deletions
4
README
4
README
|
@ -3912,10 +3912,10 @@ For PowerPC, the following registers have specific use:
|
||||||
average for all boards 752 bytes for the whole U-Boot image,
|
average for all boards 752 bytes for the whole U-Boot image,
|
||||||
624 text + 127 data).
|
624 text + 127 data).
|
||||||
|
|
||||||
On Blackfin, the normal C ABI (except for P5) is followed as documented here:
|
On Blackfin, the normal C ABI (except for P3) is followed as documented here:
|
||||||
http://docs.blackfin.uclinux.org/doku.php?id=application_binary_interface
|
http://docs.blackfin.uclinux.org/doku.php?id=application_binary_interface
|
||||||
|
|
||||||
==> U-Boot will use P5 to hold a pointer to the global data
|
==> U-Boot will use P3 to hold a pointer to the global data
|
||||||
|
|
||||||
On ARM, the following registers are used:
|
On ARM, the following registers are used:
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ Design Notes on Exporting U-Boot Functions to Standalone Applications:
|
||||||
2. The pointer to the jump table is passed to the application in a
|
2. The pointer to the jump table is passed to the application in a
|
||||||
machine-dependent way. PowerPC, ARM, MIPS and Blackfin architectures
|
machine-dependent way. PowerPC, ARM, MIPS and Blackfin architectures
|
||||||
use a dedicated register to hold the pointer to the 'global_data'
|
use a dedicated register to hold the pointer to the 'global_data'
|
||||||
structure: r2 on PowerPC, r8 on ARM, k0 on MIPS, and P5 on Blackfin.
|
structure: r2 on PowerPC, r8 on ARM, k0 on MIPS, and P3 on Blackfin.
|
||||||
The x86 architecture does not use such a register; instead, the
|
The x86 architecture does not use such a register; instead, the
|
||||||
pointer to the 'global_data' structure is passed as 'argv[-1]'
|
pointer to the 'global_data' structure is passed as 'argv[-1]'
|
||||||
pointer.
|
pointer.
|
||||||
|
|
|
@ -127,14 +127,14 @@ gd_t *global_data;
|
||||||
: : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x * sizeof(void *)) : "r5");
|
: : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x * sizeof(void *)) : "r5");
|
||||||
#elif defined(CONFIG_BLACKFIN)
|
#elif defined(CONFIG_BLACKFIN)
|
||||||
/*
|
/*
|
||||||
* P5 holds the pointer to the global_data, P0 is a call-clobbered
|
* P3 holds the pointer to the global_data, P0 is a call-clobbered
|
||||||
* register
|
* register
|
||||||
*/
|
*/
|
||||||
#define EXPORT_FUNC(x) \
|
#define EXPORT_FUNC(x) \
|
||||||
asm volatile ( \
|
asm volatile ( \
|
||||||
" .globl _" #x "\n_" \
|
" .globl _" #x "\n_" \
|
||||||
#x ":\n" \
|
#x ":\n" \
|
||||||
" P0 = [P5 + %0]\n" \
|
" P0 = [P3 + %0]\n" \
|
||||||
" P0 = [P0 + %1]\n" \
|
" P0 = [P0 + %1]\n" \
|
||||||
" JUMP (P0)\n" \
|
" JUMP (P0)\n" \
|
||||||
: : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x * sizeof(void *)) : "P0");
|
: : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x * sizeof(void *)) : "P0");
|
||||||
|
|
|
@ -66,6 +66,6 @@ typedef struct global_data {
|
||||||
#define GD_FLG_LOGINIT 0x00020 /* Log Buf has been initialized */
|
#define GD_FLG_LOGINIT 0x00020 /* Log Buf has been initialized */
|
||||||
#define GD_FLG_DISABLE_CONSOLE 0x00040 /* Disable console (in & out) */
|
#define GD_FLG_DISABLE_CONSOLE 0x00040 /* Disable console (in & out) */
|
||||||
|
|
||||||
#define DECLARE_GLOBAL_DATA_PTR register gd_t * volatile gd asm ("P5")
|
#define DECLARE_GLOBAL_DATA_PTR register gd_t * volatile gd asm ("P3")
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -28,7 +28,7 @@ CONFIG_BFIN_BOOT_MODE := $(strip $(subst ",,$(CONFIG_BFIN_BOOT_MODE)))
|
||||||
CONFIG_ENV_OFFSET := $(strip $(subst ",,$(CONFIG_ENV_OFFSET)))
|
CONFIG_ENV_OFFSET := $(strip $(subst ",,$(CONFIG_ENV_OFFSET)))
|
||||||
CONFIG_ENV_SIZE := $(strip $(subst ",,$(CONFIG_ENV_SIZE)))
|
CONFIG_ENV_SIZE := $(strip $(subst ",,$(CONFIG_ENV_SIZE)))
|
||||||
|
|
||||||
PLATFORM_RELFLAGS += -ffixed-P5 -fomit-frame-pointer -mno-fdpic
|
PLATFORM_RELFLAGS += -ffixed-P3 -fomit-frame-pointer -mno-fdpic
|
||||||
PLATFORM_CPPFLAGS += -DCONFIG_BLACKFIN
|
PLATFORM_CPPFLAGS += -DCONFIG_BLACKFIN
|
||||||
|
|
||||||
LDFLAGS += --gc-sections
|
LDFLAGS += --gc-sections
|
||||||
|
|
Loading…
Reference in a new issue