From 2730945b60f023c86677d24691053459d70c6bd1 Mon Sep 17 00:00:00 2001 From: Al En Date: Fri, 27 Nov 2015 17:52:50 +0100 Subject: [PATCH] fix kernel building with gcc newer than 4.6 --- linux-3.4/arch/arm/mach-sunxi/power/brom/Makefile | 2 +- linux-3.4/arch/arm/mach-sunxi/power/brom/resumes.h | 12 ++++++------ linux-3.4/drivers/gpu/ion/ion_cma_heap.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/linux-3.4/arch/arm/mach-sunxi/power/brom/Makefile b/linux-3.4/arch/arm/mach-sunxi/power/brom/Makefile index 5bce9ee0..f7518b65 100755 --- a/linux-3.4/arch/arm/mach-sunxi/power/brom/Makefile +++ b/linux-3.4/arch/arm/mach-sunxi/power/brom/Makefile @@ -5,7 +5,7 @@ targets := resumes.elf #use "-Os" flags. #Don't use "-O2" flags. -KBUILD_CFLAGS := -g -c -nostdlib -march=armv7-a -marm -fno-unwind-tables -fno-asynchronous-unwind-tables -mlittle-endian -O2 --min_array_alignment=4 --no_unaligned_access +KBUILD_CFLAGS := -g -c -nostdlib -march=armv7-a -marm -fno-unwind-tables -fno-asynchronous-unwind-tables -mlittle-endian -O2 -mno-unaligned-access #Include the cur dir. KBUILD_CPPFLAGS += -I. diff --git a/linux-3.4/arch/arm/mach-sunxi/power/brom/resumes.h b/linux-3.4/arch/arm/mach-sunxi/power/brom/resumes.h index 75732563..f1d63e21 100755 --- a/linux-3.4/arch/arm/mach-sunxi/power/brom/resumes.h +++ b/linux-3.4/arch/arm/mach-sunxi/power/brom/resumes.h @@ -62,15 +62,15 @@ typedef unsigned int __u32; typedef struct _Resume_file_head { __u32 jump_instruction; // one intruction jumping to real code - __u8 magic[8]; // ="eGON.BT0" or "eGON.BT1", not C-style string. + __u8 magic[8] __attribute__ ((aligned (4))); // ="eGON.BT0" or "eGON.BT1", not C-style string. __u32 check_sum; // generated by PC __u32 length; // generated by PC __u32 pub_head_size; // the size of resume_file_head_t - __u8 pub_head_vsn[4]; // the version of resume_file_head_t - __u8 file_head_vsn[4]; // the version of resume0_file_head_t or resume1_file_head_t - __u8 Resume_vsn[4]; // Resume version - __u8 eGON_vsn[4]; // eGON version - __u8 platform[8]; // platform information + __u8 pub_head_vsn[4] __attribute__ ((aligned (4))); // the version of resume_file_head_t + __u8 file_head_vsn[4] __attribute__ ((aligned (4))); // the version of resume0_file_head_t or resume1_file_head_t + __u8 Resume_vsn[4] __attribute__ ((aligned (4))); // Resume version + __u8 eGON_vsn[4] __attribute__ ((aligned (4))); // eGON version + __u8 platform[8] __attribute__ ((aligned (4))); // platform information }resume_file_head_t; extern const resume_file_head_t resume_head; diff --git a/linux-3.4/drivers/gpu/ion/ion_cma_heap.c b/linux-3.4/drivers/gpu/ion/ion_cma_heap.c index 86612c0c..2e95a9d1 100755 --- a/linux-3.4/drivers/gpu/ion/ion_cma_heap.c +++ b/linux-3.4/drivers/gpu/ion/ion_cma_heap.c @@ -48,7 +48,7 @@ struct ion_cma_buffer_info { struct page *dma_alloc_from_contiguous(struct device *dev, int count, unsigned int align); void __dma_clear_buffer(struct page *page, size_t size); -inline pgprot_t __get_dma_pgprot(struct dma_attrs *attrs, pgprot_t prot); +pgprot_t __get_dma_pgprot(struct dma_attrs *attrs, pgprot_t prot); void *__dma_alloc_remap(struct page *page, size_t size, gfp_t gfp, pgprot_t prot, const void *caller); void __dma_remap(struct page *page, size_t size, pgprot_t prot);