engine-ip22-irix-5.2.h
Upload User: tsgydb
Upload Date: 2007-04-14
Package Size: 10674k
Code Size: 3k
Category:

MySQL

Development Platform:

Visual C++

  1. /* ==== machdep.h ============================================================
  2.  * Copyright (c) 1994 Chris Provenzano, proven@athena.mit.edu
  3.  *
  4.  * $Id$
  5.  *
  6.  */
  7. #include <unistd.h>
  8. #include <setjmp.h>
  9. #include <sys/time.h>
  10. #include <sys/cdefs.h>
  11. /*
  12.  * The first machine dependent functions are the SEMAPHORES
  13.  * needing the test and set instruction.
  14.  */
  15. #define SEMAPHORE_CLEAR 0
  16. #define SEMAPHORE_SET   0xff
  17. /*
  18.  * More machine dependent macros
  19.  */
  20. #ifdef PTHREAD_KERNEL
  21. #define machdep_save_float_state(x)
  22. #define machdep_restore_float_state()
  23. #endif
  24. /*
  25.  * New types
  26.  */
  27. typedef char    semaphore;
  28. /*
  29.  * sigset_t macros
  30.  */
  31. #define SIGMAX 32
  32. #define SIG_ANY(sig)                        
  33. ({                                          
  34.     sigset_t *sig_addr = (sigset_t *)&sig;  
  35.     int ret = 0;                            
  36.     int i;                                  
  37.                                             
  38.     for (i = 1; i <= SIGMAX; i++) {         
  39.         if (sigismember(sig_addr, i)) {     
  40.             ret = 1;                        
  41.             break;                          
  42.         }                                   
  43.     }                                       
  44.     ret;                                    
  45. })
  46. /*
  47.  * New Strutures
  48.  */
  49. struct machdep_pthread {
  50.     void         *(*start_routine)(void *);
  51.     void         *start_argument;
  52.     void         *machdep_stack;
  53. struct itimerval machdep_timer;
  54.     jmp_buf      machdep_state;
  55. };
  56. /*
  57.  * Static machdep_pthread initialization values.
  58.  * For initial thread only.
  59.  */
  60. #define MACHDEP_PTHREAD_INIT    
  61. { NULL, NULL, NULL, { { 0, 0 }, { 0, 100000 } }, 0 }
  62. /*
  63.  * Minimum stack size
  64.  */
  65. #define PTHREAD_STACK_MIN 1024
  66. /*
  67.  * Some fd flag defines that are necessary to distinguish between posix
  68.  * behavior and bsd4.3 behavior.
  69.  */
  70. #define __FD_NONBLOCK  O_NONBLOCK
  71. /*
  72.  * New functions
  73.  */
  74. __BEGIN_DECLS
  75. #if defined(PTHREAD_KERNEL)
  76. #define __machdep_stack_get(x)      (x)->machdep_stack
  77. #define __machdep_stack_set(x, y)   (x)->machdep_stack = y
  78. #define __machdep_stack_repl(x, y)                          
  79. {                                                           
  80.     if (stack = __machdep_stack_get(x)) {                   
  81.         __machdep_stack_free(stack);                        
  82.     }                                                       
  83.     __machdep_stack_set(x, y);                              
  84. }
  85. void *  __machdep_stack_alloc       __P_((size_t));
  86. void    __machdep_stack_free        __P_((void *));
  87. int machdep_save_state      __P_((void));
  88. #endif
  89. __END_DECLS