diff options
author | Yoshinori Sato <ysato@users.sourceforge.jp> | 2005-04-16 18:25:21 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:25:21 -0400 |
commit | 74ad74c1581c9a27582945ca01ffdb88fc774171 (patch) | |
tree | 334c0356525f04d888f4aed5d1d139d65a55d70b /include/asm-h8300/unistd.h | |
parent | d31ddaa1722793228b364e87b6c589023b348798 (diff) |
[PATCH] h8300 header update
- page.h: fix build error
- unistd.h: _syscall macro cleanup.
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/asm-h8300/unistd.h')
-rw-r--r-- | include/asm-h8300/unistd.h | 282 |
1 files changed, 137 insertions, 145 deletions
diff --git a/include/asm-h8300/unistd.h b/include/asm-h8300/unistd.h index 48b362ff7500..56a6401886fa 100644 --- a/include/asm-h8300/unistd.h +++ b/include/asm-h8300/unistd.h | |||
@@ -310,163 +310,155 @@ do { \ | |||
310 | return (type) (res); \ | 310 | return (type) (res); \ |
311 | } while (0) | 311 | } while (0) |
312 | 312 | ||
313 | #define _syscall0(type, name) \ | 313 | #define _syscall0(type, name) \ |
314 | type name(void) \ | 314 | type name(void) \ |
315 | { \ | 315 | { \ |
316 | register long __res __asm__("er0"); \ | 316 | register long __res __asm__("er0"); \ |
317 | __asm__ __volatile__ ("mov.l %1,er0\n\t" \ | 317 | __asm__ __volatile__ ("mov.l %1,er0\n\t" \ |
318 | "trapa #0\n\t" \ | 318 | "trapa #0\n\t" \ |
319 | : "=r" (__res) \ | 319 | : "=r" (__res) \ |
320 | : "ir" (__NR_##name) \ | 320 | : "g" (__NR_##name) \ |
321 | : "cc"); \ | 321 | : "cc", "memory"); \ |
322 | if ((unsigned long)(__res) >= (unsigned long)(-125)) { \ | 322 | __syscall_return(type, __res); \ |
323 | errno = -__res; \ | ||
324 | __res = -1; \ | ||
325 | } \ | ||
326 | return (type)__res; \ | ||
327 | } | 323 | } |
328 | 324 | ||
329 | #define _syscall1(type, name, atype, a) \ | 325 | #define _syscall1(type, name, atype, a) \ |
330 | type name(atype a) \ | 326 | type name(atype a) \ |
331 | { \ | 327 | { \ |
332 | register long __res __asm__("er0"); \ | 328 | register long __res __asm__("er0"); \ |
333 | __asm__ __volatile__ ("mov.l %2, er1\n\t" \ | 329 | register long _a __asm__("er1"); \ |
334 | "mov.l %1, er0\n\t" \ | 330 | _a = (long)a; \ |
335 | "trapa #0\n\t" \ | 331 | __asm__ __volatile__ ("mov.l %1,er0\n\t" \ |
336 | : "=r" (__res) \ | 332 | "trapa #0\n\t" \ |
337 | : "ir" (__NR_##name), \ | 333 | : "=r" (__res) \ |
338 | "g" ((long)a) \ | 334 | : "g" (__NR_##name), \ |
339 | : "cc", "er1"); \ | 335 | "g" (_a) \ |
340 | if ((unsigned long)(__res) >= (unsigned long)(-125)) { \ | 336 | : "cc", "memory"); \ |
341 | errno = -__res; \ | 337 | __syscall_return(type, __res); \ |
342 | __res = -1; \ | ||
343 | } \ | ||
344 | return (type)__res; \ | ||
345 | } | 338 | } |
346 | 339 | ||
347 | #define _syscall2(type, name, atype, a, btype, b) \ | 340 | #define _syscall2(type, name, atype, a, btype, b) \ |
348 | type name(atype a, btype b) \ | 341 | type name(atype a, btype b) \ |
349 | { \ | 342 | { \ |
350 | register long __res __asm__("er0"); \ | 343 | register long __res __asm__("er0"); \ |
351 | __asm__ __volatile__ ("mov.l %3, er2\n\t" \ | 344 | register long _a __asm__("er1"); \ |
352 | "mov.l %2, er1\n\t" \ | 345 | register long _b __asm__("er2"); \ |
353 | "mov.l %1, er0\n\t" \ | 346 | _a = (long)a; \ |
354 | "trapa #0\n\t" \ | 347 | _b = (long)b; \ |
355 | : "=r" (__res) \ | 348 | __asm__ __volatile__ ("mov.l %1,er0\n\t" \ |
356 | : "ir" (__NR_##name), \ | 349 | "trapa #0\n\t" \ |
357 | "g" ((long)a), \ | 350 | : "=r" (__res) \ |
358 | "g" ((long)b) \ | 351 | : "g" (__NR_##name), \ |
359 | : "cc", "er1", "er2"); \ | 352 | "g" (_a), \ |
360 | if ((unsigned long)(__res) >= (unsigned long)(-125)) { \ | 353 | "g" (_b) \ |
361 | errno = -__res; \ | 354 | : "cc", "memory"); \ |
362 | __res = -1; \ | 355 | __syscall_return(type, __res); \ |
363 | } \ | ||
364 | return (type)__res; \ | ||
365 | } | 356 | } |
366 | 357 | ||
367 | #define _syscall3(type, name, atype, a, btype, b, ctype, c) \ | 358 | #define _syscall3(type, name, atype, a, btype, b, ctype, c) \ |
368 | type name(atype a, btype b, ctype c) \ | 359 | type name(atype a, btype b, ctype c) \ |
369 | { \ | 360 | { \ |
370 | register long __res __asm__("er0"); \ | 361 | register long __res __asm__("er0"); \ |
371 | __asm__ __volatile__ ("mov.l %4, er3\n\t" \ | 362 | register long _a __asm__("er1"); \ |
372 | "mov.l %3, er2\n\t" \ | 363 | register long _b __asm__("er2"); \ |
373 | "mov.l %2, er1\n\t" \ | 364 | register long _c __asm__("er3"); \ |
374 | "mov.l %1, er0\n\t" \ | 365 | _a = (long)a; \ |
375 | "trapa #0\n\t" \ | 366 | _b = (long)b; \ |
376 | : "=r" (__res) \ | 367 | _c = (long)c; \ |
377 | : "ir" (__NR_##name), \ | 368 | __asm__ __volatile__ ("mov.l %1,er0\n\t" \ |
378 | "g" ((long)a), \ | 369 | "trapa #0\n\t" \ |
379 | "g" ((long)b), \ | 370 | : "=r" (__res) \ |
380 | "g" ((long)c) \ | 371 | : "g" (__NR_##name), \ |
381 | : "cc", "er1", "er2", "er3"); \ | 372 | "g" (_a), \ |
382 | if ((unsigned long)(__res) >= (unsigned long)(-125)) { \ | 373 | "g" (_b), \ |
383 | errno = -__res; \ | 374 | "g" (_c) \ |
384 | __res = -1; \ | 375 | : "cc", "memory"); \ |
385 | } \ | 376 | __syscall_return(type, __res); \ |
386 | return (type)__res; \ | ||
387 | } | 377 | } |
388 | 378 | ||
389 | #define _syscall4(type, name, atype, a, btype, b, ctype, c, dtype, d) \ | 379 | #define _syscall4(type, name, atype, a, btype, b, \ |
390 | type name(atype a, btype b, ctype c, dtype d) \ | 380 | ctype, c, dtype, d) \ |
391 | { \ | 381 | type name(atype a, btype b, ctype c, dtype d) \ |
392 | register long __res __asm__("er0"); \ | 382 | { \ |
393 | __asm__ __volatile__ ("mov.l %5, er4\n\t" \ | 383 | register long __res __asm__("er0"); \ |
394 | "mov.l %4, er3\n\t" \ | 384 | register long _a __asm__("er1"); \ |
395 | "mov.l %3, er2\n\t" \ | 385 | register long _b __asm__("er2"); \ |
396 | "mov.l %2, er1\n\t" \ | 386 | register long _c __asm__("er3"); \ |
397 | "mov.l %1, er0\n\t" \ | 387 | register long _d __asm__("er4"); \ |
398 | "trapa #0\n\t" \ | 388 | _a = (long)a; \ |
399 | : "=r" (__res) \ | 389 | _b = (long)b; \ |
400 | : "ir" (__NR_##name), \ | 390 | _c = (long)c; \ |
401 | "g" ((long)a), \ | 391 | _d = (long)d; \ |
402 | "g" ((long)b), \ | 392 | __asm__ __volatile__ ("mov.l %1,er0\n\t" \ |
403 | "g" ((long)c), \ | 393 | "trapa #0\n\t" \ |
404 | "g" ((long)d) \ | 394 | : "=r" (__res) \ |
405 | : "cc", "er1", "er2", "er3", "er4"); \ | 395 | : "g" (__NR_##name), \ |
406 | if ((unsigned long)(__res) >= (unsigned long)(-125)) { \ | 396 | "g" (_a), \ |
407 | errno = -__res; \ | 397 | "g" (_b), \ |
408 | __res = -1; \ | 398 | "g" (_c), \ |
409 | } \ | 399 | "g" (_d) \ |
410 | return (type)__res; \ | 400 | : "cc", "memory"); \ |
401 | __syscall_return(type, __res); \ | ||
411 | } | 402 | } |
412 | 403 | ||
413 | #define _syscall5(type, name, atype, a, btype, b, ctype, c, dtype, d, etype, e) \ | 404 | #define _syscall5(type, name, atype, a, btype, b, \ |
414 | type name(atype a, btype b, ctype c, dtype d, etype e) \ | 405 | ctype, c, dtype, d, etype, e) \ |
415 | { \ | 406 | type name(atype a, btype b, ctype c, dtype d, etype e) \ |
416 | register long __res __asm__("er0"); \ | 407 | { \ |
417 | __asm__ __volatile__ ("mov.l %6, er5\n\t" \ | 408 | register long __res __asm__("er0"); \ |
418 | "mov.l %5, er4\n\t" \ | 409 | register long _a __asm__("er1"); \ |
419 | "mov.l %4, er3\n\t" \ | 410 | register long _b __asm__("er2"); \ |
420 | "mov.l %3, er2\n\t" \ | 411 | register long _c __asm__("er3"); \ |
421 | "mov.l %2, er1\n\t" \ | 412 | register long _d __asm__("er4"); \ |
422 | "mov.l %1, er0\n\t" \ | 413 | register long _e __asm__("er5"); \ |
423 | "trapa #0\n\t" \ | 414 | _a = (long)a; \ |
424 | : "=r" (__res) \ | 415 | _b = (long)b; \ |
425 | : "ir" (__NR_##name), \ | 416 | _c = (long)c; \ |
426 | "g" ((long)a), \ | 417 | _d = (long)d; \ |
427 | "g" ((long)b), \ | 418 | _e = (long)e; \ |
428 | "g" ((long)c), \ | 419 | __asm__ __volatile__ ("mov.l %1,er0\n\t" \ |
429 | "g" ((long)d), \ | 420 | "trapa #0\n\t" \ |
430 | "m" ((long)e) \ | 421 | : "=r" (__res) \ |
431 | : "cc", "er1", "er2", "er3", "er4", "er5"); \ | 422 | : "g" (__NR_##name), \ |
432 | if ((unsigned long)(__res) >= (unsigned long)(-125)) { \ | 423 | "g" (_a), \ |
433 | errno = -__res; \ | 424 | "g" (_b), \ |
434 | __res = -1; \ | 425 | "g" (_c), \ |
435 | } \ | 426 | "g" (_d), \ |
436 | return (type)__res; \ | 427 | "g" (_e) \ |
428 | : "cc", "memory"); \ | ||
429 | __syscall_return(type, __res); \ | ||
437 | } | 430 | } |
438 | 431 | ||
439 | #define _syscall6(type, name, atype, a, btype, b, ctype, c, dtype, d, \ | 432 | #define _syscall6(type, name, atype, a, btype, b, \ |
440 | etype, e, ftype, f) \ | 433 | ctype, c, dtype, d, etype, e, ftype, f) \ |
441 | type name(atype a, btype b, ctype c, dtype d, etype e, ftype f) \ | 434 | type name(atype a, btype b, ctype c, dtype d, etype e, ftype f) \ |
442 | { \ | 435 | { \ |
443 | register long __res __asm__("er0"); \ | 436 | register long __res __asm__("er0"); \ |
444 | __asm__ __volatile__ ("mov.l er6,@-sp\n\t" \ | 437 | register long _a __asm__("er1"); \ |
445 | "mov.l %7, er6\n\t" \ | 438 | register long _b __asm__("er2"); \ |
446 | "mov.l %6, er5\n\t" \ | 439 | register long _c __asm__("er3"); \ |
447 | "mov.l %5, er4\n\t" \ | 440 | register long _d __asm__("er4"); \ |
448 | "mov.l %4, er3\n\t" \ | 441 | register long _e __asm__("er5"); \ |
449 | "mov.l %3, er2\n\t" \ | 442 | register long _f __asm__("er6"); \ |
450 | "mov.l %2, er1\n\t" \ | 443 | _a = (long)a; \ |
451 | "mov.l %1, er0\n\t" \ | 444 | _b = (long)b; \ |
452 | "trapa #0\n\t" \ | 445 | _c = (long)c; \ |
453 | "mov.l @sp+,er6" \ | 446 | _d = (long)d; \ |
454 | : "=r" (__res) \ | 447 | _e = (long)e; \ |
455 | : "ir" (__NR_##name), \ | 448 | _f = (long)f; \ |
456 | "g" ((long)a), \ | 449 | __asm__ __volatile__ ("mov.l %1,er0\n\t" \ |
457 | "g" ((long)b), \ | 450 | "trapa #0\n\t" \ |
458 | "g" ((long)c), \ | 451 | : "=r" (__res) \ |
459 | "g" ((long)d), \ | 452 | : "g" (__NR_##name), \ |
460 | "m" ((long)e), \ | 453 | "g" (_a), \ |
461 | "m" ((long)e) \ | 454 | "g" (_b), \ |
462 | : "cc", "er1", "er2", "er3", "er4", "er5"); \ | 455 | "g" (_c), \ |
463 | if ((unsigned long)(__res) >= (unsigned long)(-125)) { \ | 456 | "g" (_d), \ |
464 | errno = -__res; \ | 457 | "g" (_e) \ |
465 | __res = -1; \ | 458 | "g" (_f) \ |
466 | } \ | 459 | : "cc", "memory"); \ |
467 | return (type)__res; \ | 460 | __syscall_return(type, __res); \ |
468 | } | 461 | } |
469 | |||
470 | 462 | ||
471 | #ifdef __KERNEL__ | 463 | #ifdef __KERNEL__ |
472 | #define __ARCH_WANT_IPC_PARSE_VERSION | 464 | #define __ARCH_WANT_IPC_PARSE_VERSION |