Changeset 2e672fd in mainline for arch/sparc64/loader/asm.S


Ignore:
Timestamp:
2006-07-10T20:48:40Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
daab5145
Parents:
822b64e
Message:

Some 32-bit vs. 64-bit fixes.

Make the call to OpenFirmware client interface architecture dependent.
For instance and contrary to my previous experience, the sparc64 version of
'translate' method would not work reliably unless the Address Mask bit in the
PSTATE register is cleared during duration of the call.

sparc64 and ppc32 OpenFirmware seem to differ in details, for example, the above
mentioned method 'translate' signals success by setting the first return value
to -1 on sparc64 while on ppc32 the value is/stays (???) zero.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • arch/sparc64/loader/asm.S

    r822b64e r2e672fd  
    2626# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2727#
     28
     29#define STACK_WINDOW_SAVE_AREA_SIZE     (16*8)
     30
     31#define PSTATE_AM_BIT   8
    2832
    2933.text
     
    9599
    96100jump_to_kernel:
    97         set ofw, %l0
     101        set ofw_cif, %l0
    98102        jmp %o0                         ! jump to kernel
    99103        ldx [%l0], %o4                  ! pass OpenFirmware address in %o4
     104
     105.global ofw
     106ofw:
     107        save %sp, -STACK_WINDOW_SAVE_AREA_SIZE, %sp
     108        set ofw_cif, %l0
     109        ldx [%l0], %l0
     110
     111        rdpr  %pstate, %l1
     112        and  %l1, ~PSTATE_AM_BIT, %l2
     113        wrpr  %l2, 0, %pstate
     114   
     115        jmpl %l0, %o7
     116        mov %i0, %o0
     117
     118        wrpr %l1, 0, %pstate
     119
     120        ret
     121        restore %o0, 0, %o0
Note: See TracChangeset for help on using the changeset viewer.