Changeset 7ba7c6d in mainline


Ignore:
Timestamp:
2006-10-08T20:09:28Z (18 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
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/sparc64/include/trap/trap_table.h

    r64c2ad5 r7ba7c6d  
    8585#define SAVED_TPC       -(2*8)
    8686#define SAVED_TNPC      -(3*8)          /* <-- istate_t begins here */
    87 /* alignment gap */
     87#define SAVED_Y         -(4*8)
    8888#define SAVED_I0        -(5*8)
    8989#define SAVED_I1        -(6*8)
  • 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        /*
  • kernel/doc/arch/sparc64

    r64c2ad5 r7ba7c6d  
    1717
    1818SIMULATORS
    19         o simics 2.2.19, simics 3.0.17
     19        o simics 2.2.19, simics 3.0.17, simics 3.0.21
    2020                                               
    2121TOOLCHAIN REQUIREMENTS
  • kernel/generic/src/mm/as.c

    r64c2ad5 r7ba7c6d  
    15931593        link_t *cur;
    15941594        for (cur = as->as_area_btree.leaf_head.next; cur != &as->as_area_btree.leaf_head; cur = cur->next) {
    1595                 as_area_t *area;
    1596                 btree_node_t *node;
    1597                
    1598                 node = list_get_instance(cur, btree_node_t, leaf_link);
     1595                btree_node_t *node = list_get_instance(cur, btree_node_t, leaf_link);
    15991596               
    16001597                int i;
    16011598                for (i = 0; i < node->keys; i++) {
    1602                         area = node->value[i];
     1599                        as_area_t *area = node->value[i];
    16031600               
    16041601                        mutex_lock(&area->lock);
Note: See TracChangeset for help on using the changeset viewer.