home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 3 / AACD03.BIN / AACD / Programming / sofa / archive / SmallEiffel.lha / SmallEiffel / sys / gc_lib / sparc.c < prev    next >
Text File  |  1999-06-05  |  1KB  |  35 lines

  1. /*
  2. -- This file is  free  software, which  comes  along  with  SmallEiffel. This
  3. -- software  is  distributed  in the hope that it will be useful, but WITHOUT 
  4. -- ANY  WARRANTY;  without  even  the  implied warranty of MERCHANTABILITY or
  5. -- FITNESS  FOR A PARTICULAR PURPOSE. You can modify it as you want, provided
  6. -- this header is kept unaltered, and a notification of the changes is added.
  7. -- You  are  allowed  to  redistribute  it and sell it, alone or as a part of 
  8. -- another product.
  9. --          Copyright (C) 1994-98 LORIA - UHP - CRIN - INRIA - FRANCE
  10. --            Dominique COLNET and Suzanne COLLIN - colnet@loria.fr 
  11. --                       http://www.loria.fr/SmallEiffel
  12. --
  13. */
  14. /* 
  15.    For SPARC architecture.
  16.    As this file contains assembly code (asm), you must not use
  17.    the flag -ansi of gcc (in file ${SmallEiffel}/sys/compiler.*).
  18. */
  19.  
  20. void mark_loop (void) {
  21.   void** max = stack_bottom + 11;
  22.   void** stack_pointer;
  23.   void* stack_top[2]={NULL,NULL};
  24.   stack_pointer = stack_top;
  25.   /* Addresses decrease as the stack grows. */
  26.   while (stack_pointer < max) {
  27.     gc_mark(*(stack_pointer++));
  28.   }
  29. }
  30.  
  31. void mark_stack_and_registers (void) {
  32.   asm("    ta    0x3   ! ST_FLUSH_WINDOWS");
  33.   mark_loop();
  34. }
  35.