Skip to content

Commit 048eb58

Browse files
author
Sam Ravnborg
committed
kbuild: mips use generic asm-offsets.h support
Removed obsolete stuff from arch makefile. mips had a special rule for generating asm-offsets.h so preserved it using an architecture specific hook in top-level Kbuild file. Renamed .h file to asm-offsets.h Signed-off-by: Sam Ravnborg <[email protected]>
1 parent 39e01cb commit 048eb58

20 files changed

+28
-52
lines changed

Kbuild

+8-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ always := $(offsets-file)
1313
targets := $(offsets-file)
1414
targets += arch/$(ARCH)/kernel/asm-offsets.s
1515

16+
# Default sed regexp - multiline due to syntax constraints
17+
define sed-y
18+
"/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"
19+
endef
20+
# Override default regexp for specific architectures
21+
sed-$(CONFIG_MIPS) := "/^@@@/s///p"
22+
1623
quiet_cmd_offsets = GEN $@
1724
define cmd_offsets
1825
cat $< | \
@@ -26,7 +33,7 @@ define cmd_offsets
2633
echo " *"; \
2734
echo " */"; \
2835
echo ""; \
29-
sed -ne "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"; \
36+
sed -ne $(sed-y); \
3037
echo ""; \
3138
echo "#endif" ) > $@
3239
endef

arch/mips/Makefile

+2-33
Original file line numberDiff line numberDiff line change
@@ -720,38 +720,7 @@ archclean:
720720
@$(MAKE) $(clean)=arch/mips/boot
721721
@$(MAKE) $(clean)=arch/mips/lasat
722722

723-
# Generate <asm/offset.h
724-
#
725-
# The default rule is suffering from funny problems on MIPS so we using our
726-
# own ...
727-
#
728-
# ---------------------------------------------------------------------------
729-
730-
define filechk_gen-asm-offset.h
731-
(set -e; \
732-
echo "#ifndef _ASM_OFFSET_H"; \
733-
echo "#define _ASM_OFFSET_H"; \
734-
echo "/*"; \
735-
echo " * DO NOT MODIFY."; \
736-
echo " *"; \
737-
echo " * This file was generated by arch/$(ARCH)/Makefile"; \
738-
echo " *"; \
739-
echo " */"; \
740-
echo ""; \
741-
sed -ne "/^@@@/s///p"; \
742-
echo "#endif /* _ASM_OFFSET_H */" )
743-
endef
744-
745-
prepare: include/asm-$(ARCH)/offset.h
746-
747-
arch/$(ARCH)/kernel/offset.s: include/asm include/linux/version.h \
748-
include/config/MARKER
749-
750-
include/asm-$(ARCH)/offset.h: arch/$(ARCH)/kernel/offset.s
751-
$(call filechk,gen-asm-offset.h)
752-
753-
CLEAN_FILES += include/asm-$(ARCH)/offset.h.tmp \
754-
include/asm-$(ARCH)/offset.h \
755-
vmlinux.32 \
723+
724+
CLEAN_FILES += vmlinux.32 \
756725
vmlinux.64 \
757726
vmlinux.ecoff

arch/mips/kernel/r2300_fpu.S

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include <asm/errno.h>
1616
#include <asm/fpregdef.h>
1717
#include <asm/mipsregs.h>
18-
#include <asm/offset.h>
18+
#include <asm/asm-offsets.h>
1919
#include <asm/regdef.h>
2020

2121
#define EX(a,b) \

arch/mips/kernel/r2300_switch.S

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include <asm/cachectl.h>
1616
#include <asm/fpregdef.h>
1717
#include <asm/mipsregs.h>
18-
#include <asm/offset.h>
18+
#include <asm/asm-offsets.h>
1919
#include <asm/page.h>
2020
#include <asm/regdef.h>
2121
#include <asm/stackframe.h>

arch/mips/kernel/r4k_fpu.S

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#include <asm/errno.h>
1818
#include <asm/fpregdef.h>
1919
#include <asm/mipsregs.h>
20-
#include <asm/offset.h>
20+
#include <asm/asm-offsets.h>
2121
#include <asm/regdef.h>
2222

2323
.macro EX insn, reg, src

arch/mips/kernel/r4k_switch.S

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include <asm/cachectl.h>
1616
#include <asm/fpregdef.h>
1717
#include <asm/mipsregs.h>
18-
#include <asm/offset.h>
18+
#include <asm/asm-offsets.h>
1919
#include <asm/page.h>
2020
#include <asm/pgtable-bits.h>
2121
#include <asm/regdef.h>

