fci_oal.c 895 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*****************************************************************************
  2. Copyright(c) 2012 FCI Inc. All Rights Reserved
  3. File name : fci_oal.c
  4. Description : OS adaptation layer
  5. *******************************************************************************/
  6. #include <linux/kernel.h>
  7. #include <linux/delay.h>
  8. #include <linux/mutex.h>
  9. #include "fc8150_regs.h"
  10. #include "fci_types.h"
  11. static struct mutex isdbt_lock;
  12. void PRINTF(HANDLE hDevice, char *fmt, ...)
  13. {
  14. va_list ap;
  15. char str[256];
  16. va_start(ap, fmt);
  17. vsprintf(str, fmt, ap);
  18. printk(KERN_DEBUG"%s", str);
  19. va_end(ap);
  20. }
  21. void msWait(int ms)
  22. {
  23. msleep(ms);
  24. }
  25. void OAL_CREATE_SEMAPHORE(void)
  26. {
  27. mutex_init(&isdbt_lock);
  28. }
  29. void OAL_DELETE_SEMAPHORE(void)
  30. {
  31. mutex_destroy(&isdbt_lock);
  32. }
  33. void OAL_OBTAIN_SEMAPHORE(void)
  34. {
  35. mutex_lock(&isdbt_lock);
  36. }
  37. void OAL_RELEASE_SEMAPHORE(void)
  38. {
  39. mutex_unlock(&isdbt_lock);
  40. }