summaryrefslogtreecommitdiff
path: root/libgcc/config/nds32/t-nds32-isr
blob: 30a781d425585b1ed422322213084e05dd5225d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# Rules of c-isr library stuff of Andes NDS32 cpu for GNU compiler
# Copyright (C) 2012-2019 Free Software Foundation, Inc.
# Contributed by Andes Technology Corporation.
#
# This file is part of GCC.
#
# GCC is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published
# by the Free Software Foundation; either version 3, or (at your
# option) any later version.
#
# GCC is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
# License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GCC; see the file COPYING3.  If not see
# <http://www.gnu.org/licenses/>.


###############################################################################
# Makfile fragment rules for libnds32_isr.a to support ISR attribute extension
###############################################################################

# Basic flags setting.
ISR_CFLAGS = $(CFLAGS) -c

# The object files we would like to create.
LIBNDS32_ISR_VEC_OBJS = \
		vec_vid00.o vec_vid01.o vec_vid02.o vec_vid03.o \
		vec_vid04.o vec_vid05.o vec_vid06.o vec_vid07.o \
		vec_vid08.o vec_vid09.o vec_vid10.o vec_vid11.o \
		vec_vid12.o vec_vid13.o vec_vid14.o vec_vid15.o \
		vec_vid16.o vec_vid17.o vec_vid18.o vec_vid19.o \
		vec_vid20.o vec_vid21.o vec_vid22.o vec_vid23.o \
		vec_vid24.o vec_vid25.o vec_vid26.o vec_vid27.o \
		vec_vid28.o vec_vid29.o vec_vid30.o vec_vid31.o \
		vec_vid32.o vec_vid33.o vec_vid34.o vec_vid35.o \
		vec_vid36.o vec_vid37.o vec_vid38.o vec_vid39.o \
		vec_vid40.o vec_vid41.o vec_vid42.o vec_vid43.o \
		vec_vid44.o vec_vid45.o vec_vid46.o vec_vid47.o \
		vec_vid48.o vec_vid49.o vec_vid50.o vec_vid51.o \
		vec_vid52.o vec_vid53.o vec_vid54.o vec_vid55.o \
		vec_vid56.o vec_vid57.o vec_vid58.o vec_vid59.o \
		vec_vid60.o vec_vid61.o vec_vid62.o vec_vid63.o \
		vec_vid64.o vec_vid65.o vec_vid66.o vec_vid67.o \
		vec_vid68.o vec_vid69.o vec_vid70.o vec_vid71.o \
		vec_vid72.o

LIBNDS32_ISR_JMP_OBJS = \
		jmptbl_vid00.o jmptbl_vid01.o jmptbl_vid02.o jmptbl_vid03.o \
		jmptbl_vid04.o jmptbl_vid05.o jmptbl_vid06.o jmptbl_vid07.o \
		jmptbl_vid08.o jmptbl_vid09.o jmptbl_vid10.o jmptbl_vid11.o \
		jmptbl_vid12.o jmptbl_vid13.o jmptbl_vid14.o jmptbl_vid15.o \
		jmptbl_vid16.o jmptbl_vid17.o jmptbl_vid18.o jmptbl_vid19.o \
		jmptbl_vid20.o jmptbl_vid21.o jmptbl_vid22.o jmptbl_vid23.o \
		jmptbl_vid24.o jmptbl_vid25.o jmptbl_vid26.o jmptbl_vid27.o \
		jmptbl_vid28.o jmptbl_vid29.o jmptbl_vid30.o jmptbl_vid31.o \
		jmptbl_vid32.o jmptbl_vid33.o jmptbl_vid34.o jmptbl_vid35.o \
		jmptbl_vid36.o jmptbl_vid37.o jmptbl_vid38.o jmptbl_vid39.o \
		jmptbl_vid40.o jmptbl_vid41.o jmptbl_vid42.o jmptbl_vid43.o \
		jmptbl_vid44.o jmptbl_vid45.o jmptbl_vid46.o jmptbl_vid47.o \
		jmptbl_vid48.o jmptbl_vid49.o jmptbl_vid50.o jmptbl_vid51.o \
		jmptbl_vid52.o jmptbl_vid53.o jmptbl_vid54.o jmptbl_vid55.o \
		jmptbl_vid56.o jmptbl_vid57.o jmptbl_vid58.o jmptbl_vid59.o \
		jmptbl_vid60.o jmptbl_vid61.o jmptbl_vid62.o jmptbl_vid63.o \
		jmptbl_vid64.o jmptbl_vid65.o jmptbl_vid66.o jmptbl_vid67.o \
		jmptbl_vid68.o jmptbl_vid69.o jmptbl_vid70.o jmptbl_vid71.o \
		jmptbl_vid72.o

LIBNDS32_ISR_COMMON_OBJS = \
		excp_isr_ps_nn.o excp_isr_ps_ns.o excp_isr_ps_nr.o \
		excp_isr_sa_nn.o excp_isr_sa_ns.o excp_isr_sa_nr.o \
		intr_isr_ps_nn.o intr_isr_ps_ns.o intr_isr_ps_nr.o \
		intr_isr_sa_nn.o intr_isr_sa_ns.o intr_isr_sa_nr.o \
		reset.o \
		nmih.o \
		wrh.o

LIBNDS32_ISR_COMPLETE_OBJS = $(LIBNDS32_ISR_VEC_OBJS) $(LIBNDS32_ISR_JMP_OBJS) $(LIBNDS32_ISR_COMMON_OBJS)



