mlos.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. #ifndef _MLOS_H
  17. #define _MLOS_H
  18. #ifndef __KERNEL__
  19. #include <stdio.h>
  20. #endif
  21. #include "mltypes.h"
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif
  25. /* ------------ */
  26. /* - Defines. - */
  27. /* ------------ */
  28. /* - MLOSCreateFile defines. - */
  29. #define MLOS_GENERIC_READ ((unsigned int)0x80000000)
  30. #define MLOS_GENERIC_WRITE ((unsigned int)0x40000000)
  31. #define MLOS_FILE_SHARE_READ ((unsigned int)0x00000001)
  32. #define MLOS_FILE_SHARE_WRITE ((unsigned int)0x00000002)
  33. #define MLOS_OPEN_EXISTING ((unsigned int)0x00000003)
  34. /* ---------- */
  35. /* - Enums. - */
  36. /* ---------- */
  37. /* --------------- */
  38. /* - Structures. - */
  39. /* --------------- */
  40. /* --------------------- */
  41. /* - Function p-types. - */
  42. /* --------------------- */
  43. void *MLOSMalloc(unsigned int numBytes);
  44. tMLError MLOSFree(void *ptr);
  45. tMLError MLOSCreateMutex(HANDLE *mutex);
  46. tMLError MLOSLockMutex(HANDLE mutex);
  47. tMLError MLOSUnlockMutex(HANDLE mutex);
  48. FILE *MLOSFOpen(char *filename);
  49. void MLOSFClose(FILE *fp);
  50. tMLError MLOSDestroyMutex(HANDLE handle);
  51. void MLOSSleep(int mSecs);
  52. unsigned long MLOSGetTickCount(void);
  53. #ifdef __cplusplus
  54. }
  55. #endif
  56. #endif /* _MLOS_H */