• Home
  • Raw
  • Download

Lines Matching refs:s

88 static size_t bcj_x86(struct xz_dec_bcj *s, uint8_t *buf, size_t size)  in bcj_x86()  argument
97 uint32_t prev_mask = s->x86_prev_mask; in bcj_x86()
132 dest = src - (s->pos + (uint32_t)i + 5); in bcj_x86()
154 s->x86_prev_mask = prev_pos > 3 ? 0 : prev_mask << (prev_pos - 1); in bcj_x86()
160 static size_t bcj_powerpc(struct xz_dec_bcj *s, uint8_t *buf, size_t size) in bcj_powerpc() argument
169 instr -= s->pos + (uint32_t)i; in bcj_powerpc()
181 static size_t bcj_ia64(struct xz_dec_bcj *s, uint8_t *buf, size_t size) in bcj_ia64() argument
242 addr -= s->pos + (uint32_t)i; in bcj_ia64()
265 static size_t bcj_arm(struct xz_dec_bcj *s, uint8_t *buf, size_t size) in bcj_arm() argument
275 addr -= s->pos + (uint32_t)i + 8; in bcj_arm()
288 static size_t bcj_armthumb(struct xz_dec_bcj *s, uint8_t *buf, size_t size) in bcj_armthumb() argument
301 addr -= s->pos + (uint32_t)i + 4; in bcj_armthumb()
316 static size_t bcj_sparc(struct xz_dec_bcj *s, uint8_t *buf, size_t size) in bcj_sparc() argument
325 instr -= s->pos + (uint32_t)i; in bcj_sparc()
345 static void bcj_apply(struct xz_dec_bcj *s, in bcj_apply() argument
353 switch (s->type) { in bcj_apply()
356 filtered = bcj_x86(s, buf, size); in bcj_apply()
361 filtered = bcj_powerpc(s, buf, size); in bcj_apply()
366 filtered = bcj_ia64(s, buf, size); in bcj_apply()
371 filtered = bcj_arm(s, buf, size); in bcj_apply()
376 filtered = bcj_armthumb(s, buf, size); in bcj_apply()
381 filtered = bcj_sparc(s, buf, size); in bcj_apply()
391 s->pos += filtered; in bcj_apply()
399 static void bcj_flush(struct xz_dec_bcj *s, struct xz_buf *b) in bcj_flush() argument
403 copy_size = min_t(size_t, s->temp.filtered, b->out_size - b->out_pos); in bcj_flush()
404 memcpy(b->out + b->out_pos, s->temp.buf, copy_size); in bcj_flush()
407 s->temp.filtered -= copy_size; in bcj_flush()
408 s->temp.size -= copy_size; in bcj_flush()
409 memmove(s->temp.buf, s->temp.buf + copy_size, s->temp.size); in bcj_flush()
417 XZ_EXTERN enum xz_ret xz_dec_bcj_run(struct xz_dec_bcj *s, in xz_dec_bcj_run() argument
428 if (s->temp.filtered > 0) { in xz_dec_bcj_run()
429 bcj_flush(s, b); in xz_dec_bcj_run()
430 if (s->temp.filtered > 0) in xz_dec_bcj_run()
433 if (s->ret == XZ_STREAM_END) in xz_dec_bcj_run()
449 if (s->temp.size < b->out_size - b->out_pos || s->temp.size == 0) { in xz_dec_bcj_run()
451 memcpy(b->out + b->out_pos, s->temp.buf, s->temp.size); in xz_dec_bcj_run()
452 b->out_pos += s->temp.size; in xz_dec_bcj_run()
454 s->ret = xz_dec_lzma2_run(lzma2, b); in xz_dec_bcj_run()
455 if (s->ret != XZ_STREAM_END in xz_dec_bcj_run()
456 && (s->ret != XZ_OK || s->single_call)) in xz_dec_bcj_run()
457 return s->ret; in xz_dec_bcj_run()
459 bcj_apply(s, b->out, &out_start, b->out_pos); in xz_dec_bcj_run()
466 if (s->ret == XZ_STREAM_END) in xz_dec_bcj_run()
469 s->temp.size = b->out_pos - out_start; in xz_dec_bcj_run()
470 b->out_pos -= s->temp.size; in xz_dec_bcj_run()
471 memcpy(s->temp.buf, b->out + b->out_pos, s->temp.size); in xz_dec_bcj_run()
478 if (b->out_pos + s->temp.size < b->out_size) in xz_dec_bcj_run()
492 s->out = b->out; in xz_dec_bcj_run()
493 s->out_pos = b->out_pos; in xz_dec_bcj_run()
494 s->out_size = b->out_size; in xz_dec_bcj_run()
495 b->out = s->temp.buf; in xz_dec_bcj_run()
496 b->out_pos = s->temp.size; in xz_dec_bcj_run()
497 b->out_size = sizeof(s->temp.buf); in xz_dec_bcj_run()
499 s->ret = xz_dec_lzma2_run(lzma2, b); in xz_dec_bcj_run()
501 s->temp.size = b->out_pos; in xz_dec_bcj_run()
502 b->out = s->out; in xz_dec_bcj_run()
503 b->out_pos = s->out_pos; in xz_dec_bcj_run()
504 b->out_size = s->out_size; in xz_dec_bcj_run()
506 if (s->ret != XZ_OK && s->ret != XZ_STREAM_END) in xz_dec_bcj_run()
507 return s->ret; in xz_dec_bcj_run()
509 bcj_apply(s, s->temp.buf, &s->temp.filtered, s->temp.size); in xz_dec_bcj_run()
516 if (s->ret == XZ_STREAM_END) in xz_dec_bcj_run()
517 s->temp.filtered = s->temp.size; in xz_dec_bcj_run()
519 bcj_flush(s, b); in xz_dec_bcj_run()
520 if (s->temp.filtered > 0) in xz_dec_bcj_run()
524 return s->ret; in xz_dec_bcj_run()
529 struct xz_dec_bcj *s = kmalloc(sizeof(*s), GFP_KERNEL); in xz_dec_bcj_create() local
530 if (s != NULL) in xz_dec_bcj_create()
531 s->single_call = single_call; in xz_dec_bcj_create()
533 return s; in xz_dec_bcj_create()
536 XZ_EXTERN enum xz_ret xz_dec_bcj_reset(struct xz_dec_bcj *s, uint8_t id) in xz_dec_bcj_reset() argument
564 s->type = id; in xz_dec_bcj_reset()
565 s->ret = XZ_OK; in xz_dec_bcj_reset()
566 s->pos = 0; in xz_dec_bcj_reset()
567 s->x86_prev_mask = 0; in xz_dec_bcj_reset()
568 s->temp.filtered = 0; in xz_dec_bcj_reset()
569 s->temp.size = 0; in xz_dec_bcj_reset()