|
@@ -45,24 +45,16 @@ jiffies = jiffies_64;
|
|
|
LONG(sym ## _end); \
|
|
LONG(sym ## _end); \
|
|
|
LONG(LOADADDR(section))
|
|
LONG(LOADADDR(section))
|
|
|
|
|
|
|
|
-/* Macro to define a section for a vector.
|
|
|
|
|
- *
|
|
|
|
|
- * Use of the MIN function catches the types of errors illustrated in
|
|
|
|
|
- * the following example:
|
|
|
|
|
- *
|
|
|
|
|
- * Assume the section .DoubleExceptionVector.literal is completely
|
|
|
|
|
- * full. Then a programmer adds code to .DoubleExceptionVector.text
|
|
|
|
|
- * that produces another literal. The final literal position will
|
|
|
|
|
- * overlay onto the first word of the adjacent code section
|
|
|
|
|
- * .DoubleExceptionVector.text. (In practice, the literals will
|
|
|
|
|
- * overwrite the code, and the first few instructions will be
|
|
|
|
|
- * garbage.)
|
|
|
|
|
|
|
+/*
|
|
|
|
|
+ * Macro to define a section for a vector. When CONFIG_VECTORS_OFFSET is
|
|
|
|
|
+ * defined code for every vector is located with other init data. At startup
|
|
|
|
|
+ * time head.S copies code for every vector to its final position according
|
|
|
|
|
+ * to description recorded in the corresponding RELOCATE_ENTRY.
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
#ifdef CONFIG_VECTORS_OFFSET
|
|
#ifdef CONFIG_VECTORS_OFFSET
|
|
|
-#define SECTION_VECTOR(sym, section, addr, max_prevsec_size, prevsec) \
|
|
|
|
|
- section addr : AT((MIN(LOADADDR(prevsec) + max_prevsec_size, \
|
|
|
|
|
- LOADADDR(prevsec) + SIZEOF(prevsec)) + 3) & ~ 3) \
|
|
|
|
|
|
|
+#define SECTION_VECTOR(sym, section, addr, prevsec) \
|
|
|
|
|
+ section addr : AT(((LOADADDR(prevsec) + SIZEOF(prevsec)) + 3) & ~ 3) \
|
|
|
{ \
|
|
{ \
|
|
|
. = ALIGN(4); \
|
|
. = ALIGN(4); \
|
|
|
sym ## _start = ABSOLUTE(.); \
|
|
sym ## _start = ABSOLUTE(.); \
|
|
@@ -112,26 +104,19 @@ SECTIONS
|
|
|
#if XCHAL_EXCM_LEVEL >= 6
|
|
#if XCHAL_EXCM_LEVEL >= 6
|
|
|
SECTION_VECTOR (.Level6InterruptVector.text, INTLEVEL6_VECTOR_VADDR)
|
|
SECTION_VECTOR (.Level6InterruptVector.text, INTLEVEL6_VECTOR_VADDR)
|
|
|
#endif
|
|
#endif
|
|
|
- SECTION_VECTOR (.DebugInterruptVector.literal, DEBUG_VECTOR_VADDR - 4)
|
|
|
|
|
SECTION_VECTOR (.DebugInterruptVector.text, DEBUG_VECTOR_VADDR)
|
|
SECTION_VECTOR (.DebugInterruptVector.text, DEBUG_VECTOR_VADDR)
|
|
|
- SECTION_VECTOR (.KernelExceptionVector.literal, KERNEL_VECTOR_VADDR - 4)
|
|
|
|
|
SECTION_VECTOR (.KernelExceptionVector.text, KERNEL_VECTOR_VADDR)
|
|
SECTION_VECTOR (.KernelExceptionVector.text, KERNEL_VECTOR_VADDR)
|
|
|
- SECTION_VECTOR (.UserExceptionVector.literal, USER_VECTOR_VADDR - 4)
|
|
|
|
|
SECTION_VECTOR (.UserExceptionVector.text, USER_VECTOR_VADDR)
|
|
SECTION_VECTOR (.UserExceptionVector.text, USER_VECTOR_VADDR)
|
|
|
- SECTION_VECTOR (.DoubleExceptionVector.literal, DOUBLEEXC_VECTOR_VADDR - 20)
|
|
|
|
|
SECTION_VECTOR (.DoubleExceptionVector.text, DOUBLEEXC_VECTOR_VADDR)
|
|
SECTION_VECTOR (.DoubleExceptionVector.text, DOUBLEEXC_VECTOR_VADDR)
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
|
|
+ IRQENTRY_TEXT
|
|
|
|
|
+ SOFTIRQENTRY_TEXT
|
|
|
|
|
+ ENTRY_TEXT
|
|
|
TEXT_TEXT
|
|
TEXT_TEXT
|
|
|
- VMLINUX_SYMBOL(__sched_text_start) = .;
|
|
|
|
|
- *(.sched.literal .sched.text)
|
|
|
|
|
- VMLINUX_SYMBOL(__sched_text_end) = .;
|
|
|
|
|
- VMLINUX_SYMBOL(__cpuidle_text_start) = .;
|
|
|
|
|
- *(.cpuidle.literal .cpuidle.text)
|
|
|
|
|
- VMLINUX_SYMBOL(__cpuidle_text_end) = .;
|
|
|
|
|
- VMLINUX_SYMBOL(__lock_text_start) = .;
|
|
|
|
|
- *(.spinlock.literal .spinlock.text)
|
|
|
|
|
- VMLINUX_SYMBOL(__lock_text_end) = .;
|
|
|
|
|
|
|
+ SCHED_TEXT
|
|
|
|
|
+ CPUIDLE_TEXT
|
|
|
|
|
+ LOCK_TEXT
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
_etext = .;
|
|
_etext = .;
|
|
@@ -196,8 +181,6 @@ SECTIONS
|
|
|
.KernelExceptionVector.text);
|
|
.KernelExceptionVector.text);
|
|
|
RELOCATE_ENTRY(_UserExceptionVector_text,
|
|
RELOCATE_ENTRY(_UserExceptionVector_text,
|
|
|
.UserExceptionVector.text);
|
|
.UserExceptionVector.text);
|
|
|
- RELOCATE_ENTRY(_DoubleExceptionVector_literal,
|
|
|
|
|
- .DoubleExceptionVector.literal);
|
|
|
|
|
RELOCATE_ENTRY(_DoubleExceptionVector_text,
|
|
RELOCATE_ENTRY(_DoubleExceptionVector_text,
|
|
|
.DoubleExceptionVector.text);
|
|
.DoubleExceptionVector.text);
|
|
|
RELOCATE_ENTRY(_DebugInterruptVector_text,
|
|
RELOCATE_ENTRY(_DebugInterruptVector_text,
|
|
@@ -230,25 +213,19 @@ SECTIONS
|
|
|
|
|
|
|
|
SECTION_VECTOR (_WindowVectors_text,
|
|
SECTION_VECTOR (_WindowVectors_text,
|
|
|
.WindowVectors.text,
|
|
.WindowVectors.text,
|
|
|
- WINDOW_VECTORS_VADDR, 4,
|
|
|
|
|
|
|
+ WINDOW_VECTORS_VADDR,
|
|
|
.dummy)
|
|
.dummy)
|
|
|
- SECTION_VECTOR (_DebugInterruptVector_literal,
|
|
|
|
|
- .DebugInterruptVector.literal,
|
|
|
|
|
- DEBUG_VECTOR_VADDR - 4,
|
|
|
|
|
- SIZEOF(.WindowVectors.text),
|
|
|
|
|
- .WindowVectors.text)
|
|
|
|
|
SECTION_VECTOR (_DebugInterruptVector_text,
|
|
SECTION_VECTOR (_DebugInterruptVector_text,
|
|
|
.DebugInterruptVector.text,
|
|
.DebugInterruptVector.text,
|
|
|
DEBUG_VECTOR_VADDR,
|
|
DEBUG_VECTOR_VADDR,
|
|
|
- 4,
|
|
|
|
|
- .DebugInterruptVector.literal)
|
|
|
|
|
|
|
+ .WindowVectors.text)
|
|
|
#undef LAST
|
|
#undef LAST
|
|
|
#define LAST .DebugInterruptVector.text
|
|
#define LAST .DebugInterruptVector.text
|
|
|
#if XCHAL_EXCM_LEVEL >= 2
|
|
#if XCHAL_EXCM_LEVEL >= 2
|
|
|
SECTION_VECTOR (_Level2InterruptVector_text,
|
|
SECTION_VECTOR (_Level2InterruptVector_text,
|
|
|
.Level2InterruptVector.text,
|
|
.Level2InterruptVector.text,
|
|
|
INTLEVEL2_VECTOR_VADDR,
|
|
INTLEVEL2_VECTOR_VADDR,
|
|
|
- SIZEOF(LAST), LAST)
|
|
|
|
|
|
|
+ LAST)
|
|
|
# undef LAST
|
|
# undef LAST
|
|
|
# define LAST .Level2InterruptVector.text
|
|
# define LAST .Level2InterruptVector.text
|
|
|
#endif
|
|
#endif
|
|
@@ -256,7 +233,7 @@ SECTIONS
|
|
|
SECTION_VECTOR (_Level3InterruptVector_text,
|
|
SECTION_VECTOR (_Level3InterruptVector_text,
|
|
|
.Level3InterruptVector.text,
|
|
.Level3InterruptVector.text,
|
|
|
INTLEVEL3_VECTOR_VADDR,
|
|
INTLEVEL3_VECTOR_VADDR,
|
|
|
- SIZEOF(LAST), LAST)
|
|
|
|
|
|
|
+ LAST)
|
|
|
# undef LAST
|
|
# undef LAST
|
|
|
# define LAST .Level3InterruptVector.text
|
|
# define LAST .Level3InterruptVector.text
|
|
|
#endif
|
|
#endif
|
|
@@ -264,7 +241,7 @@ SECTIONS
|
|
|
SECTION_VECTOR (_Level4InterruptVector_text,
|
|
SECTION_VECTOR (_Level4InterruptVector_text,
|
|
|
.Level4InterruptVector.text,
|
|
.Level4InterruptVector.text,
|
|
|
INTLEVEL4_VECTOR_VADDR,
|
|
INTLEVEL4_VECTOR_VADDR,
|
|
|
- SIZEOF(LAST), LAST)
|
|
|
|
|
|
|
+ LAST)
|
|
|
# undef LAST
|
|
# undef LAST
|
|
|
# define LAST .Level4InterruptVector.text
|
|
# define LAST .Level4InterruptVector.text
|
|
|
#endif
|
|
#endif
|
|
@@ -272,7 +249,7 @@ SECTIONS
|
|
|
SECTION_VECTOR (_Level5InterruptVector_text,
|
|
SECTION_VECTOR (_Level5InterruptVector_text,
|
|
|
.Level5InterruptVector.text,
|
|
.Level5InterruptVector.text,
|
|
|
INTLEVEL5_VECTOR_VADDR,
|
|
INTLEVEL5_VECTOR_VADDR,
|
|
|
- SIZEOF(LAST), LAST)
|
|
|
|
|
|
|
+ LAST)
|
|
|
# undef LAST
|
|
# undef LAST
|
|
|
# define LAST .Level5InterruptVector.text
|
|
# define LAST .Level5InterruptVector.text
|
|
|
#endif
|
|
#endif
|
|
@@ -280,40 +257,23 @@ SECTIONS
|
|
|
SECTION_VECTOR (_Level6InterruptVector_text,
|
|
SECTION_VECTOR (_Level6InterruptVector_text,
|
|
|
.Level6InterruptVector.text,
|
|
.Level6InterruptVector.text,
|
|
|
INTLEVEL6_VECTOR_VADDR,
|
|
INTLEVEL6_VECTOR_VADDR,
|
|
|
- SIZEOF(LAST), LAST)
|
|
|
|
|
|
|
+ LAST)
|
|
|
# undef LAST
|
|
# undef LAST
|
|
|
# define LAST .Level6InterruptVector.text
|
|
# define LAST .Level6InterruptVector.text
|
|
|
#endif
|
|
#endif
|
|
|
- SECTION_VECTOR (_KernelExceptionVector_literal,
|
|
|
|
|
- .KernelExceptionVector.literal,
|
|
|
|
|
- KERNEL_VECTOR_VADDR - 4,
|
|
|
|
|
- SIZEOF(LAST), LAST)
|
|
|
|
|
-#undef LAST
|
|
|
|
|
SECTION_VECTOR (_KernelExceptionVector_text,
|
|
SECTION_VECTOR (_KernelExceptionVector_text,
|
|
|
.KernelExceptionVector.text,
|
|
.KernelExceptionVector.text,
|
|
|
KERNEL_VECTOR_VADDR,
|
|
KERNEL_VECTOR_VADDR,
|
|
|
- 4,
|
|
|
|
|
- .KernelExceptionVector.literal)
|
|
|
|
|
- SECTION_VECTOR (_UserExceptionVector_literal,
|
|
|
|
|
- .UserExceptionVector.literal,
|
|
|
|
|
- USER_VECTOR_VADDR - 4,
|
|
|
|
|
- SIZEOF(.KernelExceptionVector.text),
|
|
|
|
|
- .KernelExceptionVector.text)
|
|
|
|
|
|
|
+ LAST)
|
|
|
|
|
+#undef LAST
|
|
|
SECTION_VECTOR (_UserExceptionVector_text,
|
|
SECTION_VECTOR (_UserExceptionVector_text,
|
|
|
.UserExceptionVector.text,
|
|
.UserExceptionVector.text,
|
|
|
USER_VECTOR_VADDR,
|
|
USER_VECTOR_VADDR,
|
|
|
- 4,
|
|
|
|
|
- .UserExceptionVector.literal)
|
|
|
|
|
- SECTION_VECTOR (_DoubleExceptionVector_literal,
|
|
|
|
|
- .DoubleExceptionVector.literal,
|
|
|
|
|
- DOUBLEEXC_VECTOR_VADDR - 20,
|
|
|
|
|
- SIZEOF(.UserExceptionVector.text),
|
|
|
|
|
- .UserExceptionVector.text)
|
|
|
|
|
|
|
+ .KernelExceptionVector.text)
|
|
|
SECTION_VECTOR (_DoubleExceptionVector_text,
|
|
SECTION_VECTOR (_DoubleExceptionVector_text,
|
|
|
.DoubleExceptionVector.text,
|
|
.DoubleExceptionVector.text,
|
|
|
DOUBLEEXC_VECTOR_VADDR,
|
|
DOUBLEEXC_VECTOR_VADDR,
|
|
|
- 20,
|
|
|
|
|
- .DoubleExceptionVector.literal)
|
|
|
|
|
|
|
+ .UserExceptionVector.text)
|
|
|
|
|
|
|
|
. = (LOADADDR( .DoubleExceptionVector.text ) + SIZEOF( .DoubleExceptionVector.text ) + 3) & ~ 3;
|
|
. = (LOADADDR( .DoubleExceptionVector.text ) + SIZEOF( .DoubleExceptionVector.text ) + 3) & ~ 3;
|
|
|
|
|
|
|
@@ -323,7 +283,6 @@ SECTIONS
|
|
|
SECTION_VECTOR (_SecondaryResetVector_text,
|
|
SECTION_VECTOR (_SecondaryResetVector_text,
|
|
|
.SecondaryResetVector.text,
|
|
.SecondaryResetVector.text,
|
|
|
RESET_VECTOR1_VADDR,
|
|
RESET_VECTOR1_VADDR,
|
|
|
- SIZEOF(.DoubleExceptionVector.text),
|
|
|
|
|
.DoubleExceptionVector.text)
|
|
.DoubleExceptionVector.text)
|
|
|
|
|
|
|
|
. = LOADADDR(.SecondaryResetVector.text)+SIZEOF(.SecondaryResetVector.text);
|
|
. = LOADADDR(.SecondaryResetVector.text)+SIZEOF(.SecondaryResetVector.text);
|
|
@@ -373,5 +332,4 @@ SECTIONS
|
|
|
|
|
|
|
|
/* Sections to be discarded */
|
|
/* Sections to be discarded */
|
|
|
DISCARDS
|
|
DISCARDS
|
|
|
- /DISCARD/ : { *(.exit.literal) }
|
|
|
|
|
}
|
|
}
|