Skip to content

Commit

Permalink
Merge pull request #7 from Blechd0se/jb_clean-2.6.32-9-patch
Browse files Browse the repository at this point in the history
[PATCH] Added XZ Compression for 2.6.32.9
  • Loading branch information
Quarx2k committed Apr 2, 2013
2 parents 07d66da + b155bf2 commit a2d2b66
Show file tree
Hide file tree
Showing 27 changed files with 4,281 additions and 8 deletions.
6 changes: 6 additions & 0 deletions arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ config ARM
select HAVE_FTRACE_MCOUNT_RECORD if (!XIP_KERNEL)
select HAVE_DYNAMIC_FTRACE if (!XIP_KERNEL && !THUMB2_KERNEL)
select HAVE_GENERIC_DMA_COHERENT
select HAVE_KERNEL_GZIP
select HAVE_KERNEL_BZIP2
select HAVE_KERNEL_LZO
select HAVE_KERNEL_LZMA
select HAVE_BPF_JIT
select HAVE_KERNEL_XZ
help
The ARM series is a line of low-power-consumption RISC chip designs
licensed by ARM Ltd and targeted at embedded applications and
Expand Down
24 changes: 20 additions & 4 deletions arch/arm/boot/compressed/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,17 @@ endif

SEDFLAGS = s/TEXT_START/$(ZTEXTADDR)/;s/BSS_START/$(ZBSSADDR)/

targets := vmlinux vmlinux.lds piggy.gz piggy.o font.o font.c \
head.o misc.o $(OBJS)
suffix_$(CONFIG_KERNEL_GZIP) := gzip
suffix_$(CONFIG_KERNEL_BZIP2) := bzip2
suffix_$(CONFIG_KERNEL_LZO) := lzo
suffix_$(CONFIG_KERNEL_LZMA) := lzma
suffix_$(CONFIG_KERNEL_XZ) := xzkern

targets := vmlinux vmlinux.lds \
piggy.$(suffix_y) piggy.$(suffix_y).o \
font.o font.c head.o misc.o $(OBJS)

extra-y += piggy.gzip piggy.lzo piggy.lzma piggy.xzkern lib1funcs.S ashldi3.S

ifeq ($(CONFIG_FUNCTION_TRACER),y)
ORIG_CFLAGS := $(KBUILD_CFLAGS)
Expand Down Expand Up @@ -98,8 +107,15 @@ LDFLAGS_vmlinux += -p --no-undefined -X \
# would otherwise mess up our GOT table
CFLAGS_misc.o := -Dstatic=

$(obj)/vmlinux: $(obj)/vmlinux.lds $(obj)/$(HEAD) $(obj)/piggy.o \
$(addprefix $(obj)/, $(OBJS)) FORCE
# For __aeabi_llsl
ashldi3 = $(obj)/ashldi3.o

+$(obj)/ashldi3.S: $(srctree)/arch/$(SRCARCH)/lib/ashldi3.S FORCE
$(call cmd,shipped)

$(obj)/vmlinux: $(obj)/vmlinux.lds $(obj)/$(HEAD) $(obj)/piggy.$(suffix_y).o \
$(addprefix $(obj)/, $(OBJS)) $(lib1funcs) $(ashldi3) FORCE

$(call if_changed,ld)
@:

Expand Down
53 changes: 53 additions & 0 deletions arch/arm/boot/compressed/ashldi3.S
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/* Copyright 1995, 1996, 1998, 1999, 2000, 2003, 2004, 2005
Free Software Foundation, Inc.
This file 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, or (at your option) any
later version.
In addition to the permissions in the GNU General Public License, the
Free Software Foundation gives you unlimited permission to link the
compiled version of this file into combinations with other programs,
and to distribute those combinations without any restriction coming
from the use of this file. (The General Public License restrictions
do apply in other respects; for example, they cover modification of
the file, and distribution when not linked into a combine
executable.)
This file 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; see the file COPYING. If not, write to
the Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */


#include <linux/linkage.h>

#ifdef __ARMEB__
#define al r1
#define ah r0
#else
#define al r0
#define ah r1
#endif

ENTRY(__ashldi3)
ENTRY(__aeabi_llsl)