arch/mips/kernel/r6000_fpu.S

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include <asm/asm.h>
1414
#include <asm/fpregdef.h>
1515
#include <asm/mipsregs.h>
16-
#include <asm/offset.h>
16+
#include <asm/asm-offsets.h>
1717
#include <asm/regdef.h>
1818

1919
.set noreorder

arch/mips/kernel/scall32-o32.S

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include <asm/thread_info.h>
2020
#include <asm/unistd.h>
2121
#include <asm/war.h>
22-
#include <asm/offset.h>
22+
#include <asm/asm-offsets.h>
2323

2424
/* Highest syscall used of any syscall flavour */
2525
#define MAX_SYSCALL_NO __NR_O32_Linux + __NR_O32_Linux_syscalls

arch/mips/kernel/scall64-64.S

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include <asm/mipsregs.h>
1515
#include <asm/regdef.h>
1616
#include <asm/stackframe.h>
17-
#include <asm/offset.h>
17+
#include <asm/asm-offsets.h>
1818
#include <asm/sysmips.h>
1919
#include <asm/thread_info.h>
2020
#include <asm/unistd.h>

arch/mips/kernel/syscall.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#include <asm/cachectl.h>
3232
#include <asm/cacheflush.h>
3333
#include <asm/ipc.h>
34-
#include <asm/offset.h>
34+
#include <asm/asm-offsets.h>
3535
#include <asm/signal.h>
3636
#include <asm/sim.h>
3737
#include <asm/shmparam.h>

arch/mips/lib-32/memset.S

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Copyright (C) 1999, 2000 Silicon Graphics, Inc.
88
*/
99
#include <asm/asm.h>
10-
#include <asm/offset.h>
10+
#include <asm/asm-offsets.h>
1111
#include <asm/regdef.h>
1212

1313
#define EX(insn,reg,addr,handler) \

arch/mips/lib-64/memset.S

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Copyright (C) 1999, 2000 Silicon Graphics, Inc.
88
*/
99
#include <asm/asm.h>
10-
#include <asm/offset.h>
10+
#include <asm/asm-offsets.h>
1111
#include <asm/regdef.h>
1212

1313
#define EX(insn,reg,addr,handler) \

arch/mips/lib/memcpy.S

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*/
1515
#include <linux/config.h>
1616
#include <asm/asm.h>
17-
#include <asm/offset.h>
17+
#include <asm/asm-offsets.h>
1818
#include <asm/regdef.h>
1919

2020
#define dst a0

arch/mips/lib/strlen_user.S

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Copyright (c) 1999 Silicon Graphics, Inc.
88
*/
99
#include <asm/asm.h>
10-
#include <asm/offset.h>
10+
#include <asm/asm-offsets.h>
1111
#include <asm/regdef.h>
1212

1313
#define EX(insn,reg,addr,handler) \

arch/mips/lib/strncpy_user.S

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*/
88
#include <linux/errno.h>
99
#include <asm/asm.h>
10-
#include <asm/offset.h>
10+
#include <asm/asm-offsets.h>
1111
#include <asm/regdef.h>
1212

1313
#define EX(insn,reg,addr,handler) \

arch/mips/lib/strnlen_user.S

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Copyright (c) 1999 Silicon Graphics, Inc.
88
*/
99
#include <asm/asm.h>
10-
#include <asm/offset.h>
10+
#include <asm/asm-offsets.h>
1111
#include <asm/regdef.h>
1212

1313
#define EX(insn,reg,addr,handler) \

include/asm-mips/asmmacro-32.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#ifndef _ASM_ASMMACRO_32_H
88
#define _ASM_ASMMACRO_32_H
99

10-
#include <asm/offset.h>
10+
#include <asm/asm-offsets.h>
1111
#include <asm/regdef.h>
1212
#include <asm/fpregdef.h>
1313
#include <asm/mipsregs.h>

include/asm-mips/asmmacro-64.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#ifndef _ASM_ASMMACRO_64_H
99
#define _ASM_ASMMACRO_64_H
1010

11-
#include <asm/offset.h>
11+
#include <asm/asm-offsets.h>
1212
#include <asm/regdef.h>
1313
#include <asm/fpregdef.h>
1414
#include <asm/mipsregs.h>

include/asm-mips/sim.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
#include <linux/config.h>
1313

14-
#include <asm/offset.h>
14+
#include <asm/asm-offsets.h>
1515

1616
#define __str2(x) #x
1717
#define __str(x) __str2(x)

include/asm-mips/stackframe.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
#include <asm/asm.h>
1717
#include <asm/mipsregs.h>
18-
#include <asm/offset.h>
18+
#include <asm/asm-offsets.h>
1919

2020
.macro SAVE_AT
2121
.set push

0 commit comments

Comments
 (0)