Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit de4f6e5b authored by Chris Zankel's avatar Chris Zankel
Browse files

[XTENSA] clean-up header files



The header files in the asm-xtensa directory are not clean and
'make headers_check' fails. This is a first patch to fix most of
the header files. It removes unnecessary include statements and
adds some that are required for building the kernel. The linker
script required some updates or the linking stage would fail.

Signed-off-by: default avatarChris Zankel <chris@zankel.net>
parent 176fd6c9
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -41,6 +41,7 @@
#include <asm/platform.h>
#include <asm/platform.h>
#include <asm/page.h>
#include <asm/page.h>
#include <asm/setup.h>
#include <asm/setup.h>
#include <asm/param.h>


#if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_DUMMY_CONSOLE)
#if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_DUMMY_CONSOLE)
struct screen_info screen_info = { 0, 24, 0, 0, 0, 80, 0, 0, 0, 24, 1, 16};
struct screen_info screen_info = { 0, 24, 0, 0, 0, 80, 0, 0, 0, 24, 1, 16};
+31 −47
Original line number Original line Diff line number Diff line
@@ -84,9 +84,7 @@ SECTIONS
  {
  {
    /* The .head.text section must be the first section! */
    /* The .head.text section must be the first section! */
    *(.head.text)
    *(.head.text)
    *(.literal)
    *(.literal .text)
    TEXT_TEXT
    *(.srom.text)
    VMLINUX_SYMBOL(__sched_text_start) = .;
    VMLINUX_SYMBOL(__sched_text_start) = .;
    *(.sched.literal .sched.text)
    *(.sched.literal .sched.text)
    VMLINUX_SYMBOL(__sched_text_end) = .;
    VMLINUX_SYMBOL(__sched_text_end) = .;
@@ -96,6 +94,7 @@ SECTIONS


  }
  }
  _etext = .;
  _etext = .;
  PROVIDE (etext = .);


  . = ALIGN(16);
  . = ALIGN(16);


@@ -103,32 +102,6 @@ SECTIONS


  /*  Relocation table */
  /*  Relocation table */


  . = ALIGN(16);
  __boot_reloc_table_start = ABSOLUTE(.);

  __relocate : {

    RELOCATE_ENTRY(_WindowVectors_text,
		   .WindowVectors.text);
#if 0
    RELOCATE_ENTRY(_KernelExceptionVector_literal,
		   .KernelExceptionVector.literal);
#endif
    RELOCATE_ENTRY(_KernelExceptionVector_text,
		   .KernelExceptionVector.text);
#if 0
    RELOCATE_ENTRY(_UserExceptionVector_literal,
		   .UserExceptionVector.literal);
#endif
    RELOCATE_ENTRY(_UserExceptionVector_text,
		   .UserExceptionVector.text);
    RELOCATE_ENTRY(_DoubleExceptionVector_literal,
		   .DoubleExceptionVector.literal);
    RELOCATE_ENTRY(_DoubleExceptionVector_text,
		   .DoubleExceptionVector.text);
  }
  __boot_reloc_table_end = ABSOLUTE(.) ;

  .fixup   : { *(.fixup) }
  .fixup   : { *(.fixup) }


  . = ALIGN(16);
  . = ALIGN(16);
@@ -145,8 +118,7 @@ SECTIONS
  _fdata = .;
  _fdata = .;
  .data :
  .data :
  {
  {
    DATA_DATA
    *(.data) CONSTRUCTORS
    CONSTRUCTORS
    . = ALIGN(XCHAL_ICACHE_LINESIZE);
    . = ALIGN(XCHAL_ICACHE_LINESIZE);
    *(.data.cacheline_aligned)
    *(.data.cacheline_aligned)
  }
  }
@@ -174,6 +146,22 @@ SECTIONS
    __tagtable_begin = .;
    __tagtable_begin = .;
    *(.taglist)
    *(.taglist)
    __tagtable_end = .;
    __tagtable_end = .;

    . = ALIGN(16);
    __boot_reloc_table_start = ABSOLUTE(.);

    RELOCATE_ENTRY(_WindowVectors_text,
		   .WindowVectors.text);
    RELOCATE_ENTRY(_KernelExceptionVector_text,
		   .KernelExceptionVector.text);
    RELOCATE_ENTRY(_UserExceptionVector_text,
		   .UserExceptionVector.text);
    RELOCATE_ENTRY(_DoubleExceptionVector_literal,
		   .DoubleExceptionVector.literal);
    RELOCATE_ENTRY(_DoubleExceptionVector_text,
		   .DoubleExceptionVector.text);
  
    __boot_reloc_table_end = ABSOLUTE(.) ;
  }
  }


  . = ALIGN(XCHAL_ICACHE_LINESIZE);
  . = ALIGN(XCHAL_ICACHE_LINESIZE);
@@ -194,16 +182,6 @@ SECTIONS


  SECURITY_INIT
  SECURITY_INIT


  . = ALIGN(4);

  __start___ftr_fixup = .;
  __ftr_fixup : { *(__ftr_fixup) }
  __stop___ftr_fixup = .;

  . = ALIGN(4096);
  __per_cpu_start = .;
  .data.percpu  : { *(.data.percpu) }
  __per_cpu_end = .;