subs r3, r2, #32
rsb ip, r2, #32
movmi ah, ah, lsl r2
movpl ah, al, lsl r3
ARM( orrmi ah, ah, al, lsr ip )
THUMB( lsrmi r3, al, ip )
THUMB( orrmi ah, ah, r3 )
mov al, al, lsl r2
mov pc, lr

ENDPROC(__ashldi3)
ENDPROC(__aeabi_llsl)
58 changes: 58 additions & 0 deletions arch/arm/boot/compressed/decompress.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#define _LINUX_STRING_H_

#include <linux/compiler.h> /* for inline */
#include <linux/types.h> /* for size_t */
#include <linux/stddef.h> /* for NULL */
#include <linux/linkage.h>
#include <asm/string.h>

extern unsigned long free_mem_ptr;
extern unsigned long free_mem_end_ptr;
extern void error(char *);

#define STATIC static
#define STATIC_RW_DATA /* non-static please */

#define ARCH_HAS_DECOMP_WDOG

/* Diagnostic functions */
#ifdef DEBUG
# define Assert(cond,msg) {if(!(cond)) error(msg);}
# define Trace(x) fprintf x
# define Tracev(x) {if (verbose) fprintf x ;}
# define Tracevv(x) {if (verbose>1) fprintf x ;}
# define Tracec(c,x) {if (verbose && (c)) fprintf x ;}
# define Tracecv(c,x) {if (verbose>1 && (c)) fprintf x ;}
#else
# define Assert(cond,msg)
# define Trace(x)
# define Tracev(x)
# define Tracevv(x)
# define Tracec(c,x)
# define Tracecv(c,x)
#endif

#ifdef CONFIG_KERNEL_GZIP
#include "../../../../lib/decompress_inflate.c"
#endif

#ifdef CONFIG_KERNEL_BZIP2
#include "../../../../lib/decompress_bunzip2.c"
#endif

#ifdef CONFIG_KERNEL_LZMA
#include "../../../../lib/decompress_unlzma.c"
#endif

#ifdef CONFIG_KERNEL_LZO
#include "../../../../lib/decompress_unlzo.c"
#endif

#ifdef CONFIG_KERNEL_XZ
#include "../../../../lib/decompress_unxz.c"
#endif

void do_decompress(u8 *input, int len, u8 *output, void (*error)(char *x))
{
decompress(input, len, NULL, NULL, output, NULL, error);
}
Binary file added arch/arm/boot/compressed/piggy.xzkern
Binary file not shown.
6 changes: 6 additions & 0 deletions arch/arm/boot/compressed/piggy.xzkern.S
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.section .piggydata,#alloc
.globl input_data
input_data:
.incbin "arch/arm/boot/compressed/piggy.xzkern"
.globl input_data_end
input_data_end:
16 changes: 16 additions & 0 deletions arch/arm/configs/ext_config/user_bld.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Override defconfig here

# do not use, to keep module compat
# CONFIG_LOCALVERSION="-Jellybean"

CONFIG_DEBUG_FS=y
CONFIG_ARM_THUMBEE=y
CONFIG_NLS_UTF8=y
CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y

# CONFIG_KERNEL_LZMA=y
# CONFIG_KERNEL_LZO=y
CONFIG_KERNEL_XZ=y
CONFIG_CLEANCACHE=y
CONFIG_SLQB=y
6 changes: 3 additions & 3 deletions arch/arm/configs/mapphone_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2408,9 +2408,9 @@ CONFIG_CRC32=y
CONFIG_LIBCRC32C=y
CONFIG_ZLIB_INFLATE=y
CONFIG_ZLIB_DEFLATE=y
CONFIG_LZO_COMPRESS=y
CONFIG_LZO_DECOMPRESS=y
CONFIG_DECOMPRESS_GZIP=y
CONFIG_KERNEL_XZ=y
CONFIG_XZ_COMPRESS=y
CONFIG_XZ_DECOMPRESS=y
CONFIG_REED_SOLOMON=y
CONFIG_REED_SOLOMON_ENC8=y
CONFIG_REED_SOLOMON_DEC8=y
Expand Down
Loading

0 comments on commit a2d2b66

Please sign in to comment.