Skip to content

Commit d3c9eb4

Browse files
authored
Merge pull request #1639 from martin-frbg/dyn_list
Add DYNAMIC_LIST option for user-defined list of dynamic targets
2 parents bfad307 + 750162a commit d3c9eb4

File tree

2 files changed

+170
-0
lines changed

2 files changed

+170
-0
lines changed

Makefile.system

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,14 @@ endif
497497
endif
498498
endif
499499

500+
ifdef DYNAMIC_LIST
501+
override DYNAMIC_CORE = PRESCOTT $(DYNAMIC_LIST)
502+
XCCOMMON_OPT = -DDYNAMIC_LIST -DDYN_PRESCOTT
503+
XCCOMMON_OPT += $(foreach dcore,$(DYNAMIC_LIST),-DDYN_$(dcore))
504+
CCOMMON_OPT += $(XCCOMMON_OPT)
505+
#CCOMMON_OPT += -DDYNAMIC_LIST='$(DYNAMIC_LIST)'
506+
endif
507+
500508
# If DYNAMIC_CORE is not set, DYNAMIC_ARCH cannot do anything, so force it to empty
501509
ifndef DYNAMIC_CORE
502510
override DYNAMIC_ARCH=

driver/others/dynamic.c

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,167 @@
4949
#define EXTERN
5050
#endif
5151

