adi_64.h 839 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /* adi_64.h: ADI related data structures
  2. *
  3. * Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved.
  4. * Author: Khalid Aziz (khalid.aziz@oracle.com)
  5. *
  6. * This work is licensed under the terms of the GNU GPL, version 2.
  7. */
  8. #ifndef __ASM_SPARC64_ADI_H
  9. #define __ASM_SPARC64_ADI_H
  10. #include <linux/types.h>
  11. #ifndef __ASSEMBLY__
  12. struct adi_caps {
  13. __u64 blksz;
  14. __u64 nbits;
  15. __u64 ue_on_adi;
  16. };
  17. struct adi_config {
  18. bool enabled;
  19. struct adi_caps caps;
  20. };
  21. extern struct adi_config adi_state;
  22. extern void mdesc_adi_init(void);
  23. static inline bool adi_capable(void)
  24. {
  25. return adi_state.enabled;
  26. }
  27. static inline unsigned long adi_blksize(void)
  28. {
  29. return adi_state.caps.blksz;
  30. }
  31. static inline unsigned long adi_nbits(void)
  32. {
  33. return adi_state.caps.nbits;
  34. }
  35. #endif /* __ASSEMBLY__ */
  36. #endif /* !(__ASM_SPARC64_ADI_H) */