Lines Matching defs:mz

240 parse_var(struct _citrus_mapper_zone *mz, struct _memstream *ms)
248 if (parse_zone(ms, &ps, &mz->mz_col))
255 mz->mz_row = mz->mz_col;
257 if (parse_zone(ms, &ps, &mz->mz_col))
263 mz->mz_col_bits = ps.ps_u_imm;
264 if (mz->mz_col_bits<0 || mz->mz_col_bits>32)
270 mz->mz_col_bits = 32;
271 mz->mz_row.z_begin = mz->mz_row.z_end = 0;
278 mz->mz_col_offset = ps.ps_s_imm;
281 mz->mz_row_offset = mz->mz_col_offset;
286 mz->mz_col_offset = ps.ps_s_imm;
288 mz->mz_row_offset = 0;
295 if (mz->mz_col_bits==32)
298 colmax = 1 << mz->mz_col_bits;
299 if (mz->mz_col_bits==0)
302 rowmax = 1 << (32-mz->mz_col_bits);
303 if (check_rowcol(&mz->mz_col, mz->mz_col_offset, colmax))
305 if (check_rowcol(&mz->mz_row, mz->mz_row_offset, rowmax))
320 struct _citrus_mapper_zone *mz;
329 mz = malloc(sizeof(*mz));
330 if (mz == NULL)
333 mz->mz_col.z_begin = mz->mz_col.z_end = 0;
334 mz->mz_row.z_begin = mz->mz_row.z_end = 0;
335 mz->mz_col_bits = 0;
336 mz->mz_row_offset = 0;
337 mz->mz_col_offset = 0;
341 if (parse_var(mz, &ms)) {
342 free(mz);
345 cm->cm_closure = mz;
365 struct _citrus_mapper_zone *mz = cm->cm_closure;
367 if (mz->mz_col_bits == 32) {
370 if (col < mz->mz_col.z_begin || col > mz->mz_col.z_end)
372 if (mz->mz_col_offset>0)
373 col += (u_int32_t)mz->mz_col_offset;
375 col -= (u_int32_t)-mz->mz_col_offset;
378 col = src & (((u_int32_t)1<<mz->mz_col_bits)-1);
379 row = src >> mz->mz_col_bits;
380 if (row < mz->mz_row.z_begin || row > mz->mz_row.z_end ||
381 col < mz->mz_col.z_begin || col > mz->mz_col.z_end)
383 if (mz->mz_col_offset>0)
384 col += (u_int32_t)mz->mz_col_offset;
386 col -= (u_int32_t)-mz->mz_col_offset;
387 if (mz->mz_row_offset>0)
388 row += (u_int32_t)mz->mz_row_offset;
390 row -= (u_int32_t)-mz->mz_row_offset;
391 *dst = col | (row << mz->mz_col_bits);