Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 338d915

Browse files
committed
xtensa: add asm-prototypes.h
Move assembly source prototypes from xtensa_ksyms.c to asm/asm-prototypes.h, move corresponding EXPORT_SYMBOLs to the assembly sources and enable HAVE_ASM_MODVERSIONS for xtensa. Signed-off-by: Max Filippov <[email protected]>
1 parent 74e2537 commit 338d915

23 files changed

+60
-91
lines changed

arch/xtensa/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ config XTENSA
3535
select HAVE_ARCH_KCSAN
3636
select HAVE_ARCH_SECCOMP_FILTER
3737
select HAVE_ARCH_TRACEHOOK
38+
select HAVE_ASM_MODVERSIONS
3839
select HAVE_CONTEXT_TRACKING_USER
3940
select HAVE_DEBUG_KMEMLEAK
4041
select HAVE_DMA_CONTIGUOUS
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
#ifndef __ASM_PROTOTYPES_H
3+
#define __ASM_PROTOTYPES_H
4+
5+
#include <asm/cacheflush.h>
6+
#include <asm/checksum.h>
7+
#include <asm/ftrace.h>
8+
#include <asm/page.h>
9+
#include <asm/string.h>
10+
#include <asm/uaccess.h>
11+
12+
#include <asm-generic/asm-prototypes.h>
13+
14+
/*
15+
* gcc internal math functions
16+
*/
17+
long long __ashrdi3(long long, int);
18+
long long __ashldi3(long long, int);
19+
long long __bswapdi2(long long);
20+
int __bswapsi2(int);
21+
long long __lshrdi3(long long, int);
22+
int __divsi3(int, int);
23+
int __modsi3(int, int);
24+
int __mulsi3(int, int);
25+
unsigned int __udivsi3(unsigned int, unsigned int);
26+
unsigned int __umodsi3(unsigned int, unsigned int);
27+
unsigned long long __umulsidi3(unsigned int, unsigned int);
28+
29+
#endif /* __ASM_PROTOTYPES_H */

arch/xtensa/include/asm/asmmacro.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#ifndef _XTENSA_ASMMACRO_H
1212
#define _XTENSA_ASMMACRO_H
1313

14+
#include <asm-generic/export.h>
1415
#include <asm/core.h>
1516

1617
/*

arch/xtensa/kernel/mcount.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ ENTRY(_mcount)
7878
#error Unsupported Xtensa ABI
7979
#endif
8080
ENDPROC(_mcount)
81+
EXPORT_SYMBOL(_mcount)
8182

8283
ENTRY(ftrace_stub)
8384
abi_entry_default

arch/xtensa/kernel/xtensa_ksyms.c

Lines changed: 1 addition & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -13,71 +13,10 @@
1313
*/
1414

1515
#include <linux/module.h>
16-
#include <linux/string.h>
17-
#include <linux/mm.h>
18-
#include <linux/interrupt.h>
19-
#include <asm/irq.h>
20-
#include <linux/in6.h>
21-
22-
#include <linux/uaccess.h>
23-
#include <asm/cacheflush.h>
24-
#include <asm/checksum.h>
25-
#include <asm/dma.h>
26-
#include <asm/io.h>
27-
#include <asm/page.h>
28-
#include <asm/ftrace.h>
29-
#ifdef CONFIG_BLK_DEV_FD
30-
#include <asm/floppy.h>
31-
#endif
32-
#ifdef CONFIG_NET
33-
#include <net/checksum.h>
34-
#endif /* CONFIG_NET */
35-
36-
37-
/*
38-
* String functions
39-
*/
40-
EXPORT_SYMBOL(memset);
41-
EXPORT_SYMBOL(memcpy);
42-
EXPORT_SYMBOL(memmove);
43-
EXPORT_SYMBOL(__memset);
44-
EXPORT_SYMBOL(__memcpy);
45-
EXPORT_SYMBOL(__memmove);
46-
#ifdef CONFIG_ARCH_HAS_STRNCPY_FROM_USER
47-
EXPORT_SYMBOL(__strncpy_user);
48-
#endif
49-
EXPORT_SYMBOL(clear_page);
50-
EXPORT_SYMBOL(copy_page);
16+
#include <asm/pgtable.h>
5117

5218
EXPORT_SYMBOL(empty_zero_page);
5319

