diff mbox

[for-2.0,2/2] ohw: let the right reset entry point 0xfff00100 jump to the currently wrong entry point (0xfffffffc)

Message ID 1396387092-5667-3-git-send-email-hpoussin@reactos.org
State New
Headers show

Commit Message

Hervé Poussineau April 1, 2014, 9:18 p.m. UTC
This is easier to do this than to copy the code from the wrong entry point to the right entry point.

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
---
 src/vectors.S |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Comments

Alexander Graf April 2, 2014, 5:14 a.m. UTC | #1
> Am 01.04.2014 um 23:18 schrieb Hervé Poussineau <hpoussin@reactos.org>:
> 
> This is easier to do this than to copy the code from the wrong entry point to the right entry point.
> 
> Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
> ---
> src/vectors.S |    7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/src/vectors.S b/src/vectors.S
> index 691d568..05cd1d9 100644
> --- a/src/vectors.S
> +++ b/src/vectors.S
> @@ -121,7 +121,12 @@ excp_##entry##:                                           ; \
> 
>         /* Exception vectors */
>         /* Reset exception */
> -        EXCP_BUG(0100)                                    ;
> +.org 0x0100
> +excp_0100:
> +        lis r3,0
> +        addi r3,r3,-4
> +        mtlr r3
> +        blr

Doesn't ba -4 work?

Alex

> 
>         /* Machine check exception */
>         EXCP_BUG(0200)                                    ;
> -- 
> 1.7.10.4
> 
>
Hervé Poussineau April 2, 2014, 5:23 a.m. UTC | #2
Le mer. 02 avril 2014 07:14:48 CEST, Alexander Graf a écrit :
>
>
>> Am 01.04.2014 um 23:18 schrieb Hervé Poussineau <hpoussin@reactos.org>:
>>
>> This is easier to do this than to copy the code from the wrong entry point to the right entry point.
>>
>> Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
>> ---
>> src/vectors.S |    7 ++++++-
>> 1 file changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/src/vectors.S b/src/vectors.S
>> index 691d568..05cd1d9 100644
>> --- a/src/vectors.S
>> +++ b/src/vectors.S
>> @@ -121,7 +121,12 @@ excp_##entry##:                                           ; \
>>
>>          /* Exception vectors */
>>          /* Reset exception */
>> -        EXCP_BUG(0100)                                    ;
>> +.org 0x0100
>> +excp_0100:
>> +        lis r3,0
>> +        addi r3,r3,-4
>> +        mtlr r3
>> +        blr
>
> Doesn't ba -4 work?
>

Yes, "ba -4" also works, I just tested it.

Hervé
Alexander Graf April 2, 2014, 5:36 a.m. UTC | #3
> Am 02.04.2014 um 07:23 schrieb Hervé Poussineau <hpoussin@reactos.org>:
> 
> Le mer. 02 avril 2014 07:14:48 CEST, Alexander Graf a écrit :
>> 
>> 
>>> Am 01.04.2014 um 23:18 schrieb Hervé Poussineau <hpoussin@reactos.org>:
>>> 
>>> This is easier to do this than to copy the code from the wrong entry point to the right entry point.
>>> 
>>> Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
>>> ---
>>> src/vectors.S |    7 ++++++-
>>> 1 file changed, 6 insertions(+), 1 deletion(-)
>>> 
>>> diff --git a/src/vectors.S b/src/vectors.S
>>> index 691d568..05cd1d9 100644
>>> --- a/src/vectors.S
>>> +++ b/src/vectors.S
>>> @@ -121,7 +121,12 @@ excp_##entry##:                                           ; \
>>> 
>>>         /* Exception vectors */
>>>         /* Reset exception */
>>> -        EXCP_BUG(0100)                                    ;
>>> +.org 0x0100
>>> +excp_0100:
>>> +        lis r3,0
>>> +        addi r3,r3,-4
>>> +        mtlr r3
>>> +        blr
>> 
>> Doesn't ba -4 work?
> 
> Yes, "ba -4" also works, I just tested it.

It's a lot cleaner because it doesn't modify registers. I don't think this is 2.0 material either - we're in the "critical bug fixes only" phase already, so no need to rush :).

Alex

> 
> Hervé
>
Alexander Graf April 2, 2014, 5:45 a.m. UTC | #4
> Am 02.04.2014 um 07:36 schrieb Alexander Graf <agraf@suse.de>:
> 
> 
> 
>> Am 02.04.2014 um 07:23 schrieb Hervé Poussineau <hpoussin@reactos.org>:
>> 
>> Le mer. 02 avril 2014 07:14:48 CEST, Alexander Graf a écrit :
>>> 
>>> 
>>>> Am 01.04.2014 um 23:18 schrieb Hervé Poussineau <hpoussin@reactos.org>:
>>>> 
>>>> This is easier to do this than to copy the code from the wrong entry point to the right entry point.
>>>> 
>>>> Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
>>>> ---
>>>> src/vectors.S |    7 ++++++-
>>>> 1 file changed, 6 insertions(+), 1 deletion(-)
>>>> 
>>>> diff --git a/src/vectors.S b/src/vectors.S
>>>> index 691d568..05cd1d9 100644
>>>> --- a/src/vectors.S
>>>> +++ b/src/vectors.S
>>>> @@ -121,7 +121,12 @@ excp_##entry##:                                           ; \
>>>> 
>>>>        /* Exception vectors */
>>>>        /* Reset exception */
>>>> -        EXCP_BUG(0100)                                    ;
>>>> +.org 0x0100
>>>> +excp_0100:
>>>> +        lis r3,0
>>>> +        addi r3,r3,-4
>>>> +        mtlr r3
>>>> +        blr
>>> 
>>> Doesn't ba -4 work?
>> 
>> Yes, "ba -4" also works, I just tested it.
> 
> It's a lot cleaner because it doesn't modify registers. I don't think this is 2.0 material either - we're in the "critical bug fixes only" phase already, so no need to rush :).

Oh, and writing it as ba 0xfffffffc should work as well and be even clearer :)


Alex
diff mbox

Patch

diff --git a/src/vectors.S b/src/vectors.S
index 691d568..05cd1d9 100644
--- a/src/vectors.S
+++ b/src/vectors.S
@@ -121,7 +121,12 @@  excp_##entry##:                                           ; \
 
         /* Exception vectors */
         /* Reset exception */
-        EXCP_BUG(0100)                                    ;
+.org 0x0100
+excp_0100:
+        lis r3,0
+        addi r3,r3,-4
+        mtlr r3
+        blr
 
         /* Machine check exception */
         EXCP_BUG(0200)                                    ;