Skip to content

Commit bd47cdb

Browse files
committed
xtensa: move section symbols to asm/sections.h
Introduce asm/sections.h and move section declarations to this header from setup.c. Assign section symbols char array type uniformly and drop address operator from section symbol references in code. Sort headers in setup.c while at it. Signed-off-by: Max Filippov <[email protected]>
1 parent 431d1a3 commit bd47cdb

File tree

2 files changed

+70
-71
lines changed

2 files changed

+70
-71
lines changed

arch/xtensa/include/asm/sections.h

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
3+
#ifndef _XTENSA_SECTIONS_H
4+
#define _XTENSA_SECTIONS_H
5+
6+
#include <asm-generic/sections.h>
7+
8+
#ifdef CONFIG_VECTORS_ADDR
9+
extern char _WindowVectors_text_start[];
10+
extern char _WindowVectors_text_end[];
11+
extern char _DebugInterruptVector_text_start[];
12+
extern char _DebugInterruptVector_text_end[];
13+
extern char _KernelExceptionVector_text_start[];
14+
extern char _KernelExceptionVector_text_end[];
15+
extern char _UserExceptionVector_text_start[];
16+
extern char _UserExceptionVector_text_end[];
17+
extern char _DoubleExceptionVector_text_start[];
18+
extern char _DoubleExceptionVector_text_end[];
19+
extern char _exception_text_start[];
20+
extern char _exception_text_end[];
21+
extern char _Level2InterruptVector_text_start[];
22+
extern char _Level2InterruptVector_text_end[];
23+
extern char _Level3InterruptVector_text_start[];
24+
extern char _Level3InterruptVector_text_end[];
25+
extern char _Level4InterruptVector_text_start[];
26+
extern char _Level4InterruptVector_text_end[];
27+
extern char _Level5InterruptVector_text_start[];
28+
extern char _Level5InterruptVector_text_end[];
29+
extern char _Level6InterruptVector_text_start[];
30+
extern char _Level6InterruptVector_text_end[];
31+
#endif
32+
#ifdef CONFIG_SMP
33+
extern char _SecondaryResetVector_text_start[];
34+
extern char _SecondaryResetVector_text_end[];
35+
#endif
36+
#ifdef CONFIG_XIP_KERNEL
37+
extern char _xip_start[];
38+
extern char _xip_end[];
39+
#endif
40+
41+
#endif

arch/xtensa/kernel/setup.c

Lines changed: 29 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,15 @@
3737
#include <asm/bootparam.h>
3838
#include <asm/kasan.h>
3939
#include <asm/mmu_context.h>
40-
#include <asm/processor.h>
41-
#include <asm/timex.h>
42-
#include <asm/platform.h>
4340
#include <asm/page.h>
44-
#include <asm/setup.h>
4541
#include <asm/param.h>
42+
#include <asm/platform.h>
43+
#include <asm/processor.h>
44+
#include <asm/sections.h>
45+
#include <asm/setup.h>
4646
#include <asm/smp.h>
4747
#include <asm/sysmem.h>
48+
#include <asm/timex.h>
4849

