blob: 7c5d6b0443128de361cc09a25f46bba7b2bfa74b [file] [log] [blame]
Patrick Williamsb48b7b42016-08-17 15:04:38 -05001From: Al Stone <ahs3@ahs3.net>
2Date: Mon, 7 Apr 2014 19:09:37 +0000
3Subject: [PATCH 1/2] Fixup aapits build
4
5From http://git.linaro.org/people/al.stone/acpica-tools.git
6Upstream-status: Unknown
7
8diff -urN acpica-unix2-20130626/tests/aapits/atexec.c acpica-unix2-20130626-aapits/tests/aapits/atexec.c
9--- acpica-unix2-20130626/tests/aapits/atexec.c 2013-01-17 12:48:28.000000000 -0700
10+++ acpica-unix2-20130626-aapits/tests/aapits/atexec.c 2013-07-25 13:44:23.023894441 -0600
11@@ -639,6 +639,7 @@
12 }
13
14
15+#if ACPI_MACHINE_WIDTH == 32
16 /*******************************************************************************
17 *
18 * FUNCTION: AtBuildLocalRSDT
19@@ -757,8 +758,9 @@
20 LocalRSDT->Header.Checksum = (UINT8)~LocalRSDT->Header.Checksum;
21 }
22 }
23+#endif
24
25
26 /*******************************************************************************
27 *
28 * FUNCTION: AtBuildLocalXSDT
29@@ -1424,7 +1426,7 @@
30 ACPI_WARNING ((AE_INFO,
31 "Request on [%4.4s] is beyond region limit Req-%X+%X, Base=%X, Len-%X\n",
32 (RegionObject->Region.Node)->Name.Ascii, (UINT32) Address,
33- ByteWidth, (UINT32) BufferAddress, Length));
34+ ByteWidth, (UINT32) BufferAddress, (UINT32) Length));
35
36 return (AE_AML_REGION_LIMIT);
37 }
38@@ -1792,7 +1796,9 @@
39 Path, Obj.Integer.Value, Value);
40 #else
41 printf ("API Error: Value of %s is 0x%llx instead of expected 0x%llx\n",
42- Path, Obj.Integer.Value, Value);
43+ Path,
44+ (long long unsigned int) Obj.Integer.Value,
45+ (long long unsigned int) Value);
46 #endif
47 Status = AE_ERROR;
48 }
49@@ -1871,7 +1877,7 @@
50 {
51 TestErrors++;
52 printf ("Test Error: cannot allocate buffer of %d bytes\n",
53- Results.Length);
54+ (int) Results.Length);
55 return (AE_NO_MEMORY);
56 }
57 Results.Pointer = Object;
58@@ -1952,7 +1956,8 @@
59 {
60 printf ("AtCheckBuffer: unexpected length %d of Buffer vs"
61 " calculated %d bytes\n",
62- Results.Length, ACPI_ROUND_UP_TO_NATIVE_WORD(sizeof (ACPI_OBJECT) + Length));
63+ (int)Results.Length,
64+ (int)(ACPI_ROUND_UP_TO_NATIVE_WORD(sizeof (ACPI_OBJECT) + Length)));
65 }
66
67 /* Initialize the return buffer structure */
68@@ -1961,7 +1968,7 @@
69 {
70 TestErrors++;
71 printf ("Test Error: cannot allocate buffer of %d bytes\n",
72- Results.Length);
73+ (int) Results.Length);
74 return (AE_NO_MEMORY);
75 }
76 Results.Pointer = Object;
77diff -urN acpica-unix2-20130626/tests/aapits/atinit.c acpica-unix2-20130626-aapits/tests/aapits/atinit.c
78--- acpica-unix2-20130626/tests/aapits/atinit.c 2013-01-17 12:48:28.000000000 -0700
79+++ acpica-unix2-20130626-aapits/tests/aapits/atinit.c 2013-07-25 13:20:19.706705960 -0600
80@@ -3024,7 +3024,7 @@
81 AapiErrors++;
82 printf ("API Error: AcpiGetSystemInfo() returned"
83 " Length %d, expected %d\n",
84- OutBuffer.Length, sizeof (Info));
85+ (int) OutBuffer.Length, (int) sizeof (Info));
86 return (AE_ERROR);
87 }
88
89@@ -3046,7 +3046,7 @@
90 AapiErrors++;
91 printf ("API Error: AcpiGetSystemInfo() returned"
92 " Length %d, expected %d\n",
93- OutBuffer.Length, sizeof (Info));
94+ (int) OutBuffer.Length, (int) sizeof (Info));
95 return (AE_ERROR);
96 }
97
98@@ -3066,7 +3066,7 @@
99 AapiErrors++;
100 printf ("API Error: AcpiGetSystemInfo() returned"
101 " Length %d, expected %d\n",
102- OutBuffer.Length, sizeof (Info));
103+ (int) OutBuffer.Length, (int) sizeof (Info));
104 return (AE_ERROR);
105 }
106 else if (OutBuffer.Pointer != &Info)
107@@ -3149,7 +3149,7 @@
108 AapiErrors++;
109 printf ("API Error: AcpiGetSystemInfo() returned"
110 " Length %d, expected %d\n",
111- OutBuffer.Length, sizeof (Info));
112+ (int) OutBuffer.Length, (int) sizeof (Info));
113 return (AE_ERROR);
114 }
115 else if (OutBuffer.Pointer != &Info)
116@@ -3214,7 +3214,7 @@
117 AapiErrors++;
118 printf ("API Error: AcpiGetSystemInfo() returned"
119 " Length %d, expected %d\n",
120- OutBuffer.Length, sizeof (ACPI_SYSTEM_INFO));
121+ (int) OutBuffer.Length, (int) sizeof (ACPI_SYSTEM_INFO));
122 return (AE_ERROR);
123 }
124 else
125diff -urN acpica-unix2-20130626/tests/aapits/atmain.c acpica-unix2-20130626-aapits/tests/aapits/atmain.c
126--- acpica-unix2-20130626/tests/aapits/atmain.c 2013-01-17 12:48:28.000000000 -0700
127+++ acpica-unix2-20130626-aapits/tests/aapits/atmain.c 2013-07-25 13:18:22.083323948 -0600
128@@ -315,7 +315,7 @@
129 {
130 printf ("ACPICA API TS err: test num %ld of test case %ld"
131 " is not implemented\n",
132- test_num, test_case);
133+ (long int) test_num, (long int) test_case);
134 return (AtRetNotImpl);
135 }
136
137@@ -430,7 +432,7 @@
138 if (test_case < 1 || test_case > AT_TEST_CASE_NUM)
139 {
140 printf ("ACPICA API TS err: test case %ld is out of range 1 - %d\n",
141- test_case, AT_TEST_CASE_NUM);
142+ (long int) test_case, (int) AT_TEST_CASE_NUM);
143 return (AtRetBadParam);
144 }
145
146@@ -438,7 +440,7 @@
147 if (test_num < 0 || test_num > AtTestCase[test_case].TestsNum)
148 {
149 printf ("ACPICA API TS err: test num %ld is out of range 0 - %d\n",
150- test_num, AtTestCase[test_case].TestsNum);
151+ (long int) test_num, AtTestCase[test_case].TestsNum);
152 return (AtRetBadParam);
153 }
154
155diff -urN acpica-unix2-20130626/tests/aapits/atnamespace.c acpica-unix2-20130626-aapits/tests/aapits/atnamespace.c
156--- acpica-unix2-20130626/tests/aapits/atnamespace.c 2013-01-17 12:48:28.000000000 -0700
157+++ acpica-unix2-20130626-aapits/tests/aapits/atnamespace.c 2013-07-25 13:24:15.366466707 -0600
158@@ -2535,7 +2535,8 @@
159 #else
160 printf ("API Error: Address of %s (0x%llX) != (0x%llX)\n",
161 PathNames[2 * i + 1],
162- Info->Address, ExpectedInfo[i].Address);
163+ (long long unsigned int) Info->Address,
164+ (long long unsigned int) ExpectedInfo[i].Address);
165 #endif
166 #else
167 printf ("API Error: Address of %s (0x%X) != (0x%X)\n",
168@@ -2908,7 +2909,8 @@
169 TestErrors++;
170 printf ("AtGetNextObjectTypeCommon: different numbers of entities"
171 "in TypesNames (%d) and LevelTypes0000 (%d)\n",
172- TypesCount, sizeof (LevelTypes0000) / sizeof (ACPI_OBJECT_TYPE));
173+ TypesCount,
174+ (int) (sizeof (LevelTypes0000) / sizeof (ACPI_OBJECT_TYPE)));
175 return (AE_ERROR);
176 }
177
178@@ -4192,7 +4194,9 @@
179 Pathname, Obj.Integer.Value, Value);
180 #else
181 printf ("API Error: Value of %s is 0x%llx instead of expected 0x%llx\n",
182- Pathname, Obj.Integer.Value, Value);
183+ Pathname,
184+ (long long unsigned int) Obj.Integer.Value,
185+ (long long unsigned int) Value);
186 #endif
187 Status = AE_ERROR;
188 }
189@@ -5199,7 +5203,7 @@
190 {
191 AapiErrors++;
192 printf ("API Error: AcpiOsAllocate(%d) returned NULL\n",
193- OutName.Length);
194+ (int) OutName.Length);
195 return (AE_ERROR);
196 }
197 }
198diff -urN acpica-unix2-20130626/tests/aapits/atosxfctrl.c acpica-unix2-20130626-aapits/tests/aapits/atosxfctrl.c
199--- acpica-unix2-20130626/tests/aapits/atosxfctrl.c 2013-01-17 12:48:28.000000000 -0700
200+++ acpica-unix2-20130626-aapits/tests/aapits/atosxfctrl.c 2013-07-25 13:30:00.375492751 -0600
201@@ -737,13 +737,15 @@
202 #if ACPI_MACHINE_WIDTH == 64
203 #ifdef _MSC_VER
204 printf("OsxfCtrlFingReg: unexpected Width %d of Reg 0x%I64x\n",
205+ Width, Address);
206 #else
207 printf("OsxfCtrlFingReg: unexpected Width %d of Reg 0x%llx\n",
208+ Width, (long long unsigned int) Address);
209 #endif
210 #else
211 printf("OsxfCtrlFingReg: unexpected Width %d of Reg 0x%x\n",
212-#endif
213 Width, Address);
214+#endif
215 return (NULL);
216 }
217
218@@ -764,15 +766,19 @@
219 #ifdef _MSC_VER
220 printf("OsxfCtrlFingReg: intersection Regs (0x%I64x: 0x%x)"
221 " and (0x%I64x: 0x%x)\n",
222+ Reg->Address, Reg->Width, Address, Width);
223 #else
224 printf("OsxfCtrlFingReg: intersection Regs (0x%llx: 0x%x)"
225 " and (0x%llx: 0x%x)\n",
226+ (long long unsigned int) Reg->Address,
227+ Reg->Width,
228+ (long long unsigned int) Address, Width);
229 #endif
230 #else
231 printf("OsxfCtrlFingReg: intersection Regs (0x%x: 0x%x)"
232 " and (0x%x: 0x%x)\n",
233-#endif
234 Reg->Address, Reg->Width, Address, Width);
235+#endif
236 return (NULL);
237 }
238 }
239@@ -786,13 +792,15 @@
240 #if ACPI_MACHINE_WIDTH == 64
241 #ifdef _MSC_VER
242 printf("OsxfCtrlFingReg: no memory for Reg (0x%I64x: 0x%x)\n",
243+ Reg->Address, Reg->Width);
244 #else
245 printf("OsxfCtrlFingReg: no memory for Reg (0x%llx: 0x%x)\n",
246+ (long long unsigned int) Reg->Address, Reg->Width);
247 #endif
248 #else
249 printf("OsxfCtrlFingReg: no memory for Reg (0x%x: 0x%x)\n",
250-#endif
251 Reg->Address, Reg->Width);
252+#endif
253 return (NULL);
254 }
255 Reg->Type = Type;
256@@ -932,14 +940,19 @@
257 #if ACPI_MACHINE_WIDTH == 64
258 #ifdef _MSC_VER
259 printf("%.2u (%s Address 0x%I64x: Width %.2u) r/w counts: %u/%u\n",
260+ i, (Reg->Type == EMUL_REG_SYS)? "SYS": "IO",
261+ Reg->Address, Reg->Width, Reg->ReadCount, Reg->WriteCount);
262 #else
263 printf("%.2u (%s Address 0x%llx: Width %.2u) r/w counts: %u/%u\n",
264+ i, (Reg->Type == EMUL_REG_SYS)? "SYS": "IO",
265+ (long long unsigned int) Reg->Address,
266+ Reg->Width, Reg->ReadCount, Reg->WriteCount);
267 #endif
268 #else
269 printf("%.2u (%s Address 0x%.4x: Width %.2u) r/w counts: %u/%u\n",
270-#endif
271 i, (Reg->Type == EMUL_REG_SYS)? "SYS": "IO",
272 Reg->Address, Reg->Width, Reg->ReadCount, Reg->WriteCount);
273+#endif
274 Reg = Reg->Next;
275 i++;
276 }
277diff -urN acpica-unix2-20130626/tests/aapits/atresource.c acpica-unix2-20130626-aapits/tests/aapits/atresource.c
278--- acpica-unix2-20130626/tests/aapits/atresource.c 2013-01-17 12:48:29.000000000 -0700
279+++ acpica-unix2-20130626-aapits/tests/aapits/atresource.c 2013-07-25 13:25:49.423565947 -0600
280@@ -174,7 +174,7 @@
281 AapiErrors++;
282 printf ("API Error: AcpiGetCurrentResources(%s) returned Length %d,"
283 " expected %d\n",
284- Pathname, OutBuffer.Length, RT0000_DEV0_CRS_LEN);
285+ Pathname, (int) OutBuffer.Length, RT0000_DEV0_CRS_LEN);
286 return (AE_ERROR);
287 }
288
289@@ -490,7 +490,7 @@
290 AapiErrors++;
291 printf ("API Error: AcpiGetCurrentResources(%s) returned Length %d,"
292 " expected %d\n",
293- Pathname, OutBuffer.Length, RT0000_DEV0_CRS_LEN);
294+ Pathname, (int) OutBuffer.Length, RT0000_DEV0_CRS_LEN);
295 return (AE_ERROR);
296 }
297
298@@ -689,7 +689,7 @@
299 AapiErrors++;
300 printf ("Api Error: Resource->Length (%d) != %d\n",
301 CurrentResource->Length,
302- ACPI_ROUND_UP_TO_NATIVE_WORD (ACPI_RS_SIZE (ACPI_RESOURCE_IRQ)));
303+ (int) (ACPI_ROUND_UP_TO_NATIVE_WORD (ACPI_RS_SIZE (ACPI_RESOURCE_IRQ))));
304 }
305
306 if (CurrentResource->Data.Irq.Triggering != 0) /* Level-Triggered */
307@@ -981,7 +981,7 @@
308 AapiErrors++;
309 printf ("API Error: AcpiGetPossibleResources(%s) returned Length %d,"
310 " expected %d\n",
311- Pathname, OutBuffer.Length, RT0000_DEV0_CRS_LEN);
312+ Pathname, (int) OutBuffer.Length, RT0000_DEV0_CRS_LEN);
313 return (AE_ERROR);
314 }
315
316@@ -1923,7 +1923,7 @@
317 AapiErrors++;
318 printf ("API Error: AcpiGetIrqRoutingTable(%s) returned Length %d,"
319 " expected %d\n",
320- Pathname, OutBuffer.Length, 0xA48);
321+ Pathname, (int) OutBuffer.Length, 0xA48);
322 return (AE_ERROR);
323 }
324
325diff -urN acpica-unix2-20130626/tests/aapits/Makefile acpica-unix2-20130626-aapits/tests/aapits/Makefile
326--- acpica-unix2-20130626/tests/aapits/Makefile 2013-01-17 12:48:29.000000000 -0700
327+++ acpica-unix2-20130626-aapits/tests/aapits/Makefile 2013-07-25 15:17:09.309236422 -0600
328@@ -194,7 +194,7 @@
329 CFLAGS+= -Wall -g -D_LINUX -DNDEBUG -D_CONSOLE -DACPI_APITS -DACPI_EXEC_APP -D_MULTI_THREADED -Wstrict-prototypes -I../../source/include
330
331
332-acpiexec : $(patsubst %.c,%.o, $(SRCS))
333+$(PROG) : $(patsubst %.c,%.o, $(SRCS))
334 $(CC) $(LDFLAGS) $(patsubst %.c,%.o, $(SRCS)) -o $(PROG)
335
336 CLEANFILES= $(PROG)