psp_osal.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * psp_osal.h
  3. *
  4. * Description:
  5. *
  6. * --------------------------------------------------------------------------
  7. *
  8. * Pthreads-embedded (PTE) - POSIX Threads Library for embedded systems
  9. * Copyright(C) 2008 Jason Schmidlapp
  10. *
  11. * Contact Email: [email protected]
  12. *
  13. * This library is free software; you can redistribute it and/or
  14. * modify it under the terms of the GNU Lesser General Public
  15. * License as published by the Free Software Foundation; either
  16. * version 2 of the License, or (at your option) any later version.
  17. *
  18. * This library is distributed in the hope that it will be useful,
  19. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  20. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  21. * Lesser General Public License for more details.
  22. *
  23. * You should have received a copy of the GNU Lesser General Public
  24. * License along with this library in the file COPYING.LIB;
  25. * if not, write to the Free Software Foundation, Inc.,
  26. * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
  27. */
  28. #include <pspsdk.h>
  29. typedef SceUID pte_osThreadHandle;
  30. typedef SceUID pte_osSemaphoreHandle;
  31. typedef SceUID pte_osMutexHandle;
  32. #define OS_IS_HANDLE_VALID(x) ((x) > 0)
  33. #define OS_MAX_SIMUL_THREADS 10
  34. #define OS_DEFAULT_PRIO 11
  35. #define OS_MIN_PRIO 17
  36. #define OS_MAX_PRIO 32
  37. //#define HAVE_THREAD_SAFE_ERRNO
  38. #define POLLING_DELAY_IN_us 100
  39. #define OS_MAX_SEM_VALUE 254
  40. int PspInterlockedExchange(int *ptarg, int val);
  41. int PspInterlockedCompareExchange(int *pdest, int exchange, int comp);
  42. int PspInterlockedExchangeAdd(int volatile* pAddend, int value);
  43. int PspInterlockedDecrement(int *pdest);
  44. int PspInterlockedIncrement(int *pdest);