]> git.proxmox.com Git - ceph.git/blob - ceph/src/isa-l/igzip/data_struct2.asm
e09907151fe3a3606761eeaf0c9093faaf622b2b
[ceph.git] / ceph / src / isa-l / igzip / data_struct2.asm
1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2 ; Copyright(c) 2011-2016 Intel 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 Intel 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
30 ;; START_FIELDS
31 %macro START_FIELDS 0
32 %assign _FIELD_OFFSET 0
33 %assign _STRUCT_ALIGN 0
34 %endm
35
36 ;; FIELD name size align
37 %macro FIELD 3
38 %define %%name %1
39 %define %%size %2
40 %define %%align %3
41
42 %assign _FIELD_OFFSET (_FIELD_OFFSET + (%%align) - 1) & (~ ((%%align)-1))
43 %%name equ _FIELD_OFFSET
44 %assign _FIELD_OFFSET _FIELD_OFFSET + (%%size)
45 %if (%%align > _STRUCT_ALIGN)
46 %assign _STRUCT_ALIGN %%align
47 %endif
48 %endm
49
50 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
51 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
52 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
53
54 START_FIELDS ;; BitBuf2
55
56 ;; name size align
57 FIELD _m_bits, 8, 8
58 FIELD _m_bit_count, 4, 4
59 FIELD _m_out_buf, 8, 8
60 FIELD _m_out_end, 8, 8
61 FIELD _m_out_start, 8, 8
62
63 %assign _BitBuf2_size _FIELD_OFFSET
64 %assign _BitBuf2_align _STRUCT_ALIGN
65
66 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
67 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
68 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
69
70 START_FIELDS ;; isal_zstate
71
72 ;; name size align
73 FIELD _b_bytes_valid, 4, 4
74 FIELD _b_bytes_processed, 4, 4
75 FIELD _file_start, 8, 8
76 FIELD _crc, 64, 16
77 FIELD _bitbuf, _BitBuf2_size, _BitBuf2_align
78 FIELD _state, 4, 4
79 FIELD _count, 4, 4
80 FIELD _tmp_out_buff, 16, 1
81 FIELD _tmp_out_start, 4, 4
82 FIELD _tmp_out_end, 4, 4
83 FIELD _last_flush, 4, 4
84 FIELD _has_gzip_hdr, 4, 4
85 FIELD _has_eob, 4, 4
86 FIELD _has_eob_hdr, 4, 4
87 FIELD _left_over, 4, 4
88 FIELD _buffer, BSIZE+16, 32
89 FIELD _head, HASH_SIZE*2, 16
90
91 %assign _isal_zstate_size _FIELD_OFFSET
92 %assign _isal_zstate_align _STRUCT_ALIGN
93
94 _bitbuf_m_bits equ _bitbuf+_m_bits
95 _bitbuf_m_bit_count equ _bitbuf+_m_bit_count
96 _bitbuf_m_out_buf equ _bitbuf+_m_out_buf
97 _bitbuf_m_out_end equ _bitbuf+_m_out_end
98 _bitbuf_m_out_start equ _bitbuf+_m_out_start
99
100 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
101 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
102 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
103
104 START_FIELDS ;; isal_zstream
105
106 ;; name size align
107 FIELD _next_in, 8, 8
108 FIELD _avail_in, 4, 4
109 FIELD _total_in, 4, 4
110 FIELD _next_out, 8, 8
111 FIELD _avail_out, 4, 4
112 FIELD _total_out, 4, 4
113 FIELD _hufftables, 8, 8
114 FIELD _end_of_stream, 4, 4
115 FIELD _flush, 4, 4
116 FIELD _internal_state, _isal_zstate_size, _isal_zstate_align
117
118 %assign _isal_zstream_size _FIELD_OFFSET
119 %assign _isal_zstream_align _STRUCT_ALIGN
120
121 _internal_state_b_bytes_valid equ _internal_state+_b_bytes_valid
122 _internal_state_b_bytes_processed equ _internal_state+_b_bytes_processed
123 _internal_state_file_start equ _internal_state+_file_start
124 _internal_state_crc equ _internal_state+_crc
125 _internal_state_bitbuf equ _internal_state+_bitbuf
126 _internal_state_state equ _internal_state+_state
127 _internal_state_count equ _internal_state+_count
128 _internal_state_tmp_out_buff equ _internal_state+_tmp_out_buff
129 _internal_state_tmp_out_start equ _internal_state+_tmp_out_start
130 _internal_state_tmp_out_end equ _internal_state+_tmp_out_end
131 _internal_state_last_flush equ _internal_state+_last_flush
132 _internal_state_has_gzip_hdr equ _internal_state+_has_gzip_hdr
133 _internal_state_has_eob equ _internal_state+_has_eob
134 _internal_state_has_eob_hdr equ _internal_state+_has_eob_hdr
135 _internal_state_left_over equ _internal_state+_left_over
136 _internal_state_buffer equ _internal_state+_buffer
137 _internal_state_head equ _internal_state+_head
138 _internal_state_bitbuf_m_bits equ _internal_state+_bitbuf_m_bits
139 _internal_state_bitbuf_m_bit_count equ _internal_state+_bitbuf_m_bit_count
140 _internal_state_bitbuf_m_out_buf equ _internal_state+_bitbuf_m_out_buf
141 _internal_state_bitbuf_m_out_end equ _internal_state+_bitbuf_m_out_end
142 _internal_state_bitbuf_m_out_start equ _internal_state+_bitbuf_m_out_start
143
144 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
145 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
146 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
147
148 ZSTATE_HDR equ 1
149 ZSTATE_BODY equ 2
150 ZSTATE_FLUSH_READ_BUFFER equ 3
151 ZSTATE_SYNC_FLUSH equ 4
152 ZSTATE_TRL equ 6
153
154 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
155 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
156 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
157 _NO_FLUSH equ 0
158 _SYNC_FLUSH equ 1
159 _FULL_FLUSH equ 2
160 _STORED_BLK equ 0
161 %assign _STORED_BLK_END 65535
162 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
163 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
164 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
165