Ignore:
Timestamp:
2006-09-03T23:37:14Z (18 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
fd85ae5
Parents:
002e613
Message:

sparc64 update.

  • Prototype userspace layer implementation that at least relates to sparc64 and compiles cleanly.
  • Fixes for kernel's preemptible_handler and code related to running userspace.
  • Enable userspace. Several dozen instructions are now run in userspace! We are pretty near the userspace milestone for sparc64.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/sparc64/src/trap/trap_table.S

    r002e613 rcfa70add  
    219219        SPILL_TO_USPACE_WINDOW_BUFFER
    220220
     221/* TT = 0xa0, TL = 0, spill_0_other handler */
     222.org trap_table + TT_SPILL_0_OTHER*ENTRY_SIZE
     223.global spill_0_other
     224spill_0_other:
     225        SPILL_TO_USPACE_WINDOW_BUFFER
     226
    221227/* TT = 0xc0, TL = 0, fill_0_normal handler */
    222228.org trap_table + TT_FILL_0_NORMAL*ENTRY_SIZE
     
    548554
    549555        /*
    550          * Mark the CANSAVE windows as OTHER windows.
     556         * Mark the CANRESTORE windows as OTHER windows.
    551557         * Set CLEANWIN to NWINDOW-1 so that clean_window traps do not occur.
    552558         */
    553         rdpr %cansave, %l0
     559        rdpr %canrestore, %l0
    554560        wrpr %l0, %otherwin
    555         wrpr %g0, %cansave
     561        wrpr %g0, %canrestore
    556562        wrpr %g0, NWINDOW - 1, %cleanwin
    557563
     
    642648        /*
    643649         * If OTHERWIN is zero, then all the userspace windows have been
    644          * spilled to kernel memory (i.e. register window buffer). If
    645          * OTHERWIN is non-zero, then some userspace windows are still
     650         * spilled to kernel memory (i.e. register window buffer). Moreover,
     651         * if the scheduler was called in the meantime, all valid windows
     652         * belonging to other threads were spilled by context_restore().
     653         * If OTHERWIN is non-zero, then some userspace windows are still
    646654         * valid. Others might have been spilled. However, the CWP pointer
    647655         * needs no fixing because the scheduler had not been called.
     
    660668        and %g1, TSTATE_CWP_MASK, %l0
    661669        inc %l0
    662         and %l0, TSTATE_CWP_MASK, %l0   ! %l0 mod NWINDOW
     670        and %l0, NWINDOW - 1, %l0       ! %l0 mod NWINDOW
    663671        rdpr %cwp, %l1
    664672        cmp %l0, %l1
     
    668676        /*
    669677         * Fix CWP.
    670          * Just for reminder, the input registers in the current window
    671          * are the output registers of the window to which we want to
    672          * restore. Because the fill trap fills only input and local
     678         * In order to recapitulate, the input registers in the current
     679         * window are the output registers of the window to which we want
     680         * to restore. Because the fill trap fills only input and local
    673681         * registers of a window, we need to preserve those output
    674682         * registers manually.
    675683         */
    676         flushw
    677684        mov %sp, %g2
    678685        stx %i0, [%sp + PREEMPTIBLE_HANDLER_STACK_FRAME_SIZE + STACK_BIAS + SAVED_I0]
     
    739746         */
    740747        clr %g4
    741 0:      andcc %g7, PAGE_WIDTH - 1, %g0          ! PAGE_SIZE alignment check
     748        set PAGE_SIZE - 1, %g5
     7490:      andcc %g7, %g5, %g0                     ! PAGE_SIZE alignment check
    742750        bz 0f                                   ! %g7 is page-aligned, no more windows to refill
    743751        nop
Note: See TracChangeset for help on using the changeset viewer.