Changeset 7ba7c6d in mainline for kernel/arch/sparc64/src


Ignore:
Timestamp:
2006-10-08T20:09:28Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e4398200
Parents:
64c2ad5
Message:

A quote from from SPARC V9 specification:

The Y register is deprecated; it is provided only for compatibility with previous versions
of the architecture. It should not be used in new SPARC-V9 software. It is
recommended that all instructions that reference the Y register (i.e., SMUL,
SMULcc, UMUL, UMULcc, MULScc, SDIV, SDIVcc, UDIV, UDIVcc, RDY, and
WRY) be avoided. See the appropriate pages in Appendix A, “Instruction Definitions,”
for suitable substitute instructions.

Still gcc is generating code which uses Y and some of the instructions above.
This change modifies the preemptible_handler() to preserve the Y register
across preemption.

Location:
kernel/arch/sparc64/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/sparc64/src/dummy.s

    r64c2ad5 r7ba7c6d  
    3434.global dummy
    3535
    36 cpu_sleep:
    37 sys_tls_set:
     36cpu_sleep:              ! not supported by architecture
     37sys_tls_set:            ! not needed on architecture
    3838
    3939dummy:
  • kernel/arch/sparc64/src/trap/trap_table.S

    r64c2ad5 r7ba7c6d  
    747747        stx %g2, [%sp + PREEMPTIBLE_HANDLER_STACK_FRAME_SIZE + STACK_BIAS + SAVED_TPC]
    748748        stx %g3, [%sp + PREEMPTIBLE_HANDLER_STACK_FRAME_SIZE + STACK_BIAS + SAVED_TNPC]
     749
     750        /*
     751         * Save the Y register.
     752         * This register is deprecated according to SPARC V9 specification
     753         * and is only present for backward compatibility with previous
     754         * versions of the SPARC architecture.
     755         * Surprisingly, gcc makes use of this register without a notice.
     756         */
     757        rd %y, %g4
     758        stx %g4, [%sp + PREEMPTIBLE_HANDLER_STACK_FRAME_SIZE + STACK_BIAS + SAVED_Y]
    749759       
    750760        wrpr %g0, 0, %tl
     
    776786        ldx [%sp + PREEMPTIBLE_HANDLER_STACK_FRAME_SIZE + STACK_BIAS + SAVED_TPC], %g2
    777787        ldx [%sp + PREEMPTIBLE_HANDLER_STACK_FRAME_SIZE + STACK_BIAS + SAVED_TNPC], %g3
     788
     789        /*
     790         * Restore Y.
     791         */
     792        ldx [%sp + PREEMPTIBLE_HANDLER_STACK_FRAME_SIZE + STACK_BIAS + SAVED_Y], %g4
     793        wr %g4, %y
    778794
    779795        /*
Note: See TracChangeset for help on using the changeset viewer.