summaryrefslogtreecommitdiffstats
path: root/lib/decompress_bunzip2.c
AgeCommit message (Expand)Author
2018-07-27lib: Use existing define with polynomialKrzysztof Kozlowski
2015-09-10lib/decompressors: use real out buf size for gunzip with kernelYinghai Lu
2014-12-13decompress_bunzip2: off by one in get_next_block()Dan Carpenter
2014-08-08initramfs: support initramfs that is bigger than 2GiBYinghai Lu
2011-12-06decompress_bunzip2: remove invalid vi modelinePaul Bolle
2011-12-06treewide: Fix comment and string typo 'bufer'Paul Bolle
2011-01-13Decompressors: include <linux/slab.h> in <linux/decompress/mm.h>Lasse Collin
2011-01-13Decompressors: get rid of set_error_fn() macroLasse Collin
2010-08-11lib/decompress_bunzip2.c: fix checkstack warningPrarit Bhargava
2009-12-15bzip2: Add missing checks for malloc returning NULLPhillip Lougher
2009-12-04tree-wide: fix assorted typos all over the placeAndré Goddard Rosa
2009-08-07lib/decompress_*: only include <linux/slab.h> if STATIC is not definedAlbin Tonnerre
2009-08-07bzip2/lzma: remove nasty uncompressed size hack in pre-boot environmentPhillip Lougher
2009-04-03kmemtrace, kbuild: fix slab.h dependency problem in lib/decompress_bunzip2.cPekka Enberg
2009-01-04bzip2/lzma: library support for gzip, bzip2 and lzma decompressionAlain Knaff
{ color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
/*
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, see the file COPYING, or write
 * to the Free Software Foundation, Inc.
 */

#include <linux/export.h>

#include <linux/libgcc.h>

long long notrace __ashrdi3(long long u, word_type b)
{
	DWunion uu, w;
	word_type bm;

	if (b == 0)
		return u;

	uu.ll = u;
	bm = 32 - b;

	if (bm <= 0) {
		/* w.s.high = 1..1 or 0..0 */
		w.s.high =
		    uu.s.high >> 31;
		w.s.low = uu.s.high >> -bm;
	} else {
		const unsigned int carries = (unsigned int) uu.s.high << bm;

		w.s.high = uu.s.high >> b;
		w.s.low = ((unsigned int) uu.s.low >> b) | carries;
	}

	return w.ll;
}
EXPORT_SYMBOL(__ashrdi3);