ged_base.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * Copyright (C) 2015 MediaTek Inc.
  3. *
  4. * This program is free software: you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 as
  6. * published by the Free Software Foundation.
  7. *
  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. */
  13. #ifndef __GED_BASE_H__
  14. #define __GED_BASE_H__
  15. #include <linux/compiler.h>
  16. #include "ged_type.h"
  17. #ifdef GED_DEBUG
  18. #define GED_LOGI(...) pr_debug("GED:" __VA_ARGS__)
  19. #else
  20. #define GED_LOGI(...)
  21. #endif
  22. #define GED_LOGE(...) pr_debug("GED:" __VA_ARGS__)
  23. #define GED_CONTAINER_OF(ptr, type, member) ((type *)( ((char *)ptr) - offsetof(type,member) ))
  24. unsigned long ged_copy_to_user(void __user *pvTo, const void *pvFrom, unsigned long ulBytes);
  25. unsigned long ged_copy_from_user(void *pvTo, const void __user *pvFrom, unsigned long ulBytes);
  26. void* ged_alloc(int i32Size);
  27. void* ged_alloc_atomic(int i32Size);
  28. void ged_free(void* pvBuf, int i32Size);
  29. long ged_get_pid(void);
  30. unsigned long long ged_get_time(void);
  31. #endif