# Build vector vid objects for ISR library.
vec_vid%.o: $(srcdir)/config/nds32/isr-library/vec_vid%.S
	$(GCC_FOR_TARGET) $(ISR_CFLAGS) $< -o $@


# Build jump table objects for ISR library.
jmptbl_vid%.o: $(srcdir)/config/nds32/isr-library/jmptbl_vid%.S
	$(GCC_FOR_TARGET) $(ISR_CFLAGS) $< -o $@


# Build commen objects for ISR library.
excp_isr_ps_nn.o: $(srcdir)/config/nds32/isr-library/excp_isr.S
	$(GCC_FOR_TARGET) $(ISR_CFLAGS) $(srcdir)/config/nds32/isr-library/excp_isr.S -o excp_isr_ps_nn.o

excp_isr_ps_ns.o: $(srcdir)/config/nds32/isr-library/excp_isr.S
	$(GCC_FOR_TARGET) $(ISR_CFLAGS) -DNDS32_NESTED $(srcdir)/config/nds32/isr-library/excp_isr.S -o excp_isr_ps_ns.o

excp_isr_ps_nr.o: $(srcdir)/config/nds32/isr-library/excp_isr.S
	$(GCC_FOR_TARGET) $(ISR_CFLAGS) -DNDS32_NESTED_READY $(srcdir)/config/nds32/isr-library/excp_isr.S -o excp_isr_ps_nr.o

excp_isr_sa_nn.o: $(srcdir)/config/nds32/isr-library/excp_isr.S
	$(GCC_FOR_TARGET) $(ISR_CFLAGS) -DNDS32_SAVE_ALL_REGS $(srcdir)/config/nds32/isr-library/excp_isr.S -o excp_isr_sa_nn.o

excp_isr_sa_ns.o: $(srcdir)/config/nds32/isr-library/excp_isr.S
	$(GCC_FOR_TARGET) $(ISR_CFLAGS) -DNDS32_SAVE_ALL_REGS -DNDS32_NESTED $(srcdir)/config/nds32/isr-library/excp_isr.S -o excp_isr_sa_ns.o

excp_isr_sa_nr.o: $(srcdir)/config/nds32/isr-library/excp_isr.S
	$(GCC_FOR_TARGET) $(ISR_CFLAGS) -DNDS32_SAVE_ALL_REGS -DNDS32_NESTED_READY $(srcdir)/config/nds32/isr-library/excp_isr.S -o excp_isr_sa_nr.o

intr_isr_ps_nn.o: $(srcdir)/config/nds32/isr-library/intr_isr.S
	$(GCC_FOR_TARGET) $(ISR_CFLAGS) $(srcdir)/config/nds32/isr-library/intr_isr.S -o intr_isr_ps_nn.o

intr_isr_ps_ns.o: $(srcdir)/config/nds32/isr-library/intr_isr.S
	$(GCC_FOR_TARGET) $(ISR_CFLAGS) -DNDS32_NESTED $(srcdir)/config/nds32/isr-library/intr_isr.S -o intr_isr_ps_ns.o

intr_isr_ps_nr.o: $(srcdir)/config/nds32/isr-library/intr_isr.S
	$(GCC_FOR_TARGET) $(ISR_CFLAGS) -DNDS32_NESTED_READY $(srcdir)/config/nds32/isr-library/intr_isr.S -o intr_isr_ps_nr.o

intr_isr_sa_nn.o: $(srcdir)/config/nds32/isr-library/intr_isr.S
	$(GCC_FOR_TARGET) $(ISR_CFLAGS) -DNDS32_SAVE_ALL_REGS $(srcdir)/config/nds32/isr-library/intr_isr.S -o intr_isr_sa_nn.o

intr_isr_sa_ns.o: $(srcdir)/config/nds32/isr-library/intr_isr.S
	$(GCC_FOR_TARGET) $(ISR_CFLAGS) -DNDS32_SAVE_ALL_REGS -DNDS32_NESTED $(srcdir)/config/nds32/isr-library/intr_isr.S -o intr_isr_sa_ns.o

intr_isr_sa_nr.o: $(srcdir)/config/nds32/isr-library/intr_isr.S
	$(GCC_FOR_TARGET) $(ISR_CFLAGS) -DNDS32_SAVE_ALL_REGS -DNDS32_NESTED_READY $(srcdir)/config/nds32/isr-library/intr_isr.S -o intr_isr_sa_nr.o

reset.o: $(srcdir)/config/nds32/isr-library/reset.S
	$(GCC_FOR_TARGET) $(ISR_CFLAGS) $(srcdir)/config/nds32/isr-library/reset.S -o reset.o

nmih.o: $(srcdir)/config/nds32/isr-library/nmih.S
	$(GCC_FOR_TARGET) $(ISR_CFLAGS) $(srcdir)/config/nds32/isr-library/nmih.S -o nmih.o

wrh.o: $(srcdir)/config/nds32/isr-library/wrh.S
	$(GCC_FOR_TARGET) $(ISR_CFLAGS) $(srcdir)/config/nds32/isr-library/wrh.S -o wrh.o



# The rule to create libnds32_isr.a file
libnds32_isr.a: $(LIBNDS32_ISR_COMPLETE_OBJS)
	$(AR) rc libnds32_isr.a $(LIBNDS32_ISR_COMPLETE_OBJS)


# ------------------------------------------------------------------------