Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /* adi_64.h: ADI related data structures
0003  *
0004  * Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved.
0005  * Author: Khalid Aziz (khalid.aziz@oracle.com)
0006  */
0007 #ifndef __ASM_SPARC64_ADI_H
0008 #define __ASM_SPARC64_ADI_H
0009 
0010 #include <linux/types.h>
0011 
0012 #ifndef __ASSEMBLY__
0013 
0014 struct adi_caps {
0015     __u64 blksz;
0016     __u64 nbits;
0017     __u64 ue_on_adi;
0018 };
0019 
0020 struct adi_config {
0021     bool enabled;
0022     struct adi_caps caps;
0023 };
0024 
0025 extern struct adi_config adi_state;
0026 
0027 extern void mdesc_adi_init(void);
0028 
0029 static inline bool adi_capable(void)
0030 {
0031     return adi_state.enabled;
0032 }
0033 
0034 static inline unsigned long adi_blksize(void)
0035 {
0036     return adi_state.caps.blksz;
0037 }
0038 
0039 static inline unsigned long adi_nbits(void)
0040 {
0041     return adi_state.caps.nbits;
0042 }
0043 
0044 #endif  /* __ASSEMBLY__ */
0045 
0046 #endif  /* !(__ASM_SPARC64_ADI_H) */