Skip to content

Commit 0365f70

Browse files
committed
[CRIS] Merge asm-offsets.c for both arches into one file.
Eliminates the link to arch specific asm-offsets.c from CRIS architecture build system. Resulting asm-offsets.s are identical before and after change for both arch-v10 and arch-v32. Signed-off-by: Jesper Nilsson <jesper.nilsson@axis.com> Acked-by: Sam Ravnborg <sam@ravnborg.org>
1 parent 556dcee commit 0365f70

3 files changed

Lines changed: 35 additions & 69 deletions

File tree

‎arch/cris/Makefile‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,6 @@ ifdef CONFIG_ETRAX_ARCH_V32
9595
endif
9696
@rm -rf $(SRC_ARCH)/kernel/vmlinux.lds.S
9797
@ln -sfn ../$(SARCH)/vmlinux.lds.S $(SRC_ARCH)/kernel/vmlinux.lds.S
98-
@rm -rf $(SRC_ARCH)/kernel/asm-offsets.c
99-
@ln -sfn ../$(SARCH)/kernel/asm-offsets.c $(SRC_ARCH)/kernel/asm-offsets.c
10098
@touch $@
10199

102100
archclean:
@@ -116,8 +114,8 @@ MRPROPER_FILES += \
116114
$(SRC_ARCH)/boot \
117115
$(SRC_ARCH)/lib \
118116
$(SRC_ARCH)/arch \
119-
$(SRC_ARCH)/kernel/vmlinux.lds.S \
120-
$(SRC_ARCH)/kernel/asm-offsets.c
117+
$(SRC_ARCH)/kernel/vmlinux.lds.S
118+
121119

122120
define archhelp
123121
echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/zImage)'

‎arch/cris/arch-v10/kernel/asm-offsets.c‎

Lines changed: 0 additions & 47 deletions
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include <linux/sched.h>
22
#include <asm/thread_info.h>
3+
#include <linux/autoconf.h>
34

45
/*
56
* Generate definitions needed by assembly language modules.
@@ -8,42 +9,56 @@
89
*/
910

1011
#define DEFINE(sym, val) \
11-
asm volatile("\n->" #sym " %0 " #val : : "i" (val))
12+
asm volatile("\n->" #sym " %0 " #val : : "i" (val))
1213

1314
#define BLANK() asm volatile("\n->" : : )
1415

16+
#if !defined(CONFIG_ETRAX_ARCH_V10) && !defined(CONFIG_ETRAX_ARCH_V32)
17+
#error One of ARCH v10 and ARCH v32 must be true!
18+
#endif
19+
1520
int main(void)
1621
{
1722
#define ENTRY(entry) DEFINE(PT_ ## entry, offsetof(struct pt_regs, entry))
1823
ENTRY(orig_r10);
1924
ENTRY(r13);
2025
ENTRY(r12);
2126
ENTRY(r11);
22-
ENTRY(r10);
23-
ENTRY(r9);
27+
ENTRY(r10);
28+
ENTRY(r9);
29+
#ifdef CONFIG_ETRAX_ARCH_V32
2430
ENTRY(acr);
2531
ENTRY(srs);
26-
ENTRY(mof);
27-
ENTRY(ccs);
28-
ENTRY(srp);
32+
#endif
33+
ENTRY(mof);
34+
#ifdef CONFIG_ETRAX_ARCH_V10
35+
ENTRY(dccr);
36+
#else
37+
ENTRY(ccs);
38+
#endif
39+
ENTRY(srp);
2940
BLANK();
3041
#undef ENTRY
3142
#define ENTRY(entry) DEFINE(TI_ ## entry, offsetof(struct thread_info, entry))
32-
ENTRY(task);
33-
ENTRY(flags);
34-
ENTRY(preempt_count);
35-
BLANK();
43+
ENTRY(task);
44+
ENTRY(flags);
45+
ENTRY(preempt_count);
46+
BLANK();
3647
#undef ENTRY
3748
#define ENTRY(entry) DEFINE(THREAD_ ## entry, offsetof(struct thread_struct, entry))
3849
ENTRY(ksp);
39-
ENTRY(usp);
40-
ENTRY(ccs);
41-
BLANK();
50+
ENTRY(usp);
51+
#ifdef CONFIG_ETRAX_ARCH_V10
52+
ENTRY(dccr);
53+
#else
54+
ENTRY(ccs);
55+
#endif
56+
BLANK();
4257
#undef ENTRY
4358
#define ENTRY(entry) DEFINE(TASK_ ## entry, offsetof(struct task_struct, entry))
44-
ENTRY(pid);
45-
BLANK();
46-
DEFINE(LCLONE_VM, CLONE_VM);
47-
DEFINE(LCLONE_UNTRACED, CLONE_UNTRACED);
48-
return 0;
59+
ENTRY(pid);
60+
BLANK();
61+
DEFINE(LCLONE_VM, CLONE_VM);
62+
DEFINE(LCLONE_UNTRACED, CLONE_UNTRACED);
63+
return 0;
4964
}

0 commit comments

Comments
 (0)