]> git.proxmox.com Git - ceph.git/blob - ceph/src/isa-l/igzip/aarch64/data_struct_aarch64.h
import quincy beta 17.1.0
[ceph.git] / ceph / src / isa-l / igzip / aarch64 / data_struct_aarch64.h
1 /**********************************************************************
2 Copyright(c) 2019 Arm Corporation All rights reserved.
3
4 Redistribution and use in source and binary forms, with or without
5 modification, are permitted provided that the following conditions
6 are met:
7 * Redistributions of source code must retain the above copyright
8 notice, this list of conditions and the following disclaimer.
9 * Redistributions in binary form must reproduce the above copyright
10 notice, this list of conditions and the following disclaimer in
11 the documentation and/or other materials provided with the
12 distribution.
13 * Neither the name of Arm Corporation nor the names of its
14 contributors may be used to endorse or promote products derived
15 from this software without specific prior written permission.
16
17 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 **********************************************************************/
29 #ifndef __AARCH64_DATA_STRUCT_H__
30 #define __AARCH64_DATA_STRUCT_H__
31 #ifdef __ASSEMBLY__
32
33 .macro start_struct name:req
34 .set _FIELD_OFFSET,0
35 .set _STRUCT_ALIGN,0
36 .endm
37 .macro end_struct name:req
38 .set _\name\()_size,_FIELD_OFFSET
39 .set _\name\()_align,_STRUCT_ALIGN
40 .endm
41 .macro field name:req, size:req, align:req
42 .set _FIELD_OFFSET,(_FIELD_OFFSET + (\align) - 1) & (~ ((\align)-1))
43 .set \name,_FIELD_OFFSET
44 .set _FIELD_OFFSET,_FIELD_OFFSET + \size
45 .if \align > _STRUCT_ALIGN
46 .set _STRUCT_ALIGN, \align
47 .endif
48 .endm
49
50 /// BitBuf2
51 start_struct BitBuf2
52 /// name size align
53 field _m_bits, 8, 8
54 field _m_bit_count, 4, 4
55 field _m_out_buf, 8, 8
56 field _m_out_end, 8, 8
57 field _m_out_start, 8, 8
58 end_struct BitBuf2
59
60 /// isal_mod_hist
61 #define HIST_ELEM_SIZE 4
62 start_struct isal_mod_hist
63 /// name size align
64 field _d_hist, 30*HIST_ELEM_SIZE, HIST_ELEM_SIZE
65 field _ll_hist, 513*HIST_ELEM_SIZE, HIST_ELEM_SIZE
66 end_struct isal_mod_hist
67
68 /// hufftables_icf
69 #define HUFF_CODE_SIZE 4
70 start_struct hufftables_icf
71 /// name size align
72 field _dist_table, 31 * HUFF_CODE_SIZE, HUFF_CODE_SIZE
73 field _lit_len_table, 513 * HUFF_CODE_SIZE, HUFF_CODE_SIZE
74 end_struct hufftables_icf
75
76 /// hash8k_buf
77 start_struct hash8k_buf
78 /// name size align
79 field _hash8k_table, 2 * IGZIP_HASH8K_HASH_SIZE, 2
80 end_struct hash8k_buf
81
82 /// hash_map_buf
83 start_struct hash_map_buf
84 /// name size align
85 field _hash_table, 2 * IGZIP_HASH_MAP_HASH_SIZE, 2
86 field _matches_next, 8, 8
87 field _matches_end, 8, 8
88 field _matches, 4*4*1024, 4
89 field _overflow, 4*LA, 4
90 end_struct hash_map_buf
91
92 /// level_buf
93 #define DEF_MAX_HDR_SIZE 328
94 start_struct level_buf
95 /// name size align
96 field _encode_tables, _hufftables_icf_size, _hufftables_icf_align
97 field _hist, _isal_mod_hist_size, _isal_mod_hist_align
98 field _deflate_hdr_count, 4, 4
99 field _deflate_hdr_extra_bits,4, 4
100 field _deflate_hdr, DEF_MAX_HDR_SIZE, 1
101 field _icf_buf_next, 8, 8
102 field _icf_buf_avail_out, 8, 8
103 field _icf_buf_start, 8, 8
104 field _lvl_extra, _hash_map_buf_size, _hash_map_buf_align
105 end_struct level_buf
106
107 .set _hash8k_hash_table , _lvl_extra + _hash8k_table
108 .set _hash_map_hash_table , _lvl_extra + _hash_table
109 .set _hash_map_matches_next , _lvl_extra + _matches_next
110 .set _hash_map_matches_end , _lvl_extra + _matches_end
111 .set _hash_map_matches , _lvl_extra + _matches
112 .set _hist_lit_len , _hist+_ll_hist
113 .set _hist_dist , _hist+_d_hist
114
115 /// isal_zstate
116 start_struct isal_zstate
117 /// name size align
118 field _total_in_start,4, 4
119 field _block_next, 4, 4
120 field _block_end, 4, 4
121 field _dist_mask, 4, 4
122 field _hash_mask, 4, 4
123 field _state, 4, 4
124 field _bitbuf, _BitBuf2_size, _BitBuf2_align
125 field _crc, 4, 4
126 field _has_wrap_hdr, 1, 1
127 field _has_eob_hdr, 1, 1
128 field _has_eob, 1, 1
129 field _has_hist, 1, 1
130 field _has_level_buf_init, 2, 2
131 field _count, 4, 4
132 field _tmp_out_buff, 16, 1
133 field _tmp_out_start, 4, 4
134 field _tmp_out_end, 4, 4
135 field _b_bytes_valid, 4, 4
136 field _b_bytes_processed, 4, 4
137 field _buffer, BSIZE, 1
138 field _head, IGZIP_LVL0_HASH_SIZE*2, 2
139 end_struct isal_zstate
140
141 .set _bitbuf_m_bits , _bitbuf+_m_bits
142 .set _bitbuf_m_bit_count , _bitbuf+_m_bit_count
143 .set _bitbuf_m_out_buf , _bitbuf+_m_out_buf
144 .set _bitbuf_m_out_end , _bitbuf+_m_out_end
145 .set _bitbuf_m_out_start , _bitbuf+_m_out_start
146
147 /// isal_zstream
148 start_struct isal_zstream
149 /// name size align
150 field _next_in, 8, 8
151 field _avail_in, 4, 4
152 field _total_in, 4, 4
153 field _next_out, 8, 8
154 field _avail_out, 4, 4
155 field _total_out, 4, 4
156 field _hufftables, 8, 8
157 field _level, 4, 4
158 field _level_buf_size, 4, 4
159 field _level_buf, 8, 8
160 field _end_of_stream, 2, 2
161 field _flush, 2, 2
162 field _gzip_flag, 2, 2
163 field _hist_bits, 2, 2
164 field _internal_state, _isal_zstate_size, _isal_zstate_align
165 end_struct isal_zstream
166
167 .set _internal_state_total_in_start , _internal_state+_total_in_start
168 .set _internal_state_block_next , _internal_state+_block_next
169 .set _internal_state_block_end , _internal_state+_block_end
170 .set _internal_state_b_bytes_valid , _internal_state+_b_bytes_valid
171 .set _internal_state_b_bytes_processed , _internal_state+_b_bytes_processed
172 .set _internal_state_crc , _internal_state+_crc
173 .set _internal_state_dist_mask , _internal_state+_dist_mask
174 .set _internal_state_hash_mask , _internal_state+_hash_mask
175 .set _internal_state_bitbuf , _internal_state+_bitbuf
176 .set _internal_state_state , _internal_state+_state
177 .set _internal_state_count , _internal_state+_count
178 .set _internal_state_tmp_out_buff , _internal_state+_tmp_out_buff
179 .set _internal_state_tmp_out_start , _internal_state+_tmp_out_start
180 .set _internal_state_tmp_out_end , _internal_state+_tmp_out_end
181 .set _internal_state_has_wrap_hdr , _internal_state+_has_wrap_hdr
182 .set _internal_state_has_eob , _internal_state+_has_eob
183 .set _internal_state_has_eob_hdr , _internal_state+_has_eob_hdr
184 .set _internal_state_has_hist , _internal_state+_has_hist
185 .set _internal_state_has_level_buf_init , _internal_state+_has_level_buf_init
186 .set _internal_state_buffer , _internal_state+_buffer
187 .set _internal_state_head , _internal_state+_head
188 .set _internal_state_bitbuf_m_bits , _internal_state+_bitbuf_m_bits
189 .set _internal_state_bitbuf_m_bit_count , _internal_state+_bitbuf_m_bit_count
190 .set _internal_state_bitbuf_m_out_buf , _internal_state+_bitbuf_m_out_buf
191 .set _internal_state_bitbuf_m_out_end , _internal_state+_bitbuf_m_out_end
192 .set _internal_state_bitbuf_m_out_start , _internal_state+_bitbuf_m_out_start
193
194 /// Internal States
195 .set ZSTATE_NEW_HDR , 0
196 .set ZSTATE_HDR , (ZSTATE_NEW_HDR + 1)
197 .set ZSTATE_CREATE_HDR , (ZSTATE_HDR + 1)
198 .set ZSTATE_BODY , (ZSTATE_CREATE_HDR + 1)
199 .set ZSTATE_FLUSH_READ_BUFFER , (ZSTATE_BODY + 1)
200 .set ZSTATE_FLUSH_ICF_BUFFER , (ZSTATE_FLUSH_READ_BUFFER + 1)
201 .set ZSTATE_TYPE0_HDR , (ZSTATE_FLUSH_ICF_BUFFER + 1)
202 .set ZSTATE_TYPE0_BODY , (ZSTATE_TYPE0_HDR + 1)
203 .set ZSTATE_SYNC_FLUSH , (ZSTATE_TYPE0_BODY + 1)
204 .set ZSTATE_FLUSH_WRITE_BUFFER , (ZSTATE_SYNC_FLUSH + 1)
205 .set ZSTATE_TRL , (ZSTATE_FLUSH_WRITE_BUFFER + 1)
206
207 .set _NO_FLUSH , 0
208 .set _SYNC_FLUSH , 1
209 .set _FULL_FLUSH , 2
210 .set _STORED_BLK , 0
211 .set IGZIP_NO_HIST , 0
212 .set IGZIP_HIST , 1
213 .set IGZIP_DICT_HIST , 2
214 #endif
215 #endif