Commit c860ca9ac0fc7ee44124c5637dda751f55e4fa3f

Richard Henderson 2014-12-17T13:24:03

s390: Kill trailing whitespace

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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
diff --git a/src/s390/ffi.c b/src/s390/ffi.c
index 477b85e..b0c3092 100644
--- a/src/s390/ffi.c
+++ b/src/s390/ffi.c
@@ -1,9 +1,9 @@
 /* -----------------------------------------------------------------------
    ffi.c - Copyright (c) 2000, 2007 Software AG
            Copyright (c) 2008 Red Hat, Inc
- 
+
    S390 Foreign Function Interface
- 
+
    Permission is hereby granted, free of charge, to any person obtaining
    a copy of this software and associated documentation files (the
    ``Software''), to deal in the Software without restriction, including
@@ -11,10 +11,10 @@
    distribute, sublicense, and/or sell copies of the Software, and to
    permit persons to whom the Software is furnished to do so, subject to
    the following conditions:
- 
+
    The above copyright notice and this permission notice shall be included
    in all copies or substantial portions of the Software.
- 
+
    THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
    OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
@@ -27,24 +27,24 @@
 /*                          Includes                                  */
 /*                          --------                                  */
 /*====================================================================*/
- 
+
 #include <ffi.h>
 #include <ffi_common.h>
- 
+
 #include <stdlib.h>
 #include <stdio.h>
- 
+
 /*====================== End of Includes =============================*/
- 
+
 /*====================================================================*/
 /*                           Defines                                  */
 /*                           -------                                  */
 /*====================================================================*/
 
-/* Maximum number of GPRs available for argument passing.  */ 
+/* Maximum number of GPRs available for argument passing.  */
 #define MAX_GPRARGS 5
 
-/* Maximum number of FPRs available for argument passing.  */ 
+/* Maximum number of FPRs available for argument passing.  */
 #ifdef __s390x__
 #define MAX_FPRARGS 4
 #else
@@ -63,12 +63,12 @@
 #define FFI390_RET_INT64	5
 
 /*===================== End of Defines ===============================*/
- 
+
 /*====================================================================*/
 /*                          Externals                                 */
 /*                          ---------                                 */
 /*====================================================================*/
