Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 100659 | Differences between
and this patch

Collapse All | Expand All

(-)./include/asm-i386/unistd.h.orig (+112 lines)
Lines 321-326 Link Here
321
__syscall_return(type,__res); \
321
__syscall_return(type,__res); \
322
}
322
}
323
323
324
#ifdef __PIC__
325
#define _syscall1(type,name,type1,arg1) \
326
type name(type1 arg1) \
327
{ \
328
long __res; \
329
__asm__ volatile (\
330
	"pushl %%ebx\n\t" \
331
	"movl %2,%%ebx\n\t" \
332
	"int $0x80\n\t" \
333
	"popl %%ebx\n\t" \
334
	: "=a" (__res) \
335
	: "0" (__NR_##name),"r" ((long)(arg1))); \
336
__syscall_return(type,__res); \
337
}
338
#else
324
#define _syscall1(type,name,type1,arg1) \
339
#define _syscall1(type,name,type1,arg1) \
325
type name(type1 arg1) \
340
type name(type1 arg1) \
326
{ \
341
{ \
Lines 330-336 Link Here
330
	: "0" (__NR_##name),"b" ((long)(arg1))); \
345
	: "0" (__NR_##name),"b" ((long)(arg1))); \
331
__syscall_return(type,__res); \
346
__syscall_return(type,__res); \
332
}
347
}
348
#endif
333
349
350
#ifdef __PIC__
351
#define _syscall2(type,name,type1,arg1,type2,arg2) \
352
type name(type1 arg1,type2 arg2) \
353
{ \
354
long __res; \
355
__asm__ volatile (\
356
	"pushl %%ebx\n\t" \
357
	"movl %2,%%ebx\n\t" \
358
	"int $0x80\n\t" \
359
	"popl %%ebx\n\t" \
360
	: "=a" (__res) \
361
	: "0" (__NR_##name),"r" ((long)(arg1)),"c" ((long)(arg2))); \
362
__syscall_return(type,__res); \
363
}
364
#else
334
#define _syscall2(type,name,type1,arg1,type2,arg2) \
365
#define _syscall2(type,name,type1,arg1,type2,arg2) \
335
type name(type1 arg1,type2 arg2) \
366
type name(type1 arg1,type2 arg2) \
336
{ \
367
{ \
Lines 340-346 Link Here
340
	: "0" (__NR_##name),"b" ((long)(arg1)),"c" ((long)(arg2))); \
371
	: "0" (__NR_##name),"b" ((long)(arg1)),"c" ((long)(arg2))); \
341
__syscall_return(type,__res); \
372
__syscall_return(type,__res); \
342
}
373
}
374
#endif
343
375
376
#ifdef __PIC__
377
#define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \
378
type name(type1 arg1,type2 arg2,type3 arg3) \
379
{ \
380
long __res; \
381
__asm__ volatile (\
382
	"pushl %%ebx\n\t" \
383
	"movl %2,%%ebx\n\t" \
384
	"int $0x80\n\t" \
385
	"popl %%ebx\n\t" \
386
	: "=a" (__res) \
387
	: "0" (__NR_##name),"r" ((long)(arg1)),"c" ((long)(arg2)), \
388
		  "d" ((long)(arg3))); \
389
__syscall_return(type,__res); \
390
}
391
#else
344
#define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \
392
#define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \
345
type name(type1 arg1,type2 arg2,type3 arg3) \
393
type name(type1 arg1,type2 arg2,type3 arg3) \
346
{ \
394
{ \
Lines 351-357 Link Here
351
		  "d" ((long)(arg3))); \
399
		  "d" ((long)(arg3))); \
352
__syscall_return(type,__res); \
400
__syscall_return(type,__res); \
353
}
401
}
402
#endif
354
403
404
#ifdef __PIC__
405
#define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
406
type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
407
{ \
408
long __res; \
409
__asm__ volatile (\
410
	"pushl %%ebx\n\t" \
411
	"movl %2,%%ebx\n\t" \
412
	"int $0x80\n\t" \
413
	"popl %%ebx\n\t" \
414
	: "=a" (__res) \
415
	: "0" (__NR_##name),"r" ((long)(arg1)),"c" ((long)(arg2)), \
416
	  "d" ((long)(arg3)),"S" ((long)(arg4))); \
417
__syscall_return(type,__res); \
418
} 
419
#else
355
#define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
420
#define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
356
type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
421
type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
357
{ \
422
{ \
Lines 362-368 Link Here
362
	  "d" ((long)(arg3)),"S" ((long)(arg4))); \
427
	  "d" ((long)(arg3)),"S" ((long)(arg4))); \
363
__syscall_return(type,__res); \
428
__syscall_return(type,__res); \
364
} 
429
} 
430
#endif
365
431
432
#ifdef __PIC__
433
#define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \
434
	  type5,arg5) \
435
type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5) \
436
{ \
437
long __res; \
438
__asm__ volatile (\
439
	"pushl %%ebx\n\t" \
440
	"movl %2,%%ebx\n\t" \
441
	"int $0x80\n\t" \
442
	"popl %%ebx\n\t" \
443
	: "=a" (__res) \
444
	: "0" (__NR_##name),"m" ((long)(arg1)),"c" ((long)(arg2)), \
445
	  "d" ((long)(arg3)),"S" ((long)(arg4)),"D" ((long)(arg5))); \
446
__syscall_return(type,__res); \
447
}
448
#else
366
#define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \
449
#define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \
367
	  type5,arg5) \
450
	  type5,arg5) \
368
type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5) \
451
type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5) \
Lines 374-380 Link Here
374
	  "d" ((long)(arg3)),"S" ((long)(arg4)),"D" ((long)(arg5))); \
