[U-Boot] DECLARE_GLOBAL_DATA_PTR : move from source to Makefile

Kevin Du Huanpeng u74147 at gmail.com
Fri Oct 31 06:04:38 CET 2014


Hi, all,
I find this macro is found anywhere in the source, nearly one thousand
in the source, looks odd sometime.
I have a idea about this:

1. remove DECLARE_GLOBAL_DATA_PTR from source
    about one thousand DECLARE_GLOBAL_DATA_PTR in the source

2. add a file like, same as other archs.
arch/arm/include/asm/declare_global_data_ptr.h
- - - -
#ifndef __DECLARE_GLOBAL_DATA_PTR_H
#define __DECLARE_GLOBAL_DATA_PTR_H

#ifdef CONFIG_ARM64
#define DECLARE_GLOBAL_DATA_PTR         register volatile gd_t *gd asm ("x18")
#else
#define DECLARE_GLOBAL_DATA_PTR         register volatile gd_t *gd asm ("r9")
#endif

#endif
- - - -

3. modify top level Makefile
- - - -
UBOOTINCLUDE    := \
                -Iinclude \
                $(if $(KBUILD_SRC), -I$(srctree)/include) \
                -I$(srctree)/arch/$(ARCH)/include \
                -include $(srctree)/include/linux/kconfig.h \
+              -include $(srctree)/arch/$(ARCH)/include/asm/global_data.h
- - - -

...
Du Huanpeng
(+86)13719074147


More information about the U-Boot mailing list