Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 178932
b: refs/heads/master
c: ac4c2a3
h: refs/heads/master
v: v3
  • Loading branch information
Joakim Tjernlund authored and Linus Torvalds committed Jan 11, 2010
1 parent 68ebdd1 commit a117b1a
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 129182e5626972ac0df85d43a36dd46ad61c64e1
refs/heads/master: ac4c2a3bbe5db5fc570b1d0ee1e474db7cb22585
4 changes: 3 additions & 1 deletion trunk/arch/powerpc/boot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
all: $(obj)/zImage

BOOTCFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
-fno-strict-aliasing -Os -msoft-float -pipe \
-fno-strict-aliasing -Os -msoft-float -pipe -D__KERNEL__\
-fomit-frame-pointer -fno-builtin -fPIC -nostdinc \
-isystem $(shell $(CROSS32CC) -print-file-name=include)
BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTCFLAGS) -traditional -nostdinc
Expand All @@ -34,6 +34,8 @@ BOOTCFLAGS += -fno-stack-protector
endif

BOOTCFLAGS += -I$(obj) -I$(srctree)/$(obj)
BOOTCFLAGS += -include include/linux/autoconf.h -Iarch/powerpc/include
BOOTCFLAGS += -Iinclude

DTS_FLAGS ?= -p 1024

Expand Down
55 changes: 44 additions & 11 deletions trunk/lib/zlib_inflate/inffast.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
*/

#include <linux/zutil.h>
#include <asm/unaligned.h>
#include <asm/byteorder.h>
#include "inftrees.h"
#include "inflate.h"
#include "inffast.h"
Expand All @@ -24,9 +26,11 @@
#ifdef POSTINC
# define OFF 0
# define PUP(a) *(a)++
# define UP_UNALIGNED(a) get_unaligned((a)++)
#else
# define OFF 1
# define PUP(a) *++(a)
# define UP_UNALIGNED(a) get_unaligned(++(a))
#endif

/*
Expand Down Expand Up @@ -239,18 +243,47 @@ void inflate_fast(z_streamp strm, unsigned start)
}
}
else {
unsigned short *sout;
unsigned long loops;

from = out - dist; /* copy direct from output */
do { /* minimum length is three */
PUP(out) = PUP(from);
PUP(out) = PUP(from);
PUP(out) = PUP(from);
len -= 3;
} while (len > 2);
if (len) {
PUP(out) = PUP(from);
if (len > 1)
PUP(out) = PUP(from);
}
/* minimum length is three */
/* Align out addr */
if (!((long)(out - 1 + OFF) & 1)) {
PUP(out) = PUP(from);
len--;
}
sout = (unsigned short *)(out - OFF);
if (dist > 2) {
unsigned short *sfrom;

sfrom = (unsigned short *)(from - OFF);
loops = len >> 1;
do
PUP(sout) = UP_UNALIGNED(sfrom);
while (--loops);
out = (unsigned char *)sout + OFF;
from = (unsigned char *)sfrom + OFF;
} else { /* dist == 1 or dist == 2 */
unsigned short pat16;

pat16 = *(sout-2+2*OFF);
if (dist == 1)
#if defined(__BIG_ENDIAN)
pat16 = (pat16 & 0xff) | ((pat16 & 0xff) << 8);
#elif defined(__LITTLE_ENDIAN)
pat16 = (pat16 & 0xff00) | ((pat16 & 0xff00) >> 8);
#else
#error __BIG_ENDIAN nor __LITTLE_ENDIAN is defined
#endif
loops = len >> 1;
do
PUP(sout) = pat16;
while (--loops);
out = (unsigned char *)sout + OFF;
}
if (len & 1)
PUP(out) = PUP(from);
}
}
else if ((op & 64) == 0) { /* 2nd level distance code */
Expand Down

0 comments on commit a117b1a

Please sign in to comment.