54-
/*
55-
* gcc internal math functions
56-
*/
57-
extern long long __ashrdi3(long long, int);
58-
extern long long __ashldi3(long long, int);
59-
extern long long __bswapdi2(long long);
60-
extern int __bswapsi2(int);
61-
extern long long __lshrdi3(long long, int);
62-
extern int __divsi3(int, int);
63-
extern int __modsi3(int, int);
64-
extern int __mulsi3(int, int);
65-
extern unsigned int __udivsi3(unsigned int, unsigned int);
66-
extern unsigned int __umodsi3(unsigned int, unsigned int);
67-
extern unsigned long long __umulsidi3(unsigned int, unsigned int);
68-
69-
EXPORT_SYMBOL(__ashldi3);
70-
EXPORT_SYMBOL(__ashrdi3);
71-
EXPORT_SYMBOL(__bswapdi2);
72-
EXPORT_SYMBOL(__bswapsi2);
73-
EXPORT_SYMBOL(__lshrdi3);
74-
EXPORT_SYMBOL(__divsi3);
75-
EXPORT_SYMBOL(__modsi3);
76-
EXPORT_SYMBOL(__mulsi3);
77-
EXPORT_SYMBOL(__udivsi3);
78-
EXPORT_SYMBOL(__umodsi3);
79-
EXPORT_SYMBOL(__umulsidi3);
80-
8120
unsigned int __sync_fetch_and_and_4(volatile void *p, unsigned int v)
8221
{
8322
BUG();
@@ -89,32 +28,3 @@ unsigned int __sync_fetch_and_or_4(volatile void *p, unsigned int v)
8928
BUG();
9029
}
9130
EXPORT_SYMBOL(__sync_fetch_and_or_4);
92-
93-
/*
94-
* Networking support
95-
*/
96-
EXPORT_SYMBOL(csum_partial);
97-
EXPORT_SYMBOL(csum_partial_copy_generic);
98-
99-
/*
100-
* Architecture-specific symbols
101-
*/
102-
EXPORT_SYMBOL(__xtensa_copy_user);
103-
EXPORT_SYMBOL(__invalidate_icache_range);
104-
105-
/*
106-
* Kernel hacking ...
107-
*/
108-
109-
#if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_DUMMY_CONSOLE)
110-
// FIXME EXPORT_SYMBOL(screen_info);
111-
#endif
112-
113-
#ifdef CONFIG_FUNCTION_TRACER
114-
EXPORT_SYMBOL(_mcount);
115-
#endif
116-
117-
EXPORT_SYMBOL(__invalidate_dcache_range);
118-
#if XCHAL_DCACHE_IS_WRITEBACK
119-
EXPORT_SYMBOL(__flush_dcache_range);
120-
#endif

arch/xtensa/lib/ashldi3.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,4 @@ ENTRY(__ashldi3)
2626
abi_ret_default
2727

2828
ENDPROC(__ashldi3)
29+
EXPORT_SYMBOL(__ashldi3)

arch/xtensa/lib/ashrdi3.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,4 @@ ENTRY(__ashrdi3)
2626
abi_ret_default
2727

2828
ENDPROC(__ashrdi3)
29+
EXPORT_SYMBOL(__ashrdi3)

arch/xtensa/lib/bswapdi2.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ ENTRY(__bswapdi2)
1919
abi_ret_default
2020

2121
ENDPROC(__bswapdi2)
22+
EXPORT_SYMBOL(__bswapdi2)

arch/xtensa/lib/bswapsi2.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ ENTRY(__bswapsi2)
1414
abi_ret_default
1515

1616
ENDPROC(__bswapsi2)
17+
EXPORT_SYMBOL(__bswapsi2)

arch/xtensa/lib/checksum.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ ENTRY(csum_partial)
169169
j 5b /* branch to handle the remaining byte */
170170

171171
ENDPROC(csum_partial)
172+
EXPORT_SYMBOL(csum_partial)
172173

173174
/*
174175
* Copy from ds while checksumming, otherwise like csum_partial
@@ -346,6 +347,7 @@ EX(10f) s8i a8, a3, 1
346347
j 4b /* process the possible trailing odd byte */
347348

348349
ENDPROC(csum_partial_copy_generic)
350+
EXPORT_SYMBOL(csum_partial_copy_generic)
349351

350352

351353
# Exception handler:

arch/xtensa/lib/divsi3.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,4 @@ ENTRY(__divsi3)
7272
abi_ret_default
7373

7474
ENDPROC(__divsi3)
75+
EXPORT_SYMBOL(__divsi3)

arch/xtensa/lib/lshrdi3.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,4 @@ ENTRY(__lshrdi3)
2626
abi_ret_default
2727

2828
ENDPROC(__lshrdi3)
29+
EXPORT_SYMBOL(__lshrdi3)

arch/xtensa/lib/memcopy.S

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,8 @@ WEAK(memcpy)
273273
abi_ret_default
274274