- 
+
 extern void ffi_call_SYSV(unsigned,
 			  extended_cif *,
 			  void (*)(unsigned char *, extended_cif *),
@@ -78,9 +78,9 @@ extern void ffi_call_SYSV(unsigned,
 
 extern void ffi_closure_SYSV(void);
 extern void ffi_go_closure_SYSV(void);
- 
+
 /*====================== End of Externals ============================*/
- 
+
 /*====================================================================*/
 /*                                                                    */
 /* Name     - ffi_check_struct_type.                                  */
@@ -89,7 +89,7 @@ extern void ffi_go_closure_SYSV(void);
 /*            general purpose or floating point register.             */
 /*                                                                    */
 /*====================================================================*/
- 
+
 static int
 ffi_check_struct_type (ffi_type *arg)
 {
@@ -97,7 +97,7 @@ ffi_check_struct_type (ffi_type *arg)
 
   /* If the struct has just one element, look at that element
      to find out whether to consider the struct as floating point.  */
-  while (arg->type == FFI_TYPE_STRUCT 
+  while (arg->type == FFI_TYPE_STRUCT
          && arg->elements[0] && !arg->elements[1])
     arg = arg->elements[0];
 
@@ -130,9 +130,9 @@ ffi_check_struct_type (ffi_type *arg)
   /* Other structs are passed via a pointer to the data.  */
   return FFI_TYPE_POINTER;
 }
- 
+
 /*======================== End of Routine ============================*/
- 
+
 /*====================================================================*/
 /*                                                                    */
 /* Name     - ffi_prep_args.                                          */
@@ -143,7 +143,7 @@ ffi_check_struct_type (ffi_type *arg)
 /* has been allocated for the function's arguments.                   */
 /*                                                                    */
 /*====================================================================*/
- 
+
 static void
 ffi_prep_args (unsigned char *stack, extended_cif *ecif)
 {
@@ -178,7 +178,7 @@ ffi_prep_args (unsigned char *stack, extended_cif *ecif)
   ffi_type **ptr;
   void **p_argv = ecif->avalue;
   int i;
- 
+
   /* If we returning a structure then we set the first parameter register
      to the address of where we are returning this structure.  */
 
@@ -186,7 +186,7 @@ ffi_prep_args (unsigned char *stack, extended_cif *ecif)
     p_gpr[n_gpr++] = (unsigned long) ecif->rvalue;
 
   /* Now for the arguments.  */
- 
+
   for (ptr = ecif->cif->arg_types, i = ecif->cif->nargs;
        i > 0;
        i--, ptr++, p_argv++)
@@ -218,7 +218,7 @@ ffi_prep_args (unsigned char *stack, extended_cif *ecif)
 	}
 
       /* Now handle all primitive int/pointer/float data types.  */
-      switch (type) 
+      switch (type)
 	{
 	  case FFI_TYPE_DOUBLE:
 	    if (n_fpr < MAX_FPRARGS)
@@ -231,7 +231,7 @@ ffi_prep_args (unsigned char *stack, extended_cif *ecif)
 	      p_ov[n_ov++] = ((unsigned long *) arg)[1];
 #endif
 	    break;
-	
+
 	  case FFI_TYPE_FLOAT:
 	    if (n_fpr < MAX_FPRARGS)
 	      p_fpr[n_fpr++] = (long long) *(unsigned int *) arg << 32;
@@ -245,7 +245,7 @@ ffi_prep_args (unsigned char *stack, extended_cif *ecif)
 	    else
 	      p_ov[n_ov++] = (unsigned long)*(unsigned char **) arg;
 	    break;
- 
+
 	  case FFI_TYPE_UINT64:
 	  case FFI_TYPE_SINT64:
 #ifdef __s390x__
@@ -264,14 +264,14 @@ ffi_prep_args (unsigned char *stack, extended_cif *ecif)
 	      p_ov[n_ov++] = ((unsigned long *) arg)[1];
 #endif
 	    break;
- 
+
 	  case FFI_TYPE_UINT32:
 	    if (n_gpr < MAX_GPRARGS)
 	      p_gpr[n_gpr++] = *(unsigned int *) arg;
 	    else
 	      p_ov[n_ov++] = *(unsigned int *) arg;
 	    break;
- 
+
 	  case FFI_TYPE_INT:
 	  case FFI_TYPE_SINT32:
 	    if (n_gpr < MAX_GPRARGS)
@@ -279,14 +279,14 @@ ffi_prep_args (unsigned char *stack, extended_cif *ecif)
 	    else
 	      p_ov[n_ov++] = *(signed int *) arg;
 	    break;
- 
+
 	  case FFI_TYPE_UINT16:
 	    if (n_gpr < MAX_GPRARGS)
 	      p_gpr[n_gpr++] = *(unsigned short *) arg;
 	    else
 	      p_ov[n_ov++] = *(unsigned short *) arg;
 	    break;
- 
+
 	  case FFI_TYPE_SINT16:
 	    if (n_gpr < MAX_GPRARGS)
 	      p_gpr[n_gpr++] = *(signed short *) arg;
@@ -300,14 +300,14 @@ ffi_prep_args (unsigned char *stack, extended_cif *ecif)
 	    else
 	      p_ov[n_ov++] = *(unsigned char *) arg;
 	    break;
- 
+
 	  case FFI_TYPE_SINT8:
 	    if (n_gpr < MAX_GPRARGS)
 	      p_gpr[n_gpr++] = *(signed char *) arg;
 	    else
 	      p_ov[n_ov++] = *(signed char *) arg;
 	    break;
- 
+
 	  default:
 	    FFI_ASSERT (0);
 	    break;
@@ -316,7 +316,7 @@ ffi_prep_args (unsigned char *stack, extended_cif *ecif)
 }
 
 /*======================== End of Routine ============================*/
- 
+
 /*====================================================================*/
 /*                                                                    */
 /* Name     - ffi_prep_cif_machdep.                                   */
@@ -324,7 +324,7 @@ ffi_prep_args (unsigned char *stack, extended_cif *ecif)
 /* Function - Perform machine dependent CIF processing.               */
 /*                                                                    */
 /*====================================================================*/
- 
+
 ffi_status
 ffi_prep_cif_machdep(ffi_cif *cif)
 {
@@ -336,7 +336,7 @@ ffi_prep_cif_machdep(ffi_cif *cif)
   ffi_type **ptr;
   int i;
 
-  /* Determine return value handling.  */ 
+  /* Determine return value handling.  */
 
   switch (cif->rtype->type)
     {
@@ -350,7 +350,7 @@ ffi_prep_cif_machdep(ffi_cif *cif)
       case FFI_TYPE_COMPLEX:
 	cif->flags = FFI390_RET_STRUCT;
 	n_gpr++;  /* We need one GPR to pass the pointer.  */
-	break; 
+	break;
 
       /* Floating point values are returned in fpr 0.  */
       case FFI_TYPE_FLOAT:
@@ -389,14 +389,14 @@ ffi_prep_cif_machdep(ffi_cif *cif)
 	cif->flags = FFI390_RET_INT32;
 #endif
 	break;
- 
+
       default:
         FFI_ASSERT (0);
         break;
     }
 
   /* Now for the arguments.  */
- 
+
   for (ptr = cif->arg_types, i = cif->nargs;
        i > 0;
        i--, ptr++)
@@ -424,7 +424,7 @@ ffi_prep_cif_machdep(ffi_cif *cif)
 	}
 
       /* Now handle all primitive int/float data types.  */
-      switch (type) 
+      switch (type)
 	{
 	  /* The first MAX_FPRARGS floating point arguments
 	     go in FPRs, the rest overflow to the stack.  */
@@ -435,7 +435,7 @@ ffi_prep_cif_machdep(ffi_cif *cif)
 	    else
 	      n_ov += sizeof (double) / sizeof (long);
 	    break;
-	
+
 	  case FFI_TYPE_FLOAT:
 	    if (n_fpr < MAX_FPRARGS)
 	      n_fpr++;
@@ -445,9 +445,9 @@ ffi_prep_cif_machdep(ffi_cif *cif)
 
 	  /* On 31-bit machines, 64-bit integers are passed in GPR pairs,
 	     if one is still available, or else on the stack.  If only one
-	     register is free, skip the register (it won't be used for any 
+	     register is free, skip the register (it won't be used for any
 	     subsequent argument either).  */
-	      
+
 #ifndef __s390x__
 	  case FFI_TYPE_UINT64:
 	  case FFI_TYPE_SINT64:
@@ -463,7 +463,7 @@ ffi_prep_cif_machdep(ffi_cif *cif)
 	  /* Everything else is passed in GPRs (until MAX_GPRARGS
 	     have been used) or overflows to the stack.  */
 
-	  default: 
+	  default:
 	    if (n_gpr < MAX_GPRARGS)
 	      n_gpr++;
 	    else
@@ -476,12 +476,12 @@ ffi_prep_cif_machdep(ffi_cif *cif)
      and temporary structure copies.  */
 
   cif->bytes = ROUND_SIZE (n_ov * sizeof (long)) + struct_size;
- 
+
   return FFI_OK;
 }
- 
+
 /*======================== End of Routine ============================*/
- 
+
 /*====================================================================*/
 /*                                                                    */
 /* Name     - ffi_call.                                               */
@@ -489,7 +489,7 @@ ffi_prep_cif_machdep(ffi_cif *cif)
 /* Function - Call the FFI routine.                                   */
 /*                                                                    */
 /*====================================================================*/
- 
+
 static void
 ffi_call_int(ffi_cif *cif,
 	     void (*fn)(void),
@@ -499,7 +499,7 @@ ffi_call_int(ffi_cif *cif,
 {
   int ret_type = cif->flags;
   extended_cif ecif;
- 
+
   ecif.cif    = cif;
   ecif.avalue = avalue;
   ecif.rvalue = rvalue;
@@ -511,7 +511,7 @@ ffi_call_int(ffi_cif *cif,
 	ecif.rvalue = alloca (cif->rtype->size);
       else
 	ret_type = FFI390_RET_VOID;
-    } 
+    }
 
   switch (cif->abi)
     {
@@ -519,7 +519,7 @@ ffi_call_int(ffi_cif *cif,
         ffi_call_SYSV (cif->bytes, &ecif, ffi_prep_args,
 		       ret_type, ecif.rvalue, fn, closure);
         break;
- 
+
       default:
         FFI_ASSERT (0);
         break;
@@ -538,7 +538,7 @@ ffi_call_go (ffi_cif *cif, void (*fn)(void), void *rvalue,
 {
   ffi_call_int(cif, fn, rvalue, avalue, closure);
 }
- 
+
 /*======================== End of Routine ============================*/
 
 /*====================================================================*/
@@ -575,8 +575,8 @@ ffi_closure_helper_SYSV (ffi_cif *cif,
 
   p_arg = avalue = alloca (cif->nargs * sizeof (void *));
 
-  /* If we returning a structure, pass the structure address 
-     directly to the target function.  Otherwise, have the target 
+  /* If we returning a structure, pass the structure address
+     directly to the target function.  Otherwise, have the target
      function store the return value to the GPR save area.  */
 
   if (cif->flags == FFI390_RET_STRUCT)
@@ -603,7 +603,7 @@ ffi_closure_helper_SYSV (ffi_cif *cif,
 	  else
 	    type = ffi_check_struct_type (*ptr);
 
-	  /* If we pass the struct via pointer, remember to 
+	  /* If we pass the struct via pointer, remember to
 	     retrieve the pointer later.  */
 	  if (type == FFI_TYPE_POINTER)
 	    deref_struct_pointer = 1;
@@ -618,23 +618,23 @@ ffi_closure_helper_SYSV (ffi_cif *cif,
 #endif
 
       /* Now handle all primitive int/float data types.  */
-      switch (type) 
+      switch (type)
 	{
 	  case FFI_TYPE_DOUBLE:
 	    if (n_fpr < MAX_FPRARGS)
 	      *p_arg = &p_fpr[n_fpr++];
 	    else
-	      *p_arg = &p_ov[n_ov], 
+	      *p_arg = &p_ov[n_ov],
 	      n_ov += sizeof (double) / sizeof (long);
 	    break;
-	
+
 	  case FFI_TYPE_FLOAT:
 	    if (n_fpr < MAX_FPRARGS)
 	      *p_arg = &p_fpr[n_fpr++];
 	    else
 	      *p_arg = (char *)&p_ov[n_ov++] + sizeof (long) - 4;
 	    break;
- 
+
 	  case FFI_TYPE_UINT64:
 	  case FFI_TYPE_SINT64:
 #ifdef __s390x__
@@ -651,7 +651,7 @@ ffi_closure_helper_SYSV (ffi_cif *cif,
 	      *p_arg = &p_ov[n_ov], n_ov += 2;
 #endif
 	    break;
- 
+
 	  case FFI_TYPE_INT:
 	  case FFI_TYPE_UINT32:
 	  case FFI_TYPE_SINT32:
@@ -660,7 +660,7 @@ ffi_closure_helper_SYSV (ffi_cif *cif,
 	    else
 	      *p_arg = (char *)&p_ov[n_ov++] + sizeof (long) - 4;
 	    break;
- 
+
 	  case FFI_TYPE_UINT16:
 	  case FFI_TYPE_SINT16:
 	    if (n_gpr < MAX_GPRARGS)
@@ -676,7 +676,7 @@ ffi_closure_helper_SYSV (ffi_cif *cif,
 	    else
 	      *p_arg = (char *)&p_ov[n_ov++] + sizeof (long) - 1;
 	    break;
- 
+
 	  default:
 	    FFI_ASSERT (0);
 	    break;
@@ -744,7 +744,7 @@ ffi_closure_helper_SYSV (ffi_cif *cif,
         break;
     }
 }
- 
+
 /*======================== End of Routine ============================*/
 
 /*====================================================================*/
@@ -754,7 +754,7 @@ ffi_closure_helper_SYSV (ffi_cif *cif,
 /* Function - Prepare a FFI closure.                                  */
 /*                                                                    */
 /*====================================================================*/
- 
+
 ffi_status
 ffi_prep_closure_loc (ffi_closure *closure,
 		      ffi_cif *cif,
@@ -780,17 +780,17 @@ ffi_prep_closure_loc (ffi_closure *closure,
   *(short *)&closure->tramp [8] = 0x07f1;   /* br %r1 */
   *(long  *)&closure->tramp[16] = (long)codeloc;
   *(long  *)&closure->tramp[24] = (long)&ffi_closure_SYSV;
-#endif 
- 
+#endif
+
   closure->cif = cif;
   closure->user_data = user_data;
   closure->fun = fun;
- 
+
   return FFI_OK;
 }
 
 /*======================== End of Routine ============================*/
- 
+
 /* Build a Go language closure.  */
 
 ffi_status
diff --git a/src/s390/sysv.S b/src/s390/sysv.S
index 14672ac..b01a7eb 100644
--- a/src/s390/sysv.S
+++ b/src/s390/sysv.S
@@ -1,9 +1,9 @@
 /* -----------------------------------------------------------------------
    sysv.S - Copyright (c) 2000 Software AG
             Copyright (c) 2008 Red Hat, Inc.
- 
+
    S390 Foreign Function Interface
- 
+
    Permission is hereby granted, free of charge, to any person obtaining
    a copy of this software and associated documentation files (the
    ``Software''), to deal in the Software without restriction, including
@@ -11,10 +11,10 @@
    distribute, sublicense, and/or sell copies of the Software, and to
    permit persons to whom the Software is furnished to do so, subject to
    the following conditions:
- 
+
    The above copyright notice and this permission notice shall be included
    in all copies or substantial portions of the Software.
- 
+
    THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -30,7 +30,7 @@
 #include <ffi.h>
 
 #ifndef __s390x__
- 
+
 .text
 
 	# r2:	cif->bytes
@@ -38,7 +38,7 @@
 	# r4:	ffi_prep_args
 	# r5:	ret_type
 	# r6:	ecif.rvalue
-	# ov:	fn 
+	# ov:	fn
 	# ov+8:	closure
 
 	# This assumes we are using gas.
@@ -125,7 +125,7 @@ ffi_call_SYSV:
 	.cfi_restore_state
 	# See comment on the nopr above.
 	nopr
- 
+
 .LretDouble:
 	l	%r4,48+56(%r11)
 	std	%f0,0(%r8)			# Return double
@@ -167,7 +167,7 @@ ffi_call_SYSV:
 	.cfi_restore_state
 	# See comment on the nopr above.
 	nopr
- 
+
 .LretInt64:
 	l	%r4,48+56(%r11)
 	stm	%r2,%r3,0(%r8)			# Return long long
@@ -186,7 +186,7 @@ ffi_call_SYSV:
 	.cfi_def_cfa r15, 96
 	br	%r4
 	.cfi_endproc
- 
+
 .Ltable:
 	.byte	.LretNone-.Lbase		# FFI390_RET_VOID
 	.byte	.LretNone-.Lbase		# FFI390_RET_STRUCT
@@ -269,15 +269,15 @@ ffi_go_closure_SYSV:
 	.cfi_endproc
 
 #else
- 
+
 .text
- 
+
 	# r2:	cif->bytes
 	# r3:	&ecif
 	# r4:	ffi_prep_args
 	# r5:	ret_type
 	# r6:	ecif.rvalue
-	# ov:	fn 
+	# ov:	fn
 	# ov+8:	closure
 
 	# This assumes we are using gas.
@@ -365,7 +365,7 @@ ffi_call_SYSV:
 	.cfi_restore_state
 	# See comment on the nopr above.
 	nopr
- 
+
 .LretDouble:
 	lg	%r4,80+112(%r11)
 	std	%f0,0(%r8)			# Return double
@@ -404,7 +404,7 @@ ffi_call_SYSV:
 	.cfi_def_cfa r15, 160
 	br	%r4
 	.cfi_endproc
- 
+
 .Ltable:
 	.byte	.LretNone-.Lbase		# FFI390_RET_VOID
 	.byte	.LretNone-.Lbase		# FFI390_RET_STRUCT
@@ -461,7 +461,7 @@ ffi_closure_SYSV:
 .ffi_closure_SYSV_end:
 	.size	 ffi_closure_SYSV,.ffi_closure_SYSV_end-ffi_closure_SYSV
 
-	
+
 	.globl	ffi_go_closure_SYSV
 	FFI_HIDDEN(ffi_go_closure_SYSV)
 	.type	ffi_go_closure_SYSV,%function