mirror of
https://github.com/upx/upx
synced 2025-09-28 19:06:07 +08:00
arm-linux nrv2b works: conditon code bug, cache flush, cache lookahead
This commit is contained in:
parent
5f622efb77
commit
05872d7650
File diff suppressed because it is too large
Load Diff
|
@ -69,6 +69,20 @@ eof_n2b:
|
|||
SUB2(src,r1) // 0 if actual src length equals expected length
|
||||
SUB2(dst,r3) // actual dst length
|
||||
str dst,[r4]
|
||||
|
||||
#if defined(LINUX_ARM_CACHEFLUSH) /*{*/
|
||||
/* linux/include/asm-arm/unistd.h */
|
||||
#define __NR_SYSCALL_BASE 0x900000
|
||||
#define __ARM_NR_BASE (__NR_SYSCALL_BASE+0x0f0000)
|
||||
#define __ARM_NR_cacheflush (__ARM_NR_BASE+2)
|
||||
mov r4,r0 // save result value
|
||||
mov r0,r3 // orig_dst
|
||||
add r1,r3,dst // orig_dst + dst_len
|
||||
mov r2,#0
|
||||
swi __ARM_NR_cacheflush // decompressed region
|
||||
mov r0,r4 // result value
|
||||
#endif /*}*/
|
||||
|
||||
POP {r4,r5, pc} // return
|
||||
|
||||
get8_n2b: // In: Carry set [from adding 0x80000000 (1<<31) to itself]
|
||||
|
@ -88,7 +102,7 @@ getoff_n2b: // ss11 len= [2..)
|
|||
getnextb(len)
|
||||
jnextb0 getoff_n2b
|
||||
|
||||
sub tmp,len,#3 // set Carry
|
||||
subs tmp,len,#3 // set Carry
|
||||
mov len,#0 // Carry unaffected
|
||||
blo offprev_n2b // ss11 returned 2
|
||||
LDRB3(off,[src],#1) // low 8 bits
|
||||
|
@ -107,7 +121,10 @@ plus1_n2b:
|
|||
/* 'cmn': add the inputs, set condition codes, discard the sum */
|
||||
cmn off,#0xd<<8 // within M2_MAX_OFFSET
|
||||
addcc len,len,#1 // too far away, so minimum match length is 3
|
||||
ldrb tmp,[dst] // force cacheline allocate
|
||||
|
||||
add tmp,dst,len
|
||||
ldrb tmp,[tmp,#-1] // force cacheline allocate
|
||||
|
||||
copy_n2b:
|
||||
ldrb tmp,[dst,off]
|
||||
STRB3(tmp,[dst],#1)
|
||||
|
|
|
@ -179,7 +179,8 @@ near_n2e:
|
|||
add tmp,dst,cnt
|
||||
cmp tmp,dstlim; bhi bad_dst_n2e // too much output
|
||||
#endif /*}*/
|
||||
ldrb tmp,[dst] // force cacheline allocate
|
||||
add tmp,dst,len
|
||||
ldrb tmp,[tmp,#-1] // force cacheline allocate
|
||||
copy_n2e:
|
||||
ldrb tmp,[dst,off]
|
||||
CHECK_BYTE
|
||||
|
|
Loading…
Reference in New Issue
Block a user