275275
ENDPROC(__memcpy)
276+
EXPORT_SYMBOL(__memcpy)
277+
EXPORT_SYMBOL(memcpy)
276278

277279
/*
278280
* void *memmove(void *dst, const void *src, size_t len);
@@ -536,3 +538,5 @@ WEAK(memmove)
536538
abi_ret_default
537539

538540
ENDPROC(__memmove)
541+
EXPORT_SYMBOL(__memmove)
542+
EXPORT_SYMBOL(memmove)

arch/xtensa/lib/memset.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ EX(10f) s8i a3, a5, 0
142142
abi_ret_default
143143

144144
ENDPROC(__memset)
145+
EXPORT_SYMBOL(__memset)
146+
EXPORT_SYMBOL(memset)
145147

146148
.section .fixup, "ax"
147149
.align 4

arch/xtensa/lib/modsi3.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ ENTRY(__modsi3)
6060
abi_ret_default
6161

6262
ENDPROC(__modsi3)
63+
EXPORT_SYMBOL(__modsi3)
6364

6465
#if !XCHAL_HAVE_NSA
6566
.section .rodata

arch/xtensa/lib/mulsi3.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,4 @@ ENTRY(__mulsi3)
131131
abi_ret_default
132132

133133
ENDPROC(__mulsi3)
134+
EXPORT_SYMBOL(__mulsi3)

arch/xtensa/lib/strncpy_user.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ EX(10f) s8i a9, a11, 0
201201
abi_ret_default
202202

203203
ENDPROC(__strncpy_user)
204+
EXPORT_SYMBOL(__strncpy_user)
204205

205206
.section .fixup, "ax"
206207
.align 4

arch/xtensa/lib/strnlen_user.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ EX(10f) l32i a9, a4, 0 # get word with first two bytes of string
133133
abi_ret_default
134134

135135
ENDPROC(__strnlen_user)
136+
EXPORT_SYMBOL(__strnlen_user)
136137

137138
.section .fixup, "ax"
138139
.align 4

arch/xtensa/lib/udivsi3.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,4 @@ ENTRY(__udivsi3)
6666
abi_ret_default
6767

6868
ENDPROC(__udivsi3)
69+
EXPORT_SYMBOL(__udivsi3)

arch/xtensa/lib/umodsi3.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,4 @@ ENTRY(__umodsi3)
5555
abi_ret_default
5656

5757
ENDPROC(__umodsi3)
58+
EXPORT_SYMBOL(__umodsi3)

arch/xtensa/lib/umulsidi3.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,3 +228,4 @@ ENTRY(__umulsidi3)
228228
#endif /* XCHAL_NO_MUL */
229229

230230
ENDPROC(__umulsidi3)
231+
EXPORT_SYMBOL(__umulsidi3)

arch/xtensa/lib/usercopy.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@ EX(10f) s8i a6, a5, 0
283283
abi_ret(STACK_SIZE)
284284

285285
ENDPROC(__xtensa_copy_user)
286+
EXPORT_SYMBOL(__xtensa_copy_user)
286287

287288
.section .fixup, "ax"
288289
.align 4

arch/xtensa/mm/misc.S

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ ENTRY(clear_page)
4747
abi_ret_default
4848

4949
ENDPROC(clear_page)
50+
EXPORT_SYMBOL(clear_page)
5051

5152
/*
5253
* copy_page and copy_user_page are the same for non-cache-aliased configs.
@@ -89,6 +90,7 @@ ENTRY(copy_page)
8990
abi_ret_default
9091

9192
ENDPROC(copy_page)
93+
EXPORT_SYMBOL(copy_page)
9294

9395
#ifdef CONFIG_MMU
9496
/*
@@ -367,6 +369,7 @@ ENTRY(__invalidate_icache_range)
367369
abi_ret_default
368370

369371
ENDPROC(__invalidate_icache_range)
372+
EXPORT_SYMBOL(__invalidate_icache_range)
370373

371374
/*
372375
* void __flush_invalidate_dcache_range(ulong start, ulong size)
@@ -397,6 +400,7 @@ ENTRY(__flush_dcache_range)
397400
abi_ret_default
398401

399402
ENDPROC(__flush_dcache_range)
403+
EXPORT_SYMBOL(__flush_dcache_range)
400404

401405
/*
402406
* void _invalidate_dcache_range(ulong start, ulong size)
@@ -411,6 +415,7 @@ ENTRY(__invalidate_dcache_range)
411415
abi_ret_default
412416

413417
ENDPROC(__invalidate_dcache_range)
418+
EXPORT_SYMBOL(__invalidate_dcache_range)
414419

415420
/*
416421
* void _invalidate_icache_all(void)

0 commit comments

Comments
 (0)