457
	  "d" ((long)(arg3)),"S" ((long)(arg4)),"D" ((long)(arg5))); \
375
__syscall_return(type,__res); \
458
__syscall_return(type,__res); \
376
}
459
}
460
#endif
377
461
462
/* Note; since %2 is memory, it's likely to be offset from %%ebp,
463
 * so the read of %2 must occur before %%ebp is used to save %%eax.
464
 * Moving %1 to %%eax is safe since %1 is immediate, and won't be
465
 * an offset from %%ebx.
466
 */
467
#ifdef __PIC__
468
#define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \
469
	  type5,arg5,type6,arg6) \
470
type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5,type6 arg6) \
471
{ \
472
long __res; \
473
__asm__ volatile (\
474
	"pushl %%ebp\n\t" \
475
	"pushl %%ebx\n\t" \
476
	"movl %2,%%ebx\n\t" \
477
	"movl %%eax,%%ebp\n\t" \
478
	"movl %1,%%eax\n\t" \
479
	"int $0x80\n\t" \
480
	"popl %%ebx\n\t" \
481
	"popl %%ebp\n\t" \
482
	: "=a" (__res) \
483
	: "i" (__NR_##name),"m" ((long)(arg1)),"c" ((long)(arg2)), \
484
	  "d" ((long)(arg3)),"S" ((long)(arg4)),"D" ((long)(arg5)), \
485
	  "0" ((long)(arg6))); \
486
__syscall_return(type,__res); \
487
}
488
#else
378
#define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \
489
#define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \
379
	  type5,arg5,type6,arg6) \
490
	  type5,arg5,type6,arg6) \
380
type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5,type6 arg6) \
491
type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5,type6 arg6) \
Lines 387-392 Link Here
387
	  "0" ((long)(arg6))); \
498
	  "0" ((long)(arg6))); \
388
__syscall_return(type,__res); \
499
__syscall_return(type,__res); \
389
}
500
}
501
#endif
390
502
391
#ifdef __KERNEL__
503
#ifdef __KERNEL__
392
#define __ARCH_WANT_IPC_PARSE_VERSION
504
#define __ARCH_WANT_IPC_PARSE_VERSION

Return to bug 100659