home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / misc / emu / AROSdev.lha / AROS / config / i386 / semaphoreglue.s < prev    next >
Encoding:
Text File  |  1997-01-09  |  1.4 KB  |  71 lines

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: semaphoreglue.s,v 1.7 1996/11/21 10:49:43 aros Exp $
  4.  
  5.     Desc:
  6.     Lang:
  7. */
  8.  
  9. #include "machine.i"
  10.  
  11. /*
  12.     The following functions are guaranteed to preserve
  13.     all registers. But I don't want to write them completely
  14.     in assembly - C is generally more readable.
  15.     So I use those stubs to preserve the registers.
  16. */
  17.  
  18.     .text
  19.     .balign 16
  20.     .globl    AROS_SLIB_ENTRY(_ObtainSemaphore,Exec)
  21.     .type    AROS_SLIB_ENTRY(_ObtainSemaphore,Exec),@function
  22. AROS_SLIB_ENTRY(_ObtainSemaphore,Exec):
  23.     pushl    %eax
  24.     pushl    %ecx
  25.     pushl    %edx
  26.     movl    20(%esp),%eax
  27.     pushl    %eax
  28.     movl    20(%esp),%eax
  29.     pushl    %eax
  30.     call    AROS_SLIB_ENTRY(ObtainSemaphore,Exec)
  31.     addl    $8,%esp
  32.     popl    %edx
  33.     popl    %ecx
  34.     popl    %eax
  35.     ret
  36.  
  37.     .globl    AROS_SLIB_ENTRY(_ReleaseSemaphore,Exec)
  38.     .type    AROS_SLIB_ENTRY(_ReleaseSemaphore,Exec),@function
  39. AROS_SLIB_ENTRY(_ReleaseSemaphore,Exec):
  40.     pushl    %eax
  41.     pushl    %ecx
  42.     pushl    %edx
  43.     movl    20(%esp),%eax
  44.     pushl    %eax
  45.     movl    20(%esp),%eax
  46.     pushl    %eax
  47.     call    AROS_SLIB_ENTRY(ReleaseSemaphore,Exec)
  48.     addl    $8,%esp
  49.     popl    %edx
  50.     popl    %ecx
  51.     popl    %eax
  52.     ret
  53.  
  54.     .globl    AROS_SLIB_ENTRY(_ObtainSemaphoreShared,Exec)
  55.     .type    AROS_SLIB_ENTRY(_ObtainSemaphoreShared,Exec),@function
  56. AROS_SLIB_ENTRY(_ObtainSemaphoreShared,Exec):
  57.     pushl    %eax
  58.     pushl    %ecx
  59.     pushl    %edx
  60.     movl    20(%esp),%eax
  61.     pushl    %eax
  62.     movl    20(%esp),%eax
  63.     pushl    %eax
  64.     call    AROS_SLIB_ENTRY(ObtainSemaphoreShared,Exec)
  65.     addl    $8,%esp
  66.     popl    %edx
  67.     popl    %ecx
  68.     popl    %eax
  69.     ret
  70.  
  71.