52+
#ifdef DYNAMIC_LIST
53+
extern gotoblas_t gotoblas_PRESCOTT;
54+
55+
#ifdef DYN_ATHLON
56+
extern gotoblas_t gotoblas_ATHLON;
57+
#else
58+
#define gotoblas_ATHLON gotoblas_PRESCOTT
59+
#endif
60+
#ifdef DYN_KATMAI
61+
extern gotoblas_t gotoblas_KATMAI;
62+
#else
63+
#define gotoblas_KATMAI gotoblas_PRESCOTT
64+
#endif
65+
#ifdef DYN_BANIAS
66+
extern gotoblas_t gotoblas_BANIAS;
67+
#else
68+
#define gotoblas_BANIAS gotoblas_PRESCOTT
69+
#endif
70+
#ifdef DYN_COPPERMINE
71+
extern gotoblas_t gotoblas_COPPERMINE;
72+
#else
73+
#define gotoblas_COPPERMINE gotoblas_PRESCOTT
74+
#endif
75+
#ifdef DYN_NORTHWOOD
76+
extern gotoblas_t gotoblas_NORTHWOOD;
77+
#else
78+
#define gotoblas_NORTHWOOD gotoblas_PRESCOTT
79+
#endif
80+
#ifdef DYN_CORE2
81+
extern gotoblas_t gotoblas_CORE2;
82+
#else
83+
#define gotoblas_CORE2 gotoblas_PRESCOTT
84+
#endif
85+
#ifdef DYN_NEHALEM
86+
extern gotoblas_t gotoblas_NEHALEM;
87+
#else
88+
#define gotoblas_NEHALEM gotoblas_PRESCOTT
89+
#endif
90+
#ifdef DYN_BARCELONA
91+
extern gotoblas_t gotoblas_BARCELONA;
92+
#elif defined(DYN_NEHALEM)
93+
#define gotoblas_BARCELONA gotoblas_NEHALEM
94+
#else
95+
#define gotoblas_BARCELONA gotoblas_PRESCOTT
96+
#endif
97+
#ifdef DYN_ATOM
98+
extern gotoblas_t gotoblas_ATOM;
99+
elif defined(DYN_NEHALEM)
100+
#define gotoblas_ATOM gotoblas_NEHALEM
101+
#else
102+
#define gotoblas_ATOM gotoblas_PRESCOTT
103+
#endif
104+
#ifdef DYN_NANO
105+
extern gotoblas_t gotoblas_NANO;
106+
#else
107+
#define gotoblas_NANO gotoblas_PRESCOTT
108+
#endif
109+
#ifdef DYN_PENRYN
110+
extern gotoblas_t gotoblas_PENRYN;
111+
#else
112+
#define gotoblas_PENRYN gotoblas_PRESCOTT
113+
#endif
114+
#ifdef DYN_DUNNINGTON
115+
extern gotoblas_t gotoblas_DUNNINGTON;
116+
#else
117+
#define gotoblas_DUNNINGTON gotoblas_PRESCOTT
118+
#endif
119+
#ifdef DYN_OPTERON
120+
extern gotoblas_t gotoblas_OPTERON;
121+
#else
122+
#define gotoblas_OPTERON gotoblas_PRESCOTT
123+
#endif
124+
#ifdef DYN_OPTERON_SSE3
125+
extern gotoblas_t gotoblas_OPTERON_SSE3;
126+
#else
127+
#define gotoblas_OPTERON_SSE3 gotoblas_PRESCOTT
128+
#endif
129+
#ifdef DYN_BOBCAT
130+
extern gotoblas_t gotoblas_BOBCAT;
131+
#elif defined(DYN_NEHALEM)
132+
#define gotoblas_BOBCAT gotoblas_NEHALEM
133+
#else
134+
#define gotoblas_BOBCAT gotoblas_PRESCOTT
135+
#endif
136+
#ifdef DYN_SANDYBRIDGE
137+
extern gotoblas_t gotoblas_SANDYBRIDGE;
138+
#elif defined(DYN_NEHALEM)
139+
#define gotoblas_SANDYBRIDGE gotoblas_NEHALEM
140+
#else
141+
#define gotoblas_SANDYBRIDGE gotoblas_PRESCOTT
142+
#endif
143+
#ifdef DYN_BULLDOZER
144+
extern gotoblas_t gotoblas_BULLDOZER;
145+
#elif defined(DYN_SANDYBRIDGE)
146+
#define gotoblas_BULLDOZER gotoblas_SANDYBRIDGE
147+
#elif defined(DYN_NEHALEM)
148+
#define gotoblas_BULLDOZER gotoblas_NEHALEM
149+
#else
150+
#define gotoblas_BULLDOZER gotoblas_PRESCOTT
151+
#endif
152+
#ifdef DYN_PILEDRIVER
153+
extern gotoblas_t gotoblas_PILEDRIVER;
154+
#elif defined(DYN_SANDYBRIDGE)
155+
#define gotoblas_PILEDRIVER gotoblas_SANDYBRIDGE
156+
#elif defined(DYN_NEHALEM)
157+
#define gotoblas_PILEDRIVER gotoblas_NEHALEM
158+
#else
159+
#define gotoblas_PILEDRIVER gotoblas_PRESCOTT
160+
#endif
161+
#ifdef DYN_STEAMROLLER
162+
extern gotoblas_t gotoblas_STEAMROLLER;
163+
#elif defined(DYN_SANDYBRIDGE)
164+
#define gotoblas_STEAMROLLER gotoblas_SANDYBRIDGE
165+
#elif defined(DYN_NEHALEM)
166+
#define gotoblas_STEAMROLLER gotoblas_NEHALEM
167+
#else
168+
#define gotoblas_STEAMROLLER gotoblas_PRESCOTT
169+
#endif
170+
#ifdef DYN_EXCAVATOR
171+
extern gotoblas_t gotoblas_EXCAVATOR;
172+
#elif defined(DYN_SANDYBRIDGE)
173+
#define gotoblas_EXCAVATOR gotoblas_SANDYBRIDGE
174+
#elif defined(DYN_NEHALEM)
175+
#define gotoblas_EXCAVATOR gotoblas_NEHALEM
176+
#else
177+
#define gotoblas_EXCAVATOR gotoblas_PRESCOTT
178+
#endif
179+
#ifdef DYN_HASWELL
180+
extern gotoblas_t gotoblas_HASWELL;
181+
#elif defined(DYN_SANDYBRIDGE)
182+
#define gotoblas_HASWELL gotoblas_SANDYBRIDGE
183+
#elif defined(DYN_NEHALEM)
184+
#define gotoblas_HASWELL gotoblas_NEHALEM
185+
#else
186+
#define gotoblas_HASWELL gotoblas_PRESCOTT
187+
#endif
188+
#ifdef DYN_ZEN
189+
extern gotoblas_t gotoblas_ZEN;
190+
#elif defined(DYN_HASWELL)
191+
#define gotoblas_ZEN gotoblas_HASWELL
192+
#elif defined(DYN_SANDYBRIDGE)
193+
#define gotoblas_ZEN gotoblas_SANDYBRIDGE
194+
#elif defined(DYN_NEHALEM)
195+
#define gotoblas_ZEN gotoblas_NEHALEM
196+
#else
197+
#define gotoblas_ZEN gotoblas_PRESCOTT
198+
#endif
199+
#ifdef DYN_SKYLAKEX
200+
extern gotoblas_t gotoblas_SKYLAKEX;
201+
#elif defined(DYN_HASWELL)
202+
#define gotoblas_SKYLAKEX gotoblas_HASWELL
203+
#elif defined(DYN_SANDYBRIDGE)
204+
#define gotoblas_SKYLAKEX gotoblas_SANDYBRIDGE
205+
#elif defined(DYN_NEHALEM)
206+
#define gotoblas_SKYLAKEX gotoblas_NEHALEM
207+
#else
208+
#define gotoblas_SKYLAKEX gotoblas_PRESCOTT
209+
#endif
210+
211+
212+
#else // not DYNAMIC_LIST
52213
EXTERN gotoblas_t gotoblas_KATMAI;
53214
EXTERN gotoblas_t gotoblas_COPPERMINE;
54215
EXTERN gotoblas_t gotoblas_NORTHWOOD;
@@ -108,6 +269,7 @@ extern gotoblas_t gotoblas_SKYLAKEX;
108269
#define gotoblas_ZEN gotoblas_BARCELONA
109270
#endif
110271

272+
#endif // DYNAMIC_LIST
111273

112274
#define VENDOR_INTEL 1
113275
#define VENDOR_AMD 2

0 commit comments

Comments
 (0)