mlos-kernel.c 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /*
  2. $License:
  3. Copyright (C) 2010 InvenSense Corporation, All Rights Reserved.
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program. If not, see <http://www.gnu.org/licenses/>.
  14. $
  15. */
  16. /**
  17. * @defgroup
  18. * @brief
  19. *
  20. * @{
  21. * @file mlos-kernel.c
  22. * @brief
  23. *
  24. *
  25. */
  26. #include "mlos.h"
  27. #include <linux/delay.h>
  28. #include <linux/slab.h>
  29. void *MLOSMalloc(unsigned int numBytes)
  30. {
  31. return kmalloc(numBytes, GFP_KERNEL);
  32. }
  33. tMLError MLOSFree(void *ptr)
  34. {
  35. kfree(ptr);
  36. return ML_SUCCESS;
  37. }
  38. tMLError MLOSCreateMutex(HANDLE *mutex)
  39. {
  40. /* @todo implement if needed */
  41. return ML_ERROR_FEATURE_NOT_IMPLEMENTED;
  42. }
  43. tMLError MLOSLockMutex(HANDLE mutex)
  44. {
  45. /* @todo implement if needed */
  46. return ML_ERROR_FEATURE_NOT_IMPLEMENTED;
  47. }
  48. tMLError MLOSUnlockMutex(HANDLE mutex)
  49. {
  50. /* @todo implement if needed */
  51. return ML_ERROR_FEATURE_NOT_IMPLEMENTED;
  52. }
  53. tMLError MLOSDestroyMutex(HANDLE handle)
  54. {
  55. /* @todo implement if needed */
  56. return ML_ERROR_FEATURE_NOT_IMPLEMENTED;
  57. }
  58. FILE *MLOSFOpen(char *filename)
  59. {
  60. /* @todo implement if needed */
  61. return NULL;
  62. }
  63. void MLOSFClose(FILE *fp)
  64. {
  65. /* @todo implement if needed */
  66. }
  67. void MLOSSleep(int mSecs)
  68. {
  69. msleep(mSecs);
  70. }
  71. unsigned long MLOSGetTickCount(void)
  72. {
  73. /* @todo implement if needed */
  74. return ML_ERROR_FEATURE_NOT_IMPLEMENTED;
  75. }