4950
#if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_DUMMY_CONSOLE)
5051
struct screen_info screen_info = {
@@ -271,49 +272,6 @@ void __init init_arch(bp_tag_t *bp_start)
271272
* Initialize system. Setup memory and reserve regions.
272273
*/
273274

274-
extern char _end[];
275-
extern char _stext[];
276-
extern char _WindowVectors_text_start;
277-
extern char _WindowVectors_text_end;
278-
extern char _DebugInterruptVector_text_start;
279-
extern char _DebugInterruptVector_text_end;
280-
extern char _KernelExceptionVector_text_start;
281-
extern char _KernelExceptionVector_text_end;
282-
extern char _UserExceptionVector_text_start;
283-
extern char _UserExceptionVector_text_end;
284-
extern char _DoubleExceptionVector_text_start;
285-
extern char _DoubleExceptionVector_text_end;
286-
extern char _exception_text_start;
287-
extern char _exception_text_end;
288-
#if XCHAL_EXCM_LEVEL >= 2
289-
extern char _Level2InterruptVector_text_start;
290-
extern char _Level2InterruptVector_text_end;
291-
#endif
292-
#if XCHAL_EXCM_LEVEL >= 3
293-
extern char _Level3InterruptVector_text_start;
294-
extern char _Level3InterruptVector_text_end;
295-
#endif
296-
#if XCHAL_EXCM_LEVEL >= 4
297-
extern char _Level4InterruptVector_text_start;
298-
extern char _Level4InterruptVector_text_end;
299-
#endif
300-
#if XCHAL_EXCM_LEVEL >= 5
301-
extern char _Level5InterruptVector_text_start;
302-
extern char _Level5InterruptVector_text_end;
303-
#endif
304-
#if XCHAL_EXCM_LEVEL >= 6
305-
extern char _Level6InterruptVector_text_start;
306-
extern char _Level6InterruptVector_text_end;
307-
#endif
308-
#ifdef CONFIG_SMP
309-
extern char _SecondaryResetVector_text_start;
310-
extern char _SecondaryResetVector_text_end;
311-
#endif
312-
#ifdef CONFIG_XIP_KERNEL
313-
extern char _xip_start[];
314-
extern char _xip_end[];
315-
#endif
316-
317275
static inline int __init_memblock mem_reserve(unsigned long start,
318276
unsigned long end)
319277
{
@@ -350,50 +308,50 @@ void __init setup_arch(char **cmdline_p)
350308

351309
#ifdef CONFIG_VECTORS_ADDR
352310
#ifdef SUPPORT_WINDOWED
353-
mem_reserve(__pa(&_WindowVectors_text_start),
354-
__pa(&_WindowVectors_text_end));
311+
mem_reserve(__pa(_WindowVectors_text_start),
312+
__pa(_WindowVectors_text_end));
355313
#endif
356314

357-
mem_reserve(__pa(&_DebugInterruptVector_text_start),
358-
__pa(&_DebugInterruptVector_text_end));
315+
mem_reserve(__pa(_DebugInterruptVector_text_start),
316+
__pa(_DebugInterruptVector_text_end));
359317

360-
mem_reserve(__pa(&_KernelExceptionVector_text_start),
361-
__pa(&_KernelExceptionVector_text_end));
318+
mem_reserve(__pa(_KernelExceptionVector_text_start),
319+
__pa(_KernelExceptionVector_text_end));
362320

363-
mem_reserve(__pa(&_UserExceptionVector_text_start),
364-
__pa(&_UserExceptionVector_text_end));
321+
mem_reserve(__pa(_UserExceptionVector_text_start),
322+
__pa(_UserExceptionVector_text_end));
365323

366-
mem_reserve(__pa(&_DoubleExceptionVector_text_start),
367-
__pa(&_DoubleExceptionVector_text_end));
324+
mem_reserve(__pa(_DoubleExceptionVector_text_start),
325+
__pa(_DoubleExceptionVector_text_end));
368326

369-
mem_reserve(__pa(&_exception_text_start),
370-
__pa(&_exception_text_end));
327+
mem_reserve(__pa(_exception_text_start),
328+
__pa(_exception_text_end));
371329
#if XCHAL_EXCM_LEVEL >= 2
372-
mem_reserve(__pa(&_Level2InterruptVector_text_start),
373-
__pa(&_Level2InterruptVector_text_end));
330+
mem_reserve(__pa(_Level2InterruptVector_text_start),
331+
__pa(_Level2InterruptVector_text_end));
374332
#endif
375333
#if XCHAL_EXCM_LEVEL >= 3
376-
mem_reserve(__pa(&_Level3InterruptVector_text_start),
377-
__pa(&_Level3InterruptVector_text_end));
334+
mem_reserve(__pa(_Level3InterruptVector_text_start),
335+
__pa(_Level3InterruptVector_text_end));
378336
#endif
379337
#if XCHAL_EXCM_LEVEL >= 4
380-
mem_reserve(__pa(&_Level4InterruptVector_text_start),
381-
__pa(&_Level4InterruptVector_text_end));
338+
mem_reserve(__pa(_Level4InterruptVector_text_start),
339+
__pa(_Level4InterruptVector_text_end));
382340
#endif
383341
#if XCHAL_EXCM_LEVEL >= 5
384-
mem_reserve(__pa(&_Level5InterruptVector_text_start),
385-
__pa(&_Level5InterruptVector_text_end));
342+
mem_reserve(__pa(_Level5InterruptVector_text_start),
343+
__pa(_Level5InterruptVector_text_end));
386344
#endif
387345
#if XCHAL_EXCM_LEVEL >= 6
388-
mem_reserve(__pa(&_Level6InterruptVector_text_start),
389-
__pa(&_Level6InterruptVector_text_end));
346+
mem_reserve(__pa(_Level6InterruptVector_text_start),
347+
__pa(_Level6InterruptVector_text_end));
390348
#endif
391349

392350
#endif /* CONFIG_VECTORS_ADDR */
393351

394352
#ifdef CONFIG_SMP
395-
mem_reserve(__pa(&_SecondaryResetVector_text_start),
396-
__pa(&_SecondaryResetVector_text_end));
353+
mem_reserve(__pa(_SecondaryResetVector_text_start),
354+
__pa(_SecondaryResetVector_text_end));
397355
#endif
398356
parse_early_param();
399357
bootmem_init();

0 commit comments

Comments
 (0)