On Sun, Apr 24, 2011 at 12:10 AM, Roman Mamedov <r...@romanrm.ru> wrote:
> On Sat, 23 Apr 2011 23:19:26 +0800
> wu zhangjin <wuzhang...@gmail.com> wrote:
>
>> On Sat, Apr 23, 2011 at 10:57 PM, Roman Mamedov <r...@romanrm.ru> wrote:
>> > On Sat, 23 Apr 2011 22:47:36 +0800
>> > wu zhangjin <wuzhang...@gmail.com> wrote:
>> >
>> >> Can you get .s file at first and check what the above line is?
>> >>
>> >> $ make arch/mips/power/hibernate.s
>> >
>> > Hello,
>> >
>> > I believe this is the line:
>> >
>> >  daddiu $15, $13, (1 << 16)
>> >
>>
>> This may work,
>>
>> daddiu $15, $13, (1ULL << 16)
>

Sorry, I was wrong, I thought the error had been reported by gcc, but
the root cause is that (1 << 16) is too big to be the immediate of the
daddiu instruction, we must use another instruction instead, that is
daddu, it needs to load the immediate to a register at first:

PTR_LI t3, PAGE_SIZE
PTR_ADDU t3, t1, t3

or we can simply use

PTR_ADDU t3, t1, PAGE_SIZE

the 'as' tool will handle the left automatically.

Attached the patch.

Regards,
Wu Zhangjin

> It results in this error:
>
>  AS      arch/mips/power/hibernate.o
> arch/mips/power/hibernate.S: Assembler messages:
> arch/mips/power/hibernate.S:38: Error: missing ')'
> arch/mips/power/hibernate.S:38: Error: illegal operands `daddiu
> $15,$13,(1ULL<<16)'
>
> --
> With respect,
> Roman
>

-- 
You received this message because you are subscribed to the Google Groups 
"loongson-dev" group.
To post to this group, send email to loongson-dev@googlegroups.com.
To unsubscribe from this group, send email to 
loongson-dev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/loongson-dev?hl=en.

From 5a150f677cfb5c987b8d9736448a2d100174afbc Mon Sep 17 00:00:00 2001
From: Wu Zhangjin <wuzhang...@gmail.com>
Date: Sun, 24 Apr 2011 04:04:19 +0800
Subject: [PATCH] MIPS: Hibernation: Fix for 64kb page size

PAGE_SIZE >= 64kb is too big to be the immediate of the addiu/daddiu
instruction, so, use addu/daddu instruction instead.

This fixed the following compiling error with 64kb page size:

AS      arch/mips/power/hibernate.o
arch/mips/power/hibernate.S: Assembler messages:
arch/mips/power/hibernate.S:38: Error: expression out of range
make[2]: *** [arch/mips/power/hibernate.o] Error 1
make[1]: *** [arch/mips/power] Error 2

Reported-by: Roman Mamedov <r...@romanrm.ru>
Signed-off-by: Wu Zhangjin <wuzhang...@gmail.com>
---
 arch/mips/power/hibernate.S |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/mips/power/hibernate.S b/arch/mips/power/hibernate.S
index dbb5c7b..f8a751c 100644
--- a/arch/mips/power/hibernate.S
+++ b/arch/mips/power/hibernate.S
@@ -35,7 +35,7 @@ LEAF(swsusp_arch_resume)
 0:
 	PTR_L t1, PBE_ADDRESS(t0)   /* source */
 	PTR_L t2, PBE_ORIG_ADDRESS(t0) /* destination */
-	PTR_ADDIU t3, t1, PAGE_SIZE
+	PTR_ADDU t3, t1, PAGE_SIZE
 1:
 	REG_L t8, (t1)
 	REG_S t8, (t2)
-- 
1.7.1

Reply via email to