hardwall.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * Copyright 2010 Tilera Corporation. All Rights Reserved.
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License
  6. * as published by the Free Software Foundation, version 2.
  7. *
  8. * This program is distributed in the hope that it will be useful, but
  9. * WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
  11. * NON INFRINGEMENT. See the GNU General Public License for
  12. * more details.
  13. *
  14. * Provide methods for the HARDWALL_FILE for accessing the UDN.
  15. */
  16. #ifndef _ASM_TILE_HARDWALL_H
  17. #define _ASM_TILE_HARDWALL_H
  18. #include <linux/ioctl.h>
  19. #define HARDWALL_IOCTL_BASE 0xa2
  20. /*
  21. * The HARDWALL_CREATE() ioctl is a macro with a "size" argument.
  22. * The resulting ioctl value is passed to the kernel in conjunction
  23. * with a pointer to a little-endian bitmask of cpus, which must be
  24. * physically in a rectangular configuration on the chip.
  25. * The "size" is the number of bytes of cpu mask data.
  26. */
  27. #define _HARDWALL_CREATE 1
  28. #define HARDWALL_CREATE(size) \
  29. _IOC(_IOC_READ, HARDWALL_IOCTL_BASE, _HARDWALL_CREATE, (size))
  30. #define _HARDWALL_ACTIVATE 2
  31. #define HARDWALL_ACTIVATE \
  32. _IO(HARDWALL_IOCTL_BASE, _HARDWALL_ACTIVATE)
  33. #define _HARDWALL_DEACTIVATE 3
  34. #define HARDWALL_DEACTIVATE \
  35. _IO(HARDWALL_IOCTL_BASE, _HARDWALL_DEACTIVATE)
  36. #define _HARDWALL_GET_ID 4
  37. #define HARDWALL_GET_ID \
  38. _IO(HARDWALL_IOCTL_BASE, _HARDWALL_GET_ID)
  39. #ifndef __KERNEL__
  40. /* This is the canonical name expected by userspace. */
  41. #define HARDWALL_FILE "/dev/hardwall"
  42. #else
  43. /* /proc hooks for hardwall. */
  44. struct proc_dir_entry;
  45. #ifdef CONFIG_HARDWALL
  46. void proc_tile_hardwall_init(struct proc_dir_entry *root);
  47. int proc_pid_hardwall(struct task_struct *task, char *buffer);
  48. #else
  49. static inline void proc_tile_hardwall_init(struct proc_dir_entry *root) {}
  50. #endif
  51. #endif
  52. #endif /* _ASM_TILE_HARDWALL_H */