#ifdef CONFIG_BLK_DEV_INITRD
#ifdef CONFIG_BLK_DEV_INITRD
  . = ALIGN(4096);
  . = ALIGN(4096);
@@ -212,6 +190,12 @@ SECTIONS
  __initramfs_end = .;
  __initramfs_end = .;
#endif
#endif


  . = ALIGN(4096);
  __per_cpu_start = .;
  .data.percpu  : { *(.data.percpu) }
  __per_cpu_end = .;


  /* We need this dummy segment here */
  /* We need this dummy segment here */


  . = ALIGN(4);
  . = ALIGN(4);
@@ -273,9 +257,9 @@ SECTIONS


  /* BSS section */
  /* BSS section */
  _bss_start = .;
  _bss_start = .;
  .sbss : { *(.sbss) *(.scommon) }
  .bss : { *(.bss.page_aligned) *(.bss) }
  .bss : { *(COMMON) *(.bss) }
  _bss_end = .;
  _bss_end = .;

  _end = .;
  _end = .;


  /* only used by the boot loader  */
  /* only used by the boot loader  */
@@ -293,16 +277,16 @@ SECTIONS
    *(.ResetVector.text)
    *(.ResetVector.text)
  }
  }



  /* Sections to be discarded */
  /* Sections to be discarded */
  /DISCARD/ :
  /DISCARD/ :
  {
  {
        *(.text.exit)
  	*(.exit.literal .exit.text)
	*(.text.exit.literal)
  	*(.exit.data)
        *(.data.exit)
        *(.exitcall.exit)
        *(.exitcall.exit)
  }
  }


  .xt.lit : { *(.xt.lit) }
  .xt.prop : { *(.xt.prop) }


  .debug  0 :  { *(.debug) }
  .debug  0 :  { *(.debug) }
  .line  0 :  { *(.line) }
  .line  0 :  { *(.line) }
+8 −7
Original line number Original line Diff line number Diff line
@@ -57,9 +57,6 @@ static inline int __ffs(unsigned long x)
	return 31 - __cntlz(x & -x);
	return 31 - __cntlz(x & -x);
}
}



#ifdef __KERNEL__

/*
/*
 * ffs: Find first bit set in word. This is defined the same way as
 * ffs: Find first bit set in word. This is defined the same way as
 * the libc and compiler builtin ffs routines, therefore
 * the libc and compiler builtin ffs routines, therefore
@@ -97,11 +94,15 @@ static inline int fls (unsigned int x)
#include <asm-generic/bitops/ext2-non-atomic.h>
#include <asm-generic/bitops/ext2-non-atomic.h>


#ifdef __XTENSA_EL__
#ifdef __XTENSA_EL__
# define ext2_set_bit_atomic(lock,nr,addr) test_and_set_bit((nr),(addr))
# define ext2_set_bit_atomic(lock,nr,addr)				\
# define ext2_clear_bit_atomic(lock,nr,addr) test_and_clear_bit((nr),(addr))
	test_and_set_bit((nr), (unsigned long*)(addr))
# define ext2_clear_bit_atomic(lock,nr,addr)				\
	test_and_clear_bit((nr), (unsigned long*)(addr))
#elif defined(__XTENSA_EB__)
#elif defined(__XTENSA_EB__)
# define ext2_set_bit_atomic(lock,nr,addr) test_and_set_bit((nr) ^ 0x18, (addr))
# define ext2_set_bit_atomic(lock,nr,addr)				\
# define ext2_clear_bit_atomic(lock,nr,addr) test_and_clear_bit((nr)^0x18,(addr))
	test_and_set_bit((nr) ^ 0x18, (unsigned long*)(addr))
# define ext2_clear_bit_atomic(lock,nr,addr)				\
	test_and_clear_bit((nr) ^ 0x18, (unsigned long*)(addr))
#else
#else
# error processor byte order undefined!
# error processor byte order undefined!
#endif
#endif
+2 −1
Original line number Original line Diff line number Diff line
@@ -12,6 +12,7 @@
#define _XTENSA_BYTEORDER_H
#define _XTENSA_BYTEORDER_H


#include <asm/types.h>
#include <asm/types.h>
#include <linux/compiler.h>


static __inline__ __attribute_const__ __u32 ___arch__swab32(__u32 x)
static __inline__ __attribute_const__ __u32 ___arch__swab32(__u32 x)
{
{
@@ -78,4 +79,4 @@ static __inline__ __attribute_const__ __u16 ___arch__swab16(__u16 x)
# error processor byte order undefined!
# error processor byte order undefined!
#endif
#endif


#endif /* __ASM_XTENSA_BYTEORDER_H */
#endif /* _XTENSA_BYTEORDER_H */
+1 −0
Original line number Original line Diff line number Diff line
@@ -14,6 +14,7 @@
#define _XTENSA_MMU_CONTEXT_H
#define _XTENSA_MMU_CONTEXT_H


#include <linux/stringify.h>
#include <linux/stringify.h>
#include <linux/sched.h>


#include <asm/pgtable.h>
#include <asm/pgtable.h>
#include <asm/cacheflush.h>
#include <asm/cacheflush.h>
Loading