Subversion Repositories Kolibri OS

Rev

Rev 3065 | Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. /* default reentrant pointer when multithread enabled */
  2.  
  3. #include <_ansi.h>
  4. #include <string.h>
  5. #include <reent.h>
  6.  
  7. static inline
  8. void *user_alloc(int size)
  9. {
  10.     void  *val;
  11.     __asm__ __volatile__(
  12.     "int $0x40"
  13.     :"=eax"(val)
  14.     :"a"(68),"b"(12),"c"(size));
  15.     return val;
  16. }
  17.  
  18. void init_reent()
  19. {
  20.     struct _reent *ent;
  21.  
  22.     ent = user_alloc(sizeof(struct _reent));
  23.  
  24.     _REENT_INIT_PTR(ent);
  25.  
  26.     __asm__ __volatile__(
  27.     "movl %0, %%fs:12"
  28.     ::"r"(ent));
  29.     __sinit(ent);
  30. }
  31.  
  32.  
  33.  
  34.  
  35.