memalloc.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * Memalloc, encoder memory allocation driver (kernel module headers)
  3. *
  4. * Copyright (C) 2009 Hantro Products Oy.
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License
  8. * as published by the Free Software Foundation; either version 2
  9. * of the License, or (at your option) any later version.
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, write to the Free Software
  17. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  18. */
  19. #ifndef MEMALLOC_H
  20. #define MEMALLOC_H
  21. #include <linux/ioctl.h>
  22. /* Use 'k' as magic number */
  23. #define MEMALLOC_IOC_MAGIC 'k'
  24. /*
  25. * S means "Set" through a ptr,
  26. * T means "Tell" directly with the argument value
  27. * G means "Get": reply by setting through a pointer
  28. * Q means "Query": response is on the return value
  29. * X means "eXchange": G and S atomically
  30. * H means "sHift": T and Q atomically
  31. */
  32. #define MEMALLOC_IOCXGETBUFFER _IOWR(MEMALLOC_IOC_MAGIC, 1, MemallocParams*)
  33. #define MEMALLOC_IOCSFREEBUFFER _IOW(MEMALLOC_IOC_MAGIC, 2, unsigned long)
  34. #define MEMALLOC_IOCSFLUSHRAMBUFFER _IOW(MEMALLOC_IOC_MAGIC, 6, unsigned long)
  35. /*
  36. * ... more to come
  37. *
  38. * debugging tool
  39. * #define MEMALLOC_IOCHARDRESET _IO(MEMALLOC_IOC_MAGIC, 15)
  40. * #define MEMALLOC_IOC_MAXNR 15
  41. *
  42. */
  43. typedef struct {
  44. unsigned busAddress;
  45. unsigned size;
  46. } MemallocParams;
  47. #endif /* MEMALLOC_H */