@@ -82,117 +82,16 @@ enum zpci_ioat_dtype {
8282#define ZPCI_TABLE_VALID_MASK 0x20
8383#define ZPCI_TABLE_PROT_MASK 0x200
8484
85- static inline unsigned int calc_rtx (dma_addr_t ptr )
86- {
87- return ((unsigned long ) ptr >> ZPCI_RT_SHIFT ) & ZPCI_INDEX_MASK ;
88- }
89-
90- static inline unsigned int calc_sx (dma_addr_t ptr )
91- {
92- return ((unsigned long ) ptr >> ZPCI_ST_SHIFT ) & ZPCI_INDEX_MASK ;
93- }
94-
95- static inline unsigned int calc_px (dma_addr_t ptr )
96- {
97- return ((unsigned long ) ptr >> PAGE_SHIFT ) & ZPCI_PT_MASK ;
98- }
99-
100- static inline void set_pt_pfaa (unsigned long * entry , phys_addr_t pfaa )
101- {
102- * entry &= ZPCI_PTE_FLAG_MASK ;
103- * entry |= (pfaa & ZPCI_PTE_ADDR_MASK );
104- }
105-
106- static inline void set_rt_sto (unsigned long * entry , phys_addr_t sto )
107- {
108- * entry &= ZPCI_RTE_FLAG_MASK ;
109- * entry |= (sto & ZPCI_RTE_ADDR_MASK );
110- * entry |= ZPCI_TABLE_TYPE_RTX ;
111- }
112-
113- static inline void set_st_pto (unsigned long * entry , phys_addr_t pto )
114- {
115- * entry &= ZPCI_STE_FLAG_MASK ;
116- * entry |= (pto & ZPCI_STE_ADDR_MASK );
117- * entry |= ZPCI_TABLE_TYPE_SX ;
118- }
119-
120- static inline void validate_rt_entry (unsigned long * entry )
121- {
122- * entry &= ~ZPCI_TABLE_VALID_MASK ;
123- * entry &= ~ZPCI_TABLE_OFFSET_MASK ;
124- * entry |= ZPCI_TABLE_VALID ;
125- * entry |= ZPCI_TABLE_LEN_RTX ;
126- }
127-
128- static inline void validate_st_entry (unsigned long * entry )
129- {
130- * entry &= ~ZPCI_TABLE_VALID_MASK ;
131- * entry |= ZPCI_TABLE_VALID ;
132- }
133-
134- static inline void invalidate_pt_entry (unsigned long * entry )
135- {
136- WARN_ON_ONCE ((* entry & ZPCI_PTE_VALID_MASK ) == ZPCI_PTE_INVALID );
137- * entry &= ~ZPCI_PTE_VALID_MASK ;
138- * entry |= ZPCI_PTE_INVALID ;
139- }
140-
141- static inline void validate_pt_entry (unsigned long * entry )
142- {
143- WARN_ON_ONCE ((* entry & ZPCI_PTE_VALID_MASK ) == ZPCI_PTE_VALID );
144- * entry &= ~ZPCI_PTE_VALID_MASK ;
145- * entry |= ZPCI_PTE_VALID ;
146- }
147-
148- static inline void entry_set_protected (unsigned long * entry )
149- {
150- * entry &= ~ZPCI_TABLE_PROT_MASK ;
151- * entry |= ZPCI_TABLE_PROTECTED ;
152- }
153-
154- static inline void entry_clr_protected (unsigned long * entry )
155- {
156- * entry &= ~ZPCI_TABLE_PROT_MASK ;
157- * entry |= ZPCI_TABLE_UNPROTECTED ;
158- }
159-
160- static inline int reg_entry_isvalid (unsigned long entry )
161- {
162- return (entry & ZPCI_TABLE_VALID_MASK ) == ZPCI_TABLE_VALID ;
163- }
164-
165- static inline int pt_entry_isvalid (unsigned long entry )
166- {
167- return (entry & ZPCI_PTE_VALID_MASK ) == ZPCI_PTE_VALID ;
168- }
169-
170- static inline unsigned long * get_rt_sto (unsigned long entry )
171- {
172- if ((entry & ZPCI_TABLE_TYPE_MASK ) == ZPCI_TABLE_TYPE_RTX )
173- return phys_to_virt (entry & ZPCI_RTE_ADDR_MASK );
174- else
175- return NULL ;
176-
177- }
178-
179- static inline unsigned long * get_st_pto (unsigned long entry )
180- {
181- if ((entry & ZPCI_TABLE_TYPE_MASK ) == ZPCI_TABLE_TYPE_SX )
182- return phys_to_virt (entry & ZPCI_STE_ADDR_MASK );
183- else
184- return NULL ;
185- }
186-
187- /* Prototypes */
188- void dma_free_seg_table (unsigned long );
189- unsigned long * dma_alloc_cpu_table (gfp_t gfp );
190- void dma_cleanup_tables (unsigned long * );
191- unsigned long * dma_walk_cpu_trans (unsigned long * rto , dma_addr_t dma_addr ,
192- gfp_t gfp );
193- void dma_update_cpu_trans (unsigned long * entry , phys_addr_t page_addr , int flags );
194-
195- extern const struct dma_map_ops s390_pci_dma_ops ;
85+ struct zpci_iommu_ctrs {
86+ atomic64_t mapped_pages ;
87+ atomic64_t unmapped_pages ;
88+ atomic64_t global_rpcits ;
89+ atomic64_t sync_map_rpcits ;
90+ atomic64_t sync_rpcits ;
91+ };
92+
93+ struct zpci_dev ;
19694
95+ struct zpci_iommu_ctrs * zpci_get_iommu_ctrs (struct zpci_dev * zdev );
19796
19897#endif
0 commit comments